From 8ad1262cf70d46f801ab85a8c42906fe91715da1 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Thu, 25 Jan 2018 11:33:29 +0100
Subject: [PATCH] [test][geometry] Add fracture network intersection test

---
 test/common/boundingboxtree/CMakeLists.txt    |   5 +-
 test/common/boundingboxtree/fracture.msh      | 702 ++++++++++++++++++
 .../boundingboxtree/test_geometry_fracture.cc |  95 +++
 3 files changed, 801 insertions(+), 1 deletion(-)
 create mode 100644 test/common/boundingboxtree/fracture.msh
 create mode 100644 test/common/boundingboxtree/test_geometry_fracture.cc

diff --git a/test/common/boundingboxtree/CMakeLists.txt b/test/common/boundingboxtree/CMakeLists.txt
index f13fc75df0..0611365eb8 100644
--- a/test/common/boundingboxtree/CMakeLists.txt
+++ b/test/common/boundingboxtree/CMakeLists.txt
@@ -11,12 +11,15 @@ dune_add_test(NAME test_bboxtree_dim3
               SOURCES test_bboxtree.cc
               COMPILE_DEFINITIONS WORLD_DIMENSION=3)
 
+dune_add_test(SOURCES test_geometry_fracture.cc)
+
 # symlink the input file in the build directory
-dune_symlink_to_source_files(FILES "network1d.msh" "network2d.msh")
+dune_symlink_to_source_files(FILES "network1d.msh" "network2d.msh" "fracture.msh")
 
 #install sources
 install(FILES
 test_bboxtree.cc
+test_geometry_fracture.cc
 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/common/boundingboxtree)
 
 set(CMAKE_BUILD_TYPE Release)
diff --git a/test/common/boundingboxtree/fracture.msh b/test/common/boundingboxtree/fracture.msh
new file mode 100644
index 0000000000..87bc429024
--- /dev/null
+++ b/test/common/boundingboxtree/fracture.msh
@@ -0,0 +1,702 @@
+$MeshFormat
+2.2 0 8
+$EndMeshFormat
+$Nodes
+395
+1 8.0 8.0 0.0
+2 2.93370304222 1.96473259891 2.10839754587
+3 0.815252373891 3.36812522883 0.594170963962
+4 3.00649720307 6.36418120972 2.62279811831
+5 0.0 5.95561013727 0.0
+6 0.0 4.91463734361 0.0
+7 8.0 0.0 2.15821170498
+8 2.18920132951 -0.0 0.0
+9 8.0 1.20023724306 0.0
+10 8.0 0.0 1.02223121707
+11 8.0 0.0 0.0
+12 0.0 7.00215791508 0.0
+13 0.0 8.0 0.0
+14 5.88657015349 8.0 5.0
+15 -0.0 1.67624911946 4.98507777165
+16 0.124968404575 1.68392577285 5.0
+17 0.0 4.89911081582 5.0
+18 0.0 5.79751958351 5.0
+19 8.0 8.0 5.0
+20 8.0 0.0 4.82129149958
+21 7.15378900915 0.0 5.0
+22 8.0 0.0 5.0
+23 0.0 0.0 4.01803437989
+24 0.0 0.0 5.0
+25 0.0 8.0 5.0
+26 0.0 0.0 0.0
+27 0.0 0.0 0.932989250719
+28 0.0 1.15894360262 0.0
+29 1.12810989554 0.0 0.0
+30 1.17655123381 0.0 5.0
+31 0.0 1.20679629588 5.0
+32 8.0 8.0 2.76480147997
+33 5.15962855055 8.0 0.0
+34 3.32548299159 0.0 0.0
+35 2.93325961555 1.61628739455 0.0
+36 2.70315990052 0.747563638919 0.0
+37 1.5784336554 0.0 0.540979769231
+38 2.79510483526 0.0 0.796035172513
+39 5.48442541945 4.22661100559 5.0
+40 0.0 8.0 1.74421325991
+41 1.0035959307 8.0 0.0
+42 5.89887310141 8.0 2.80917838841
+43 8.0 6.8956935717 2.94948395771
+44 8.0 8.0 3.92082404632
+45 8.0 7.08146253932 5.0
+46 8.0 8.0 1.38240073998
+47 7.75215881503 8.0 0.690700942587
+48 4.64578200885 0.0 5.0
+49 3.67140946588 0.954376083463 0.0
+50 3.58111415542 2.31321471272 0.0
+51 4.35564173891 8.0 5.0
+52 6.27449634323 2.66201993667 5.0
+53 8.0 2.4612007978 5.0
+54 6.89541166193 0.0 2.07629112213
+55 7.10076042609 0.0 1.0942761646
+56 8.0 1.01889882425 1.28833625892
+57 5.980605169 0.0 2.47242793121
+58 3.49532450465 0.0 5.0
+59 4.36771284671 4.73443806813 5.0
+60 4.28045114158 5.97484271518 5.0
+61 5.29682273669 5.32458385782 5.0
+62 4.80225000482 8.0 3.07474578506
+63 5.13077243471 8.0 4.51683179783
+64 4.9816033144 7.44071787762 5.0
+65 1.99664131716 1.69192141418 0.0
+66 1.58277480351 0.845375057679 0.0
+67 8.0 1.2306003989 5.0
+68 7.16146767338 1.8678455862 5.0
+69 8.0 0.939027920998 4.19912529192
+70 8.0 0.0 3.40013303275
+71 7.24038831614 0.0 4.73136009427
+72 0.0 3.38798651784 3.92296471121
+73 4.52303015426 2.83096495649 5.0
+74 5.42859292037 3.2378112215 5.0
+75 4.67903948898 3.86087139953 5.0
+76 0.905132163178 -0.0 1.13734807968
+77 1.39775528954 0.0 2.37476123243
+78 0.0 0.274148207631 1.7648691164
+79 0.0 0.0 1.98818505721
+80 0.0 0.0 3.04338086369
+81 0.939383392107 0.0 3.23205589772
+82 0.0 3.92069155655 4.49721186505
+83 0.0 8.0 4.09667716198
+84 0.0 6.82481770303 5.0
+85 0.980184183572 8.0 5.0
+86 3.74908168057 3.97734554863 5.0
+87 3.43668312657 4.93872602929 5.0
+88 2.53363605135 4.8607685154 5.0
+89 3.04891903294 3.34462105989 5.0
+90 4.20454677029 0.798414391968 5.0
+91 4.44804843574 1.76650658417 5.0
+92 5.31837009234 2.23805698235 5.0
+93 2.0336573113 8.0 5.0
+94 3.19762419793 8.0 5.0
+95 3.74107925563 7.06477635668 5.0
+96 7.02635236182 5.86184848741 0.0
+97 7.69706631462 7.19546340627 1.17578474538
+98 8.0 6.60833855485 0.0
+99 7.19970831954 8.0 0.0
+100 7.63823590872 6.33634076679 1.69378042174
+101 8.0 6.95675441856 1.9594887072
+102 4.71824870462 5.63526679167 0.0
+103 5.00152312391 6.89444304353 0.0
+104 6.30065454028 8.0 0.0
+105 6.20677328587 6.57732573702 0.0
+106 5.70258574878 8.0 0.431203756811
+107 6.79765091815 8.0 0.569850353203
+108 6.79531728973 6.87878801779 1.25529441602
+109 6.78910958494 8.0 1.9983754772
+110 5.97022723028 7.25095323909 0.923211133194
+111 5.39774366353 8.0 1.91071347782
+112 6.56124830383 2.89875671861 0.0
+113 6.96368232431 1.6107515548 0.0
+114 8.0 2.15194301001 0.729060798106
+115 5.77895357034 3.75356880451 0.0
+116 3.41915599195 3.29175901908 4.521271308
+117 8.0 1.91699045113 3.55116240924
+118 8.0 1.08387747465 2.71095779593
+119 3.82676101224 5.24761697669 0.0
+120 0.802250057172 4.84373184581 5.0
+121 0.0 4.62235617906 3.9449737507
+122 0.760721598198 4.15481107483 4.32527541294
+123 1.60991534179 4.24699737086 5.0
+124 1.10407470473 1.93249222088 5.0
+125 0.0 2.53211781865 4.45402124143
+126 0.0 2.2443267783 5.0
+127 1.48373557718 3.31240083396 5.0
+128 0.0 3.28185726072 5.0
+129 1.98298298341 3.41924602799 4.21593563086
+130 2.01896982868 4.40600845045 4.147958773
+131 3.03862664687 4.07722686452 4.42324318415
+132 3.02671279909 4.9252473325 3.75562414291
+133 3.43261333857 4.37451927681 3.85155106891
+134 2.59322815589 8.0 0.037526869553
+135 1.76776797566 6.93221784858 -0.0
+136 2.0593257742 8.0 0.0
+137 5.5438198137 0.0 4.5305011648
+138 5.89630649175 0.0 5.0
+139 5.96425873217 0.0 3.53978336429
+140 6.05718177715 1.73945809187 5.0
+141 6.49703785451 0.0 4.643353876
+142 6.77395822115 0.0 3.04666495918
+143 7.22695289802 1.34158323703 3.84088454165
+144 4.64354991804 0.364962993006 4.18210566858
+145 5.31121692145 1.04286096231 5.0
+146 6.02579041046 0.930566962946 3.97100200389
+147 5.85415035062 1.93784620533 3.2832942319
+148 6.26334129923 0.992101088403 2.33888844459
+149 4.63403379595 2.87033166008 3.81623689819
+150 8.0 2.89805526877 1.68242466629
+151 8.0 1.93297576548 1.92337694644
+152 1.32907727611 7.09403727787 5.0
+153 0.933621904186 5.83619605811 5.0
+154 1.5980448048 5.13453119511 5.0
+155 2.59493980783 6.99534911986 5.0
+156 2.11080066948 5.88496218539 5.0
+157 1.91522986408 5.84929882167 3.01035077809
+158 3.15740013654 5.92831889919 5.0
+159 1.72299478048 6.54016778458 4.44809977354
+160 8.0 5.86547663547 4.21749298797
+161 5.60448020358 6.8841918508 5.0
+162 8.0 5.98004833516 5.0
+163 6.39717404325 7.10791064415 2.97201247485
+164 7.0903574583 6.74622243271 5.0
+165 6.34916891725 7.34888030843 5.0
+166 7.5953602144 6.73291028118 3.86455159572
+167 6.06753080164 8.0 3.93291497132
+168 7.00428916858 8.0 3.34899814482
+169 6.9686357171 8.0 5.0
+170 6.86245205569 6.56516765309 4.43842722907
+171 8.0 5.93798527301 2.24844576944
+172 8.0 5.94930066568 3.16620175684
+173 7.55168808563 5.07245021421 2.45582510725
+174 0.0 1.10783246572 2.18393704018
+175 0.889084516268 3.52332078964 3.97904337739
+176 1.36918429818 2.79981033287 4.50360032223
+177 1.25667632384 8.0 2.29327058227
+178 1.61389509609 8.0 3.24415061825
+179 8.0 3.63084451422 5.0
+180 7.12072763033 3.11335294994 5.0
+181 5.89570280991 2.30412992263 4.32982524512
+182 6.28201320028 3.67769170693 5.0
+183 5.42133392482 3.98061869116 4.01133099649
+184 8.0 4.80048823065 5.0
+185 7.0858948894 4.15587102378 5.0
+186 8.0 5.8635935997 4.21880669559
+187 6.21841338782 4.61461858064 5.0
+188 6.94291069325 5.68833530909 5.0
+189 8.0 2.98288686368 0.0
+190 7.0793607658 3.16731825074 0.447158605251
+191 6.67078036448 4.20611539423 0.433786132158
+192 0.0 4.07075585444 2.48165070469
+193 0.0 3.23657508703 2.98455162041
+194 0.0 2.31256157491 2.4002436177
+195 0.123985963716 2.91349874409 2.31042306783
+196 4.83695943524 2.48449690163 2.80067655245
+197 5.95520541806 2.88407805853 0.513685953004
+198 0.0 4.82555190506 1.28105752691
+199 0.142941171315 3.92795459299 2.32612041839
+200 0.0 5.02867387703 2.90493737013
+201 0.0 4.20833019743 3.41395104067
+202 2.64921994354 0.0 2.71762449427
+203 3.73174181858 1.77756315242 1.5239676934
+204 3.82292066831 0.0 3.12452818508
+205 5.02587260249 0.0 3.00596889028
+206 4.29659423614 1.43045368007 3.43507323977
+207 4.11778560046 0.440567998893 2.20377122099
+208 6.48802126232 3.93436238407 3.0172147542
+209 7.15767101916 4.29096197881 1.8785296417
+210 8.0 3.94948781931 2.20450258012
+211 8.0 5.09804718255 3.24938431223
+212 7.0688678902 3.70510260061 4.06103920556
+213 8.0 3.69504838382 3.8173443829
+214 7.03682385979 3.37962105031 2.46804419075
+215 8.0 2.95657222989 2.86237282336
+216 7.0981031825 2.42618852693 3.10700930902
+217 7.09242472929 2.74775730897 4.04363865015
+218 7.47414269227 3.94002554355 3.13860432438
+219 2.47367417541 4.3342321354 3.72549299684
+220 2.16479140802 3.4067995297 3.13566347831
+221 1.27511646679 4.29502949727 3.56101637139
+222 5.83963918181 5.01067404268 0.0
+223 5.41376618443 5.22456752782 0.464262051183
+224 6.23595129709 5.60253268628 0.409987310064
+225 3.71301745265 0.742194215883 3.82199885884
+226 2.8680064315 0.608214819234 3.14757345091
+227 1.92431348967 0.0 3.4298789817
+228 2.83855038395 -0.0 3.61350334486
+229 1.53865016119 0.0 4.04891210069
+230 2.35310246762 0.0 5.0
+231 1.83187125908 0.909842322173 5.0
+232 3.12236198076 1.18270441337 5.0
+233 2.25680556541 2.22513686581 5.0
+234 3.4095364261 2.51778151075 5.0
+235 2.98499887286 1.03732775431 3.54026290878
+236 4.41318798 0.0 0.0
+237 3.98100788058 0.0 1.07215045065
+238 5.0549578721 0.0 1.80071604543
+239 5.5008929684 0.0 0.0
+240 6.01844794381 0.0 1.12922081536
+241 6.7504464842 0.0 0.0
+242 6.89690137029 4.29158251656 0.0
+243 8.0 3.50172547697 0.870349128841
+244 7.51085470549 3.95300258596 0.399357274324
+245 8.0 4.09978198669 0.0
+246 7.10183799187 5.12526596447 0.381617267408
+247 8.0 5.21667710969 0.0
+248 8.0 4.72153971 1.18061250433
+249 8.0 6.00624648761 1.00218035799
+250 7.91001324842 4.67980911928 0.355138091044
+251 -0.0 3.05180614773 0.0
+252 0.0 2.34724158825 0.447666436383
+253 0.698382787064 2.0782415631 0.0
+254 0.95294468183 0.842169976689 0.559900537202
+255 0.0 1.31069489794 1.10626777639
+256 0.0 2.21566493145 1.32449321666
+257 3.11509414485 6.00872059989 0.0
+258 3.09902510224 8.0 0.0
+259 3.98698647331 6.25814736105 0.0
+260 3.80965653185 5.93950735464 0.522385257167
+261 4.13872443027 8.0 0.0
+262 3.61696253777 8.0 0.167142249192
+263 4.61922163206 8.0 0.294038634917
+264 5.36473656748 7.16941638884 0.896418135821
+265 2.53990514217 7.22130388878 0.507030523946
+266 1.49656961653 7.29022565143 1.86950074623
+267 2.84948346372 8.0 1.01726361995
+268 4.38287716035 6.62392569745 0.470701711408
+269 3.44462475567 5.34094196361 3.25378916524
+270 3.86647956711 5.05244281095 2.00147616626
+271 3.01555176 5.71968333308 3.13019041688
+272 2.37031493192 7.09333234136 4.0153507416
+273 4.52564380356 6.12139219341 3.69705048646
+274 3.99668842221 6.98742135759 4.15782130018
+275 4.58367775559 6.2586513845 1.35455697241
+276 5.30941422872 6.11322919186 0.440344510736
+277 5.80405624447 6.51438697312 1.35266021593
+278 6.7521723573 5.97531261162 1.80240243621
+279 4.60136028345 5.69487577873 2.6339083332
+280 5.36721641352 6.36622483999 1.88543298736
+281 6.10067466173 6.1102337487 3.4826588219
+282 5.28087856353 5.18983256688 3.39071132994
+283 5.35233731869 5.56991677006 1.87311118258
+284 2.18408944761 5.39432978786 2.16277791429
+285 2.15374731878 5.25801906879 3.1018978909
+286 3.31788032187 3.91615670151 2.62697676273
+287 3.08584743652 4.78057506398 2.06891588625
+288 6.11181000407 3.34498818279 1.45124200387
+289 6.32466701571 3.64072782354 2.21073104573
+290 6.31534203832 4.63243613831 1.55255670327
+291 6.00812507709 4.8138870227 2.41853273279
+292 5.64050194136 3.01378792336 2.5451197446
+293 5.4150427245 3.92820041619 2.88513324825
+294 3.70823627494 2.85166673327 1.97824193422
+295 4.32038480332 3.14758958754 2.30017719506
+296 4.34921801049 3.25597546682 0.0
+297 4.34910196976 3.92207886533 2.75391807928
+298 3.79933177781 4.11577414756 1.99156883363
+299 4.6094084429 5.3111797905 1.93729367442
+300 5.33709632483 4.75424037721 1.86048967885
+301 4.45604688932 5.15679906456 0.515232067755
+302 5.32314933558 4.00781727718 1.84893977742
+303 4.8157637604 4.34875339193 0.0
+304 5.59716847888 4.19471512101 0.488800292206
+305 5.47546271988 4.97291722215 1.22753175983
+306 4.75284014999 3.83098304844 1.89858415368
+307 0.219027741395 8.0 2.38912988726
+308 0.0 7.26545788037 1.86474702593
+309 0.0 8.0 3.18918212041
+310 0.0 6.93436773563 4.06531520334
+311 2.29432490629 8.0 2.19741127727
+312 2.06373247635 6.88261591849 2.1994948974
+313 2.51465654514 6.24950001553 2.54354734993
+314 2.66341039947 8.0 3.27989660931
+315 2.94101316014 6.42990950201 0.550463567509
+316 3.35785138985 7.18890803545 0.504285810815
+317 3.33326976389 8.0 2.10143222071
+318 3.71292570284 8.0 3.31564260037
+319 2.99313923306 7.31499342249 1.87425446653
+320 3.45663617277 6.30736465041 2.65602726158
+321 3.98122974738 6.23917892246 2.01128704388
+322 4.34161036169 8.0 2.00828042487
+323 4.86554033599 6.80195784351 2.66557371574
+324 2.99744264615 7.00867908636 2.11540581974
+325 0.180850941127 5.9568317507 2.35751458504
+326 -0.0 6.09502779708 2.24327721909
+327 1.54062135376 4.44931991982 2.20596832229
+328 1.09047222662 5.95867047045 0.0
+329 2.4695045164 6.19321695803 1.12690079692
+330 0.193431035913 6.63010059619 2.367932522
+331 0.0 6.37960225543 1.05357588082
+332 0.0 7.32944361018 0.932507233331
+333 0.161896378913 4.94241044188 2.34181776894
+334 0.0 5.46813738238 3.27931012467
+335 0.782486881826 5.14456825663 3.54664956912
+336 1.12858175613 6.75635825734 2.2837137097
+337 0.0 6.36679763138 2.5720285753
+338 1.0675007567 7.10408600678 3.96213614834
+339 0.632657095869 6.13389113423 2.31882154316
+340 3.6250509243 3.13327823628 0.624077970408
+341 3.65380755706 3.968236386 0.0
+342 3.00869487335 3.51318009324 0.922191695552
+343 3.53666655927 1.16118788325 0.69343866751
+344 2.7731787954 2.86779743821 2.06490118694
+345 3.8754541801 2.44448190069 2.71335521115
+346 3.4546846295 1.16366771093 2.17205430168
+347 2.95453146336 0.0 1.78373022638
+348 2.96678379084 2.6477910274 1.58513285208
+349 2.61634821624 1.66845669943 0.723592116924
+350 1.96848274874 0.0 1.74347488397
+351 3.43022652648 1.7409048275 3.12680905996
+352 2.90085473686 1.28647370907 2.62798549839
+353 1.42801771358 0.888119168555 2.64120529145
+354 1.92468600456 1.67423505208 3.87749833035
+355 2.79158365853 1.88676742296 2.14033738237
+356 2.54790383645 2.42470463886 0.0
+357 2.01455739282 2.73410062497 2.1031712788
+358 2.83789303952 2.69585734387 1.52195585969
+359 2.88420242052 3.50494726477 0.90357433701
+360 2.31318245586 3.91038686012 2.50330047053
+361 1.61603220169 2.50330461357 0.0
+362 1.63050474778 3.42203880194 0.716088762209
+363 1.6960298732 2.1757255156 0.753745566338
+364 0.858242875244 2.63750400983 0.781194946277
+365 1.40958747783 2.89132079338 2.19127609671
+366 0.0 3.98322174567 0.0
+367 0.0 3.31421165573 0.472253165715
+368 1.30983122193 3.50259187073 2.06946337597
+369 0.0 3.18667893813 1.81143921962
+370 0.605105051029 4.27108311649 2.03575547314
+371 1.21104208689 3.27989730571 0.742111496162
+372 5.41040473381 0.128405093669 0.632047226506
+373 4.47353564654 0.644796488458 0.662742947008
+374 4.80053913665 1.09437432671 0.0
+375 5.73998768401 1.83150610324 0.0
+376 4.58486898336 2.17416864655 0.606775426625
+377 5.04460284725 2.54374078503 0.0
+378 5.87519306595 0.974713414986 0.580557509427
+379 4.71032589439 0.948634707445 1.39880169204
+380 6.47727691588 2.07101583286 0.513858057339
+381 5.30103313095 2.8241893464 1.83062471464
+382 6.31454826581 2.25287132286 2.09747990519
+383 5.30286618833 1.456701416 0.593832163099
+384 2.10363027846 5.55597595462 -0.0
+385 0.924089640597 4.9721134653 0.0
+386 1.23404098895 3.4004270251 -0.0
+387 2.85187845683 4.78959700149 0.0
+388 2.47775945929 5.58639550908 0.601783276596
+389 3.19390686654 4.75598314272 0.592648949354
+390 1.63977641807 4.06055681678 0.694615877429
+391 1.27695846832 4.84715593018 1.12303859232
+392 2.81973456579 3.93800016759 0.638595327548
+393 2.41193203018 5.35246419475 1.63382061983
+394 2.35534944572 4.52616734089 2.13202445944
+395 2.01441820729 4.74272209891 0.653112684688
+$EndNodes
+$Elements
+298
+1 2 1 -20005 359 391 358
+2 2 1 -20005 368 391 358
+3 2 1 -10009 312 157 271
+4 2 1 -10009 4 312 271
+5 2 1 -10006 208 173 218
+6 2 1 -10006 208 173 291
+7 2 1 -10010 269 320 313
+8 2 1 -10010 269 285 313
+9 2 1 -20005 391 395 392
+10 2 1 -20005 359 391 392
+11 2 1 -10010 285 339 313
+12 2 1 -10010 285 339 200
+13 2 1 -10004 256 371 3
+14 2 1 -10004 367 256 3
+15 2 1 -10010 325 200 339
+16 2 1 -30002 365 327 394
+17 2 1 -30002 394 365 344
+18 2 1 -20011 188 186 160
+19 2 1 -20011 188 170 160
+20 2 1 -10004 362 358 371
+21 2 1 -10004 358 256 371
+22 2 1 -20011 161 170 167
+23 2 1 -10010 133 285 219
+24 2 1 -10010 133 285 269
+25 2 1 -10010 116 129 219
+26 2 1 -10010 219 116 133
+27 2 1 -10010 325 200 326
+28 2 1 -10010 285 200 221
+29 2 1 -10009 335 337 334
+30 2 1 -10009 335 337 157
+31 2 1 -10009 157 337 336
+32 2 1 -10009 157 336 312
+33 2 1 -10009 4 312 324
+34 2 1 -10009 89 130 131
+35 2 1 -10009 89 130 127
+36 2 1 -10009 127 130 122
+37 2 1 -30008 301 304 340
+38 2 1 -30008 362 349 363
+39 2 1 -30008 362 349 340
+40 2 1 -30008 376 304 197
+41 2 1 -30008 376 304 340
+42 2 1 -30008 301 340 389
+43 2 1 -30008 304 191 224
+44 2 1 -30008 389 340 392
+45 2 1 -30008 340 362 392
+46 2 1 -30008 383 197 380
+47 2 1 -30008 383 197 376
+48 2 1 -30008 373 383 372
+49 2 1 -30008 304 224 223
+50 2 1 -30008 260 268 276
+51 2 1 -30008 260 276 301
+52 2 1 -30008 343 349 340
+53 2 1 -10006 275 270 299
+54 2 1 -10006 275 270 329
+55 2 1 -10006 275 329 263
+56 2 1 -10006 263 329 265
+57 2 1 -10006 263 275 264
+58 2 1 -10006 263 265 262
+59 2 1 -10006 270 329 393
+60 2 1 -10006 262 265 134
+61 2 1 -10006 297 293 291
+62 2 1 -10006 297 291 299
+63 2 1 -10006 299 291 283
+64 2 1 -20005 355 358 203
+65 2 1 -20005 203 340 376
+66 2 1 -20005 203 340 358
+67 2 1 -20005 203 355 346
+68 2 1 -10004 256 174 353
+69 2 1 -10004 353 256 355
+70 2 1 -10004 355 256 358
+71 2 1 -30002 312 339 336
+72 2 1 -30002 312 339 284
+73 2 1 -30002 365 327 199
+74 2 1 -30002 284 324 321
+75 2 1 -30002 284 324 312
+76 2 1 -30002 333 327 199
+77 2 1 -30002 339 327 284
+78 2 1 -30002 287 284 321
+79 2 1 -30002 111 321 322
+80 2 1 -30002 111 321 280
+81 2 1 -30002 280 321 299
+82 2 1 -30002 294 306 381
+83 2 1 -30002 344 394 287
+84 2 1 -30002 344 287 298
+85 2 1 -30002 280 299 283
+86 2 1 -10009 336 266 312
+87 2 1 -30002 336 312 177
+88 2 1 -30002 195 199 365
+89 2 1 -10004 352 2 355
+90 2 1 -10004 348 355 2
+91 2 1 -10004 348 342 358
+92 2 1 -10004 362 3 371
+93 2 1 -20005 357 368 358
+94 2 1 -10006 173 100 278
+95 2 1 -20005 355 358 357
+96 2 1 -10004 355 358 348
+97 2 1 -20005 340 359 392
+98 2 1 -20005 340 341 392
+99 2 1 -20001 66 8 37
+100 2 1 -10007 69 20 71
+101 2 1 -20001 78 76 255
+102 2 1 -10010 15 16 125
+103 2 1 -10010 125 16 124
+104 2 1 -10003 153 18 310
+105 2 1 -20001 254 76 255
+106 2 1 -20001 254 76 37
+107 2 1 -20001 253 254 66
+108 2 1 -10006 106 264 263
+109 2 1 -20001 254 37 66
+110 2 1 -10010 233 116 234
+111 2 1 -30002 336 177 307
+112 2 1 -10009 308 266 336
+113 2 1 -20005 340 341 296
+114 2 1 -10006 107 97 47
+115 2 1 -10007 289 209 290
+116 2 1 -20011 64 63 51
+117 2 1 -10003 274 158 60
+118 2 1 -20011 167 63 161
+119 2 1 -20011 161 64 63
+120 2 1 -30008 343 376 340
+121 2 1 -10006 208 293 291
+122 2 1 -30008 260 315 388
+123 2 1 -10007 69 143 117
+124 2 1 -10007 69 143 71
+125 2 1 -10007 141 143 71
+126 2 1 -30008 343 376 373
+127 2 1 -10010 72 175 201
+128 2 1 -10010 72 175 125
+129 2 1 -10004 81 353 80
+130 2 1 -10004 353 174 80
+131 2 1 -10004 81 353 227
+132 2 1 -10004 227 353 226
+133 2 1 -10009 128 122 82
+134 2 1 -10009 82 122 121
+135 2 1 -10010 175 221 201
+136 2 1 -10009 128 122 127
+137 2 1 -10009 130 157 132
+138 2 1 -10009 132 157 271
+139 2 1 -10003 338 178 309
+140 2 1 -10003 338 310 153
+141 2 1 -10006 286 270 287
+142 2 1 -10006 286 270 297
+143 2 1 -10006 299 270 297
+144 2 1 -30002 298 270 299
+145 2 1 -30002 321 270 299
+146 2 1 -10010 175 129 221
+147 2 1 -10010 129 233 116
+148 2 1 -30008 246 191 224
+149 2 1 -10007 206 225 144
+150 2 1 -10003 338 272 178
+151 2 1 -10003 272 158 274
+152 2 1 -10006 100 108 97
+153 2 1 -10006 107 108 97
+154 2 1 -10006 277 108 278
+155 2 1 -10006 100 108 278
+156 2 1 -30008 301 223 276
+157 2 1 -30008 224 223 276
+158 2 1 -10006 106 110 264
+159 2 1 -10006 106 110 107
+160 2 1 -10006 277 110 108
+161 2 1 -10006 107 110 108
+162 2 1 -10006 275 264 277
+163 2 1 -10006 277 110 264
+164 2 1 -30008 197 190 380
+165 2 1 -30008 197 190 191
+166 2 1 -30008 304 197 191
+167 2 1 -10007 215 216 117
+168 2 1 -10007 147 216 143
+169 2 1 -10007 147 216 292
+170 2 1 -10007 143 216 117
+171 2 1 -20005 341 392 387
+172 2 1 -30008 260 389 301
+173 2 1 -30002 298 270 287
+174 2 1 -10006 287 393 270
+175 2 1 -30008 260 389 388
+176 2 1 -10009 130 335 157
+177 2 1 -10009 122 335 121
+178 2 1 -10009 335 334 121
+179 2 1 -10009 122 335 130
+180 2 1 -10010 124 176 233
+181 2 1 -10010 129 176 233
+182 2 1 -10010 125 176 124
+183 2 1 -10010 175 176 125
+184 2 1 -10010 175 176 129
+185 2 1 -10010 129 219 221
+186 2 1 -10010 219 285 221
+187 2 1 -10009 130 131 132
+188 2 1 -10007 144 146 137
+189 2 1 -10007 137 146 141
+190 2 1 -10007 147 146 143
+191 2 1 -10007 141 146 143
+192 2 1 -10007 144 146 206
+193 2 1 -10007 147 146 206
+194 2 1 -10007 345 196 295
+195 2 1 -10007 206 196 147
+196 2 1 -10007 345 196 206
+197 2 1 -10007 292 196 147
+198 2 1 -10007 289 214 209
+199 2 1 -10007 289 214 292
+200 2 1 -10007 214 216 292
+201 2 1 -10003 338 159 272
+202 2 1 -10003 153 159 338
+203 2 1 -10003 153 159 156
+204 2 1 -10003 272 159 158
+205 2 1 -10003 156 159 158
+206 2 1 -20011 160 170 166
+207 2 1 -20011 161 170 188
+208 2 1 -20011 166 170 168
+209 2 1 -20011 167 170 168
+210 2 1 -10006 278 173 291
+211 2 1 -10007 351 206 225
+212 2 1 -10007 351 206 345
+213 2 1 -30002 177 312 311
+214 2 1 -10003 314 272 178
+215 2 1 -30008 244 246 191
+216 2 1 -30008 190 244 191
+217 2 1 -10007 295 292 196
+218 2 1 -20005 376 203 379
+219 2 1 -20005 376 296 340
+220 2 1 -20005 377 376 296
+221 2 1 -30002 294 298 344
+222 2 1 -20005 368 370 391
+223 2 1 -10010 200 221 201
+224 2 1 -20005 346 207 203
+225 2 1 -20005 379 207 203
+226 2 1 -10007 210 215 214
+227 2 1 -10007 210 209 214
+228 2 1 -10007 214 216 215
+229 2 1 -30008 301 223 304
+230 2 1 -10007 225 235 351
+231 2 1 -10004 228 227 226
+232 2 1 -10004 352 353 226
+233 2 1 -30008 244 250 246
+234 2 1 -20001 253 251 252
+235 2 1 -20001 253 255 252
+236 2 1 -20001 253 255 254
+237 2 1 -30008 260 316 315
+238 2 1 -30008 260 316 268
+239 2 1 -10009 266 319 312
+240 2 1 -30002 321 270 287
+241 2 1 -10003 314 274 318
+242 2 1 -10003 314 274 272
+243 2 1 -10006 275 283 299
+244 2 1 -10006 275 283 277
+245 2 1 -10006 277 283 278
+246 2 1 -10006 291 283 278
+247 2 1 -30002 299 283 300
+248 2 1 -30002 327 394 284
+249 2 1 -30002 287 394 284
+250 2 1 -10006 286 394 360
+251 2 1 -10006 286 394 287
+252 2 1 -10006 287 394 393
+253 2 1 -10007 289 302 292
+254 2 1 -10007 302 305 290
+255 2 1 -10007 289 302 290
+256 2 1 -10007 295 306 292
+257 2 1 -10007 292 306 302
+258 2 1 -30002 294 306 298
+259 2 1 -30002 381 306 302
+260 2 1 -30002 298 306 299
+261 2 1 -30002 300 306 299
+262 2 1 -30002 302 306 300
+263 2 1 -10007 302 306 305
+264 2 1 -10009 308 330 336
+265 2 1 -30002 330 336 307
+266 2 1 -10009 308 330 337
+267 2 1 -10003 309 338 310
+268 2 1 -10009 319 324 312
+269 2 1 -30002 312 324 311
+270 2 1 -30002 311 324 317
+271 2 1 -30002 317 324 322
+272 2 1 -30002 321 324 322
+273 2 1 -30002 325 339 330
+274 2 1 -10009 330 337 336
+275 2 1 -30002 333 339 325
+276 2 1 -10010 326 339 325
+277 2 1 -30002 333 339 327
+278 2 1 -30002 330 339 336
+279 2 1 -10004 359 358 342
+280 2 1 -20005 340 359 358
+281 2 1 -10004 352 355 353
+282 2 1 -30008 390 362 392
+283 2 1 -10004 359 362 358
+284 2 1 -30008 362 371 390
+285 2 1 -30008 364 371 363
+286 2 1 -30008 362 371 363
+287 2 1 -30008 378 383 372
+288 2 1 -30008 373 383 376
+289 2 1 -20005 377 383 375
+290 2 1 -20005 379 383 376
+291 2 1 -20005 377 383 376
+292 2 1 -30008 378 383 380
+293 2 1 -20005 391 395 384
+294 2 1 -20005 387 395 384
+295 2 1 -20005 387 395 392
+296 2 1 -30008 388 395 389
+297 2 1 -30008 392 395 389
+298 2 1 -30008 390 395 392
+$EndElements
diff --git a/test/common/boundingboxtree/test_geometry_fracture.cc b/test/common/boundingboxtree/test_geometry_fracture.cc
new file mode 100644
index 0000000000..09697e6f9a
--- /dev/null
+++ b/test/common/boundingboxtree/test_geometry_fracture.cc
@@ -0,0 +1,95 @@
+#include <config.h>
+
+#include <iostream>
+#include <algorithm>
+
+#include <dune/common/timer.hh>
+#include <dune/common/parallel/mpihelper.hh>
+#include <dune/grid/utility/structuredgridfactory.hh>
+#include <dune/grid/io/file/vtk.hh>
+#include <dune/grid/io/file/gmshreader.hh>
+#include <dune/grid/yaspgrid.hh>
+
+#include <dune/foamgrid/foamgrid.hh>
+#include <dune/common/version.hh>
+#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
+#include <dune/foamgrid/dgffoam.hh>
+#else
+#include <dune/foamgrid/dgffoam.cc>
+#endif
+
+#include <dumux/common/exceptions.hh>
+#include <dumux/common/geometry/boundingboxtree.hh>
+#include <dumux/common/geometry/geometricentityset.hh>
+#include <dumux/common/geometry/intersectingentities.hh>
+#include <test/common/geometry/writetriangulation.hh>
+
+int main (int argc, char *argv[]) try
+{
+    // maybe initialize mpi
+    Dune::MPIHelper::instance(argc, argv);
+
+    // Some aliases two type tags for tests using two grids
+    constexpr int dimworld = 3;
+    using Grid = Dune::YaspGrid<dimworld>;
+    using ctype = Grid::ctype;
+    using Point = Dune::FieldVector<ctype, dimworld>;
+
+    // make the bulk grid
+    const Point lowerLeft(0.0);
+    const Point upperRight({8.0, 8.0, 5.0});
+    constexpr int numCellsX = 10;
+    std::array<unsigned int, dimworld> elems; elems.fill(numCellsX);
+    auto bulkGrid = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, elems);
+
+    // write to file
+    using GridView = Grid::LeafGridView;
+    Dune::VTKWriter<GridView> vtkWriter(bulkGrid->leafGridView());
+    vtkWriter.write("bulk", Dune::VTK::base64);
+
+    // make the bulk bounding box tree
+    using BulkEntitySet = Dumux::GridViewGeometricEntitySet<GridView, 0>;
+    auto bulkTree = std::make_shared<Dumux::BoundingBoxTree<BulkEntitySet>>();
+    bulkTree->build(std::make_shared<BulkEntitySet>(bulkGrid->leafGridView()));
+
+    // make the fracture grid
+    using FractureGrid = Dune::FoamGrid<2, dimworld>;
+    auto fractureGrid = std::shared_ptr<FractureGrid>(Dune::GmshReader<FractureGrid>::read("fracture.msh", false, false));
+
+    // write to file
+    using FractureGridView = FractureGrid::LeafGridView;
+    Dune::VTKWriter<FractureGridView> lowDimVtkWriter(fractureGrid->leafGridView());
+    lowDimVtkWriter.write("fracture", Dune::VTK::base64);
+
+    // make the fracture bounding box tree
+    using FractureEntitySet = Dumux::GridViewGeometricEntitySet<FractureGridView, 0>;
+    auto fractureTree = std::make_shared<Dumux::BoundingBoxTree<FractureEntitySet>>();
+    fractureTree->build(std::make_shared<FractureEntitySet>(fractureGrid->leafGridView()));
+
+    // compute intersections
+    Dune::Timer timer;
+    const auto treeIntersections = intersectingEntities(*bulkTree, *fractureTree);
+    std::cout << "Computed " << treeIntersections.size() << " tree intersections in " << timer.elapsed() << std::endl;
+    timer.reset();
+
+    // convert format
+    std::vector<std::vector<Point>> intersections;
+    intersections.reserve(treeIntersections.size());
+    for (const auto& is : treeIntersections)
+        intersections.emplace_back(std::vector<Point>(is.corners()));
+    std::cout << "Converted to output format in " << timer.elapsed() << " seconds." << std::endl;
+    timer.reset();
+
+    std::cout << "Writing " << intersections.size() << "intersections to file ...";
+    Dumux::writeVTKPolyDataTriangle(intersections, "bulk_fracture_intersections");
+    std::cout << " done ( " << timer.elapsed() << " seconds)." << std::endl;
+
+    return 0;
+}
+// //////////////////////////////////
+//   Error handler
+// /////////////////////////////////
+catch (const Dune::Exception& e) {
+    std::cout << e << std::endl;
+    return 1;
+}
-- 
GitLab