diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmsh/deadsimple_version4.msh b/applications/utilities/mesh/conversion/gmshToFoam/gmsh/deadsimple_version4.msh new file mode 100644 index 0000000000000000000000000000000000000000..cc56f3fb224542c8f9d66c20eadd70a74b74a72e --- /dev/null +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmsh/deadsimple_version4.msh @@ -0,0 +1,2522 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$PhysicalNames +2 +2 1 "walls" +3 2 "inside" +$EndPhysicalNames +$Entities +8 12 6 1 +1 -1 -1 2 0 +2 -1 -1 -1 0 +3 -1 2 2 0 +4 -1 2 -1 0 +5 2 -1 2 0 +6 2 -1 -1 0 +7 2 2 2 0 +8 2 2 -1 0 +1 -1.0000001 -1.0000001 -1.0000001 -0.9999999000000001 -0.9999999000000001 2.0000001 0 2 2 -1 +2 -1.0000001 -1.0000001 1.9999999 -0.9999999000000001 2.0000001 2.0000001 0 2 1 -3 +3 -1.0000001 1.9999999 -1.0000001 -0.9999999000000001 2.0000001 2.0000001 0 2 4 -3 +4 -1.0000001 -1.0000001 -1.0000001 -0.9999999000000001 2.0000001 -0.9999999000000001 0 2 2 -4 +5 1.9999999 -1.0000001 -1.0000001 2.0000001 -0.9999999000000001 2.0000001 0 2 6 -5 +6 1.9999999 -1.0000001 1.9999999 2.0000001 2.0000001 2.0000001 0 2 5 -7 +7 1.9999999 1.9999999 -1.0000001 2.0000001 2.0000001 2.0000001 0 2 8 -7 +8 1.9999999 -1.0000001 -1.0000001 2.0000001 2.0000001 -0.9999999000000001 0 2 6 -8 +9 -1.0000001 -1.0000001 -1.0000001 2.0000001 -0.9999999000000001 -0.9999999000000001 0 2 2 -6 +10 -1.0000001 -1.0000001 1.9999999 2.0000001 -0.9999999000000001 2.0000001 0 2 1 -5 +11 -1.0000001 1.9999999 -1.0000001 2.0000001 2.0000001 -0.9999999000000001 0 2 4 -8 +12 -1.0000001 1.9999999 1.9999999 2.0000001 2.0000001 2.0000001 0 2 3 -7 +1 -1.0000001 -1.0000001 -1.0000001 -0.9999999000000001 2.0000001 2.0000001 1 1 4 1 2 -3 -4 +2 1.9999999 -1.0000001 -1.0000001 2.0000001 2.0000001 2.0000001 1 1 4 5 6 -7 -8 +3 -1.0000001 -1.0000001 -1.0000001 2.0000001 -0.9999999000000001 2.0000001 1 1 4 9 5 -10 -1 +4 -1.0000001 1.9999999 -1.0000001 2.0000001 2.0000001 2.0000001 1 1 4 11 7 -12 -3 +5 -1.0000001 -1.0000001 -1.0000001 2.0000001 2.0000001 -0.9999999000000001 1 1 4 4 11 -8 -9 +6 -1.0000001 -1.0000001 1.9999999 2.0000001 2.0000001 2.0000001 1 1 4 2 12 -6 -10 +1 -1.0000001 -1.0000001 -1.0000001 2.0000001 2.0000001 2.0000001 1 2 6 1 2 3 4 5 6 +$EndEntities +$Nodes +27 357 1 357 +0 1 0 1 +1 +-1 -1 2 +0 2 0 1 +2 +-1 -1 -1 +0 3 0 1 +3 +-1 2 2 +0 4 0 1 +4 +-1 2 -1 +0 5 0 1 +5 +2 -1 2 +0 6 0 1 +6 +2 -1 -1 +0 7 0 1 +7 +2 2 2 +0 8 0 1 +8 +2 2 -1 +1 1 0 5 +9 +10 +11 +12 +13 +-1 -1 -0.5000000000000016 +-1 -1 -3.108624468950438e-15 +-1 -1 0.4999999999999976 +-1 -1 0.9999999999999982 +-1 -1 1.499999999999999 +1 2 0 5 +14 +15 +16 +17 +18 +-1 -0.5000000000000016 2 +-1 -3.108624468950438e-15 2 +-1 0.4999999999999976 2 +-1 0.9999999999999982 2 +-1 1.499999999999999 2 +1 3 0 5 +19 +20 +21 +22 +23 +-1 2 -0.5000000000000016 +-1 2 -3.108624468950438e-15 +-1 2 0.4999999999999976 +-1 2 0.9999999999999982 +-1 2 1.499999999999999 +1 4 0 5 +24 +25 +26 +27 +28 +-1 -0.5000000000000016 -1 +-1 -3.108624468950438e-15 -1 +-1 0.4999999999999976 -1 +-1 0.9999999999999982 -1 +-1 1.499999999999999 -1 +1 5 0 5 +29 +30 +31 +32 +33 +2 -1 -0.5000000000000016 +2 -1 -3.108624468950438e-15 +2 -1 0.4999999999999976 +2 -1 0.9999999999999982 +2 -1 1.499999999999999 +1 6 0 5 +34 +35 +36 +37 +38 +2 -0.5000000000000016 2 +2 -3.108624468950438e-15 2 +2 0.4999999999999976 2 +2 0.9999999999999982 2 +2 1.499999999999999 2 +1 7 0 5 +39 +40 +41 +42 +43 +2 2 -0.5000000000000016 +2 2 -3.108624468950438e-15 +2 2 0.4999999999999976 +2 2 0.9999999999999982 +2 2 1.499999999999999 +1 8 0 5 +44 +45 +46 +47 +48 +2 -0.5000000000000016 -1 +2 -3.108624468950438e-15 -1 +2 0.4999999999999976 -1 +2 0.9999999999999982 -1 +2 1.499999999999999 -1 +1 9 0 5 +49 +50 +51 +52 +53 +-0.5000000000000016 -1 -1 +-3.108624468950438e-15 -1 -1 +0.4999999999999976 -1 -1 +0.9999999999999982 -1 -1 +1.499999999999999 -1 -1 +1 10 0 5 +54 +55 +56 +57 +58 +-0.5000000000000016 -1 2 +-3.108624468950438e-15 -1 2 +0.4999999999999976 -1 2 +0.9999999999999982 -1 2 +1.499999999999999 -1 2 +1 11 0 5 +59 +60 +61 +62 +63 +-0.5000000000000016 2 -1 +-3.108624468950438e-15 2 -1 +0.4999999999999976 2 -1 +0.9999999999999982 2 -1 +1.499999999999999 2 -1 +1 12 0 5 +64 +65 +66 +67 +68 +-0.5000000000000016 2 2 +-3.108624468950438e-15 2 2 +0.4999999999999976 2 2 +0.9999999999999982 2 2 +1.499999999999999 2 2 +2 1 0 41 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +-1 0.5 0.5 +-1 1.123482565155653 -0.1404370903285543 +-1 0.7356810464883741 -0.04991389300405613 +-1 -0.1404370903285542 -0.1234825651556534 +-1 0.265530293240851 1.026332540756722 +-1 -0.1234825651556535 1.140437090328554 +-1 1.126277538034385 1.12046454628282 +-1 -0.7502403545539664 1.227722343360801 +-1 1.227340469106295 -0.7513853701820414 +-1 -0.3392857142857145 0.4999999999999998 +-1 0.5 -0.3392857142857145 +-1 0.5 1.339285714285714 +-1 1.361379983321088 0.4974270681724016 +-1 -0.4732816656856955 -0.4711623500390829 +-1 1.471162350039082 -0.4732816656856959 +-1 -0.4711623500390832 1.473281665685695 +-1 1.471511721648924 1.470785097679979 +-1 1.030289418192672 0.6942383426637107 +-1 0.2736302322592599 -0.0504932918702824 +-1 -0.05049329187028251 0.726369767740739 +-1 1.045401253196459 0.2599464401583489 +-1 0.7053571428571432 0.9196428571428572 +-1 0.06239229224248621 -0.5297990681767822 +-1 -0.5322598150424698 0.06180047361389907 +-1 1.532227958228432 0.06006990310984173 +-1 0.06180047361389884 1.532259815042469 +-1 0.9381995263860994 -0.5322598150424702 +-1 -0.5297990681767826 0.9376077077575118 +-1 0.9323302618697213 1.510621110182587 +-1 1.525619568131916 0.9259855229807556 +-1 -0.0483876726993806 0.2599130163194738 +-1 1.225960495879661 1.745351551965642 +-1 1.74928282244521 1.224192655165183 +-1 -0.2277223433608035 -0.7502403545539663 +-1 -0.7513853701820413 -0.2273404691062971 +-1 -0.2273404691062972 1.751385370182041 +-1 1.750847577066879 -0.2283029406439647 +-1 -0.7433204164214242 -0.7427905875097711 +-1 1.742877930412231 1.742696274419995 +-1 1.74279058750977 -0.7433204164214243 +-1 -0.7427905875097712 1.743320416421424 +2 2 0 41 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +2 -0.1234825651556535 1.140437090328554 +2 1.227340469106295 -0.7513853701820414 +2 0.7053571428571432 0.9196428571428572 +2 0.06239229224248621 -0.5297990681767822 +2 -0.1404370903285542 -0.1234825651556534 +2 0.7356810464883741 -0.04991389300405613 +2 0.2736302322592599 -0.0504932918702824 +2 -0.05049329187028251 0.726369767740739 +2 1.045401253196459 0.2599464401583489 +2 -0.5322598150424698 0.06180047361389907 +2 1.532227958228432 0.06006990310984173 +2 1.030289418192672 0.6942383426637107 +2 -0.7502403545539664 1.227722343360801 +2 -0.3392857142857145 0.4999999999999998 +2 0.5 -0.3392857142857145 +2 0.5 1.339285714285714 +2 1.361379983321088 0.4974270681724016 +2 -0.4732816656856955 -0.4711623500390829 +2 1.471162350039082 -0.4732816656856959 +2 -0.4711623500390832 1.473281665685695 +2 0.265530293240851 1.026332540756722 +2 1.471511721648924 1.470785097679979 +2 1.126277538034385 1.12046454628282 +2 0.5 0.5 +2 1.123482565155653 -0.1404370903285543 +2 0.06180047361389884 1.532259815042469 +2 0.9381995263860994 -0.5322598150424702 +2 -0.5297990681767826 0.9376077077575118 +2 0.9323302618697213 1.510621110182587 +2 1.525619568131916 0.9259855229807556 +2 -0.0483876726993806 0.2599130163194738 +2 1.225960495879661 1.745351551965642 +2 1.74928282244521 1.224192655165183 +2 -0.2277223433608035 -0.7502403545539663 +2 -0.7513853701820413 -0.2273404691062971 +2 -0.2273404691062972 1.751385370182041 +2 1.750847577066879 -0.2283029406439647 +2 -0.7433204164214242 -0.7427905875097711 +2 1.742877930412231 1.742696274419995 +2 1.74279058750977 -0.7433204164214243 +2 -0.7427905875097712 1.743320416421424 +2 3 0 41 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +-0.1234825651556534 -1 -0.1404370903285542 +0.06006990310984173 -1 1.532227958228432 +1.532259815042469 -1 0.06180047361389884 +0.9376077077575118 -1 -0.5297990681767826 +0.5 -1 0.5 +0.06180047361389907 -1 -0.5322598150424698 +-0.04991389300405613 -1 0.7356810464883741 +-0.0504932918702824 -1 0.2736302322592599 +1.339285714285714 -1 0.5 +0.4974270681724016 -1 1.361379983321088 +-0.4711623500390829 -1 -0.4732816656856955 +1.140437090328554 -1 -0.1234825651556535 +-0.4732816656856959 -1 1.471162350039082 +1.473281665685695 -1 -0.4711623500390832 +1.470785097679979 -1 1.471511721648924 +-0.5297990681767822 -1 0.06239229224248621 +-0.1404370903285543 -1 1.123482565155653 +0.4999999999999998 -1 -0.3392857142857145 +0.726369767740739 -1 -0.05049329187028251 +0.2599464401583489 -1 1.045401253196459 +-0.3392857142857145 -1 0.5 +1.12046454628282 -1 1.126277538034385 +1.751385370182041 -1 -0.2273404691062972 +0.9196428571428572 -1 0.7053571428571432 +-0.5322598150424702 -1 0.9381995263860994 +1.510621110182587 -1 0.9323302618697213 +0.9259855229807556 -1 1.525619568131916 +0.2599130163194738 -1 -0.0483876726993806 +1.026332540756722 -1 0.265530293240851 +0.6942383426637107 -1 1.030289418192672 +1.227722343360801 -1 -0.7502403545539664 +-0.7502403545539663 -1 -0.2277223433608035 +-0.7513853701820414 -1 1.227340469106295 +1.745351551965642 -1 1.225960495879661 +1.224192655165183 -1 1.74928282244521 +-0.2273404691062971 -1 -0.7513853701820413 +-0.2283029406439647 -1 1.750847577066879 +-0.7427905875097711 -1 -0.7433204164214242 +-0.7433204164214243 -1 1.74279058750977 +1.742696274419995 -1 1.742877930412231 +1.743320416421424 -1 -0.7427905875097712 +2 4 0 41 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +0.5 2 0.5 +0.06180047361389907 2 -0.5322598150424698 +0.6942383426637107 2 1.030289418192672 +-0.1234825651556534 2 -0.1404370903285542 +1.470785097679979 2 1.471511721648924 +-0.1404370903285543 2 1.123482565155653 +-0.0504932918702824 2 0.2736302322592599 +0.726369767740739 2 -0.05049329187028251 +1.12046454628282 2 1.126277538034385 +1.473281665685695 2 -0.4711623500390832 +1.026332540756722 2 0.265530293240851 +-0.3392857142857145 2 0.5 +0.4999999999999998 2 -0.3392857142857145 +1.227722343360801 2 -0.7502403545539664 +0.2599464401583489 2 1.045401253196459 +-0.4711623500390829 2 -0.4732816656856955 +-0.4732816656856959 2 1.471162350039082 +1.140437090328554 2 -0.1234825651556535 +-0.04991389300405613 2 0.7356810464883741 +1.339285714285714 2 0.5 +0.4974270681724016 2 1.361379983321088 +0.06006990310984173 2 1.532227958228432 +0.9196428571428572 2 0.7053571428571432 +-0.5297990681767822 2 0.06239229224248621 +1.532259815042469 2 0.06180047361389884 +-0.5322598150424702 2 0.9381995263860994 +0.9376077077575118 2 -0.5297990681767826 +1.510621110182587 2 0.9323302618697213 +0.2599130163194738 2 -0.0483876726993806 +-0.7513853701820414 2 1.227340469106295 +-0.7502403545539663 2 -0.2277223433608035 +1.745351551965642 2 1.225960495879661 +1.224192655165183 2 1.74928282244521 +1.751385370182041 2 -0.2273404691062972 +0.9259855229807556 2 1.525619568131916 +-0.2273404691062971 2 -0.7513853701820413 +-0.2283029406439647 2 1.750847577066879 +-0.7427905875097711 2 -0.7433204164214242 +-0.7433204164214243 2 1.74279058750977 +1.742696274419995 2 1.742877930412231 +1.743320416421424 2 -0.7427905875097712 +2 5 0 41 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +0.5 0.5 -1 +1.123482565155653 -0.1404370903285543 -1 +-0.3392857142857145 0.4999999999999998 -1 +-0.4711623500390832 1.473281665685695 -1 +1.361379983321088 0.4974270681724016 -1 +0.2736302322592599 -0.0504932918702824 -1 +-0.05049329187028251 0.726369767740739 -1 +0.5 1.339285714285714 -1 +0.7356810464883741 -0.04991389300405613 -1 +0.5 -0.3392857142857145 -1 +1.471162350039082 -0.4732816656856959 -1 +-0.1404370903285542 -0.1234825651556534 -1 +1.030289418192672 0.6942383426637107 -1 +-0.4732816656856955 -0.4711623500390829 -1 +-0.5322598150424698 0.06180047361389907 -1 +1.126277538034385 1.12046454628282 -1 +1.532227958228432 0.06006990310984173 -1 +0.06239229224248621 -0.5297990681767822 -1 +-0.1234825651556535 1.140437090328554 -1 +1.471511721648924 1.470785097679979 -1 +0.7053571428571432 0.9196428571428572 -1 +1.045401253196459 0.2599464401583489 -1 +0.06180047361389884 1.532259815042469 -1 +1.227340469106295 -0.7513853701820414 -1 +0.265530293240851 1.026332540756722 -1 +-0.7502403545539664 1.227722343360801 -1 +0.9381995263860994 -0.5322598150424702 -1 +-0.5297990681767826 0.9376077077575118 -1 +0.9323302618697213 1.510621110182587 -1 +1.525619568131916 0.9259855229807556 -1 +-0.0483876726993806 0.2599130163194738 -1 +1.74928282244521 1.224192655165183 -1 +-0.2277223433608035 -0.7502403545539663 -1 +1.225960495879661 1.745351551965642 -1 +-0.7513853701820413 -0.2273404691062971 -1 +-0.2273404691062972 1.751385370182041 -1 +1.750847577066879 -0.2283029406439647 -1 +-0.7433204164214242 -0.7427905875097711 -1 +1.74279058750977 -0.7433204164214243 -1 +1.742877930412231 1.742696274419994 -1 +-0.7427905875097712 1.743320416421424 -1 +2 6 0 41 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +0.7053571428571432 0.9196428571428572 2 +1.045401253196459 0.2599464401583489 2 +0.2736302322592599 -0.0504932918702824 2 +-0.4732816656856955 -0.4711623500390829 2 +-0.4711623500390832 1.473281665685695 2 +1.361379983321088 0.4974270681724016 2 +1.471511721648924 1.470785097679979 2 +-0.05049329187028251 0.726369767740739 2 +0.06239229224248621 -0.5297990681767822 2 +-0.3392857142857145 0.4999999999999998 2 +0.7356810464883741 -0.04991389300405613 2 +-0.1234825651556535 1.140437090328554 2 +1.126277538034385 1.12046454628282 2 +0.5 0.5 2 +1.471162350039082 -0.4732816656856959 2 +-0.1404370903285542 -0.1234825651556534 2 +1.123482565155653 -0.1404370903285543 2 +0.5 -0.3392857142857145 2 +0.265530293240851 1.026332540756722 2 +1.030289418192672 0.6942383426637107 2 +1.532227958228432 0.06006990310984173 2 +0.5 1.339285714285714 2 +-0.5322598150424698 0.06180047361389907 2 +0.06180047361389884 1.532259815042469 2 +0.9381995263860994 -0.5322598150424702 2 +-0.5297990681767826 0.9376077077575118 2 +0.9323302618697213 1.510621110182587 2 +-0.0483876726993806 0.2599130163194738 2 +-0.7502403545539664 1.227722343360801 2 +1.227340469106295 -0.7513853701820414 2 +1.74928282244521 1.224192655165183 2 +-0.2277223433608035 -0.7502403545539663 2 +1.225960495879661 1.745351551965642 2 +-0.7513853701820413 -0.2273404691062971 2 +1.525619568131916 0.9259855229807556 2 +-0.2273404691062972 1.751385370182041 2 +1.750847577066879 -0.2283029406439647 2 +-0.7433204164214242 -0.7427905875097711 2 +1.74279058750977 -0.7433204164214243 2 +1.742877930412231 1.742696274419994 2 +-0.7427905875097712 1.743320416421424 2 +3 1 0 43 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +0.5 0.5 0.5 +-0.05155188206573381 1.051551882065734 -0.05155188206573383 +-0.05155188206573383 -0.05155188206573379 -0.05155188206573369 +-0.05155188206573358 -0.05155188206573383 1.051551882065734 +1.051551882065734 -0.05155188206573379 -0.05155188206573369 +1.051926643265114 1.051895937035783 -0.05033918828818755 +-0.05033918828818751 1.051926643265114 1.051895937035783 +1.051895937035783 -0.05033918828818768 1.051926643265114 +1.051052795441635 1.051052795441635 1.051052795441635 +0.5 0.4226721769013991 -0.2500000000000001 +0.4226721769013994 -0.25 0.5 +-0.2500000000000001 0.5 0.4226721769013994 +1.25 0.4230675449210161 0.4996046319803834 +0.4230675449210162 0.4996046319803831 1.25 +0.4996046319803833 1.25 0.4230675449210161 +-0.202574719487977 1.483737652840241 -0.4837376528402403 +-0.4837376528402412 -0.2025747194879768 1.483737652840242 +1.483737652840242 -0.4837376528402411 -0.2025747194879767 +-0.2025747194879768 -0.4849238932038742 -0.4837376528402412 +-0.2365081782457332 1.440069363385562 1.451992842855579 +1.45199284285558 -0.2365081782457333 1.440069363385562 +1.440069324681569 1.45199281012986 -0.2365079960013205 +1.355145587909049 1.469496620745763 1.223122904785665 +0.500514163545104 -0.3869204984868427 1.13153796684289 +1.13153796684289 0.500514163545104 -0.3869204984868428 +-0.3869204984868427 1.13153796684289 0.5005141635451038 +-0.3946624585275814 0.5005636481924485 1.056432941358737 +1.056432941358737 -0.3946624585275816 0.5005636481924486 +0.5005636481924487 1.056432941358736 -0.3946624585275815 +1.052854966731872 0.5006231893841968 1.385908531619983 +0.5006231893841967 1.385908531619983 1.052854966731872 +1.385908531619984 1.052854966731872 0.5006231893841968 +-0.325838006338208 -0.3258380063382081 0.5 +-0.3258380063382081 0.5 -0.3258380063382081 +0.5 -0.325838006338208 -0.3258380063382081 +1.607636811478162 -0.6076368114781616 -0.6076368114781616 +1.60777812319307 1.607777540507454 -0.6074952540976615 +-0.6076368114781621 -0.607636811478162 1.607636811478162 +-0.6076368114781621 -0.6076368114781621 -0.6076368114781621 +-0.607636811478162 1.607636811478162 -0.6076368114781621 +-0.6074957925211726 1.607778660492915 1.607778077809613 +1.607778077809614 -0.6074957925211726 1.607778660492915 +1.606967528263687 1.606967528263687 1.606967528263686 +$EndNodes +$Elements +7 1730 1 1730 +2 1 2 104 +1 13 1 109 +2 1 14 109 +3 2 9 106 +4 24 2 106 +5 18 3 107 +6 3 23 107 +7 19 4 108 +8 4 28 108 +9 9 10 103 +10 82 9 103 +11 9 82 106 +12 10 11 92 +13 10 92 103 +14 11 12 96 +15 11 78 92 +16 78 11 96 +17 12 13 76 +18 96 12 76 +19 13 84 76 +20 84 13 109 +21 14 15 104 +22 84 14 104 +23 14 84 109 +24 15 16 94 +25 15 94 104 +26 16 17 97 +27 16 80 94 +28 80 16 97 +29 17 18 100 +30 97 17 100 +31 18 85 100 +32 85 18 107 +33 20 19 105 +34 19 83 105 +35 83 19 108 +36 21 20 93 +37 93 20 105 +38 22 21 98 +39 81 21 93 +40 21 81 98 +41 23 22 101 +42 22 98 101 +43 85 23 101 +44 23 85 107 +45 25 24 102 +46 24 82 102 +47 82 24 106 +48 26 25 91 +49 91 25 102 +50 27 26 95 +51 79 26 91 +52 26 79 95 +53 28 27 77 +54 27 95 77 +55 83 28 77 +56 28 83 108 +57 69 87 99 +58 87 69 71 +59 88 69 99 +60 69 88 73 +61 69 89 71 +62 89 69 86 +63 90 69 73 +64 69 90 86 +65 82 72 91 +66 72 82 92 +67 72 87 91 +68 87 72 99 +69 72 92 99 +70 83 70 93 +71 70 83 95 +72 70 89 93 +73 89 70 71 +74 70 95 71 +75 74 84 94 +76 84 74 96 +77 74 88 96 +78 88 74 73 +79 74 94 73 +80 85 75 97 +81 75 85 98 +82 75 90 97 +83 90 75 86 +84 75 98 86 +85 88 78 96 +86 78 88 99 +87 92 78 99 +88 87 79 91 +89 79 87 71 +90 95 79 71 +91 90 80 97 +92 80 90 73 +93 94 80 73 +94 89 81 93 +95 81 89 86 +96 98 81 86 +97 82 91 102 +98 92 82 103 +99 83 93 105 +100 95 83 77 +101 94 84 104 +102 84 96 76 +103 85 97 100 +104 98 85 101 +2 2 2 104 +105 33 150 5 +106 5 150 34 +107 6 147 29 +108 44 147 6 +109 38 148 7 +110 7 148 43 +111 39 149 8 +112 8 149 48 +113 29 144 30 +114 127 144 29 +115 29 147 127 +116 30 119 31 +117 30 144 119 +118 31 137 32 +119 31 119 123 +120 123 137 31 +121 32 122 33 +122 137 122 32 +123 33 122 129 +124 129 150 33 +125 34 145 35 +126 129 145 34 +127 34 150 129 +128 35 135 36 +129 35 145 135 +130 36 138 37 +131 36 135 125 +132 125 138 36 +133 37 141 38 +134 138 141 37 +135 38 141 131 +136 131 148 38 +137 40 146 39 +138 39 146 128 +139 128 149 39 +140 41 120 40 +141 120 146 40 +142 42 139 41 +143 126 120 41 +144 41 139 126 +145 43 142 42 +146 42 142 139 +147 131 142 43 +148 43 148 131 +149 45 143 44 +150 44 143 127 +151 127 147 44 +152 46 113 45 +153 113 143 45 +154 47 136 46 +155 124 113 46 +156 46 136 124 +157 48 111 47 +158 47 111 136 +159 128 111 48 +160 48 149 128 +161 133 140 116 +162 116 115 133 +163 117 140 133 +164 133 130 117 +165 133 115 118 +166 118 121 133 +167 112 130 133 +168 133 121 112 +169 127 113 114 +170 114 119 127 +171 114 113 116 +172 116 140 114 +173 114 140 119 +174 128 120 134 +175 134 136 128 +176 134 120 118 +177 118 115 134 +178 134 115 136 +179 110 135 129 +180 129 137 110 +181 110 137 117 +182 117 130 110 +183 110 130 135 +184 131 138 132 +185 132 139 131 +186 132 138 112 +187 112 121 132 +188 132 121 139 +189 117 137 123 +190 123 140 117 +191 119 140 123 +192 116 113 124 +193 124 115 116 +194 136 115 124 +195 112 138 125 +196 125 130 112 +197 135 130 125 +198 118 120 126 +199 126 121 118 +200 139 121 126 +201 127 143 113 +202 119 144 127 +203 128 146 120 +204 136 111 128 +205 135 145 129 +206 129 122 137 +207 131 141 138 +208 139 142 131 +2 3 2 104 +209 1 13 189 +210 54 1 189 +211 9 2 188 +212 2 49 188 +213 33 5 190 +214 5 58 190 +215 6 29 191 +216 53 6 191 +217 10 9 182 +218 9 161 182 +219 161 9 188 +220 11 10 166 +221 166 10 182 +222 12 11 175 +223 171 11 166 +224 11 171 175 +225 13 12 183 +226 12 175 183 +227 163 13 183 +228 13 163 189 +229 29 30 173 +230 164 29 173 +231 29 164 191 +232 30 31 153 +233 30 153 173 +234 31 32 176 +235 31 159 153 +236 159 31 176 +237 32 33 184 +238 176 32 184 +239 33 165 184 +240 165 33 190 +241 49 50 186 +242 161 49 186 +243 49 161 188 +244 50 51 156 +245 50 156 186 +246 51 52 154 +247 51 168 156 +248 168 51 154 +249 52 53 181 +250 154 52 181 +251 53 164 181 +252 164 53 191 +253 55 54 187 +254 54 163 187 +255 163 54 189 +256 56 55 152 +257 152 55 187 +258 57 56 177 +259 160 56 152 +260 56 160 177 +261 58 57 185 +262 57 177 185 +263 165 58 185 +264 58 165 190 +265 155 158 178 +266 158 155 157 +267 169 155 178 +268 155 169 179 +269 155 170 157 +270 170 155 180 +271 174 155 179 +272 155 174 180 +273 161 151 166 +274 151 161 156 +275 151 158 166 +276 158 151 178 +277 151 156 178 +278 163 167 152 +279 167 163 175 +280 167 170 152 +281 170 167 157 +282 167 175 157 +283 162 164 153 +284 164 162 154 +285 162 169 154 +286 169 162 179 +287 162 153 179 +288 165 172 176 +289 172 165 177 +290 172 174 176 +291 174 172 180 +292 172 177 180 +293 158 171 166 +294 171 158 157 +295 175 171 157 +296 169 168 154 +297 168 169 178 +298 156 168 178 +299 174 159 176 +300 159 174 179 +301 153 159 179 +302 170 160 152 +303 160 170 180 +304 177 160 180 +305 161 166 182 +306 156 161 186 +307 163 152 187 +308 175 163 183 +309 153 164 173 +310 164 154 181 +311 165 176 184 +312 177 165 185 +2 4 2 104 +313 3 230 23 +314 64 230 3 +315 19 229 4 +316 4 229 59 +317 43 231 7 +318 7 231 68 +319 8 232 39 +320 63 232 8 +321 20 222 19 +322 19 222 207 +323 207 229 19 +324 21 215 20 +325 215 222 20 +326 22 217 21 +327 203 215 21 +328 21 217 203 +329 23 221 22 +330 22 221 217 +331 208 221 23 +332 23 230 208 +333 39 225 40 +334 201 225 39 +335 39 232 201 +336 40 216 41 +337 40 225 216 +338 41 219 42 +339 41 216 211 +340 211 219 41 +341 42 223 43 +342 219 223 42 +343 43 223 196 +344 196 231 43 +345 59 227 60 +346 207 227 59 +347 59 229 207 +348 60 193 61 +349 60 227 193 +350 61 218 62 +351 61 193 204 +352 204 218 61 +353 62 205 63 +354 218 205 62 +355 63 205 201 +356 201 232 63 +357 65 228 64 +358 64 228 208 +359 208 230 64 +360 66 213 65 +361 213 228 65 +362 67 226 66 +363 212 213 66 +364 66 226 212 +365 68 224 67 +366 67 224 226 +367 196 224 68 +368 68 231 196 +369 192 220 198 +370 198 210 192 +371 199 220 192 +372 192 202 199 +373 192 210 206 +374 206 194 192 +375 214 202 192 +376 192 194 214 +377 207 215 195 +378 195 193 207 +379 195 215 198 +380 198 220 195 +381 195 220 193 +382 208 213 197 +383 197 217 208 +384 197 213 206 +385 206 210 197 +386 197 210 217 +387 209 216 201 +388 201 218 209 +389 209 218 199 +390 199 202 209 +391 209 202 216 +392 196 219 200 +393 200 226 196 +394 200 219 214 +395 214 194 200 +396 200 194 226 +397 198 215 203 +398 203 210 198 +399 217 210 203 +400 199 218 204 +401 204 220 199 +402 193 220 204 +403 214 219 211 +404 211 202 214 +405 216 202 211 +406 206 213 212 +407 212 194 206 +408 226 194 212 +409 207 222 215 +410 193 227 207 +411 208 228 213 +412 217 221 208 +413 216 225 201 +414 201 205 218 +415 196 223 219 +416 226 224 196 +2 5 2 104 +417 2 24 270 +418 49 2 270 +419 28 4 273 +420 4 59 273 +421 44 6 271 +422 6 53 271 +423 8 48 272 +424 63 8 272 +425 24 25 267 +426 246 24 267 +427 24 246 270 +428 25 26 247 +429 25 247 267 +430 26 27 260 +431 26 235 247 +432 235 26 260 +433 27 28 258 +434 260 27 258 +435 28 236 258 +436 236 28 273 +437 45 44 269 +438 44 243 269 +439 243 44 271 +440 46 45 249 +441 249 45 269 +442 47 46 262 +443 237 46 249 +444 46 237 262 +445 48 47 264 +446 47 262 264 +447 252 48 264 +448 48 252 272 +449 50 49 265 +450 49 246 265 +451 246 49 270 +452 51 50 250 +453 250 50 265 +454 52 51 259 +455 242 51 250 +456 51 242 259 +457 53 52 256 +458 52 259 256 +459 243 53 256 +460 53 243 271 +461 59 60 268 +462 236 59 268 +463 59 236 273 +464 60 61 255 +465 60 255 268 +466 61 62 261 +467 61 240 255 +468 240 61 261 +469 62 63 266 +470 261 62 266 +471 63 252 266 +472 252 63 272 +473 233 238 263 +474 238 233 241 +475 239 233 263 +476 233 239 257 +477 233 254 241 +478 254 233 245 +479 253 233 257 +480 233 253 245 +481 246 244 250 +482 244 246 247 +483 244 238 250 +484 238 244 263 +485 244 247 263 +486 243 234 249 +487 234 243 259 +488 234 254 249 +489 254 234 241 +490 234 259 241 +491 251 236 255 +492 236 251 260 +493 251 239 260 +494 239 251 257 +495 251 255 257 +496 252 248 261 +497 248 252 262 +498 248 253 261 +499 253 248 245 +500 248 262 245 +501 239 235 260 +502 235 239 263 +503 247 235 263 +504 238 242 250 +505 242 238 241 +506 259 242 241 +507 253 240 261 +508 240 253 257 +509 255 240 257 +510 254 237 249 +511 237 254 245 +512 262 237 245 +513 246 250 265 +514 247 246 267 +515 243 249 269 +516 259 243 256 +517 255 236 268 +518 236 260 258 +519 252 261 266 +520 262 252 264 +2 6 2 104 +521 1 311 14 +522 54 311 1 +523 18 314 3 +524 3 314 64 +525 34 312 5 +526 5 312 58 +527 7 313 38 +528 68 313 7 +529 14 307 15 +530 277 307 14 +531 14 311 277 +532 15 296 16 +533 15 307 296 +534 16 299 17 +535 16 296 283 +536 283 299 16 +537 17 302 18 +538 299 302 17 +539 18 302 278 +540 278 314 18 +541 35 310 34 +542 34 310 288 +543 288 312 34 +544 36 294 35 +545 294 310 35 +546 37 308 36 +547 279 294 36 +548 36 308 279 +549 38 304 37 +550 37 304 308 +551 280 304 38 +552 38 313 280 +553 55 305 54 +554 54 305 277 +555 277 311 54 +556 56 282 55 +557 282 305 55 +558 57 298 56 +559 291 282 56 +560 56 298 291 +561 58 303 57 +562 57 303 298 +563 288 303 58 +564 58 312 288 +565 64 309 65 +566 278 309 64 +567 64 314 278 +568 65 297 66 +569 65 309 297 +570 66 300 67 +571 66 297 295 +572 295 300 66 +573 67 306 68 +574 300 306 67 +575 68 306 280 +576 280 313 68 +577 287 301 276 +578 276 284 287 +579 281 301 287 +580 287 292 281 +581 287 284 275 +582 275 293 287 +583 274 292 287 +584 287 293 274 +585 277 282 289 +586 289 296 277 +587 289 282 276 +588 276 301 289 +589 289 301 296 +590 288 294 290 +591 290 298 288 +592 290 294 275 +593 275 284 290 +594 290 284 298 +595 285 297 278 +596 278 299 285 +597 285 299 281 +598 281 292 285 +599 285 292 297 +600 280 300 286 +601 286 308 280 +602 286 300 274 +603 274 293 286 +604 286 293 308 +605 281 299 283 +606 283 301 281 +607 296 301 283 +608 276 282 291 +609 291 284 276 +610 298 284 291 +611 274 300 295 +612 295 292 274 +613 297 292 295 +614 275 294 279 +615 279 293 275 +616 308 293 279 +617 277 305 282 +618 296 307 277 +619 288 310 294 +620 298 303 288 +621 297 309 278 +622 278 302 299 +623 280 306 300 +624 308 304 280 +3 1 4 1106 +625 292 328 321 345 +626 202 329 320 346 +627 130 327 322 344 +628 214 323 329 346 +629 274 323 328 345 +630 323 327 112 344 +631 300 224 306 357 +632 138 304 141 357 +633 95 258 77 354 +634 259 181 256 350 +635 76 183 175 352 +636 103 92 182 353 +637 267 247 102 353 +638 210 329 321 340 +639 284 328 322 338 +640 115 327 320 339 +641 187 305 152 352 +642 222 93 105 354 +643 269 143 249 350 +644 303 185 298 356 +645 217 221 101 355 +646 111 264 136 351 +647 175 167 318 331 +648 259 234 319 332 +649 70 316 95 330 +650 72 317 92 333 +651 249 319 234 332 +652 167 152 318 331 +653 93 316 70 330 +654 72 91 317 333 +655 137 184 122 356 +656 100 302 299 355 +657 205 218 266 351 +658 172 322 177 335 +659 262 248 320 336 +660 98 75 321 334 +661 322 335 130 344 +662 321 334 292 345 +663 202 320 336 346 +664 214 337 323 346 +665 321 329 210 345 +666 115 320 327 346 +667 322 328 284 344 +668 286 308 323 337 +669 220 329 316 343 +670 301 328 318 341 +671 140 327 319 342 +672 290 298 322 335 +673 217 321 197 334 +674 136 320 134 336 +675 199 320 329 343 +676 281 321 328 341 +677 117 322 327 342 +678 195 316 215 330 +679 282 289 318 331 +680 114 319 113 332 +681 112 138 132 323 +682 300 286 274 323 +683 298 284 290 322 +684 134 136 115 320 +685 197 217 210 321 +686 285 321 299 334 +687 137 110 322 335 +688 209 320 218 336 +689 112 327 130 344 +690 274 328 292 345 +691 214 329 202 346 +692 286 323 308 344 +693 281 299 321 341 +694 218 320 199 343 +695 137 322 117 342 +696 167 318 152 338 +697 249 234 319 339 +698 93 70 316 340 +699 276 282 289 318 +700 195 198 215 316 +701 114 116 113 319 +702 218 209 199 320 +703 285 281 299 321 +704 117 137 110 322 +705 97 321 75 334 +706 261 320 248 336 +707 176 322 172 335 +708 262 320 248 339 +709 98 321 75 340 +710 172 177 322 338 +711 220 316 330 343 +712 140 319 332 342 +713 318 331 301 341 +714 320 327 324 339 +715 322 328 325 338 +716 321 329 326 340 +717 318 331 74 347 +718 319 332 162 349 +719 316 330 251 348 +720 319 327 116 339 +721 276 318 328 338 +722 198 316 329 340 +723 317 333 151 347 +724 286 323 300 337 +725 244 333 317 348 +726 92 317 72 347 +727 175 318 167 347 +728 234 259 319 349 +729 95 316 70 348 +730 125 323 112 344 +731 274 295 323 345 +732 323 315 329 346 +733 315 327 323 344 +734 315 328 323 345 +735 308 323 138 344 +736 75 321 97 341 +737 172 322 176 342 +738 261 248 320 343 +739 72 317 91 348 +740 176 322 137 342 +741 97 321 299 341 +742 261 320 218 343 +743 226 200 337 345 +744 320 329 315 346 +745 315 322 327 344 +746 315 321 328 345 +747 75 340 321 341 +748 248 339 320 343 +749 172 338 322 342 +750 217 98 321 334 +751 262 320 136 336 +752 298 177 322 335 +753 138 323 125 344 +754 295 300 323 345 +755 298 322 177 338 +756 217 321 98 340 +757 262 136 320 339 +758 282 318 152 331 +759 249 113 319 332 +760 215 316 93 330 +761 88 74 318 341 +762 239 251 316 343 +763 162 319 169 342 +764 315 324 320 327 +765 315 325 322 328 +766 315 326 321 329 +767 274 328 323 344 +768 214 329 323 345 +769 112 327 323 346 +770 132 323 138 337 +771 318 328 315 341 +772 319 327 315 342 +773 316 329 315 343 +774 249 319 113 339 +775 93 316 215 340 +776 152 318 282 338 +777 319 315 325 342 +778 318 315 326 341 +779 316 315 324 343 +780 321 315 328 341 +781 322 315 327 342 +782 320 315 329 343 +783 322 325 315 342 +784 321 326 315 341 +785 320 324 315 343 +786 290 322 284 344 +787 197 321 210 345 +788 134 320 115 346 +789 175 331 318 347 +790 259 332 319 349 +791 95 330 316 348 +792 92 333 317 347 +793 117 327 140 342 +794 199 329 220 343 +795 281 328 301 341 +796 91 317 333 348 +797 176 137 322 335 +798 218 320 261 336 +799 299 321 97 334 +800 113 319 116 339 +801 276 282 318 338 +802 215 316 198 340 +803 115 320 136 339 +804 298 284 322 338 +805 210 321 217 340 +806 320 315 327 346 +807 315 328 322 344 +808 315 329 321 345 +809 308 138 323 337 +810 115 116 327 339 +811 276 328 284 338 +812 198 329 210 340 +813 323 327 315 346 +814 315 323 328 344 +815 315 323 329 345 +816 199 209 202 320 +817 292 281 285 321 +818 130 117 110 322 +819 324 327 319 339 +820 326 329 316 340 +821 325 328 318 338 +822 134 336 320 346 +823 290 335 322 344 +824 197 334 321 345 +825 209 202 320 336 +826 292 321 285 334 +827 110 130 322 335 +828 74 331 318 341 +829 162 332 319 342 +830 251 330 316 343 +831 238 317 244 333 +832 198 195 220 316 +833 238 263 244 317 +834 289 301 276 318 +835 116 114 140 319 +836 72 87 99 317 +837 151 158 178 317 +838 274 323 286 344 +839 132 112 323 346 +840 74 88 318 347 +841 169 319 162 349 +842 158 317 151 347 +843 87 317 72 348 +844 239 316 251 348 +845 130 117 322 327 +846 281 321 292 328 +847 199 320 202 329 +848 289 301 318 331 +849 114 140 319 332 +850 220 316 195 330 +851 151 317 178 333 +852 220 198 316 329 +853 116 319 140 327 +854 276 318 301 328 +855 158 178 317 325 +856 238 263 317 324 +857 87 99 317 326 +858 167 318 157 347 +859 71 70 316 348 +860 234 319 241 349 +861 72 317 99 347 +862 263 244 317 348 +863 132 323 337 346 +864 157 325 318 338 +865 241 324 319 339 +866 71 326 316 340 +867 214 211 337 346 +868 315 319 324 327 +869 315 318 325 328 +870 315 316 326 329 +871 318 88 341 347 +872 239 343 316 348 +873 169 342 319 349 +874 244 247 333 348 +875 154 162 332 349 +876 96 74 331 347 +877 260 251 330 348 +878 166 151 333 347 +879 179 162 169 342 +880 239 257 251 343 +881 88 73 74 341 +882 178 317 325 349 +883 317 326 99 347 +884 317 324 263 348 +885 300 274 295 323 +886 138 112 125 323 +887 315 324 319 325 +888 315 316 324 326 +889 315 325 318 326 +890 158 325 317 347 +891 87 326 317 348 +892 238 324 317 349 +893 125 130 335 344 +894 295 292 334 345 +895 202 336 211 346 +896 214 202 211 346 +897 125 112 130 344 +898 274 292 295 345 +899 316 326 71 348 +900 241 319 324 349 +901 318 325 157 347 +902 169 325 342 349 +903 239 324 343 348 +904 326 341 88 347 +905 318 326 325 347 +906 324 326 316 348 +907 319 325 324 349 +908 275 290 284 344 +909 197 210 206 345 +910 118 134 115 346 +911 72 91 333 353 +912 249 332 234 350 +913 167 152 331 352 +914 93 330 70 354 +915 262 248 336 351 +916 98 75 334 355 +917 172 335 177 356 +918 117 140 123 342 +919 199 220 204 343 +920 281 301 283 341 +921 259 234 332 350 +922 175 167 331 352 +923 70 330 95 354 +924 72 333 92 353 +925 324 325 317 349 +926 317 326 324 348 +927 325 326 317 347 +928 75 90 340 341 +929 172 174 338 342 +930 253 339 248 343 +931 91 333 247 348 +932 286 308 337 357 +933 154 332 259 349 +934 175 96 331 347 +935 95 260 330 348 +936 166 333 92 347 +937 318 341 326 347 +938 319 342 325 349 +939 316 343 324 348 +940 315 324 317 326 +941 315 317 325 326 +942 315 317 324 325 +943 261 336 248 351 +944 176 335 172 356 +945 97 334 75 355 +946 204 218 199 343 +947 281 283 299 341 +948 123 137 117 342 +949 86 75 90 340 +950 172 174 180 338 +951 253 245 248 339 +952 153 119 332 342 +953 255 193 330 343 +954 296 331 94 341 +955 286 337 300 357 +956 317 333 238 349 +957 178 333 317 349 +958 298 185 177 356 +959 217 101 98 355 +960 136 264 262 351 +961 200 194 214 345 +962 293 274 286 344 +963 132 121 112 346 +964 300 226 224 357 +965 304 138 308 357 +966 97 100 299 355 +967 137 176 184 356 +968 218 261 266 351 +969 258 95 260 354 +970 259 154 181 350 +971 96 76 175 352 +972 102 247 91 353 +973 92 166 182 353 +974 305 282 152 352 +975 215 93 222 354 +976 249 143 113 350 +977 99 326 88 347 +978 178 325 169 349 +979 263 324 239 348 +980 115 327 133 346 +981 287 284 328 344 +982 210 329 192 345 +983 308 138 279 344 +984 226 300 212 345 +985 169 325 155 342 +986 88 326 69 341 +987 239 324 233 343 +988 255 204 193 343 +989 80 296 94 341 +990 153 123 119 342 +991 279 138 125 344 +992 295 212 300 345 +993 226 194 200 345 +994 293 286 308 344 +995 158 151 166 347 +996 87 72 91 348 +997 169 162 154 349 +998 74 96 88 347 +999 260 239 251 348 +1000 204 261 218 343 +1001 283 97 299 341 +1002 123 153 159 342 +1003 240 204 255 343 +1004 296 80 283 341 +1005 240 261 204 343 +1006 283 80 97 341 +1007 249 254 234 339 +1008 170 167 152 338 +1009 93 89 70 340 +1010 115 124 116 339 +1011 276 284 291 338 +1012 198 210 203 340 +1013 136 262 336 351 +1014 217 98 334 355 +1015 298 177 335 356 +1016 157 170 325 338 +1017 89 326 71 340 +1018 241 254 324 339 +1019 172 177 165 356 +1020 98 85 75 355 +1021 262 252 248 351 +1022 115 116 133 327 +1023 192 210 198 329 +1024 284 276 287 328 +1025 93 70 83 354 +1026 167 163 152 352 +1027 249 234 243 350 +1028 239 263 233 324 +1029 69 88 99 326 +1030 178 155 169 325 +1031 72 82 91 353 +1032 247 333 91 353 +1033 276 291 282 338 +1034 124 113 116 339 +1035 215 198 203 340 +1036 96 175 331 352 +1037 259 332 154 350 +1038 95 330 260 354 +1039 298 291 284 338 +1040 115 136 124 339 +1041 210 217 203 340 +1042 92 333 166 353 +1043 282 331 152 352 +1044 249 113 332 350 +1045 215 330 93 354 +1046 286 280 308 357 +1047 300 337 226 357 +1048 92 72 99 347 +1049 263 247 244 348 +1050 71 95 70 348 +1051 175 167 157 347 +1052 234 241 259 349 +1053 218 336 261 351 +1054 97 299 334 355 +1055 137 335 176 356 +1056 73 88 69 341 +1057 169 155 179 342 +1058 239 233 257 343 +1059 83 70 95 354 +1060 175 163 167 352 +1061 259 243 234 350 +1062 138 337 308 357 +1063 82 72 92 353 +1064 85 97 75 355 +1065 176 172 165 356 +1066 261 248 252 351 +1067 185 165 177 356 +1068 101 85 98 355 +1069 262 264 252 351 +1070 200 214 219 337 +1071 286 300 280 357 +1072 304 308 280 357 +1073 226 196 224 357 +1074 326 340 90 341 +1075 325 338 174 342 +1076 324 339 253 343 +1077 157 325 158 347 +1078 241 324 238 349 +1079 71 326 87 348 +1080 95 77 83 354 +1081 175 183 163 352 +1082 259 256 243 350 +1083 98 81 217 340 +1084 160 298 177 338 +1085 237 136 262 339 +1086 103 82 92 353 +1087 246 247 267 353 +1088 303 298 288 356 +1089 217 208 221 355 +1090 111 136 128 351 +1091 236 258 260 354 +1092 84 76 96 352 +1093 164 181 154 350 +1094 305 277 282 352 +1095 207 215 222 354 +1096 143 127 113 350 +1097 287 275 284 344 +1098 206 210 192 345 +1099 115 133 118 346 +1100 182 166 161 353 +1101 82 102 91 353 +1102 299 302 278 355 +1103 137 122 129 356 +1104 205 201 218 351 +1105 86 98 75 340 +1106 245 262 248 339 +1107 172 180 177 338 +1108 83 105 93 354 +1109 187 152 163 352 +1110 269 249 243 350 +1111 152 282 160 338 +1112 237 249 113 339 +1113 81 93 215 340 +1114 97 85 100 355 +1115 176 165 184 356 +1116 266 261 252 351 +1117 203 217 81 340 +1118 160 291 298 338 +1119 237 124 136 339 +1120 215 203 81 340 +1121 282 291 160 338 +1122 124 237 113 339 +1123 280 300 306 357 +1124 141 131 138 357 +1125 253 324 233 339 +1126 174 325 155 338 +1127 69 90 326 340 +1128 116 140 133 327 +1129 220 192 198 329 +1130 287 276 301 328 +1131 158 155 178 325 +1132 87 69 99 326 +1133 238 233 263 324 +1134 287 281 292 328 +1135 192 199 202 329 +1136 130 133 117 327 +1137 157 170 155 325 +1138 241 254 233 324 +1139 89 69 71 326 +1140 170 155 325 338 +1141 233 324 254 339 +1142 89 69 326 340 +1143 69 86 90 340 +1144 180 174 155 338 +1145 245 253 233 339 +1146 287 301 281 328 +1147 199 192 220 329 +1148 117 133 140 327 +1149 233 238 241 324 +1150 71 69 87 326 +1151 157 155 158 325 +1152 321 340 326 341 +1153 322 338 325 342 +1154 320 339 324 343 +1155 287 292 274 328 +1156 112 133 130 327 +1157 202 214 192 329 +1158 214 211 219 337 +1159 274 287 328 344 +1160 192 329 214 345 +1161 133 327 112 346 +1162 174 155 325 342 +1163 233 324 253 343 +1164 90 69 326 341 +1165 135 125 130 335 +1166 297 295 292 334 +1167 202 216 211 336 +1168 261 253 248 343 +1169 75 97 90 341 +1170 172 176 174 342 +1171 297 292 285 334 +1172 110 135 130 335 +1173 209 216 202 336 +1174 247 235 91 348 +1175 96 175 171 347 +1176 242 154 259 349 +1177 171 166 92 347 +1178 242 250 156 349 +1179 95 235 260 348 +1180 89 86 69 340 +1181 170 180 155 338 +1182 233 254 245 339 +1183 226 337 196 357 +1184 92 78 171 347 +1185 156 168 242 349 +1186 79 235 95 348 +1187 235 79 91 348 +1188 171 78 96 347 +1189 242 168 154 349 +1190 246 333 247 353 +1191 298 335 288 356 +1192 217 334 208 355 +1193 136 336 128 351 +1194 236 260 330 354 +1195 84 96 331 352 +1196 277 331 282 352 +1197 164 154 332 350 +1198 127 332 113 350 +1199 207 330 215 354 +1200 166 333 161 353 +1201 238 333 250 349 +1202 299 278 334 355 +1203 137 129 335 356 +1204 201 336 218 351 +1205 156 333 178 349 +1206 212 213 206 345 +1207 118 126 120 346 +1208 294 275 279 344 +1209 244 247 246 333 +1210 208 217 197 334 +1211 290 288 298 335 +1212 128 136 134 336 +1213 308 279 293 344 +1214 226 212 194 345 +1215 121 139 126 346 +1216 226 200 196 337 +1217 154 162 164 332 +1218 260 251 236 330 +1219 84 96 74 331 +1220 282 277 289 331 +1221 114 113 127 332 +1222 207 195 215 330 +1223 250 333 156 349 +1224 192 214 194 345 +1225 274 293 287 344 +1226 121 133 112 346 +1227 278 285 299 334 +1228 137 129 110 335 +1229 201 209 218 336 +1230 161 166 151 333 +1231 131 337 138 357 +1232 193 220 195 330 +1233 289 296 301 331 +1234 114 119 140 332 +1235 151 178 156 333 +1236 238 244 250 333 +1237 179 159 153 342 +1238 240 255 257 343 +1239 73 80 94 341 +1240 219 142 223 337 +1241 153 123 31 119 +1242 296 16 80 94 +1243 204 255 193 61 +1244 235 91 26 247 +1245 171 96 11 175 +1246 242 154 51 259 +1247 166 92 11 171 +1248 250 156 51 242 +1249 95 235 26 260 +1250 176 31 159 137 +1251 171 92 11 78 +1252 80 283 16 296 +1253 242 156 51 168 +1254 204 240 255 61 +1255 159 123 31 153 +1256 26 235 95 79 +1257 91 235 26 79 +1258 154 242 51 168 +1259 31 123 159 137 +1260 96 171 11 78 +1261 255 227 268 330 +1262 144 173 119 332 +1263 104 296 307 331 +1264 46 136 262 237 +1265 98 81 21 217 +1266 298 56 160 177 +1267 66 300 212 226 +1268 41 139 219 126 +1269 138 279 36 308 +1270 186 156 265 333 +1271 138 304 37 141 +1272 300 224 67 306 +1273 219 142 42 223 +1274 228 213 309 334 +1275 310 294 145 335 +1276 225 146 120 336 +1277 131 132 138 337 +1278 237 46 136 124 +1279 291 56 160 298 +1280 203 21 81 217 +1281 279 36 135 125 +1282 126 211 41 216 +1283 297 295 212 66 +1284 46 237 113 124 +1285 81 215 21 203 +1286 282 56 160 291 +1287 211 41 219 126 +1288 36 279 138 125 +1289 212 295 300 66 +1290 56 160 152 282 +1291 46 237 249 113 +1292 93 215 21 81 +1293 120 126 41 216 +1294 297 212 213 66 +1295 36 135 294 279 +1296 275 287 293 344 +1297 192 194 206 345 +1298 118 133 121 346 +1299 261 240 253 343 +1300 80 90 97 341 +1301 159 174 176 342 +1302 173 119 30 144 +1303 268 227 255 60 +1304 307 15 296 104 +1305 50 265 186 156 +1306 102 267 25 247 +1307 10 182 103 92 +1308 258 77 27 95 +1309 256 181 259 52 +1310 12 175 76 183 +1311 81 98 86 340 +1312 160 177 180 338 +1313 245 237 262 339 +1314 17 299 100 302 +1315 62 266 205 218 +1316 184 122 32 137 +1317 65 309 228 213 +1318 145 310 35 294 +1319 40 146 120 225 +1320 187 55 152 305 +1321 105 222 20 93 +1322 249 269 45 143 +1323 170 152 160 338 +1324 237 254 249 339 +1325 81 89 93 340 +1326 185 303 298 57 +1327 221 101 22 217 +1328 264 111 136 47 +1329 90 73 69 341 +1330 174 179 155 342 +1331 233 253 257 343 +1332 227 268 330 354 +1333 104 331 307 352 +1334 144 173 332 350 +1335 92 99 78 347 +1336 247 263 235 348 +1337 156 178 168 349 +1338 186 333 265 353 +1339 175 157 171 347 +1340 241 242 259 349 +1341 79 95 71 348 +1342 171 158 166 347 +1343 242 238 250 349 +1344 91 79 87 348 +1345 88 96 78 347 +1346 239 260 235 348 +1347 168 169 154 349 +1348 228 334 309 355 +1349 310 335 145 356 +1350 225 146 336 351 +1351 223 337 142 357 +1352 104 307 14 352 +1353 29 173 144 350 +1354 59 268 227 354 +1355 181 53 256 350 +1356 76 13 183 352 +1357 28 77 258 354 +1358 49 186 265 353 +1359 9 103 182 353 +1360 102 24 267 353 +1361 48 264 111 351 +1362 58 185 303 356 +1363 101 221 23 355 +1364 44 143 269 350 +1365 54 305 187 352 +1366 19 222 105 354 +1367 178 169 168 349 +1368 78 99 88 347 +1369 235 263 239 348 +1370 39 146 225 351 +1371 228 309 64 355 +1372 310 145 34 356 +1373 63 205 266 351 +1374 18 302 100 355 +1375 33 122 184 356 +1376 171 157 158 347 +1377 79 71 87 348 +1378 241 238 242 349 +1379 38 141 304 357 +1380 68 306 224 357 +1381 43 223 142 357 +1382 219 139 142 337 +1383 255 193 227 330 +1384 104 94 296 331 +1385 153 119 173 332 +1386 156 250 265 333 +1387 213 297 309 334 +1388 135 145 294 335 +1389 216 225 120 336 +1390 304 138 37 308 +1391 142 219 42 139 +1392 224 300 67 226 +1393 16 17 299 97 +1394 62 218 61 261 +1395 176 32 31 137 +1396 36 37 138 308 +1397 226 66 300 67 +1398 219 42 139 41 +1399 62 266 218 261 +1400 97 17 299 100 +1401 176 184 32 137 +1402 55 56 152 282 +1403 46 249 45 113 +1404 215 21 20 93 +1405 96 12 11 175 +1406 26 27 95 260 +1407 51 259 154 52 +1408 25 26 91 247 +1409 92 11 10 166 +1410 156 51 50 250 +1411 297 213 65 66 +1412 35 36 135 294 +1413 40 120 41 216 +1414 101 98 22 217 +1415 264 136 262 47 +1416 298 185 57 177 +1417 56 298 57 177 +1418 47 136 262 46 +1419 21 22 98 217 +1420 60 193 255 61 +1421 15 16 296 94 +1422 31 30 153 119 +1423 131 142 139 337 +1424 227 330 207 354 +1425 236 330 268 354 +1426 307 331 277 352 +1427 144 332 127 350 +1428 164 332 173 350 +1429 84 331 104 352 +1430 186 161 333 353 +1431 265 333 246 353 +1432 265 250 246 333 +1433 193 207 227 330 +1434 255 268 236 330 +1435 104 84 94 331 +1436 296 277 307 331 +1437 144 119 127 332 +1438 164 153 173 332 +1439 10 182 92 166 +1440 102 25 91 247 +1441 50 265 156 250 +1442 175 96 12 76 +1443 27 258 95 260 +1444 181 154 259 52 +1445 228 208 334 355 +1446 288 335 310 356 +1447 128 336 146 351 +1448 309 334 278 355 +1449 129 145 335 356 +1450 225 336 201 351 +1451 228 208 213 334 +1452 146 128 120 336 +1453 288 294 310 335 +1454 227 193 255 60 +1455 119 30 153 173 +1456 94 296 15 104 +1457 305 55 152 282 +1458 222 215 20 93 +1459 143 45 249 113 +1460 309 297 278 334 +1461 135 129 145 335 +1462 216 201 225 336 +1463 186 161 156 333 +1464 65 309 213 297 +1465 135 145 35 294 +1466 120 40 225 216 +1467 131 142 337 357 +1468 219 223 196 337 +1469 196 337 223 357 +1470 191 29 147 350 +1471 59 229 273 354 +1472 14 311 109 352 +1473 191 271 53 350 +1474 109 189 13 352 +1475 28 273 108 354 +1476 44 271 147 350 +1477 108 229 19 354 +1478 189 311 54 352 +1479 106 9 188 353 +1480 270 188 49 353 +1481 106 270 24 353 +1482 250 244 246 333 +1483 208 197 213 334 +1484 288 290 294 335 +1485 134 120 128 336 +1486 39 232 149 351 +1487 64 314 230 355 +1488 34 150 312 356 +1489 48 149 272 351 +1490 23 230 107 355 +1491 58 312 190 356 +1492 63 272 232 351 +1493 18 107 314 355 +1494 33 190 150 356 +1495 38 313 148 357 +1496 231 313 68 357 +1497 43 148 231 357 +1498 131 139 132 337 +1499 243 271 44 350 +1500 163 189 54 352 +1501 83 108 19 354 +1502 127 44 147 350 +1503 207 19 229 354 +1504 164 191 53 350 +1505 54 311 277 352 +1506 236 273 28 354 +1507 84 109 13 352 +1508 243 256 53 350 +1509 163 183 13 352 +1510 83 77 28 354 +1511 29 144 127 350 +1512 164 173 29 350 +1513 59 227 207 354 +1514 277 14 307 352 +1515 84 104 14 352 +1516 59 236 268 354 +1517 193 195 207 330 +1518 236 251 255 330 +1519 119 114 127 332 +1520 296 289 277 331 +1521 164 162 153 332 +1522 84 74 94 331 +1523 161 188 9 353 +1524 246 270 49 353 +1525 82 106 24 353 +1526 53 271 243 350 +1527 28 108 83 354 +1528 13 189 163 352 +1529 127 147 29 350 +1530 14 277 311 352 +1531 29 191 164 350 +1532 59 207 229 354 +1533 59 273 236 354 +1534 14 109 84 352 +1535 44 269 243 350 +1536 19 105 83 354 +1537 54 187 163 352 +1538 39 149 128 351 +1539 208 64 230 355 +1540 288 34 312 356 +1541 135 110 129 335 +1542 278 297 285 334 +1543 209 201 216 336 +1544 164 53 181 350 +1545 28 258 236 354 +1546 127 143 44 350 +1547 84 13 76 352 +1548 277 305 54 352 +1549 222 19 207 354 +1550 49 161 186 353 +1551 9 82 103 353 +1552 246 267 24 353 +1553 48 111 128 351 +1554 208 23 221 355 +1555 58 303 288 356 +1556 161 151 156 333 +1557 63 232 201 351 +1558 18 314 278 355 +1559 33 150 129 356 +1560 49 265 246 353 +1561 161 9 182 353 +1562 82 24 102 353 +1563 24 270 246 353 +1564 49 188 161 353 +1565 106 82 9 353 +1566 128 149 48 351 +1567 288 312 58 356 +1568 23 208 230 355 +1569 128 146 39 351 +1570 208 228 64 355 +1571 288 310 34 356 +1572 200 219 196 337 +1573 39 225 201 351 +1574 278 64 309 355 +1575 129 34 145 356 +1576 201 205 63 351 +1577 278 302 18 355 +1578 129 122 33 356 +1579 201 232 39 351 +1580 34 129 150 356 +1581 64 278 314 355 +1582 252 272 63 351 +1583 85 107 18 355 +1584 165 190 33 356 +1585 275 293 279 344 +1586 206 194 212 345 +1587 121 126 118 346 +1588 48 272 252 351 +1589 23 107 85 355 +1590 58 190 165 356 +1591 252 264 48 351 +1592 58 165 185 356 +1593 101 23 85 355 +1594 280 68 313 357 +1595 43 231 196 357 +1596 38 148 131 357 +1597 63 266 252 351 +1598 18 100 85 355 +1599 165 33 184 356 +1600 38 280 313 357 +1601 231 68 196 357 +1602 131 148 43 357 +1603 68 224 196 357 +1604 38 304 280 357 +1605 43 142 131 357 +1606 280 306 68 357 +1607 131 141 38 357 +1608 196 223 43 357 +1609 86 89 81 340 +1610 245 254 237 339 +1611 160 180 170 338 +1612 80 73 90 341 +1613 257 253 240 343 +1614 159 179 174 342 +1615 191 147 271 350 +1616 229 108 273 354 +1617 109 311 189 352 +1618 106 188 270 353 +1619 232 272 149 351 +1620 107 230 314 355 +1621 190 312 150 356 +1622 231 148 313 357 +1623 14 15 307 104 +1624 60 268 227 59 +1625 30 29 173 144 +1626 27 28 77 258 +1627 52 256 181 53 +1628 76 13 12 183 +1629 9 10 182 103 +1630 49 50 265 186 +1631 267 25 24 102 +1632 310 35 34 145 +1633 64 65 309 228 +1634 40 39 146 225 +1635 22 23 101 221 +1636 57 185 303 58 +1637 264 48 111 47 +1638 187 54 55 305 +1639 269 45 143 44 +1640 222 20 19 105 +1641 18 17 100 302 +1642 32 33 122 184 +1643 63 62 266 205 +1644 37 38 141 304 +1645 67 306 224 68 +1646 43 223 42 142 +1647 191 29 6 147 +1648 4 59 229 273 +1649 1 14 311 109 +1650 229 19 4 108 +1651 311 54 1 189 +1652 6 44 271 147 +1653 109 1 13 189 +1654 108 28 4 273 +1655 271 53 6 191 +1656 270 188 2 49 +1657 2 24 106 270 +1658 106 9 2 188 +1659 150 5 34 312 +1660 39 8 149 232 +1661 230 3 314 64 +1662 312 190 5 58 +1663 272 48 8 149 +1664 107 23 3 230 +1665 8 272 232 63 +1666 18 3 314 107 +1667 5 33 190 150 +1668 148 38 7 313 +1669 7 68 231 313 +1670 148 231 7 43 +1671 188 2 106 270 +1672 4 229 108 273 +1673 191 6 271 147 +1674 109 311 1 189 +1675 149 8 272 232 +1676 150 190 5 312 +1677 3 314 107 230 +1678 7 231 148 313 +1679 337 345 214 323 +1680 214 345 337 200 +1681 337 345 300 226 +1682 300 345 337 323 +1683 338 167 157 170 +1684 338 157 167 318 +1685 339 234 241 254 +1686 339 241 234 319 +1687 340 70 71 89 +1688 340 71 70 316 +1689 343 193 220 204 +1690 343 220 193 330 +1691 342 119 140 123 +1692 342 140 119 332 +1693 341 296 301 283 +1694 341 301 296 331 +1695 211 346 219 337 +1696 211 219 346 126 +1697 139 219 346 337 +1698 139 346 219 126 +1699 343 251 255 257 +1700 343 255 251 330 +1701 342 162 153 179 +1702 342 153 162 332 +1703 341 74 94 73 +1704 341 94 74 331 +1705 295 345 297 212 +1706 295 297 345 334 +1707 213 297 345 212 +1708 213 345 297 334 +1709 211 346 216 126 +1710 211 216 346 336 +1711 120 216 346 126 +1712 120 346 216 336 +1713 125 344 135 279 +1714 125 135 344 335 +1715 294 135 344 279 +1716 294 344 135 335 +1717 261 204 61 240 +1718 261 61 204 218 +1719 159 137 342 176 +1720 342 137 159 123 +1721 97 283 16 80 +1722 97 16 283 299 +1723 344 290 294 275 +1724 344 294 290 335 +1725 345 197 213 206 +1726 345 213 197 334 +1727 346 134 120 118 +1728 346 120 134 336 +1729 346 132 139 337 +1730 346 139 132 121 +$EndElements diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index 9eb9883ec46317a68d765481f6841a6715500f7d..f2929d29ad078819058e39df3d5840a18cfd0994 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2004-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -58,6 +58,7 @@ Description #include "repatchPolyTopoChanger.H" #include "cellSet.H" #include "faceSet.H" +#include "List.H" using namespace Foam; @@ -285,8 +286,8 @@ scalar readMeshFormat(IFstream& inFile) } -// Reads points and map -void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam) +// Reads points and map for gmsh MSH file <4 +void readPointsLegacy(IFstream& inFile, pointField& points, Map<label>& mshToFoam) { Info<< "Starting to read points at line " << inFile.lineNumber() << endl; @@ -297,7 +298,7 @@ void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam) label nVerts; lineStr >> nVerts; - Info<< "Vertices to be read:" << nVerts << endl; + Info<< "Vertices to be read: " << nVerts << endl; points.resize(nVerts); @@ -336,6 +337,76 @@ void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam) Info<< endl; } +// Reads points and map for gmsh MSH file >=4 +void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam) +{ + Info<< "Starting to read points at line " << inFile.lineNumber() << endl; + + string line; + inFile.getLine(line); + IStringStream lineStr(line); + + // Number of "entities": 0, 1, 2, and 3 dimensional geometric structures + label nEntities, nVerts; + lineStr >> nEntities >> nVerts; + + Info<< "Vertices to be read: " << nVerts << endl; + + points.resize(nVerts); + + // Index of points, in the order as they appeared, not what gmsh + // labelled them. + label pointi = 0; + + for (label entityi = 0; entityi < nEntities; entityi++) + { + label entityDim, entityLabel, isParametric, nNodes; + scalar xVal, yVal, zVal; + inFile.getLine(line); + IStringStream lineStr(line); // can IStringStream be removed? + + // Read entity entry, then set up a list for node IDs + lineStr >> entityDim >> entityLabel >> isParametric >> nNodes; + List<label> nodeIDs(nNodes); + + // Loop over entity node IDs + for (label eNode = 0; eNode < nNodes; ++eNode) + { + inFile.getLine(line); + IStringStream lineStr(line); + lineStr >> nodeIDs[eNode]; + } + + // Loop over entity node values, saving to points[] + for (label eNode = 0; eNode < nNodes; ++eNode) + { + inFile.getLine(line); + IStringStream lineStr(line); + lineStr >> xVal >> yVal >> zVal; + point& pt = points[nodeIDs[eNode]-1]; + pt.x() = xVal; + pt.y() = yVal; + pt.z() = zVal; + mshToFoam.insert(nodeIDs[eNode], pointi++); + } + + } + + Info<< "Vertices read: " << mshToFoam.size() << endl; + + inFile.getLine(line); + IStringStream tagStr(line); + word tag(tagStr); + + if (tag != "$ENDNOD" && tag != "$EndNodes") + { + FatalIOErrorInFunction(inFile) + << "Did not find $ENDNOD tag on line " + << inFile.lineNumber() << exit(FatalIOError); + } + Info<< endl; +} + // Reads physical names void readPhysNames(IFstream& inFile, Map<word>& physicalNames) @@ -411,9 +482,7 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames) Info<< endl; } - -// Reads cells and patch faces -void readCells +void readCellsLegacy ( const scalar versionFormat, const bool keepOrientation, @@ -456,7 +525,7 @@ void readCells label nElems; lineStr >> nElems; - Info<< "Cells to be read:" << nElems << endl << endl; + Info<< "Cells to be read: " << nElems << endl << endl; // Storage for all cells. Too big. Shrink later @@ -765,6 +834,466 @@ void readCells Info<< endl; } +void readCells +( + const scalar versionFormat, + const bool keepOrientation, + const pointField& points, + const Map<label>& mshToFoam, + IFstream& inFile, + cellShapeList& cells, + + labelList& patchToPhys, + List<DynamicList<face>>& patchFaces, + + labelList& zoneToPhys, + List<DynamicList<label>>& zoneCells, + Map<label> surfEntityToPhysSurface, + Map<label> volEntityToPhysVolume +) +{ + Info<< "Starting to read cells at line " << inFile.lineNumber() << endl; + + const cellModel& hex = cellModel::ref(cellModel::HEX); + const cellModel& prism = cellModel::ref(cellModel::PRISM); + const cellModel& pyr = cellModel::ref(cellModel::PYR); + const cellModel& tet = cellModel::ref(cellModel::TET); + + face triPoints(3); + face quadPoints(4); + labelList tetPoints(4); + labelList pyrPoints(5); + labelList prismPoints(6); + labelList hexPoints(8); + + + string line; + inFile.getLine(line); + IStringStream lineStr(line); + + label nEntities, nElems, minElemTag, maxElemTag; + lineStr >> nEntities >> nElems >> minElemTag >> maxElemTag; + + Info<< "Cells to be read:" << nElems << endl << endl; + + // Storage for all cells. Too big. Shrink later + cells.setSize(nElems); + + label celli = 0; + label nTet = 0; + label nPyr = 0; + label nPrism = 0; + label nHex = 0; + + + // From gmsh physical region to Foam patch + Map<label> physToPatch; + + // From gmsh physical region to Foam cellZone + Map<label> physToZone; + + + for (label entityi = 0; entityi < nEntities; entityi++) + { + string line; + inFile.getLine(line); + IStringStream lineStr(line); + + label entityDim, entityID, regPhys, elmType, nElemInBlock, elemID; + lineStr >> entityDim >> entityID >> elmType >> nElemInBlock; + + if (entityDim == 2) + regPhys = surfEntityToPhysSurface[entityID]; + else if (entityDim == 3) + regPhys = volEntityToPhysVolume[entityID]; + else + regPhys = 0; // Points and lines don't matter to openFOAM + + // regPhys on surface elements is region number. + if (elmType == MSHLINE) + { + for (label entityElm = 0; entityElm < nElemInBlock; entityElm++) + { + inFile.getLine(line); + IStringStream lineStr(line); + label meshPti; + lineStr >> elemID >> meshPti >> meshPti; + } + } + else if (elmType == MSHTRI) + { + for (label entityElm = 0; entityElm < nElemInBlock; entityElm++) + { + inFile.getLine(line); + IStringStream lineStr(line); + lineStr >> elemID >> triPoints[0] >> triPoints[1] >> triPoints[2]; + + renumber(mshToFoam, triPoints); + + const auto regFnd = physToPatch.cfind(regPhys); + + label patchi = -1; + if (regFnd.found()) + { + // Existing patch for region + patchi = regFnd(); + } + else + { + // New region. Allocate patch for it. + patchi = patchFaces.size(); + + patchFaces.setSize(patchi + 1); + patchToPhys.setSize(patchi + 1); + + Info<< "Mapping region " << regPhys << " to Foam patch " + << patchi << endl; + physToPatch.insert(regPhys, patchi); + patchToPhys[patchi] = regPhys; + } + + // Add triangle to correct patchFaces. + patchFaces[patchi].append(triPoints); + } + } + else if (elmType == MSHQUAD) + { + for (label entityElm = 0; entityElm < nElemInBlock; entityElm++) + { + inFile.getLine(line); + IStringStream lineStr(line); + lineStr >> elemID + >> quadPoints[0] >> quadPoints[1] >> quadPoints[2] + >> quadPoints[3]; + + renumber(mshToFoam, quadPoints); + + const auto regFnd = physToPatch.cfind(regPhys); + + label patchi = -1; + if (regFnd.found()) + { + // Existing patch for region + patchi = regFnd(); + } + else + { + // New region. Allocate patch for it. + patchi = patchFaces.size(); + + patchFaces.setSize(patchi + 1); + patchToPhys.setSize(patchi + 1); + + Info<< "Mapping region " << regPhys << " to Foam patch " + << patchi << endl; + physToPatch.insert(regPhys, patchi); + patchToPhys[patchi] = regPhys; + } + + // Add quad to correct patchFaces. + patchFaces[patchi].append(quadPoints); + } + } + else if (elmType == MSHTET) + { + nTet += nElemInBlock; + + for (label entityElm = 0; entityElm < nElemInBlock; entityElm++) + { + inFile.getLine(line); + IStringStream lineStr(line); + + storeCellInZone + ( + regPhys, + celli, + physToZone, + zoneToPhys, + zoneCells + ); + + lineStr >> elemID + >> tetPoints[0] >> tetPoints[1] >> tetPoints[2] + >> tetPoints[3]; + + renumber(mshToFoam, tetPoints); + + cells[celli++] = cellShape(tet, tetPoints); + } + } + else if (elmType == MSHPYR) + { + nPyr += nElemInBlock; + + for (label entityElm = 0; entityElm < nElemInBlock; entityElm++) + { + inFile.getLine(line); + IStringStream lineStr(line); + + storeCellInZone + ( + regPhys, + celli, + physToZone, + zoneToPhys, + zoneCells + ); + + lineStr >> elemID + >> pyrPoints[0] >> pyrPoints[1] >> pyrPoints[2] + >> pyrPoints[3] >> pyrPoints[4]; + + renumber(mshToFoam, pyrPoints); + + cells[celli++] = cellShape(pyr, pyrPoints); + } + } + else if (elmType == MSHPRISM) + { + nPrism += nElemInBlock; + + for (label entityElm = 0; entityElm < nElemInBlock; entityElm++) + { + inFile.getLine(line); + IStringStream lineStr(line); + + storeCellInZone + ( + regPhys, + celli, + physToZone, + zoneToPhys, + zoneCells + ); + + lineStr >> elemID + >> prismPoints[0] >> prismPoints[1] >> prismPoints[2] + >> prismPoints[3] >> prismPoints[4] >> prismPoints[5]; + + renumber(mshToFoam, prismPoints); + + cells[celli] = cellShape(prism, prismPoints); + + const cellShape& cell = cells[celli]; + + if (!keepOrientation && !correctOrientation(points, cell)) + { + Info<< "Inverting prism " << celli << endl; + // Reorder prism. + prismPoints[0] = cell[0]; + prismPoints[1] = cell[2]; + prismPoints[2] = cell[1]; + prismPoints[3] = cell[3]; + prismPoints[4] = cell[4]; + prismPoints[5] = cell[5]; + + cells[celli] = cellShape(prism, prismPoints); + } + + celli++; + } + } + else if (elmType == MSHHEX) + { + nHex += nElemInBlock; + + for (label entityElm = 0; entityElm < nElemInBlock; entityElm++) + { + inFile.getLine(line); + IStringStream lineStr(line); + + storeCellInZone + ( + regPhys, + celli, + physToZone, + zoneToPhys, + zoneCells + ); + + lineStr >> elemID + >> hexPoints[0] >> hexPoints[1] + >> hexPoints[2] >> hexPoints[3] + >> hexPoints[4] >> hexPoints[5] + >> hexPoints[6] >> hexPoints[7]; + + renumber(mshToFoam, hexPoints); + + cells[celli] = cellShape(hex, hexPoints); + + const cellShape& cell = cells[celli]; + + if (!keepOrientation && !correctOrientation(points, cell)) + { + Info<< "Inverting hex " << celli << endl; + // Reorder hex. + hexPoints[0] = cell[4]; + hexPoints[1] = cell[5]; + hexPoints[2] = cell[6]; + hexPoints[3] = cell[7]; + hexPoints[4] = cell[0]; + hexPoints[5] = cell[1]; + hexPoints[6] = cell[2]; + hexPoints[7] = cell[3]; + + cells[celli] = cellShape(hex, hexPoints); + } + + celli++; + } + } + else + { + Info<< "Unhandled element " << elmType << " at line " + << inFile.lineNumber() << "in/on physical region ID: " + << regPhys << endl; + Info << "Perhaps you created a higher order mesh?" << endl; + } + } + + + inFile.getLine(line); + IStringStream tagStr(line); + word tag(tagStr); + + if (tag != "$ENDELM" && tag != "$EndElements") + { + FatalIOErrorInFunction(inFile) + << "Did not find $ENDELM tag on line " + << inFile.lineNumber() << exit(FatalIOError); + } + + + cells.setSize(celli); + + forAll(patchFaces, patchi) + { + patchFaces[patchi].shrink(); + } + + + Info<< "Cells:" << endl + << " total: " << cells.size() << endl + << " hex : " << nHex << endl + << " prism: " << nPrism << endl + << " pyr : " << nPyr << endl + << " tet : " << nTet << endl + << endl; + + if (cells.size() == 0) + { + FatalIOErrorInFunction(inFile) + << "No cells read from file " << inFile.name() << nl + << "Does your file specify any 3D elements (hex=" << MSHHEX + << ", prism=" << MSHPRISM << ", pyramid=" << MSHPYR + << ", tet=" << MSHTET << ")?" << nl + << "Perhaps you have not exported the 3D elements?" + << exit(FatalIOError); + } + + Info<< "CellZones:" << nl + << "Zone\tSize" << endl; + + forAll(zoneCells, zonei) + { + zoneCells[zonei].shrink(); + + const labelList& zCells = zoneCells[zonei]; + + if (zCells.size()) + { + Info<< " " << zonei << '\t' << zCells.size() << endl; + } + } + Info<< endl; +} + +void readEntities +( + IFstream& inFile, + Map<label>& surfEntityToPhysSurface, + Map<label>& volEntityToPhysVolume +) +{ + label nPoints, nCurves, nSurfaces, nVolumes; + label entityID, physicalID, nPhysicalTags; + scalar pt; // unused scalar, gives bounding boxes of entities + string line; + inFile.getLine(line); + IStringStream lineStr(line); + + lineStr >> nPoints >> nCurves >> nSurfaces >> nVolumes; + + // Skip over the points, since only the full nodes list matters. + for (label i = 0; i < nPoints; ++i) + inFile.getLine(line); + + // Skip over the curves + for (label i = 0; i < nCurves; ++i) + inFile.getLine(line); + + // Read in physical surface entity groupings + for (label i = 0; i < nSurfaces; ++i) + { + inFile.getLine(line); + IStringStream lineStr(line); + lineStr >> entityID; + + // Skip 6 useless (to us) numbers + for (label j = 0; j < 6; ++j) + lineStr >> pt; + + // Number of physical groups associated to this surface + lineStr >> nPhysicalTags; + if (nPhysicalTags > 1) + { + FatalIOErrorInFunction(inFile) + << "Cannot interpret multiple physical surfaces associated" + << " with one surface on line number " << inFile.lineNumber() + << exit(FatalIOError); + } + + lineStr >> physicalID; + surfEntityToPhysSurface.insert(entityID, physicalID); + } + + // Read in physical volume entity groupings + for (label i = 0; i < nVolumes; ++i) + { + inFile.getLine(line); + IStringStream lineStr(line); + lineStr >> entityID; + + // Skip 6 useless (to us) numbers + for (label j = 0; j < 6; ++j) + lineStr >> pt; + + // Number of physical groups associated to this volume + lineStr >> nPhysicalTags; + if (nPhysicalTags > 1) + { + FatalIOErrorInFunction(inFile) + << "Cannot interpret multiple physical volumes associated" + << " with one volume on line number " << inFile.lineNumber() + << exit(FatalIOError); + } + + lineStr >> physicalID; + volEntityToPhysVolume.insert(entityID, physicalID); + } + + // Try to read end of section tag: + inFile.getLine(line); + IStringStream tagStr(line); + word tag(tagStr); + + if (tag != "$EndEntities") + { + FatalIOErrorInFunction(inFile) + << "Did not find $EndEntities tag on line " + << inFile.lineNumber() << exit(FatalIOError); + } +} int main(int argc, char *argv[]) @@ -817,22 +1346,23 @@ int main(int argc, char *argv[]) // Name per physical region Map<word> physicalNames; + // Maps from 2 and 3 dimensional entity IDs to physical region ID + Map<label> surfEntityToPhysSurface; + Map<label> volEntityToPhysVolume; + // Version 1 or 2 format scalar versionFormat = 1; - - while (inFile.good()) + do { string line; inFile.getLine(line); - - if (line.empty()) - { - continue; - } - IStringStream lineStr(line); + // This implies the end of while has been reached + if (line == "") + break; + word tag(lineStr); if (tag == "$MeshFormat") @@ -843,25 +1373,52 @@ int main(int argc, char *argv[]) { readPhysNames(inFile, physicalNames); } + else if (tag == "$Entities") + { + // This will only happen to .msh files over version 4. + readEntities(inFile, + surfEntityToPhysSurface, + volEntityToPhysVolume); + } else if (tag == "$NOD" || tag == "$Nodes") { - readPoints(inFile, points, mshToFoam); + if (versionFormat < 4.0) + readPointsLegacy(inFile, points, mshToFoam); + else + readPoints(inFile, points, mshToFoam); } else if (tag == "$ELM" || tag == "$Elements") { - readCells - ( - versionFormat, - keepOrientation, - points, - mshToFoam, - inFile, - cells, - patchToPhys, - patchFaces, - zoneToPhys, - zoneCells - ); + if (versionFormat < 4.0) + readCellsLegacy + ( + versionFormat, + keepOrientation, + points, + mshToFoam, + inFile, + cells, + patchToPhys, + patchFaces, + zoneToPhys, + zoneCells + ); + else + readCells + ( + versionFormat, + keepOrientation, + points, + mshToFoam, + inFile, + cells, + patchToPhys, + patchFaces, + zoneToPhys, + zoneCells, + surfEntityToPhysSurface, + volEntityToPhysVolume + ); } else { @@ -874,7 +1431,7 @@ int main(int argc, char *argv[]) break; } } - } + } while (inFile.good()); label nValidCellZones = 0;