Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to identify quad elements #4

Open
austinerees opened this issue Aug 7, 2024 · 7 comments
Open

How to identify quad elements #4

austinerees opened this issue Aug 7, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@austinerees
Copy link

You can forgive my ignorance because my worries might be trivial. I am able to generate a triangular mesh and visualize it from gmsh. But when I generate an all quad mesh from gmesh,I could not visualise it ourself gmesh. I was wondering if there is a work around with your program.
Thank you in advance

@austinerees
Copy link
Author

Any help on how to visualize quad elements of a 3D model from gmsh will greatly be appreciated

1 similar comment
@austinerees
Copy link
Author

Any help on how to visualize quad elements of a 3D model from gmsh will greatly be appreciated

@ahojukka5
Copy link
Owner

I guess I have only implemented plotting for triangular mesh. One workaround would be to split each rectangular element to two triangular element and plot them. It would be a new feature to visualize meshes with rectangular elements. But it doesn't feel hard to impelement though.

@ahojukka5 ahojukka5 added the enhancement New feature or request label Aug 14, 2024
@ahojukka5
Copy link
Owner

Can you provide the code here what you are doing and what is the expected result, I could take a look of that.

@austinerees
Copy link
Author

Thank you so very much. I actually generated the mesh in gmsh using the blossom-quad algorithm. here is what it looks like :
image
. here is the .msh file $MeshFormat 4.1 0 8 $EndMeshFormat $Entities 5 8 3 0 1 0 0 1219.432 0 2 0 -3544.005 2698.779 0 3 0 3544.005 2698.779 0 4 39057.4 0 2984.981 0 5 36226.95 0 120.0104 0 1 0 0 0 0 0 0 0 2 1 -1 2 -2.911754639002567 -3544.005 1219.432 4.225286054963624 0 2698.779 0 2 1 -2 3 0 -3544.005 2698.779 0 3544.005 2698.779 0 2 2 -3 4 -2.911754639002571 0 1219.432 4.225286054963627 3544.005 2698.779 0 2 3 -1 5 0 0 2698.779 39057.4 4241.400638555574 2984.981 0 2 3 -4 6 36226.95 0 120.0103999999999 39057.4 0 2984.981 0 2 4 -5 7 0 0 29.6543628289528 36226.95 0 1219.432 0 2 5 -1 8 0 -4241.400638555574 2698.779 39057.4 0 2984.981 0 2 2 -4 1 -2.911754639002571 -3544.005 1219.432 4.225286054963627 3544.005 2698.779 0 4 1 2 3 4 2 -2.911754639004357 0 29.6543628289528 39057.4 4241.400638555574 2984.981 0 4 5 6 7 -4 3 -2.911754639004357 -4241.400638555574 29.6543628289528 39057.4 0 2984.981 0 4 -2 -7 -6 -8 $EndEntities $Nodes 16 227 1 227 0 1 0 1 1 0 0 1219.432 0 2 0 1 2 0 -3544.005 2698.779 0 3 0 1 3 0 3544.005 2698.779 0 4 0 1 4 39057.4 0 2984.981 0 5 0 1 5 36226.95 0 120.0104 1 1 0 0 1 2 0 3 6 7 8 4.225286054963624 -1031.569112783053 1286.023256154083 2.379816724784349 -2053.625843727305 1434.861236562361 -2.911754639002568 -2992.006837284101 1849.226381184197 1 3 0 3 9 10 11 0 -1772.002500000001 2698.779 0 -4.092726157978177e-12 2698.779 0 1772.002499999998 2698.779 1 4 0 3 12 13 14 -2.911754639002571 2992.006837284101 1849.226381184197 2.379816724784342 2053.625843727306 1434.861236562362 4.225286054963627 1031.569112783053 1286.023256154083 1 5 0 19 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1987.809942880016 3704.360745129456 2699.774891674847 3977.20593090254 3843.733544693317 2700.772609548489 5967.631765361903 3967.466855821891 2701.771174612476 7959.755906575783 4059.436327489588 2702.76486254949 9953.004093581427 4123.309918469389 2703.495635703197 11946.63442150251 4174.027253135535 2703.500509646034 13940.52033563604 4213.396534714735 2702.929605984631 15934.6416366201 4237.861247003315 2703.009127173837 17928.90214189153 4241.400638555574 2705.669427738301 19923.01637104362 4218.253041149042 2712.349465217277 21916.49198783324 4163.628442427277 2723.25641007495 23908.55378678218 4071.498863041321 2737.479374003578 25897.83987798287 3932.272729201352 2753.771211110925 27882.37278197041 3736.848689623365 2771.061232701853 29859.5956435369 3478.126696584281 2789.327964931468 31820.02070396263 3115.342960756846 2812.248694183222 33741.13702868317 2584.017028450658 2845.534399101276 35609.44009990797 1889.057706258678 2888.341598786273 37432.36347513061 1082.03959851756 2933.260247349956 1 6 0 3 34 35 36 38359.21178529201 0 2240.904621358834 37716.70809998205 0 1448.499468818439 37072.79261830998 0 657.314987960455 1 7 0 19 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 34427.30180341569 0 35.20257011826024 32611.22583279685 0 35.19320664635129 30796.08361621645 0 35.21612183367203 28980.94139782967 0 35.30433632455153 27165.79942229054 0 35.4555546857566 25350.65751753151 0 35.5746717090454 23535.51536653596 0 35.42009388074735 21720.3734452194 0 34.53052296535145 19905.23258050694 0 32.38379420032675 18090.0924630525 0 29.65436282895282 16274.95102853293 0 29.86230894507318 14459.84441245046 0 40.31799357717065 12644.99497791699 0 71.97231345373179 10831.02420489369 0 136.2282616380498 9019.169449889523 0 244.4444293278068 7212.062507134045 0 413.7627673852853 5411.168918790301 0 640.5598254383161 3611.639355489113 0 878.1185732103419 1810.643495173534 0 1104.009196420497 1 8 0 19 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 1987.809942880016 -3704.360745129456 2699.774891674847 3977.20593090254 -3843.733544693317 2700.772609548489 5967.631765361903 -3967.466855821891 2701.771174612476 7959.755906575783 -4059.436327489588 2702.76486254949 9953.004093581427 -4123.309918469389 2703.495635703197 11946.63442150251 -4174.027253135535 2703.500509646034 13940.52033563604 -4213.396534714735 2702.929605984631 15934.6416366201 -4237.861247003315 2703.009127173837 17928.90214189153 -4241.400638555574 2705.669427738301 19923.01637104362 -4218.253041149042 2712.349465217277 21916.49198783324 -4163.628442427277 2723.25641007495 23908.55378678218 -4071.498863041321 2737.479374003578 25897.83987798287 -3932.272729201352 2753.771211110925 27882.37278197041 -3736.848689623365 2771.061232701853 29859.5956435369 -3478.126696584281 2789.327964931468 31820.02070396263 -3115.342960756846 2812.248694183222 33741.13702868317 -2584.017028450658 2845.534399101276 35609.44009990797 -1889.057706258678 2888.341598786273 37432.36347513061 -1082.03959851756 2933.260247349956 2 1 0 7 75 76 77 78 79 80 81 -1.294112839754086 316.2507916305532 1696.421383688165 0.175848396976664 -868.687526048376 1565.63694504459 0.1758483969766614 1184.93831767893 1565.63694504459 3.10434226273077 79.06269790763878 1405.255276986965 -1.25948593977361 158.1253958152743 2197.60383523763 -2.584572060259952 -1416.940720734413 2023.415618238757 -2.58457206025995 1575.066116549688 2023.415618238757 2 2 0 89 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 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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 4810.210932565317 2179.052830041156 1093.820176568337 9741.24162594878 2794.008791067121 753.7756888705185 6270.38037799976 2029.32983628436 863.1538124775999 3045.608693392315 2118.572360150645 1259.661751566093 11702.91575969719 3125.134123320345 783.6226430082124 8147.471887360462 2447.925459730714 765.4889890470896 15222.52724904727 3842.703564367826 1251.454656549921 23109.66755370394 3369.189612717883 1136.638257786708 19082.24153853025 3680.261698753024 1128.536050150552 8924.22899678511 3752.972286909852 1561.867324853244 6005.374080140521 3399.87590851277 1564.103049518142 7309.922965598851 3105.467639443075 1188.138809376005 30896.81602047574 2083.63918601462 1290.537893906765 26998.19439147809 2847.39301282685 1202.873318891426 34994.4301836352 989.9431168509608 1441.969961055088 11741.832850556 3867.533376831629 1455.501649717544 3548.955436305705 3132.025702304362 1620.696085032636 1521.033610171233 1061.737848760294 1215.860534185239 3928.446858533875 2147.393098404904 1181.934060465365 4204.146863853251 1097.756777240352 932.9359752750825 2863.819745575027 1080.770009994595 1091.461935169575 5540.655783321582 2103.355014935021 981.2901921173899 6734.449274027332 1022.898552155914 585.0752063572108 5469.347167593613 1059.660344678866 759.267725806506 7671.181471984821 1237.529526970747 509.55197194263 8943.62746925791 2624.078942844403 752.0595061074915 10279.91955671306 1415.711134580906 334.047597025496 8974.209388902214 1327.717874027521 405.4610195360919 10721.46633086484 2963.994001186635 759.9081808277986 13077.41155901679 1590.277701866867 253.7219867540444 11678.21725667659 1504.864702231298 283.3364480752804 19506.51158793661 4088.533115885863 1881.964121481511 17152.6495813788 3779.728804007736 1174.185696319032 15577.91566679019 4142.608804991374 1954.941123199822 17542.37831790932 4130.851996789283 1909.666075479562 14837.49676210787 1997.138943198846 302.1320053230559 18589.44564501638 1909.126326593105 286.3268542060674 16713.59138114622 1961.711153247665 286.1927995608365 21097.21973995324 3540.589644996645 1114.99955866695 22422.64149532454 1760.172428210805 324.620296052302 20506.61591518325 1841.812250430331 299.8159749979482 23521.97543190683 3871.216588756692 1876.896684318766 21515.60921146239 4004.396205735728 1867.416026253183 6785.254822750452 2582.968493172486 988.6690929548806 7726.494070227295 2785.361126632091 958.9662602822177 7223.012861590981 1920.23587378839 707.7346032992905 8113.254879296325 3456.34772104584 1343.402112346306 9326.58012316211 3318.026080421172 1097.45970719299 8524.917612249465 3063.331307412578 1014.464341136155 8437.827633371115 3990.254544486502 2106.886928893397 6657.091998103742 3255.749640263159 1371.762131952004 6970.991496631408 3884.992563136459 2065.484580689599 7539.672689293408 3715.094954160995 1688.908426813456 5400.922750735173 2818.327852251407 1268.69810868354 6093.3063313263 2700.648771131112 1130.392260339936 27457.69562088702 3394.574508877291 1926.159236965687 25056.26249874628 3123.295117052374 1151.143617355689 25493.75708414104 3666.707855517278 1885.926670407181 26186.09941993808 1512.765678275684 389.4515646787892 24305.37587144313 1642.607046982015 352.0387009715396 28950.15722979834 2477.530227192774 1232.876339999407 29955.12392068756 1154.292931270013 463.9891905343524 28071.73989204592 1338.097330459733 422.9352454223592 31369.91028027932 2643.554072875903 2015.534182505981 29419.26874133767 3050.796095086938 1962.976328931876 35295.36651871985 1423.610347701318 2177.479790352544 32954.30843629088 1565.749868710598 1340.88893700756 33351.48177779066 2092.673915776305 2078.300341493059 33835.80047432056 664.3223416714815 585.9920831508319 31900.23020414446 926.3731710400386 508.7902006793758 36365.66246775708 524.9770457252148 1430.459128685468 35464.38750872301 352.0924661296136 590.4175278990479 36872.61255318776 774.866193217279 2213.748084790649 13481.75349396657 3868.202858545705 1344.780651800049 11842.1210837251 4101.556300035078 2062.104850492002 13709.78254517532 4130.274485600777 2004.450126105371 10332.5200512884 3818.061886358073 1503.469951811529 10139.58286535076 4054.251223596207 2081.78458908139 11719.2630048889 3537.581856044008 1072.990002930171 10522.23137774246 3435.155462774573 1076.698290140729 13275.1223907593 2802.63990405123 566.5134129074322 3293.821775029461 2641.169562870487 1398.547952292226 4777.490796532852 3263.61529814889 1595.561673310013 4347.884851712498 2727.514960047093 1338.633987375578 3751.589484849073 3622.607867867166 2077.646897317863 5361.262645617719 3757.827152185981 2074.652443874514 1773.661135868705 2603.766059285095 1498.050110251933 1871.290828459322 3333.764997111568 1932.57852745293 1646.930266273825 1843.611851789574 1312.473959191461 2 3 0 57 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 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 7322.4146168487 -3370.548843535527 1371.780047579357 14959.63229684146 -3751.79182868632 1145.252127435705 10861.36305980403 -3646.019438946635 1242.2483813278 23099.61393048406 -3367.101255445194 1133.882973358895 19036.34515100163 -3663.636244913559 1109.980051691989 30897.848729121 -2084.123793193704 1291.258077679466 26996.17270195602 -2847.457199822327 1202.603445658042 34997.74135220671 -989.3794111035679 1442.773218578052 3971.5582620099 -2921.782693391516 1463.666833150908 14706.17406660297 -1940.107087044187 291.255529399595 12909.69452086486 -3715.966317402292 1178.377077887702 10831.0572218608 -1887.309206700462 395.0622432902241 12767.95862818223 -1922.502652799715 326.0780391952331 9090.150745815239 -3523.103374192871 1290.887271577522 7238.790230793457 -1740.406962870652 660.5026274979558 9032.34169373614 -1822.749095030304 497.9425906098739 7628.804986727593 -3883.404121805598 1956.591705008846 11399.35510336335 -4056.442985792119 1931.4911936397 9512.924756535176 -3984.702707987158 1934.700712151893 15446.13654143725 -4127.353799934369 1892.30931579803 13422.33239603251 -4101.834829655451 1904.634229871718 16998.21534413845 -3724.594460914438 1111.409891017053 19483.71810373034 -4085.941052632421 1870.386891379534 17465.08125680384 -4122.246003982777 1872.116560078584 21069.22442293606 -3530.967973303118 1104.383919738533 23517.0092441748 -3870.911728220425 1875.072607679332 21501.72292519346 -4002.88457544726 1860.687281449477 22417.57270422174 -1758.803416584669 324.0761839477752 18566.35225138686 -1898.796007749123 283.6449850868074 20492.529395257 -1835.886975773595 298.0135774373953 16636.36629923966 -1927.511226406132 278.5210134834751 25050.22576808891 -3122.29649463179 1149.58384954446 27456.69094395213 -3394.648059904265 1925.995490317201 25490.77046315372 -3666.587130296582 1884.908088529885 28949.67163402853 -2477.844935685118 1233.056629781255 31370.41502166113 -2643.752144382367 2015.939376552471 29419.01855223167 -3050.929297126163 1963.090860432045 29955.65890322713 -1154.629991383676 464.2234786902436 26185.08200152819 -1512.755744762276 389.396030513515 28071.50295384622 -1338.27996342663 423.0044299373898 24302.33413022189 -1641.931130683115 351.6971655400871 32956.49319883859 -1565.742263094974 1341.628573112465 35296.99975242894 -1423.276561840036 2177.92001279615 33352.5620940264 -2092.63557351705 2078.701064528279 36367.30179956995 -524.6388870851384 1430.892462837434 36873.41796969273 -774.6660972497425 2213.987359757517 33837.50877670887 -664.2509699625315 586.2821516935084 35465.23222847177 -352.0209589509412 590.5834718676206 31901.35881771282 -926.5244345341811 509.0390732881591 3777.519819993755 -1482.897888922792 1050.070324465411 1986.62857808639 -2489.315007192645 1444.266579419297 1894.373235537442 -1256.172152364774 1208.3345611088 3959.430328323282 -3545.045859575316 1946.224342242836 1976.204014399782 -3288.420207305534 1879.766371688784 5647.282844556636 -3144.523112869547 1420.310125669207 5793.809308042742 -3721.682558490414 1952.476177250854 5508.54282027761 -1609.864070491709 858.2510347094329 $EndNodes $Elements 15 285 1 285 0 1 15 1 1 1 0 2 15 1 2 2 0 3 15 1 3 3 0 4 15 1 4 4 0 5 15 1 5 5 1 2 1 4 6 1 6 7 6 7 8 7 8 9 8 2 1 3 1 4 10 2 9 11 9 10 12 10 11 13 11 3 1 4 1 4 14 3 12 15 12 13 16 13 14 17 14 1 1 5 1 20 18 3 15 19 15 16 20 16 17 21 17 18 22 18 19 23 19 20 24 20 21 25 21 22 26 22 23 27 23 24 28 24 25 29 25 26 30 26 27 31 27 28 32 28 29 33 29 30 34 30 31 35 31 32 36 32 33 37 33 4 1 6 1 4 38 4 34 39 34 35 40 35 36 41 36 5 1 7 1 20 42 5 37 43 37 38 44 38 39 45 39 40 46 40 41 47 41 42 48 42 43 49 43 44 50 44 45 51 45 46 52 46 47 53 47 48 54 48 49 55 49 50 56 50 51 57 51 52 58 52 53 59 53 54 60 54 55 61 55 1 1 8 1 20 62 2 56 63 56 57 64 57 58 65 58 59 66 59 60 67 60 61 68 61 62 69 62 63 70 63 64 71 64 65 72 65 66 73 66 67 74 67 68 75 68 69 76 69 70 77 70 71 78 71 72 79 72 73 80 73 74 81 74 4 2 1 3 12 82 1 6 78 14 83 6 7 76 78 84 78 76 75 77 85 14 78 77 13 86 2 9 80 8 87 9 10 79 80 88 80 79 75 76 89 8 80 76 7 90 3 12 81 11 91 12 13 77 81 92 81 77 75 79 93 11 81 79 10 2 2 3 112 94 1 99 102 55 95 99 85 100 102 96 102 100 82 101 97 55 102 101 54 98 52 53 105 104 99 53 54 101 105 100 105 101 82 103 101 104 105 103 84 102 52 106 109 51 103 106 87 107 109 104 109 107 83 108 105 51 109 108 50 106 48 49 112 111 107 49 50 108 112 108 112 108 83 110 109 111 112 110 86 110 22 23 116 115 111 23 24 113 116 112 116 113 90 114 113 115 116 114 88 114 48 117 119 47 115 117 88 114 119 116 119 114 90 118 117 47 119 118 46 118 44 45 122 121 119 45 46 118 122 120 122 118 90 120 121 121 122 120 89 122 26 123 124 25 123 123 89 120 124 124 124 120 90 113 125 25 124 113 24 126 52 104 127 106 127 104 84 125 127 128 127 125 93 126 129 106 127 126 87 130 83 107 130 129 131 107 87 126 130 132 130 126 93 128 133 129 130 128 91 134 18 131 134 133 135 131 91 128 134 136 134 128 93 132 137 133 134 132 92 138 82 135 136 103 139 135 92 132 136 140 136 132 93 125 141 103 136 125 84 142 26 27 139 123 143 27 28 137 139 144 139 137 95 138 145 123 139 138 89 146 44 121 141 43 147 121 89 138 141 148 141 138 95 140 149 43 141 140 42 150 40 41 144 143 151 41 42 140 144 152 144 140 95 142 153 143 144 142 94 154 30 145 146 29 155 145 94 142 146 156 146 142 95 137 157 29 146 137 28 158 30 31 149 145 159 31 32 147 149 160 149 147 96 148 161 145 149 148 94 162 40 143 151 39 163 143 94 148 151 164 151 148 96 150 165 39 151 150 38 166 5 37 153 36 167 37 38 150 153 168 153 150 96 152 169 36 153 152 35 170 4 34 154 33 171 34 35 152 154 172 154 152 96 147 173 33 154 147 32 174 22 115 157 21 175 115 88 155 157 176 157 155 97 156 177 21 157 156 20 178 18 19 159 131 179 19 20 156 159 180 159 156 97 158 181 131 159 158 91 182 83 129 161 110 183 129 91 158 161 184 161 158 97 160 185 110 161 160 86 186 48 111 162 117 187 111 86 160 162 188 162 160 97 155 189 117 162 155 88 190 82 100 165 135 191 100 85 163 165 192 165 163 98 164 193 135 165 164 92 194 18 133 167 17 195 133 92 164 167 196 167 164 98 166 197 17 167 166 16 198 3 15 169 12 199 15 16 166 169 200 169 166 98 168 201 12 169 168 13 202 1 14 170 99 203 14 13 168 170 204 170 168 98 163 205 99 170 163 85 2 3 3 80 206 48 180 183 49 207 180 172 181 183 208 183 181 173 182 209 49 183 182 50 210 52 51 186 185 211 51 50 182 186 212 186 182 173 184 213 185 186 184 171 214 59 187 189 60 215 187 171 184 189 216 189 184 173 188 217 60 189 188 61 218 63 62 191 190 219 62 61 188 191 220 191 188 173 181 221 190 191 181 172 222 63 190 194 64 223 190 172 192 194 224 194 192 175 193 225 64 194 193 65 226 67 66 197 196 227 66 65 193 197 228 197 193 175 195 229 196 197 195 174 230 44 198 200 45 231 198 174 195 200 232 200 195 175 199 233 45 200 199 46 234 48 47 201 180 235 47 46 199 201 236 201 199 175 192 237 180 201 192 172 238 67 196 204 68 239 196 174 202 204 240 204 202 177 203 241 68 204 203 69 242 71 70 207 206 243 70 69 203 207 244 207 203 177 205 245 206 207 205 176 246 40 208 210 41 247 208 176 205 210 248 210 205 177 209 249 41 210 209 42 250 44 43 211 198 251 43 42 209 211 252 211 209 177 202 253 198 211 202 174 254 71 206 214 72 255 206 176 212 214 256 214 212 178 213 257 72 214 213 73 258 4 74 216 34 259 74 73 213 216 260 216 213 178 215 261 34 216 215 35 262 5 36 218 37 263 36 35 215 218 264 218 215 178 217 265 37 218 217 38 266 40 39 219 208 267 39 38 217 219 268 219 217 178 212 269 208 219 212 176 270 1 55 222 6 271 55 54 220 222 272 222 220 179 221 273 6 222 221 7 274 2 8 224 56 275 8 7 221 224 276 224 221 179 223 277 56 224 223 57 278 59 58 226 187 279 58 57 223 226 280 226 223 179 225 281 187 226 225 171 282 52 185 227 53 283 185 171 225 227 284 227 225 179 220 285 53 227 220 54 $EndElements . I would like to visualize this same mesh in python as it is shown here from the gmsh graphical user interface. I have searched for many weeks and no solution. any assistance would be greatly appreciated.

@austinerees
Copy link
Author

any help would be appreciated. I just need to visualize it like it is in python. could not find codes for quad meshes easily

@ahojukka5
Copy link
Owner

Can you provide the mesh file as attachment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants