From ad0688d955677865e3561183adba6264622f13e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Wed, 29 Dec 2021 15:50:25 +0100 Subject: [PATCH 01/15] Implement loading of meshes from MSH files --- Cargo.toml | 1 + assets/meshes/sphere_593.msh | Bin 0 -> 39898 bytes src/io/mod.rs | 1 + src/io/msh.rs | 241 +++++++++++++++++++++++++++++++++++ 4 files changed, 243 insertions(+) create mode 100644 assets/meshes/sphere_593.msh create mode 100644 src/io/msh.rs diff --git a/Cargo.toml b/Cargo.toml index 1aacf404..39f02422 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ fenris-sparse = { version= "0.0.2", path = "fenris-sparse" } fenris-geometry = { version= "^0.0.5", path = "fenris-geometry", features = [ "proptest" ] } fenris-optimize = { version= "0.0.2", path = "fenris-optimize" } fenris-quadrature = { version= "0.0.4", path = "fenris-quadrature" } +mshio = "0.4.2" [dev-dependencies] fenris = { path = ".", features = [ "proptest-support" ]} diff --git a/assets/meshes/sphere_593.msh b/assets/meshes/sphere_593.msh new file mode 100644 index 0000000000000000000000000000000000000000..835b28f141cc490a394c372560c21cdc92ace91d GIT binary patch literal 39898 zcmbuIb##~4(zb)UyIXK~3+!M4f=h4EeV8^-fIrTp-{GX!WU>Jk_A7gAB2dkz0V>2$9oD?aCl}P@?QudQnHsg}ZP9g31 zTj|PwoH=C@JjmYqX!x`vpIg_>klHua_UJGoVS%gH%|p-RMf%vqM>f1&wrbSF+jh@) zHM1|}yE}E>>Labbb2g#ZKjX~LEkd3oI3IAN;`h8Nko)HQegltu`L)`xkxMVSefd6* zi51^L>)5LNQJjM%wDXMHFXGmoud_l{B?9jWn$^ zoix2PgEXTwlQgq5i!`e=n>4#Lhcu@&mo&FDk2J3|pESR;fYeo5P+CY@SXx9{R9Z}0 zTv|d}Qd&w{T3SY0R$5M4URpu=txNs$r;@a?w2HKCi*pXD+iBxTo3v%?U$)e^V)FGldZTvcSo725SGD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rEcyQdih>(file_path: P) -> eyre::Result> +where + T: RealField, + D: DimName, + C: TryConnectivityFromMshElement, + OPoint: TryVertexFromMshNode, + DefaultAllocator: Allocator, +{ + let msh_bytes = std::fs::read(file_path).wrap_err("failed to read file")?; + load_msh_from_bytes(&msh_bytes).wrap_err("failed to load mesh from msh file") +} + +/// Loads a [`Mesh`] by parsing the given bytes as a Gmsh MSH file. +pub fn load_msh_from_bytes(bytes: &[u8]) -> eyre::Result> +where + T: RealField, + D: DimName, + C: TryConnectivityFromMshElement, + OPoint: TryVertexFromMshNode, + DefaultAllocator: Allocator, +{ + let mut msh_file = mshio::parse_msh_bytes(bytes).map_err(|e| eyre!("failed to parse msh file: {}", e))?; + + let msh_nodes = msh_file + .data + .nodes + .take() + .ok_or(eyre!("MSH file does not contain nodes"))?; + let msh_elements = msh_file + .data + .elements + .take() + .ok_or(eyre!("MSH file does not contain elements"))?; + + let mut vertices = Vec::new(); + let mut connectivity = Vec::new(); + + for node_block in &msh_nodes.node_blocks { + let block_vertices = vertices_from_node_block(node_block)?; + vertices.extend(block_vertices); + } + + for element_block in &msh_elements.element_blocks { + let block_connectivity = connectivity_from_element_block(element_block)?; + connectivity.extend(block_connectivity); + } + + Ok(Mesh::from_vertices_and_connectivity(vertices, connectivity)) +} + +/// Tries to convert a `mshio::NodeBlock` to a `Vec>`. +fn vertices_from_node_block(node_block: &mshio::NodeBlock) -> eyre::Result>> +where + T: RealField, + D: DimName, + F: mshio::MshFloatT, + I: mshio::MshIntT, + OPoint: TryVertexFromMshNode, + DefaultAllocator: Allocator, +{ + // Ensure that node tags are consecutive + if node_block.node_tags.is_some() { + return Err(eyre!("node block tags are not consecutive in msh file")); + } + + // Check dimension of node block vertices + if node_block + .entity_dim + .to_usize() + .ok_or_else(|| eyre!("error converting node block entity dimension to usize"))? + != D::dim() + { + // TODO: When can this happen? + warn!("Node block entity does not have the right dimension for this mesh. Will be read as if they were of the same dimension."); + //return Err(eyre!("node block entity does not have the right dimension for this mesh")); + } + + let mut vertices = Vec::with_capacity(node_block.nodes.len()); + + // Convert MSH vertices to points + for node in &node_block.nodes { + vertices.push(OPoint::try_vertex_from_msh_node(node)?); + } + + Ok(vertices) +} + +/// Tries to convert a `mshio::ElementBlock` to a `Vec`. +fn connectivity_from_element_block(element_block: &mshio::ElementBlock) -> eyre::Result> +where + C: TryConnectivityFromMshElement, + I: mshio::MshIntT, +{ + // Ensure that element tags are consecutive + if element_block.element_tags.is_some() { + return Err(eyre!("element block tags are not consecutive in msh file")); + } + + let requested_msh_element_type = C::msh_element_type(); + if element_block.element_type != requested_msh_element_type { + warn!( + "Detected connectivity in the MSH file that does not match the requested connectivity. It will be ignored." + ); + return Ok(Vec::new()); + //return Err(eyre!("connectivity in the MSH file does not match the requested connectivity.")); + } else { + let mut connectivity = Vec::with_capacity(element_block.elements.len()); + let requested_nodes = requested_msh_element_type + .nodes() + .map_err(|_| eyre!("unimplemented element type requested"))?; + + for element in &element_block.elements { + if element.nodes.len() < requested_nodes { + return Err(eyre!("Not enough nodes to initialize connectivity.")); + } + connectivity.push(C::try_connectivity_from_msh_element(element)?); + } + + return Ok(connectivity); + } +} + +/// Allows conversion from `mshio::Node`s to `OPoint`s which are used as vertices in `fenris`. +pub trait TryVertexFromMshNode +where + T: RealField, + D: DimName, + F: mshio::MshFloatT, + DefaultAllocator: Allocator, +{ + fn try_vertex_from_msh_node(node: &mshio::Node) -> eyre::Result>; +} + +macro_rules! f_to_t { + ($component:expr) => { + T::from_f64( + $component + .to_f64() + .ok_or_else(|| eyre!("failed to convert coordinate to f64"))?, + ) + .ok_or_else(|| eyre!("failed to convert node coordinate from f64 to target mesh real type"))? + }; +} + +impl TryVertexFromMshNode for Point2 +where + T: RealField, + F: mshio::MshFloatT, +{ + fn try_vertex_from_msh_node(node: &mshio::Node) -> eyre::Result { + // TODO: Ensure that node.z is zero? + Ok(Self::new(f_to_t!(node.x), f_to_t!(node.y))) + } +} + +impl TryVertexFromMshNode for Point3 +where + T: RealField, + F: mshio::MshFloatT, +{ + fn try_vertex_from_msh_node(node: &mshio::Node) -> eyre::Result { + Ok(Self::new(f_to_t!(node.x), f_to_t!(node.y), f_to_t!(node.z))) + } +} + +/// Allows conversion from `mshio::Element`s to connectivity types used in `fenris`. +pub trait TryConnectivityFromMshElement +where + Self: Sized, +{ + fn msh_element_type() -> mshio::ElementType; + fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result; +} + +impl TryConnectivityFromMshElement for Tri3d2Connectivity { + fn msh_element_type() -> mshio::ElementType { + mshio::ElementType::Tri3 + } + + fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { + Ok(Self([ + element.nodes[0] as usize - 1, + element.nodes[1] as usize - 1, + element.nodes[2] as usize - 1, + ])) + } +} + +impl TryConnectivityFromMshElement for Tri3d3Connectivity { + fn msh_element_type() -> mshio::ElementType { + mshio::ElementType::Tri3 + } + + fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { + Ok(Self([ + element.nodes[0] as usize - 1, + element.nodes[1] as usize - 1, + element.nodes[2] as usize - 1, + ])) + } +} + +impl TryConnectivityFromMshElement for Tet4Connectivity { + fn msh_element_type() -> mshio::ElementType { + mshio::ElementType::Tet4 + } + + fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { + Ok(Self([ + element.nodes[0] as usize - 1, + element.nodes[1] as usize - 1, + element.nodes[2] as usize - 1, + element.nodes[3] as usize - 1, + ])) + } +} + +#[cfg(test)] +mod msh_tests { + use crate::connectivity::Tet4Connectivity; + use crate::io::msh::load_msh_from_file; + use nalgebra::U3; + + #[test] + fn load_msh_sphere() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/sphere_593.msh")?; + + assert_eq!(mesh.vertices().len(), 183); + assert_eq!(mesh.connectivity().len(), 593); + Ok(()) + } +} From 7463f5c8bef5169071e28b6aa9ea1434a80c87d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Thu, 30 Dec 2021 14:40:09 +0100 Subject: [PATCH 02/15] Ensure that MSH file contains requested connectivity --- assets/meshes/rectangle_110.msh | 321 ++++++++++++++++++++++++++++++++ src/io/msh.rs | 86 +++++++-- 2 files changed, 389 insertions(+), 18 deletions(-) create mode 100644 assets/meshes/rectangle_110.msh diff --git a/assets/meshes/rectangle_110.msh b/assets/meshes/rectangle_110.msh new file mode 100644 index 00000000..fa9492f1 --- /dev/null +++ b/assets/meshes/rectangle_110.msh @@ -0,0 +1,321 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +4 4 1 0 +1 -0.3 -0.3 0 0 +2 0.7 -0.3 0 0 +3 0.7 0.2 0 0 +4 -0.3 0.2 0 0 +1 -0.3000001 -0.3000001 -1e-07 0.7000000999999999 -0.2999999 1e-07 0 2 1 -2 +2 0.6999999 -0.3000001 -1e-07 0.7000000999999999 0.2000001 1e-07 0 2 2 -3 +3 -0.3000001 0.1999999 -1e-07 0.7000000999999999 0.2000001 1e-07 0 2 3 -4 +4 -0.3000001 -0.3000001 -1e-07 -0.2999999 0.2000001 1e-07 0 2 4 -1 +1 -0.3000001 -0.3000001 -1e-07 0.7000000999999999 0.2000001 1e-07 0 4 1 2 3 4 +$EndEntities +$Nodes +9 70 1 70 +0 1 0 1 +1 +-0.3 -0.3 -0 +0 2 0 1 +2 +0.7 -0.3 -0 +0 3 0 1 +3 +0.7 0.2 -0 +0 4 0 1 +4 +-0.3 0.2 -0 +1 1 0 8 +5 +6 +7 +8 +9 +10 +11 +12 +-0.1888888888888891 -0.3 0 +-0.07777777777777825 -0.3 0 +0.03333333333333294 -0.3 0 +0.1444444444444442 -0.3 0 +0.2555555555555554 -0.3 0 +0.3666666666666664 -0.3 0 +0.4777777777777777 -0.3 0 +0.5888888888888888 -0.3 0 +1 2 0 4 +13 +14 +15 +16 +0.7 -0.2000000000000002 0 +0.7 -0.1000000000000001 0 +0.7 -1.110223024625157e-16 0 +0.7 0.09999999999999998 0 +1 3 0 8 +17 +18 +19 +20 +21 +22 +23 +24 +0.588888888888889 0.2 0 +0.4777777777777782 0.2 0 +0.366666666666667 0.2 0 +0.2555555555555558 0.2 0 +0.1444444444444446 0.2 0 +0.03333333333333355 0.2 0 +-0.07777777777777772 0.2 0 +-0.1888888888888889 0.2 0 +1 4 0 4 +25 +26 +27 +28 +-0.3 0.1000000000000002 0 +-0.3 1.665334536937735e-16 0 +-0.3 -0.09999999999999987 0 +-0.3 -0.2 0 +2 1 0 42 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +0.6181853054877119 -0.0415974196800525 0 +-0.2184200639486318 -0.05004133303915795 0 +0.2017105453434146 -0.2002352435348832 0 +0.3104891941360209 0.1029078944520922 0 +0.08834248811904713 0.1038514358620944 0 +0.4416365682405676 -0.2094183433526482 0 +-0.02487999700958349 -0.1993290750383707 0 +0.5363367134450407 0.09963349191309573 0 +-0.1376937270386464 0.09918316830157284 0 +-0.02320268433312986 0.1034937157688774 0 +0.03225151084425054 0.00824487064593734 0 +0.1430952130559973 0.007257297698020186 0 +0.08670007502345552 -0.08790564410859014 0 +-0.02366509376319328 -0.08669558283174966 0 +0.1971963049208412 -0.08916950506662782 0 +0.253922991933277 0.006317558455476907 0 +0.3081255793967473 -0.09077591339602184 0 +0.3646194671681309 0.005510616989843405 0 +0.4185164091280256 -0.0918398591757682 0 +0.4701913192082958 0.01124911446365311 0 +0.4222222222222225 0.1037749551350623 0 +0.3165578285233138 -0.2010429173546686 0 +0.5129409764096799 -0.1461571739671005 0 +-0.07204502561708118 0.003996362274948255 0 +-0.1428703653664571 -0.2133259091633978 0 +0.0882666209765149 -0.2041342216817793 0 +0.1993083145407238 0.1033890310779473 0 +0.6141673003725829 -0.1500000000000002 0 +-0.2150687950126897 -0.1499999999999999 0 +-0.1217096898957324 -0.09916445375994822 0 +-0.2228047796821482 0.04659250577317239 0 +0.6177454205875057 0.04994026324231237 0 +0.5466426593556569 -0.2259292528866248 0 +0.5296132320729046 -0.06139610197017452 0 +0.6285942045842871 0.1299147510310816 0 +-0.2286828846737035 0.1291590499816862 0 +-0.2256650626505246 -0.2291340202289778 0 +-0.1550184885524905 0.001244361478090254 0 +0.03088955984017527 -0.1445718351398361 0 +0.6299397697234258 -0.2351858505773251 0 +0.141299000533621 -0.1452945975736307 0 +0.5531073904611943 0.0116360736783649 0 +$EndNodes +$Elements +9 142 1 142 +0 1 15 1 +1 1 +0 2 15 1 +2 2 +0 3 15 1 +3 3 +0 4 15 1 +4 4 +1 1 1 9 +5 1 5 +6 5 6 +7 6 7 +8 7 8 +9 8 9 +10 9 10 +11 10 11 +12 11 12 +13 12 2 +1 2 1 5 +14 2 13 +15 13 14 +16 14 15 +17 15 16 +18 16 3 +1 3 1 9 +19 3 17 +20 17 18 +21 18 19 +22 19 20 +23 20 21 +24 21 22 +25 22 23 +26 23 24 +27 24 4 +1 4 1 5 +28 4 25 +29 25 26 +30 26 27 +31 27 28 +32 28 1 +2 1 2 110 +33 31 50 45 +34 31 45 43 +35 47 50 34 +36 45 50 47 +37 42 58 35 +38 35 58 53 +39 11 61 34 +40 34 61 51 +41 36 49 48 +42 52 58 42 +43 48 49 46 +44 46 49 32 +45 29 62 56 +46 34 51 47 +47 44 46 32 +48 34 50 10 +49 10 50 9 +50 18 49 36 +51 56 62 51 +52 35 53 6 +53 24 37 23 +54 18 36 17 +55 39 52 42 +56 38 39 33 +57 9 50 31 +58 32 55 44 +59 22 38 33 +60 37 38 23 +61 47 48 46 +62 45 47 46 +63 37 52 38 +64 11 34 10 +65 7 35 6 +66 6 53 5 +67 39 42 41 +68 38 52 39 +69 31 54 8 +70 19 49 18 +71 32 49 19 +72 7 54 35 +73 21 55 20 +74 45 46 44 +75 39 41 40 +76 44 55 40 +77 40 55 33 +78 33 55 21 +79 20 55 32 +80 23 38 22 +81 39 40 33 +82 8 54 7 +83 43 45 44 +84 9 31 8 +85 20 32 19 +86 22 33 21 +87 41 43 40 +88 43 44 40 +89 52 66 58 +90 15 29 14 +91 27 30 26 +92 14 56 13 +93 51 62 47 +94 28 57 27 +95 26 59 25 +96 16 60 15 +97 29 56 14 +98 47 62 48 +99 12 61 11 +100 27 57 30 +101 15 60 29 +102 30 59 26 +103 57 58 30 +104 53 58 57 +105 5 65 1 +106 17 63 3 +107 4 64 24 +108 48 70 36 +109 1 65 28 +110 3 63 16 +111 25 64 4 +112 35 67 42 +113 58 66 30 +114 37 66 52 +115 56 68 13 +116 2 68 12 +117 36 63 17 +118 24 64 37 +119 53 65 5 +120 59 66 37 +121 43 69 31 +122 61 68 56 +123 31 69 54 +124 54 67 35 +125 42 67 41 +126 54 69 67 +127 57 65 53 +128 67 69 41 +129 37 64 59 +130 60 63 36 +131 41 69 43 +132 51 61 56 +133 60 70 29 +134 13 68 2 +135 36 70 60 +136 28 65 57 +137 16 63 60 +138 59 64 25 +139 30 66 59 +140 29 70 62 +141 12 68 61 +142 62 70 48 +$EndElements diff --git a/src/io/msh.rs b/src/io/msh.rs index b4e40468..9a8dda19 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -11,7 +11,7 @@ pub fn load_msh_from_file>(file_path: P) -> eyre::Result where T: RealField, D: DimName, - C: TryConnectivityFromMshElement, + C: MshConnectivity, OPoint: TryVertexFromMshNode, DefaultAllocator: Allocator, { @@ -24,7 +24,7 @@ pub fn load_msh_from_bytes(bytes: &[u8]) -> eyre::Result> where T: RealField, D: DimName, - C: TryConnectivityFromMshElement, + C: MshConnectivity, OPoint: TryVertexFromMshNode, DefaultAllocator: Allocator, { @@ -44,11 +44,26 @@ where let mut vertices = Vec::new(); let mut connectivity = Vec::new(); + // Ensure that at least one element block matches the target mesh connectivity + if !msh_elements + .element_blocks + .iter() + .any(|block| element_block_matches_connectivity::(block)) + { + return Err(eyre!( + "MSH file does not contain an element block of the requested type ({:?} of dim {})", + C::msh_element_type(), + C::reference_dim() + )); + } + + // Collect all mesh vertices for node_block in &msh_nodes.node_blocks { let block_vertices = vertices_from_node_block(node_block)?; vertices.extend(block_vertices); } + // Collect all connectivity matching the target connectivity for element_block in &msh_elements.element_blocks { let block_connectivity = connectivity_from_element_block(element_block)?; connectivity.extend(block_connectivity); @@ -97,7 +112,7 @@ where /// Tries to convert a `mshio::ElementBlock` to a `Vec`. fn connectivity_from_element_block(element_block: &mshio::ElementBlock) -> eyre::Result> where - C: TryConnectivityFromMshElement, + C: MshConnectivity, I: mshio::MshIntT, { // Ensure that element tags are consecutive @@ -105,22 +120,18 @@ where return Err(eyre!("element block tags are not consecutive in msh file")); } - let requested_msh_element_type = C::msh_element_type(); - if element_block.element_type != requested_msh_element_type { - warn!( - "Detected connectivity in the MSH file that does not match the requested connectivity. It will be ignored." - ); + if !element_block_matches_connectivity::(element_block) { + // Just ignore blocks that don't match the requested connectivity return Ok(Vec::new()); - //return Err(eyre!("connectivity in the MSH file does not match the requested connectivity.")); } else { let mut connectivity = Vec::with_capacity(element_block.elements.len()); - let requested_nodes = requested_msh_element_type + let requested_nodes = C::msh_element_type() .nodes() .map_err(|_| eyre!("unimplemented element type requested"))?; for element in &element_block.elements { if element.nodes.len() < requested_nodes { - return Err(eyre!("Not enough nodes to initialize connectivity.")); + return Err(eyre!("not enough nodes to initialize connectivity")); } connectivity.push(C::try_connectivity_from_msh_element(element)?); } @@ -129,6 +140,20 @@ where } } +/// Returns whether the given element block contains elements corresponding to the specified connectivity. +fn element_block_matches_connectivity(element_block: &mshio::ElementBlock) -> bool +where + C: MshConnectivity, + I: mshio::MshIntT, +{ + element_block.element_type == C::msh_element_type() + && element_block + .entity_dim + .to_usize() + .expect("failed to convert element block dimension to usize") + == C::reference_dim() +} + /// Allows conversion from `mshio::Node`s to `OPoint`s which are used as vertices in `fenris`. pub trait TryVertexFromMshNode where @@ -173,19 +198,27 @@ where } /// Allows conversion from `mshio::Element`s to connectivity types used in `fenris`. -pub trait TryConnectivityFromMshElement +pub trait MshConnectivity where Self: Sized, { + /// Returns the MSH element type corresponding to this connectivity. fn msh_element_type() -> mshio::ElementType; + /// Returns the reference dimension of this connectivity (corresponds to MSH entity dimension). + fn reference_dim() -> usize; + /// Tries to construct the element connectivity from the given MSH element. fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result; } -impl TryConnectivityFromMshElement for Tri3d2Connectivity { +impl MshConnectivity for Tri3d2Connectivity { fn msh_element_type() -> mshio::ElementType { mshio::ElementType::Tri3 } + fn reference_dim() -> usize { + 2 + } + fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { Ok(Self([ element.nodes[0] as usize - 1, @@ -195,11 +228,15 @@ impl TryConnectivityFromMshElement for Tri3d2Connectivity { } } -impl TryConnectivityFromMshElement for Tri3d3Connectivity { +impl MshConnectivity for Tri3d3Connectivity { fn msh_element_type() -> mshio::ElementType { mshio::ElementType::Tri3 } + fn reference_dim() -> usize { + 3 + } + fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { Ok(Self([ element.nodes[0] as usize - 1, @@ -209,11 +246,15 @@ impl TryConnectivityFromMshElement for Tri3d3Connectivity { } } -impl TryConnectivityFromMshElement for Tet4Connectivity { +impl MshConnectivity for Tet4Connectivity { fn msh_element_type() -> mshio::ElementType { mshio::ElementType::Tet4 } + fn reference_dim() -> usize { + 3 + } + fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { Ok(Self([ element.nodes[0] as usize - 1, @@ -226,16 +267,25 @@ impl TryConnectivityFromMshElement for Tet4Connectivity { #[cfg(test)] mod msh_tests { - use crate::connectivity::Tet4Connectivity; + use crate::connectivity::{Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; use crate::io::msh::load_msh_from_file; - use nalgebra::U3; + use nalgebra::{U2, U3}; #[test] - fn load_msh_sphere() -> eyre::Result<()> { + fn load_msh_sphere_tet4() -> eyre::Result<()> { let mesh = load_msh_from_file::("assets/meshes/sphere_593.msh")?; assert_eq!(mesh.vertices().len(), 183); assert_eq!(mesh.connectivity().len(), 593); Ok(()) } + + #[test] + fn load_msh_rect_tri3d2() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/rectangle_110.msh")?; + + assert_eq!(mesh.vertices().len(), 70); + assert_eq!(mesh.connectivity().len(), 110); + Ok(()) + } } From 4ac497790c4946307807410504a90e9c08136a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Thu, 30 Dec 2021 14:49:41 +0100 Subject: [PATCH 03/15] Remove TryVertexFromMshNode trait --- src/io/msh.rs | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/src/io/msh.rs b/src/io/msh.rs index 9a8dda19..91b3ee0b 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -3,7 +3,7 @@ use crate::mesh::Mesh; use eyre::{eyre, Context}; use log::warn; use nalgebra::allocator::Allocator; -use nalgebra::{DefaultAllocator, DimName, OPoint, Point2, Point3, RealField, U2, U3}; +use nalgebra::{DefaultAllocator, DimName, OPoint, RealField}; use std::path::Path; /// Loads a [`Mesh`] from a Gmsh MSH file at the given path. @@ -12,7 +12,6 @@ where T: RealField, D: DimName, C: MshConnectivity, - OPoint: TryVertexFromMshNode, DefaultAllocator: Allocator, { let msh_bytes = std::fs::read(file_path).wrap_err("failed to read file")?; @@ -25,7 +24,6 @@ where T: RealField, D: DimName, C: MshConnectivity, - OPoint: TryVertexFromMshNode, DefaultAllocator: Allocator, { let mut msh_file = mshio::parse_msh_bytes(bytes).map_err(|e| eyre!("failed to parse msh file: {}", e))?; @@ -79,7 +77,6 @@ where D: DimName, F: mshio::MshFloatT, I: mshio::MshIntT, - OPoint: TryVertexFromMshNode, DefaultAllocator: Allocator, { // Ensure that node tags are consecutive @@ -103,7 +100,7 @@ where // Convert MSH vertices to points for node in &node_block.nodes { - vertices.push(OPoint::try_vertex_from_msh_node(node)?); + vertices.push(point_from_msh_node(node)?); } Ok(vertices) @@ -154,17 +151,6 @@ where == C::reference_dim() } -/// Allows conversion from `mshio::Node`s to `OPoint`s which are used as vertices in `fenris`. -pub trait TryVertexFromMshNode -where - T: RealField, - D: DimName, - F: mshio::MshFloatT, - DefaultAllocator: Allocator, -{ - fn try_vertex_from_msh_node(node: &mshio::Node) -> eyre::Result>; -} - macro_rules! f_to_t { ($component:expr) => { T::from_f64( @@ -176,25 +162,24 @@ macro_rules! f_to_t { }; } -impl TryVertexFromMshNode for Point2 +fn point_from_msh_node(node: &mshio::Node) -> eyre::Result> where T: RealField, + D: DimName, F: mshio::MshFloatT, + DefaultAllocator: Allocator, { - fn try_vertex_from_msh_node(node: &mshio::Node) -> eyre::Result { - // TODO: Ensure that node.z is zero? - Ok(Self::new(f_to_t!(node.x), f_to_t!(node.y))) + // TODO: Ensure that components i < D are zero? + let mut point = OPoint::origin(); + point[0] = f_to_t!(node.x); + if D::dim() > 1 { + point[1] = f_to_t!(node.y); } -} - -impl TryVertexFromMshNode for Point3 -where - T: RealField, - F: mshio::MshFloatT, -{ - fn try_vertex_from_msh_node(node: &mshio::Node) -> eyre::Result { - Ok(Self::new(f_to_t!(node.x), f_to_t!(node.y), f_to_t!(node.z))) + if D::dim() > 2 { + point[2] = f_to_t!(node.z); } + + Ok(point) } /// Allows conversion from `mshio::Element`s to connectivity types used in `fenris`. @@ -267,7 +252,7 @@ impl MshConnectivity for Tet4Connectivity { #[cfg(test)] mod msh_tests { - use crate::connectivity::{Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; + use crate::connectivity::{Tet4Connectivity, Tri3d2Connectivity}; use crate::io::msh::load_msh_from_file; use nalgebra::{U2, U3}; From dee2d0a5624be7d6e4417734f41764376fe57131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Thu, 30 Dec 2021 15:05:41 +0100 Subject: [PATCH 04/15] Use macro to implement MshConnectivity --- src/io/msh.rs | 73 ++++++++++++++++----------------------------------- 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/src/io/msh.rs b/src/io/msh.rs index 91b3ee0b..a16f0b8c 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -195,60 +195,33 @@ where fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result; } -impl MshConnectivity for Tri3d2Connectivity { - fn msh_element_type() -> mshio::ElementType { - mshio::ElementType::Tri3 - } - - fn reference_dim() -> usize { - 2 - } - - fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { - Ok(Self([ - element.nodes[0] as usize - 1, - element.nodes[1] as usize - 1, - element.nodes[2] as usize - 1, - ])) - } -} - -impl MshConnectivity for Tri3d3Connectivity { - fn msh_element_type() -> mshio::ElementType { - mshio::ElementType::Tri3 - } +macro_rules! impl_msh_connectivity { + ($connectivity:ident, $msh_type:ident, num_nodes = $num_nodes:literal) => { + impl MshConnectivity for $connectivity { + fn msh_element_type() -> mshio::ElementType { + mshio::ElementType::$msh_type + } - fn reference_dim() -> usize { - 3 - } + fn reference_dim() -> usize { + use crate::element::ElementConnectivity; + <$connectivity as ElementConnectivity::>::ReferenceDim::dim() + } - fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { - Ok(Self([ - element.nodes[0] as usize - 1, - element.nodes[1] as usize - 1, - element.nodes[2] as usize - 1, - ])) - } + fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { + assert_eq!(element.nodes.len(), $num_nodes, "number of msh element nodes have to match with connectivity"); + let mut nodes = [0; $num_nodes]; + for i in 0..$num_nodes { + nodes[i] = element.nodes[i] as usize - 1; + } + Ok(Self(nodes)) + } + } + }; } -impl MshConnectivity for Tet4Connectivity { - fn msh_element_type() -> mshio::ElementType { - mshio::ElementType::Tet4 - } - - fn reference_dim() -> usize { - 3 - } - - fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { - Ok(Self([ - element.nodes[0] as usize - 1, - element.nodes[1] as usize - 1, - element.nodes[2] as usize - 1, - element.nodes[3] as usize - 1, - ])) - } -} +impl_msh_connectivity!(Tri3d2Connectivity, Tri3, num_nodes = 3); +impl_msh_connectivity!(Tri3d3Connectivity, Tri3, num_nodes = 3); +impl_msh_connectivity!(Tet4Connectivity, Tet4, num_nodes = 4); #[cfg(test)] mod msh_tests { From d78952b6405c431af163b9661e7af0155c601cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Thu, 30 Dec 2021 15:08:34 +0100 Subject: [PATCH 05/15] Formatting --- src/io/msh.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/io/msh.rs b/src/io/msh.rs index a16f0b8c..4fa24838 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -49,7 +49,7 @@ where .any(|block| element_block_matches_connectivity::(block)) { return Err(eyre!( - "MSH file does not contain an element block of the requested type ({:?} of dim {})", + "MSH file does not contain an element block of the requested type (type {:?} of with reference/entity dim {})", C::msh_element_type(), C::reference_dim() )); @@ -204,11 +204,15 @@ macro_rules! impl_msh_connectivity { fn reference_dim() -> usize { use crate::element::ElementConnectivity; - <$connectivity as ElementConnectivity::>::ReferenceDim::dim() + <$connectivity as ElementConnectivity>::ReferenceDim::dim() } fn try_connectivity_from_msh_element(element: &mshio::Element) -> eyre::Result { - assert_eq!(element.nodes.len(), $num_nodes, "number of msh element nodes have to match with connectivity"); + assert_eq!( + element.nodes.len(), + $num_nodes, + "number of msh element nodes have to match with connectivity" + ); let mut nodes = [0; $num_nodes]; for i in 0..$num_nodes { nodes[i] = element.nodes[i] as usize - 1; From 6c561398cf7004b919f3bb4e3e6056e85a94b9f7 Mon Sep 17 00:00:00 2001 From: Fabian Loeschner Date: Tue, 4 Jan 2022 11:12:29 +0100 Subject: [PATCH 06/15] Replace binary mesh file with ASCII file --- assets/meshes/sphere_593.msh | Bin 39898 -> 27847 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/meshes/sphere_593.msh b/assets/meshes/sphere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KWZF#d4DbB?;{RB9OKwWUvcX- zj(u?dOXTk-4nG{@7K`gIj`!SJe(o)!>;VprI6UV#P~2XPYcK62r7nFO9C7#+;s=T2 z-B*yG`b;I;*TE5oUnOp^xJ|M{q}&(W5OMh77`IyEhKi$}8_T~%N}n6%;E2PMZ@4(_ zV}$awlG2|>I5^_)d@o0eV;{AZXQY(BkB@S2#Nqi)j26fFj!~XmQqE_LgCh=KQT$kO j)C+ZxNpb3BoP#3{&v_+xtv9G=y@9=adJP&rEcyQdih Date: Tue, 4 Jan 2022 13:20:18 +0100 Subject: [PATCH 07/15] Add/improve comments and errors --- src/io/msh.rs | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/src/io/msh.rs b/src/io/msh.rs index 4fa24838..e8859817 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -1,9 +1,9 @@ use crate::connectivity::{Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; use crate::mesh::Mesh; use eyre::{eyre, Context}; -use log::warn; use nalgebra::allocator::Allocator; use nalgebra::{DefaultAllocator, DimName, OPoint, RealField}; +use num::ToPrimitive; use std::path::Path; /// Loads a [`Mesh`] from a Gmsh MSH file at the given path. @@ -61,6 +61,19 @@ where vertices.extend(block_vertices); } + if vertices.len() + != msh_nodes + .num_nodes + .to_usize() + .expect("failed to convert num_nodes to usize") + { + return Err(eyre!( + "only {} vertices were read but msh file claims to contain {} nodes", + vertices.len(), + msh_nodes.num_nodes + )); + } + // Collect all connectivity matching the target connectivity for element_block in &msh_elements.element_blocks { let block_connectivity = connectivity_from_element_block(element_block)?; @@ -81,20 +94,29 @@ where { // Ensure that node tags are consecutive if node_block.node_tags.is_some() { - return Err(eyre!("node block tags are not consecutive in msh file")); + return Err(eyre!( + "node block tags are not consecutive in msh file (sparse tags are not supported)" + )); } - // Check dimension of node block vertices + // Note: The MSH `node_block`'s `entity_dim` does not seem to correspond to the geometrical + // dimension of the points. Rather it seems to correspond to the dimension of the "physical" + // object represented by the node block. + // When creating primitives in Gmsh for example, the nodes of a triangulation of a sphere are + // divided into node_blocks representing its equator, surface and volume and all of them are + // referenced by the volumetric elements. + // In addition, all node blocks have to be read in order for the global `node_tag` indexing to + // be consistent work. + /* if node_block .entity_dim .to_usize() .ok_or_else(|| eyre!("error converting node block entity dimension to usize"))? != D::dim() { - // TODO: When can this happen? - warn!("Node block entity does not have the right dimension for this mesh. Will be read as if they were of the same dimension."); - //return Err(eyre!("node block entity does not have the right dimension for this mesh")); + return Err(eyre!("node block entity does not have the right dimension for this mesh")); } + */ let mut vertices = Vec::with_capacity(node_block.nodes.len()); @@ -114,7 +136,9 @@ where { // Ensure that element tags are consecutive if element_block.element_tags.is_some() { - return Err(eyre!("element block tags are not consecutive in msh file")); + return Err(eyre!( + "element block tags are not consecutive in msh file (sparse tags are not supported)" + )); } if !element_block_matches_connectivity::(element_block) { @@ -229,7 +253,7 @@ impl_msh_connectivity!(Tet4Connectivity, Tet4, num_nodes = 4); #[cfg(test)] mod msh_tests { - use crate::connectivity::{Tet4Connectivity, Tri3d2Connectivity}; + use crate::connectivity::{Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; use crate::io::msh::load_msh_from_file; use nalgebra::{U2, U3}; @@ -250,4 +274,14 @@ mod msh_tests { assert_eq!(mesh.connectivity().len(), 110); Ok(()) } + + #[test] + fn load_msh_rect_tri3d3() -> eyre::Result<()> { + // Loading a 2D triangle mesh to a 3D triangle mesh should work + let mesh = load_msh_from_file::("assets/meshes/rectangle_110.msh")?; + + assert_eq!(mesh.vertices().len(), 70); + assert_eq!(mesh.connectivity().len(), 110); + Ok(()) + } } From 40fd2965b7b46c157365e3f24c2609a68df255f5 Mon Sep 17 00:00:00 2001 From: Fabian Loeschner Date: Thu, 10 Nov 2022 14:53:40 +0100 Subject: [PATCH 08/15] Rename msh files, implement msh connectivity trait for quads --- ...ctangle_110.msh => rectangle_tri3_110.msh} | 0 .../{sphere_593.msh => sphere_tet4_593.msh} | 0 assets/meshes/square_quad4_79.msh | 346 ++++++++++++++++++ src/io/msh.rs | 33 +- 4 files changed, 374 insertions(+), 5 deletions(-) rename assets/meshes/{rectangle_110.msh => rectangle_tri3_110.msh} (100%) rename assets/meshes/{sphere_593.msh => sphere_tet4_593.msh} (100%) create mode 100644 assets/meshes/square_quad4_79.msh diff --git a/assets/meshes/rectangle_110.msh b/assets/meshes/rectangle_tri3_110.msh similarity index 100% rename from assets/meshes/rectangle_110.msh rename to assets/meshes/rectangle_tri3_110.msh diff --git a/assets/meshes/sphere_593.msh b/assets/meshes/sphere_tet4_593.msh similarity index 100% rename from assets/meshes/sphere_593.msh rename to assets/meshes/sphere_tet4_593.msh diff --git a/assets/meshes/square_quad4_79.msh b/assets/meshes/square_quad4_79.msh new file mode 100644 index 00000000..c7965ec0 --- /dev/null +++ b/assets/meshes/square_quad4_79.msh @@ -0,0 +1,346 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +4 4 1 0 +1 0 0 0 0 +2 0.5 0 0 0 +3 0.5 0.5 0 0 +4 0 0.5 0 0 +1 -9.999999997511999e-08 -1e-07 -1e-07 0.5000000999999999 1e-07 1e-07 0 2 1 -2 +2 0.4999999 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 2 -3 +3 -9.999999997511999e-08 0.4999999 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 3 -4 +4 -1e-07 -9.999999997511999e-08 -1e-07 1e-07 0.5000000999999999 1e-07 0 2 4 -1 +1 -9.999999997511999e-08 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 4 1 2 3 4 +$EndEntities +$Nodes +9 96 1 96 +0 1 0 1 +1 +0 0 0 +0 2 0 1 +2 +0.5 0 0 +0 3 0 1 +3 +0.5 0.5 0 +0 4 0 1 +4 +0 0.5 0 +1 1 0 7 +5 +6 +7 +8 +9 +10 +11 +0.0625000000000001 0 0 +0.1250000000000001 0 0 +0.1875000000000001 0 0 +0.2500000000000001 0 0 +0.3125000000000001 0 0 +0.3750000000000001 0 0 +0.4375 0 0 +1 2 0 7 +12 +13 +14 +15 +16 +17 +18 +0.5 0.0625000000000001 0 +0.5 0.1250000000000001 0 +0.5 0.1875000000000001 0 +0.5 0.2500000000000001 0 +0.5 0.3125000000000001 0 +0.5 0.3750000000000001 0 +0.5 0.4375 0 +1 3 0 7 +19 +20 +21 +22 +23 +24 +25 +0.4374999999999999 0.5 0 +0.3749999999999999 0.5 0 +0.3124999999999999 0.5 0 +0.2499999999999999 0.5 0 +0.1874999999999999 0.5 0 +0.1249999999999999 0.5 0 +0.0625 0.5 0 +1 4 0 7 +26 +27 +28 +29 +30 +31 +32 +0 0.4374999999999999 0 +0 0.3749999999999999 0 +0 0.3124999999999999 0 +0 0.2499999999999999 0 +0 0.1874999999999999 0 +0 0.1249999999999999 0 +0 0.0625 0 +2 1 0 64 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +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 +0.05822998290347076 0.2605649934272224 0 +0.2690625499678753 0.4373741634969621 0 +0.4394063223897706 0.2532266282495676 0 +0.218731571670798 0.05413444603683523 0 +0.4485296952607269 0.3514543919622855 0 +0.1562572613976605 0.4430017882804914 0 +0.3139361519575364 0.05655977493085765 0 +0.06317620356498166 0.143322085838519 0 +0.09487783772320771 0.05177176608767001 0 +0.4346802809668467 0.1254847795829751 0 +0.385835561124088 0.4424107541217095 0 +0.05642710595914754 0.3800935995942247 0 +0.2206910771762775 0.4223319654557284 0 +0.2409669046111134 0.3803342651533306 0 +0.2796523091247737 0.3809670135891468 0 +0.2811532273431561 0.3278775056845646 0 +0.2226036411773187 0.3311968358436785 0 +0.2383195344809018 0.2774912466426128 0 +0.2785950269114238 0.275688209913682 0 +0.2811213160111221 0.22424678930415 0 +0.2051718789543341 0.2190264006807288 0 +0.2437323515129852 0.1510889946253526 0 +0.2955104382677184 0.1705633178693746 0 +0.170775327327602 0.1496636539918524 0 +0.1214950554939795 0.1549693083706915 0 +0.1571075604841364 0.1175566591042925 0 +0.3096864964698186 0.1137240137759864 0 +0.3600135006231731 0.1960897704484206 0 +0.1223462154153212 0.2116835515605153 0 +0.1160915762585152 0.2719530266180434 0 +0.1103153596848872 0.3288204042469799 0 +0.1503778448299227 0.3343952793879381 0 +0.1108085553193199 0.3847477195247274 0 +0.1722344345729996 0.388665431896197 0 +0.4451386678415112 0.3111850878656598 0 +0.3810973352747714 0.2611286164327285 0 +0.4349323164015576 0.1902737625983149 0 +0.2602460266589819 0.05295883471215043 0 +0.169321158311335 0.2933206700284435 0 +0.3901133716683218 0.3173464068481684 0 +0.4042022912715102 0.3789676816396894 0 +0.1591573024428046 0.04559816201766287 0 +0.3260818403833355 0.4401545419132589 0 +0.2067505282756192 0.1228710534088913 0 +0.3737227477880348 0.06011343705045663 0 +0.4477468983095898 0.402878525370986 0 +0.07366106010639908 0.09356062491854583 0 +0.1150073732639813 0.4420073499310098 0 +0.3344198772063799 0.3243065221373092 0 +0.3216841712974912 0.2322442333286768 0 +0.1243251727668242 0.1096855974361544 0 +0.3697587371967951 0.1225195262768584 0 +0.06043027625340477 0.2006739036270033 0 +0.05640733571939122 0.3204727192992418 0 +0.05704756158401425 0.03578978132756394 0 +0.4363834543890258 0.0619771294693556 0 +0.4434497320434642 0.443296169676297 0 +0.05864054073426955 0.4399127167621574 0 +0.3286863771347082 0.2710301016990295 0 +0.2280270786306877 0.09529701131120621 0 +0.1773829335529767 0.09451185524609806 0 +0.2598706027949543 0.1025253630660608 0 +0.1405036776174168 0.07236710706135094 0 +0.3345858245375794 0.3811534603906345 0 +$EndNodes +$Elements +9 115 1 115 +0 1 15 1 +1 1 +0 2 15 1 +2 2 +0 3 15 1 +3 3 +0 4 15 1 +4 4 +1 1 1 8 +5 1 5 +6 5 6 +7 6 7 +8 7 8 +9 8 9 +10 9 10 +11 10 11 +12 11 2 +1 2 1 8 +13 2 12 +14 12 13 +15 13 14 +16 14 15 +17 15 16 +18 16 17 +19 17 18 +20 18 3 +1 3 1 8 +21 3 19 +22 19 20 +23 20 21 +24 21 22 +25 22 23 +26 23 24 +27 24 25 +28 25 4 +1 4 1 8 +29 4 26 +30 26 27 +31 27 28 +32 28 29 +33 29 30 +34 30 31 +35 31 32 +36 32 1 +2 1 3 79 +37 68 60 69 35 +38 77 84 59 39 +39 57 61 85 40 +40 65 44 86 63 +41 14 69 42 13 +42 71 49 66 64 +43 71 64 63 62 +44 79 41 95 83 +45 66 65 63 64 +46 66 38 80 65 +47 45 46 47 34 +48 35 15 16 67 +49 72 68 35 67 +50 73 72 67 37 +51 17 37 67 16 +52 49 48 47 46 +53 45 66 49 46 +54 36 74 6 7 +55 8 9 39 70 +56 69 14 15 35 +57 66 45 23 38 +58 53 71 62 61 +59 43 20 21 75 +60 34 22 23 45 +61 70 36 7 8 +62 49 71 53 50 +63 53 54 55 52 +64 53 61 57 56 +65 49 50 51 48 +66 53 52 51 50 +67 75 21 22 34 +68 53 56 76 54 +69 62 33 85 61 +70 23 24 80 38 +71 62 63 86 33 +72 73 37 17 78 +73 9 10 77 39 +74 32 79 40 31 +75 31 40 85 30 +76 29 33 86 28 +77 55 59 84 60 +78 18 3 19 89 +79 26 90 25 4 +80 5 87 32 1 +81 12 88 11 2 +82 73 43 75 96 +83 60 82 52 55 +84 72 73 96 81 +85 56 57 83 58 +86 48 51 91 81 +87 48 81 96 47 +88 60 84 42 69 +89 57 40 79 83 +90 52 82 91 51 +91 33 29 30 85 +92 17 18 89 78 +93 10 11 88 77 +94 44 27 28 86 +95 20 43 89 19 +96 27 44 90 26 +97 13 42 88 12 +98 6 41 87 5 +99 60 68 91 82 +100 24 25 90 80 +101 94 92 36 70 +102 59 94 70 39 +103 81 91 68 72 +104 76 93 36 92 +105 94 54 76 92 +106 55 54 94 59 +107 56 58 93 76 +108 36 93 95 74 +109 6 74 95 41 +110 34 47 96 75 +111 84 77 88 42 +112 32 87 41 79 +113 73 78 89 43 +114 65 80 90 44 +115 93 58 83 95 +$EndElements diff --git a/src/io/msh.rs b/src/io/msh.rs index e8859817..761d002b 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -1,4 +1,4 @@ -use crate::connectivity::{Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; +use crate::connectivity::{Quad4d2Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; use crate::mesh::Mesh; use eyre::{eyre, Context}; use nalgebra::allocator::Allocator; @@ -249,17 +249,20 @@ macro_rules! impl_msh_connectivity { impl_msh_connectivity!(Tri3d2Connectivity, Tri3, num_nodes = 3); impl_msh_connectivity!(Tri3d3Connectivity, Tri3, num_nodes = 3); +impl_msh_connectivity!(Quad4d2Connectivity, Qua4, num_nodes = 4); +// Quad4d3Connectivity does not implement ElementConnectivity +//impl_msh_connectivity!(Quad4d3Connectivity, Qua4, num_nodes = 4); impl_msh_connectivity!(Tet4Connectivity, Tet4, num_nodes = 4); #[cfg(test)] mod msh_tests { - use crate::connectivity::{Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; + use crate::connectivity::{Quad4d2Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; use crate::io::msh::load_msh_from_file; use nalgebra::{U2, U3}; #[test] fn load_msh_sphere_tet4() -> eyre::Result<()> { - let mesh = load_msh_from_file::("assets/meshes/sphere_593.msh")?; + let mesh = load_msh_from_file::("assets/meshes/sphere_tet4_593.msh")?; assert_eq!(mesh.vertices().len(), 183); assert_eq!(mesh.connectivity().len(), 593); @@ -268,7 +271,7 @@ mod msh_tests { #[test] fn load_msh_rect_tri3d2() -> eyre::Result<()> { - let mesh = load_msh_from_file::("assets/meshes/rectangle_110.msh")?; + let mesh = load_msh_from_file::("assets/meshes/rectangle_tri3_110.msh")?; assert_eq!(mesh.vertices().len(), 70); assert_eq!(mesh.connectivity().len(), 110); @@ -278,10 +281,30 @@ mod msh_tests { #[test] fn load_msh_rect_tri3d3() -> eyre::Result<()> { // Loading a 2D triangle mesh to a 3D triangle mesh should work - let mesh = load_msh_from_file::("assets/meshes/rectangle_110.msh")?; + let mesh = load_msh_from_file::("assets/meshes/rectangle_tri3_110.msh")?; assert_eq!(mesh.vertices().len(), 70); assert_eq!(mesh.connectivity().len(), 110); Ok(()) } + + #[test] + fn load_msh_square_quad4d2() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/square_quad4_79.msh")?; + + assert_eq!(mesh.vertices().len(), 96); + assert_eq!(mesh.connectivity().len(), 79); + Ok(()) + } + + /* + #[test] + fn load_msh_square_quad4d3() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/square_quad4_79.msh")?; + + assert_eq!(mesh.vertices().len(), 96); + assert_eq!(mesh.connectivity().len(), 79); + Ok(()) + } + */ } From cae78f31dce447910aaa72e12c6e956bbdc61758 Mon Sep 17 00:00:00 2001 From: Fabian Loeschner Date: Thu, 10 Nov 2022 15:43:28 +0100 Subject: [PATCH 09/15] Move export_mesh_vtk to unit.rs --- tests/unit.rs | 21 +++++++++++++++++++++ tests/unit_tests/mesh/refinement.rs | 14 ++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/tests/unit.rs b/tests/unit.rs index f28d4edc..84e468e6 100644 --- a/tests/unit.rs +++ b/tests/unit.rs @@ -1 +1,22 @@ +use std::path::Path; +use nalgebra::{DefaultAllocator, DimName}; +use nalgebra::allocator::Allocator; +use fenris::io::vtk::{FiniteElementMeshDataSetBuilder, VtkCellConnectivity}; +use fenris::mesh::Mesh; + mod unit_tests; + +fn export_mesh_vtk(test_name: &str, file_stem: &str, mesh: &Mesh) + where + D: DimName, + DefaultAllocator: Allocator, + C: VtkCellConnectivity, +{ + let output_path = Path::new("data/unit_tests/") + .join(test_name) + .join(format!("{file_stem}.vtu")); + FiniteElementMeshDataSetBuilder::from_mesh(mesh) + .try_export(output_path) + .expect("Export failure is a test failure") +} + diff --git a/tests/unit_tests/mesh/refinement.rs b/tests/unit_tests/mesh/refinement.rs index 1bf1b561..1e40947f 100644 --- a/tests/unit_tests/mesh/refinement.rs +++ b/tests/unit_tests/mesh/refinement.rs @@ -1,19 +1,9 @@ +use crate::export_mesh_vtk; use fenris::connectivity::Tri3d2Connectivity; -use fenris::io::vtk::FiniteElementMeshDataSetBuilder; use fenris::mesh::refinement::{refine_uniformly, refine_uniformly_repeat}; -use fenris::mesh::{Mesh, TriangleMesh2d}; +use fenris::mesh::Mesh; use insta::assert_debug_snapshot; use nalgebra::point; -use std::path::Path; - -fn export_mesh_vtk(test_name: &str, file_stem: &str, mesh: &TriangleMesh2d) { - let output_path = Path::new("data/unit_tests/") - .join(test_name) - .join(format!("{file_stem}.vtu")); - FiniteElementMeshDataSetBuilder::from_mesh(mesh) - .try_export(output_path) - .expect("Export failure is a test failure") -} #[test] fn uniform_refinement_tri3d2() { From d74b70ab5d3f3debbf1c4559fdb803bd0cf71b22 Mon Sep 17 00:00:00 2001 From: Fabian Loeschner Date: Thu, 10 Nov 2022 15:45:00 +0100 Subject: [PATCH 10/15] Implement MshConnectivity for Tri6d2 & Quad9d2, move tests, use insta --- assets/meshes/square_quad4_4.msh | 73 + assets/meshes/square_quad9_4.msh | 105 + assets/meshes/square_tri3_4.msh | 61 + assets/meshes/square_tri6_4.msh | 77 + src/io/msh.rs | 62 +- tests/unit_tests/io.rs | 1 + tests/unit_tests/io/msh.rs | 129 + ...__io__msh__load_msh_rect_tri3d2_large.snap | 1060 +++ ...__io__msh__load_msh_rect_tri3d3_large.snap | 1130 ++++ ...__io__msh__load_msh_sphere_tet4_large.snap | 5669 +++++++++++++++++ ...sts__io__msh__load_msh_square_quad4d2.snap | 78 + ...o__msh__load_msh_square_quad4d2_large.snap | 1026 +++ ...sts__io__msh__load_msh_square_quad9d2.snap | 162 + ...ests__io__msh__load_msh_square_tri3d2.snap | 58 + ...ests__io__msh__load_msh_square_tri6d2.snap | 102 + tests/unit_tests/mod.rs | 1 + 16 files changed, 9738 insertions(+), 56 deletions(-) create mode 100644 assets/meshes/square_quad4_4.msh create mode 100644 assets/meshes/square_quad9_4.msh create mode 100644 assets/meshes/square_tri3_4.msh create mode 100644 assets/meshes/square_tri6_4.msh create mode 100644 tests/unit_tests/io.rs create mode 100644 tests/unit_tests/io/msh.rs create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_rect_tri3d2_large.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_rect_tri3d3_large.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_sphere_tet4_large.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad4d2.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad4d2_large.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad9d2.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_tri3d2.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_tri6d2.snap diff --git a/assets/meshes/square_quad4_4.msh b/assets/meshes/square_quad4_4.msh new file mode 100644 index 00000000..79cde41e --- /dev/null +++ b/assets/meshes/square_quad4_4.msh @@ -0,0 +1,73 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +4 4 1 0 +1 0 0 0 0 +2 0.5 0 0 0 +3 0.5 0.5 0 0 +4 0 0.5 0 0 +1 -9.999999997511999e-08 -1e-07 -1e-07 0.5000000999999999 1e-07 1e-07 0 2 1 -2 +2 0.4999999 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 2 -3 +3 -9.999999997511999e-08 0.4999999 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 3 -4 +4 -1e-07 -9.999999997511999e-08 -1e-07 1e-07 0.5000000999999999 1e-07 0 2 4 -1 +1 -9.999999997511999e-08 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 4 1 2 3 4 +$EndEntities +$Nodes +9 9 1 9 +0 1 0 1 +1 +0 0 0 +0 2 0 1 +2 +0.5 0 0 +0 3 0 1 +3 +0.5 0.5 0 +0 4 0 1 +4 +0 0.5 0 +1 1 0 1 +5 +0.25 0 0 +1 2 0 1 +6 +0.5 0.25 0 +1 3 0 1 +7 +0.25 0.5 0 +1 4 0 1 +8 +0 0.25 0 +2 1 0 1 +9 +0.25 0.25 0 +$EndNodes +$Elements +9 16 1 16 +0 1 15 1 +1 1 +0 2 15 1 +2 2 +0 3 15 1 +3 3 +0 4 15 1 +4 4 +1 1 1 2 +5 1 5 +6 5 2 +1 2 1 2 +7 2 6 +8 6 3 +1 3 1 2 +9 3 7 +10 7 4 +1 4 1 2 +11 4 8 +12 8 1 +2 1 3 4 +13 1 5 9 8 +14 5 2 6 9 +15 9 6 3 7 +16 8 9 7 4 +$EndElements diff --git a/assets/meshes/square_quad9_4.msh b/assets/meshes/square_quad9_4.msh new file mode 100644 index 00000000..908534a4 --- /dev/null +++ b/assets/meshes/square_quad9_4.msh @@ -0,0 +1,105 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +4 4 1 0 +1 0 0 0 0 +2 0.5 0 0 0 +3 0.5 0.5 0 0 +4 0 0.5 0 0 +1 -9.999999997511999e-08 -1e-07 -1e-07 0.5000000999999999 1e-07 1e-07 0 2 1 -2 +2 0.4999999 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 2 -3 +3 -9.999999997511999e-08 0.4999999 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 3 -4 +4 -1e-07 -9.999999997511999e-08 -1e-07 1e-07 0.5000000999999999 1e-07 0 2 4 -1 +1 -9.999999997511999e-08 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 4 1 2 3 4 +$EndEntities +$Nodes +9 25 1 25 +0 1 0 1 +1 +0 0 0 +0 2 0 1 +2 +0.5 0 0 +0 3 0 1 +3 +0.5 0.5 0 +0 4 0 1 +4 +0 0.5 0 +1 1 0 3 +5 +6 +7 +0.25 0 0 +0.125 0 0 +0.375 0 0 +1 2 0 3 +8 +9 +10 +0.5 0.25 0 +0.5 0.125 0 +0.5 0.375 0 +1 3 0 3 +11 +12 +13 +0.25 0.5 0 +0.375 0.5 0 +0.125 0.5 0 +1 4 0 3 +14 +15 +16 +0 0.25 0 +0 0.375 0 +0 0.125 0 +2 1 0 9 +17 +18 +19 +20 +21 +22 +23 +24 +25 +0.25 0.25 0 +0.25 0.125 0 +0.125 0.25 0 +0.125 0.125 0 +0.375 0.25 0 +0.375 0.125 0 +0.25 0.375 0 +0.375 0.375 0 +0.125 0.375 0 +$EndNodes +$Elements +9 16 1 16 +0 1 15 1 +1 1 +0 2 15 1 +2 2 +0 3 15 1 +3 3 +0 4 15 1 +4 4 +1 1 8 2 +5 1 5 6 +6 5 2 7 +1 2 8 2 +7 2 8 9 +8 8 3 10 +1 3 8 2 +9 3 11 12 +10 11 4 13 +1 4 8 2 +11 4 14 15 +12 14 1 16 +2 1 10 4 +13 1 5 17 14 6 18 19 16 20 +14 5 2 8 17 7 9 21 18 22 +15 17 8 3 11 21 10 12 23 24 +16 14 17 11 4 19 23 13 15 25 +$EndElements diff --git a/assets/meshes/square_tri3_4.msh b/assets/meshes/square_tri3_4.msh new file mode 100644 index 00000000..95989365 --- /dev/null +++ b/assets/meshes/square_tri3_4.msh @@ -0,0 +1,61 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +4 4 1 0 +1 0 0 0 0 +2 0.5 0 0 0 +3 0.5 0.5 0 0 +4 0 0.5 0 0 +1 -9.999999997511999e-08 -1e-07 -1e-07 0.5000000999999999 1e-07 1e-07 0 2 1 -2 +2 0.4999999 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 2 -3 +3 -9.999999997511999e-08 0.4999999 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 3 -4 +4 -1e-07 -9.999999997511999e-08 -1e-07 1e-07 0.5000000999999999 1e-07 0 2 4 -1 +1 -9.999999997511999e-08 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 4 1 2 3 4 +$EndEntities +$Nodes +9 5 1 5 +0 1 0 1 +1 +0 0 0 +0 2 0 1 +2 +0.5 0 0 +0 3 0 1 +3 +0.5 0.5 0 +0 4 0 1 +4 +0 0.5 0 +1 1 0 0 +1 2 0 0 +1 3 0 0 +1 4 0 0 +2 1 0 1 +5 +0.25 0.25 0 +$EndNodes +$Elements +9 12 1 12 +0 1 15 1 +1 1 +0 2 15 1 +2 2 +0 3 15 1 +3 3 +0 4 15 1 +4 4 +1 1 1 1 +5 1 2 +1 2 1 1 +6 2 3 +1 3 1 1 +7 3 4 +1 4 1 1 +8 4 1 +2 1 2 4 +9 2 5 1 +10 1 5 4 +11 3 5 2 +12 4 5 3 +$EndElements diff --git a/assets/meshes/square_tri6_4.msh b/assets/meshes/square_tri6_4.msh new file mode 100644 index 00000000..f366b1ac --- /dev/null +++ b/assets/meshes/square_tri6_4.msh @@ -0,0 +1,77 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +4 4 1 0 +1 0 0 0 0 +2 0.5 0 0 0 +3 0.5 0.5 0 0 +4 0 0.5 0 0 +1 -9.999999997511999e-08 -1e-07 -1e-07 0.5000000999999999 1e-07 1e-07 0 2 1 -2 +2 0.4999999 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 2 -3 +3 -9.999999997511999e-08 0.4999999 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 2 3 -4 +4 -1e-07 -9.999999997511999e-08 -1e-07 1e-07 0.5000000999999999 1e-07 0 2 4 -1 +1 -9.999999997511999e-08 -9.999999997511999e-08 -1e-07 0.5000000999999999 0.5000000999999999 1e-07 0 4 1 2 3 4 +$EndEntities +$Nodes +9 13 1 13 +0 1 0 1 +1 +0 0 0 +0 2 0 1 +2 +0.5 0 0 +0 3 0 1 +3 +0.5 0.5 0 +0 4 0 1 +4 +0 0.5 0 +1 1 0 1 +5 +0.25 0 0 +1 2 0 1 +6 +0.5 0.25 0 +1 3 0 1 +7 +0.25 0.5 0 +1 4 0 1 +8 +0 0.25 0 +2 1 0 5 +9 +10 +11 +12 +13 +0.25 0.25 0 +0.375 0.125 0 +0.125 0.125 0 +0.125 0.375 0 +0.375 0.375 0 +$EndNodes +$Elements +9 12 1 12 +0 1 15 1 +1 1 +0 2 15 1 +2 2 +0 3 15 1 +3 3 +0 4 15 1 +4 4 +1 1 8 1 +5 1 2 5 +1 2 8 1 +6 2 3 6 +1 3 8 1 +7 3 4 7 +1 4 8 1 +8 4 1 8 +2 1 9 4 +9 2 9 1 10 11 5 +10 1 9 4 11 12 8 +11 3 9 2 13 10 6 +12 4 9 3 12 13 7 +$EndElements diff --git a/src/io/msh.rs b/src/io/msh.rs index 761d002b..c6f4bd4c 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -1,4 +1,7 @@ -use crate::connectivity::{Quad4d2Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; +use crate::connectivity::{ + Quad4d2Connectivity, Quad9d2Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity, + Tri6d2Connectivity, +}; use crate::mesh::Mesh; use eyre::{eyre, Context}; use nalgebra::allocator::Allocator; @@ -249,62 +252,9 @@ macro_rules! impl_msh_connectivity { impl_msh_connectivity!(Tri3d2Connectivity, Tri3, num_nodes = 3); impl_msh_connectivity!(Tri3d3Connectivity, Tri3, num_nodes = 3); +impl_msh_connectivity!(Tri6d2Connectivity, Tri6, num_nodes = 6); impl_msh_connectivity!(Quad4d2Connectivity, Qua4, num_nodes = 4); +impl_msh_connectivity!(Quad9d2Connectivity, Qua9, num_nodes = 9); // Quad4d3Connectivity does not implement ElementConnectivity //impl_msh_connectivity!(Quad4d3Connectivity, Qua4, num_nodes = 4); impl_msh_connectivity!(Tet4Connectivity, Tet4, num_nodes = 4); - -#[cfg(test)] -mod msh_tests { - use crate::connectivity::{Quad4d2Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity}; - use crate::io::msh::load_msh_from_file; - use nalgebra::{U2, U3}; - - #[test] - fn load_msh_sphere_tet4() -> eyre::Result<()> { - let mesh = load_msh_from_file::("assets/meshes/sphere_tet4_593.msh")?; - - assert_eq!(mesh.vertices().len(), 183); - assert_eq!(mesh.connectivity().len(), 593); - Ok(()) - } - - #[test] - fn load_msh_rect_tri3d2() -> eyre::Result<()> { - let mesh = load_msh_from_file::("assets/meshes/rectangle_tri3_110.msh")?; - - assert_eq!(mesh.vertices().len(), 70); - assert_eq!(mesh.connectivity().len(), 110); - Ok(()) - } - - #[test] - fn load_msh_rect_tri3d3() -> eyre::Result<()> { - // Loading a 2D triangle mesh to a 3D triangle mesh should work - let mesh = load_msh_from_file::("assets/meshes/rectangle_tri3_110.msh")?; - - assert_eq!(mesh.vertices().len(), 70); - assert_eq!(mesh.connectivity().len(), 110); - Ok(()) - } - - #[test] - fn load_msh_square_quad4d2() -> eyre::Result<()> { - let mesh = load_msh_from_file::("assets/meshes/square_quad4_79.msh")?; - - assert_eq!(mesh.vertices().len(), 96); - assert_eq!(mesh.connectivity().len(), 79); - Ok(()) - } - - /* - #[test] - fn load_msh_square_quad4d3() -> eyre::Result<()> { - let mesh = load_msh_from_file::("assets/meshes/square_quad4_79.msh")?; - - assert_eq!(mesh.vertices().len(), 96); - assert_eq!(mesh.connectivity().len(), 79); - Ok(()) - } - */ -} diff --git a/tests/unit_tests/io.rs b/tests/unit_tests/io.rs new file mode 100644 index 00000000..a189259f --- /dev/null +++ b/tests/unit_tests/io.rs @@ -0,0 +1 @@ +mod msh; diff --git a/tests/unit_tests/io/msh.rs b/tests/unit_tests/io/msh.rs new file mode 100644 index 00000000..43b170a6 --- /dev/null +++ b/tests/unit_tests/io/msh.rs @@ -0,0 +1,129 @@ +use crate::export_mesh_vtk; +use fenris::connectivity::{ + Quad4d2Connectivity, Quad9d2Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity, + Tri6d2Connectivity, +}; +use fenris::io::msh::load_msh_from_file; +use insta::assert_debug_snapshot; +use nalgebra::{U2, U3}; + +#[test] +fn load_msh_sphere_tet4_large() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/sphere_tet4_593.msh")?; + + assert_eq!(mesh.vertices().len(), 183); + assert_eq!(mesh.connectivity().len(), 593); + + export_mesh_vtk("io_msh", "load_msh_sphere_tet4_large", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +#[test] +fn load_msh_rect_tri3d2_large() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/rectangle_tri3_110.msh")?; + + assert_eq!(mesh.vertices().len(), 70); + assert_eq!(mesh.connectivity().len(), 110); + + export_mesh_vtk("io_msh", "load_msh_rect_tri3d2_large", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +#[test] +fn load_msh_rect_tri3d3_large() -> eyre::Result<()> { + // Loading a 2D triangle mesh to a 3D triangle mesh should work + let mesh = load_msh_from_file::("assets/meshes/rectangle_tri3_110.msh")?; + + assert_eq!(mesh.vertices().len(), 70); + assert_eq!(mesh.connectivity().len(), 110); + + export_mesh_vtk("io_msh", "load_msh_rect_tri3d3_large", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +#[test] +fn load_msh_square_quad4d2_large() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/square_quad4_79.msh")?; + + assert_eq!(mesh.vertices().len(), 96); + assert_eq!(mesh.connectivity().len(), 79); + + export_mesh_vtk("io_msh", "load_msh_square_quad4d2_large", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +// Quad4d3Connectivity does not implement ElementConnectivity +/* +#[test] +fn load_msh_square_quad4d3_large() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/square_quad4_79.msh")?; + + assert_eq!(mesh.vertices().len(), 96); + assert_eq!(mesh.connectivity().len(), 79); + + export_mesh_vtk("io_msh", "load_msh_square_quad4d3_large", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} +*/ + +#[test] +fn load_msh_square_tri3d2() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/square_tri3_4.msh")?; + + assert_eq!(mesh.vertices().len(), 5); + assert_eq!(mesh.connectivity().len(), 4); + + export_mesh_vtk("io_msh", "load_msh_square_tri3d2", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +#[test] +fn load_msh_square_tri6d2() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/square_tri6_4.msh")?; + + assert_eq!(mesh.vertices().len(), 13); + assert_eq!(mesh.connectivity().len(), 4); + + export_mesh_vtk("io_msh", "load_msh_square_tri6d2", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +#[test] +fn load_msh_square_quad4d2() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/square_quad4_4.msh")?; + + assert_eq!(mesh.vertices().len(), 9); + assert_eq!(mesh.connectivity().len(), 4); + + export_mesh_vtk("io_msh", "load_msh_square_quad4d2", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +#[test] +fn load_msh_square_quad9d2() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/square_quad9_4.msh")?; + + assert_eq!(mesh.vertices().len(), 25); + assert_eq!(mesh.connectivity().len(), 4); + + export_mesh_vtk("io_msh", "load_msh_square_quad9d2", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_rect_tri3d2_large.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_rect_tri3d2_large.snap new file mode 100644 index 00000000..a4c72bf4 --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_rect_tri3d2_large.snap @@ -0,0 +1,1060 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + -0.3, + -0.3, + ], + [ + 0.7, + -0.3, + ], + [ + 0.7, + 0.2, + ], + [ + -0.3, + 0.2, + ], + [ + -0.1888888888888891, + -0.3, + ], + [ + -0.07777777777777825, + -0.3, + ], + [ + 0.03333333333333294, + -0.3, + ], + [ + 0.1444444444444442, + -0.3, + ], + [ + 0.2555555555555554, + -0.3, + ], + [ + 0.3666666666666664, + -0.3, + ], + [ + 0.4777777777777777, + -0.3, + ], + [ + 0.5888888888888888, + -0.3, + ], + [ + 0.7, + -0.2000000000000002, + ], + [ + 0.7, + -0.1000000000000001, + ], + [ + 0.7, + -1.110223024625157e-16, + ], + [ + 0.7, + 0.09999999999999998, + ], + [ + 0.588888888888889, + 0.2, + ], + [ + 0.4777777777777782, + 0.2, + ], + [ + 0.366666666666667, + 0.2, + ], + [ + 0.2555555555555558, + 0.2, + ], + [ + 0.1444444444444446, + 0.2, + ], + [ + 0.03333333333333355, + 0.2, + ], + [ + -0.07777777777777772, + 0.2, + ], + [ + -0.1888888888888889, + 0.2, + ], + [ + -0.3, + 0.1000000000000002, + ], + [ + -0.3, + 1.665334536937735e-16, + ], + [ + -0.3, + -0.09999999999999987, + ], + [ + -0.3, + -0.2, + ], + [ + 0.6181853054877119, + -0.0415974196800525, + ], + [ + -0.2184200639486318, + -0.05004133303915795, + ], + [ + 0.2017105453434146, + -0.2002352435348832, + ], + [ + 0.3104891941360209, + 0.1029078944520922, + ], + [ + 0.08834248811904713, + 0.1038514358620944, + ], + [ + 0.4416365682405676, + -0.2094183433526482, + ], + [ + -0.02487999700958349, + -0.1993290750383707, + ], + [ + 0.5363367134450407, + 0.09963349191309573, + ], + [ + -0.1376937270386464, + 0.09918316830157284, + ], + [ + -0.02320268433312986, + 0.1034937157688774, + ], + [ + 0.03225151084425054, + 0.00824487064593734, + ], + [ + 0.1430952130559973, + 0.007257297698020186, + ], + [ + 0.08670007502345552, + -0.08790564410859014, + ], + [ + -0.02366509376319328, + -0.08669558283174966, + ], + [ + 0.1971963049208412, + -0.08916950506662782, + ], + [ + 0.253922991933277, + 0.006317558455476907, + ], + [ + 0.3081255793967473, + -0.09077591339602184, + ], + [ + 0.3646194671681309, + 0.005510616989843405, + ], + [ + 0.4185164091280256, + -0.0918398591757682, + ], + [ + 0.4701913192082958, + 0.01124911446365311, + ], + [ + 0.4222222222222225, + 0.1037749551350623, + ], + [ + 0.3165578285233138, + -0.2010429173546686, + ], + [ + 0.51294097640968, + -0.1461571739671005, + ], + [ + -0.07204502561708118, + 0.003996362274948255, + ], + [ + -0.1428703653664571, + -0.2133259091633978, + ], + [ + 0.0882666209765149, + -0.2041342216817793, + ], + [ + 0.1993083145407238, + 0.1033890310779473, + ], + [ + 0.6141673003725829, + -0.1500000000000002, + ], + [ + -0.2150687950126897, + -0.1499999999999999, + ], + [ + -0.1217096898957324, + -0.09916445375994822, + ], + [ + -0.2228047796821482, + 0.04659250577317239, + ], + [ + 0.6177454205875057, + 0.04994026324231237, + ], + [ + 0.5466426593556569, + -0.2259292528866248, + ], + [ + 0.5296132320729046, + -0.06139610197017452, + ], + [ + 0.628594204584287, + 0.1299147510310816, + ], + [ + -0.2286828846737035, + 0.1291590499816862, + ], + [ + -0.2256650626505246, + -0.2291340202289778, + ], + [ + -0.1550184885524905, + 0.001244361478090254, + ], + [ + 0.03088955984017527, + -0.1445718351398361, + ], + [ + 0.6299397697234258, + -0.2351858505773251, + ], + [ + 0.141299000533621, + -0.1452945975736307, + ], + [ + 0.5531073904611943, + 0.0116360736783649, + ], + ], + connectivity: [ + Tri3d2Connectivity( + [ + 30, + 49, + 44, + ], + ), + Tri3d2Connectivity( + [ + 30, + 44, + 42, + ], + ), + Tri3d2Connectivity( + [ + 46, + 49, + 33, + ], + ), + Tri3d2Connectivity( + [ + 44, + 49, + 46, + ], + ), + Tri3d2Connectivity( + [ + 41, + 57, + 34, + ], + ), + Tri3d2Connectivity( + [ + 34, + 57, + 52, + ], + ), + Tri3d2Connectivity( + [ + 10, + 60, + 33, + ], + ), + Tri3d2Connectivity( + [ + 33, + 60, + 50, + ], + ), + Tri3d2Connectivity( + [ + 35, + 48, + 47, + ], + ), + Tri3d2Connectivity( + [ + 51, + 57, + 41, + ], + ), + Tri3d2Connectivity( + [ + 47, + 48, + 45, + ], + ), + Tri3d2Connectivity( + [ + 45, + 48, + 31, + ], + ), + Tri3d2Connectivity( + [ + 28, + 61, + 55, + ], + ), + Tri3d2Connectivity( + [ + 33, + 50, + 46, + ], + ), + Tri3d2Connectivity( + [ + 43, + 45, + 31, + ], + ), + Tri3d2Connectivity( + [ + 33, + 49, + 9, + ], + ), + Tri3d2Connectivity( + [ + 9, + 49, + 8, + ], + ), + Tri3d2Connectivity( + [ + 17, + 48, + 35, + ], + ), + Tri3d2Connectivity( + [ + 55, + 61, + 50, + ], + ), + Tri3d2Connectivity( + [ + 34, + 52, + 5, + ], + ), + Tri3d2Connectivity( + [ + 23, + 36, + 22, + ], + ), + Tri3d2Connectivity( + [ + 17, + 35, + 16, + ], + ), + Tri3d2Connectivity( + [ + 38, + 51, + 41, + ], + ), + Tri3d2Connectivity( + [ + 37, + 38, + 32, + ], + ), + Tri3d2Connectivity( + [ + 8, + 49, + 30, + ], + ), + Tri3d2Connectivity( + [ + 31, + 54, + 43, + ], + ), + Tri3d2Connectivity( + [ + 21, + 37, + 32, + ], + ), + Tri3d2Connectivity( + [ + 36, + 37, + 22, + ], + ), + Tri3d2Connectivity( + [ + 46, + 47, + 45, + ], + ), + Tri3d2Connectivity( + [ + 44, + 46, + 45, + ], + ), + Tri3d2Connectivity( + [ + 36, + 51, + 37, + ], + ), + Tri3d2Connectivity( + [ + 10, + 33, + 9, + ], + ), + Tri3d2Connectivity( + [ + 6, + 34, + 5, + ], + ), + Tri3d2Connectivity( + [ + 5, + 52, + 4, + ], + ), + Tri3d2Connectivity( + [ + 38, + 41, + 40, + ], + ), + Tri3d2Connectivity( + [ + 37, + 51, + 38, + ], + ), + Tri3d2Connectivity( + [ + 30, + 53, + 7, + ], + ), + Tri3d2Connectivity( + [ + 18, + 48, + 17, + ], + ), + Tri3d2Connectivity( + [ + 31, + 48, + 18, + ], + ), + Tri3d2Connectivity( + [ + 6, + 53, + 34, + ], + ), + Tri3d2Connectivity( + [ + 20, + 54, + 19, + ], + ), + Tri3d2Connectivity( + [ + 44, + 45, + 43, + ], + ), + Tri3d2Connectivity( + [ + 38, + 40, + 39, + ], + ), + Tri3d2Connectivity( + [ + 43, + 54, + 39, + ], + ), + Tri3d2Connectivity( + [ + 39, + 54, + 32, + ], + ), + Tri3d2Connectivity( + [ + 32, + 54, + 20, + ], + ), + Tri3d2Connectivity( + [ + 19, + 54, + 31, + ], + ), + Tri3d2Connectivity( + [ + 22, + 37, + 21, + ], + ), + Tri3d2Connectivity( + [ + 38, + 39, + 32, + ], + ), + Tri3d2Connectivity( + [ + 7, + 53, + 6, + ], + ), + Tri3d2Connectivity( + [ + 42, + 44, + 43, + ], + ), + Tri3d2Connectivity( + [ + 8, + 30, + 7, + ], + ), + Tri3d2Connectivity( + [ + 19, + 31, + 18, + ], + ), + Tri3d2Connectivity( + [ + 21, + 32, + 20, + ], + ), + Tri3d2Connectivity( + [ + 40, + 42, + 39, + ], + ), + Tri3d2Connectivity( + [ + 42, + 43, + 39, + ], + ), + Tri3d2Connectivity( + [ + 51, + 65, + 57, + ], + ), + Tri3d2Connectivity( + [ + 14, + 28, + 13, + ], + ), + Tri3d2Connectivity( + [ + 26, + 29, + 25, + ], + ), + Tri3d2Connectivity( + [ + 13, + 55, + 12, + ], + ), + Tri3d2Connectivity( + [ + 50, + 61, + 46, + ], + ), + Tri3d2Connectivity( + [ + 27, + 56, + 26, + ], + ), + Tri3d2Connectivity( + [ + 25, + 58, + 24, + ], + ), + Tri3d2Connectivity( + [ + 15, + 59, + 14, + ], + ), + Tri3d2Connectivity( + [ + 28, + 55, + 13, + ], + ), + Tri3d2Connectivity( + [ + 46, + 61, + 47, + ], + ), + Tri3d2Connectivity( + [ + 11, + 60, + 10, + ], + ), + Tri3d2Connectivity( + [ + 26, + 56, + 29, + ], + ), + Tri3d2Connectivity( + [ + 14, + 59, + 28, + ], + ), + Tri3d2Connectivity( + [ + 29, + 58, + 25, + ], + ), + Tri3d2Connectivity( + [ + 56, + 57, + 29, + ], + ), + Tri3d2Connectivity( + [ + 52, + 57, + 56, + ], + ), + Tri3d2Connectivity( + [ + 4, + 64, + 0, + ], + ), + Tri3d2Connectivity( + [ + 16, + 62, + 2, + ], + ), + Tri3d2Connectivity( + [ + 3, + 63, + 23, + ], + ), + Tri3d2Connectivity( + [ + 47, + 69, + 35, + ], + ), + Tri3d2Connectivity( + [ + 0, + 64, + 27, + ], + ), + Tri3d2Connectivity( + [ + 2, + 62, + 15, + ], + ), + Tri3d2Connectivity( + [ + 24, + 63, + 3, + ], + ), + Tri3d2Connectivity( + [ + 34, + 66, + 41, + ], + ), + Tri3d2Connectivity( + [ + 57, + 65, + 29, + ], + ), + Tri3d2Connectivity( + [ + 36, + 65, + 51, + ], + ), + Tri3d2Connectivity( + [ + 55, + 67, + 12, + ], + ), + Tri3d2Connectivity( + [ + 1, + 67, + 11, + ], + ), + Tri3d2Connectivity( + [ + 35, + 62, + 16, + ], + ), + Tri3d2Connectivity( + [ + 23, + 63, + 36, + ], + ), + Tri3d2Connectivity( + [ + 52, + 64, + 4, + ], + ), + Tri3d2Connectivity( + [ + 58, + 65, + 36, + ], + ), + Tri3d2Connectivity( + [ + 42, + 68, + 30, + ], + ), + Tri3d2Connectivity( + [ + 60, + 67, + 55, + ], + ), + Tri3d2Connectivity( + [ + 30, + 68, + 53, + ], + ), + Tri3d2Connectivity( + [ + 53, + 66, + 34, + ], + ), + Tri3d2Connectivity( + [ + 41, + 66, + 40, + ], + ), + Tri3d2Connectivity( + [ + 53, + 68, + 66, + ], + ), + Tri3d2Connectivity( + [ + 56, + 64, + 52, + ], + ), + Tri3d2Connectivity( + [ + 66, + 68, + 40, + ], + ), + Tri3d2Connectivity( + [ + 36, + 63, + 58, + ], + ), + Tri3d2Connectivity( + [ + 59, + 62, + 35, + ], + ), + Tri3d2Connectivity( + [ + 40, + 68, + 42, + ], + ), + Tri3d2Connectivity( + [ + 50, + 60, + 55, + ], + ), + Tri3d2Connectivity( + [ + 59, + 69, + 28, + ], + ), + Tri3d2Connectivity( + [ + 12, + 67, + 1, + ], + ), + Tri3d2Connectivity( + [ + 35, + 69, + 59, + ], + ), + Tri3d2Connectivity( + [ + 27, + 64, + 56, + ], + ), + Tri3d2Connectivity( + [ + 15, + 62, + 59, + ], + ), + Tri3d2Connectivity( + [ + 58, + 63, + 24, + ], + ), + Tri3d2Connectivity( + [ + 29, + 65, + 58, + ], + ), + Tri3d2Connectivity( + [ + 28, + 69, + 61, + ], + ), + Tri3d2Connectivity( + [ + 11, + 67, + 60, + ], + ), + Tri3d2Connectivity( + [ + 61, + 69, + 47, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_rect_tri3d3_large.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_rect_tri3d3_large.snap new file mode 100644 index 00000000..24e8f23a --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_rect_tri3d3_large.snap @@ -0,0 +1,1130 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + -0.3, + -0.3, + -0.0, + ], + [ + 0.7, + -0.3, + -0.0, + ], + [ + 0.7, + 0.2, + -0.0, + ], + [ + -0.3, + 0.2, + -0.0, + ], + [ + -0.1888888888888891, + -0.3, + 0.0, + ], + [ + -0.07777777777777825, + -0.3, + 0.0, + ], + [ + 0.03333333333333294, + -0.3, + 0.0, + ], + [ + 0.1444444444444442, + -0.3, + 0.0, + ], + [ + 0.2555555555555554, + -0.3, + 0.0, + ], + [ + 0.3666666666666664, + -0.3, + 0.0, + ], + [ + 0.4777777777777777, + -0.3, + 0.0, + ], + [ + 0.5888888888888888, + -0.3, + 0.0, + ], + [ + 0.7, + -0.2000000000000002, + 0.0, + ], + [ + 0.7, + -0.1000000000000001, + 0.0, + ], + [ + 0.7, + -1.110223024625157e-16, + 0.0, + ], + [ + 0.7, + 0.09999999999999998, + 0.0, + ], + [ + 0.588888888888889, + 0.2, + 0.0, + ], + [ + 0.4777777777777782, + 0.2, + 0.0, + ], + [ + 0.366666666666667, + 0.2, + 0.0, + ], + [ + 0.2555555555555558, + 0.2, + 0.0, + ], + [ + 0.1444444444444446, + 0.2, + 0.0, + ], + [ + 0.03333333333333355, + 0.2, + 0.0, + ], + [ + -0.07777777777777772, + 0.2, + 0.0, + ], + [ + -0.1888888888888889, + 0.2, + 0.0, + ], + [ + -0.3, + 0.1000000000000002, + 0.0, + ], + [ + -0.3, + 1.665334536937735e-16, + 0.0, + ], + [ + -0.3, + -0.09999999999999987, + 0.0, + ], + [ + -0.3, + -0.2, + 0.0, + ], + [ + 0.6181853054877119, + -0.0415974196800525, + 0.0, + ], + [ + -0.2184200639486318, + -0.05004133303915795, + 0.0, + ], + [ + 0.2017105453434146, + -0.2002352435348832, + 0.0, + ], + [ + 0.3104891941360209, + 0.1029078944520922, + 0.0, + ], + [ + 0.08834248811904713, + 0.1038514358620944, + 0.0, + ], + [ + 0.4416365682405676, + -0.2094183433526482, + 0.0, + ], + [ + -0.02487999700958349, + -0.1993290750383707, + 0.0, + ], + [ + 0.5363367134450407, + 0.09963349191309573, + 0.0, + ], + [ + -0.1376937270386464, + 0.09918316830157284, + 0.0, + ], + [ + -0.02320268433312986, + 0.1034937157688774, + 0.0, + ], + [ + 0.03225151084425054, + 0.00824487064593734, + 0.0, + ], + [ + 0.1430952130559973, + 0.007257297698020186, + 0.0, + ], + [ + 0.08670007502345552, + -0.08790564410859014, + 0.0, + ], + [ + -0.02366509376319328, + -0.08669558283174966, + 0.0, + ], + [ + 0.1971963049208412, + -0.08916950506662782, + 0.0, + ], + [ + 0.253922991933277, + 0.006317558455476907, + 0.0, + ], + [ + 0.3081255793967473, + -0.09077591339602184, + 0.0, + ], + [ + 0.3646194671681309, + 0.005510616989843405, + 0.0, + ], + [ + 0.4185164091280256, + -0.0918398591757682, + 0.0, + ], + [ + 0.4701913192082958, + 0.01124911446365311, + 0.0, + ], + [ + 0.4222222222222225, + 0.1037749551350623, + 0.0, + ], + [ + 0.3165578285233138, + -0.2010429173546686, + 0.0, + ], + [ + 0.51294097640968, + -0.1461571739671005, + 0.0, + ], + [ + -0.07204502561708118, + 0.003996362274948255, + 0.0, + ], + [ + -0.1428703653664571, + -0.2133259091633978, + 0.0, + ], + [ + 0.0882666209765149, + -0.2041342216817793, + 0.0, + ], + [ + 0.1993083145407238, + 0.1033890310779473, + 0.0, + ], + [ + 0.6141673003725829, + -0.1500000000000002, + 0.0, + ], + [ + -0.2150687950126897, + -0.1499999999999999, + 0.0, + ], + [ + -0.1217096898957324, + -0.09916445375994822, + 0.0, + ], + [ + -0.2228047796821482, + 0.04659250577317239, + 0.0, + ], + [ + 0.6177454205875057, + 0.04994026324231237, + 0.0, + ], + [ + 0.5466426593556569, + -0.2259292528866248, + 0.0, + ], + [ + 0.5296132320729046, + -0.06139610197017452, + 0.0, + ], + [ + 0.628594204584287, + 0.1299147510310816, + 0.0, + ], + [ + -0.2286828846737035, + 0.1291590499816862, + 0.0, + ], + [ + -0.2256650626505246, + -0.2291340202289778, + 0.0, + ], + [ + -0.1550184885524905, + 0.001244361478090254, + 0.0, + ], + [ + 0.03088955984017527, + -0.1445718351398361, + 0.0, + ], + [ + 0.6299397697234258, + -0.2351858505773251, + 0.0, + ], + [ + 0.141299000533621, + -0.1452945975736307, + 0.0, + ], + [ + 0.5531073904611943, + 0.0116360736783649, + 0.0, + ], + ], + connectivity: [ + Tri3d3Connectivity( + [ + 30, + 49, + 44, + ], + ), + Tri3d3Connectivity( + [ + 30, + 44, + 42, + ], + ), + Tri3d3Connectivity( + [ + 46, + 49, + 33, + ], + ), + Tri3d3Connectivity( + [ + 44, + 49, + 46, + ], + ), + Tri3d3Connectivity( + [ + 41, + 57, + 34, + ], + ), + Tri3d3Connectivity( + [ + 34, + 57, + 52, + ], + ), + Tri3d3Connectivity( + [ + 10, + 60, + 33, + ], + ), + Tri3d3Connectivity( + [ + 33, + 60, + 50, + ], + ), + Tri3d3Connectivity( + [ + 35, + 48, + 47, + ], + ), + Tri3d3Connectivity( + [ + 51, + 57, + 41, + ], + ), + Tri3d3Connectivity( + [ + 47, + 48, + 45, + ], + ), + Tri3d3Connectivity( + [ + 45, + 48, + 31, + ], + ), + Tri3d3Connectivity( + [ + 28, + 61, + 55, + ], + ), + Tri3d3Connectivity( + [ + 33, + 50, + 46, + ], + ), + Tri3d3Connectivity( + [ + 43, + 45, + 31, + ], + ), + Tri3d3Connectivity( + [ + 33, + 49, + 9, + ], + ), + Tri3d3Connectivity( + [ + 9, + 49, + 8, + ], + ), + Tri3d3Connectivity( + [ + 17, + 48, + 35, + ], + ), + Tri3d3Connectivity( + [ + 55, + 61, + 50, + ], + ), + Tri3d3Connectivity( + [ + 34, + 52, + 5, + ], + ), + Tri3d3Connectivity( + [ + 23, + 36, + 22, + ], + ), + Tri3d3Connectivity( + [ + 17, + 35, + 16, + ], + ), + Tri3d3Connectivity( + [ + 38, + 51, + 41, + ], + ), + Tri3d3Connectivity( + [ + 37, + 38, + 32, + ], + ), + Tri3d3Connectivity( + [ + 8, + 49, + 30, + ], + ), + Tri3d3Connectivity( + [ + 31, + 54, + 43, + ], + ), + Tri3d3Connectivity( + [ + 21, + 37, + 32, + ], + ), + Tri3d3Connectivity( + [ + 36, + 37, + 22, + ], + ), + Tri3d3Connectivity( + [ + 46, + 47, + 45, + ], + ), + Tri3d3Connectivity( + [ + 44, + 46, + 45, + ], + ), + Tri3d3Connectivity( + [ + 36, + 51, + 37, + ], + ), + Tri3d3Connectivity( + [ + 10, + 33, + 9, + ], + ), + Tri3d3Connectivity( + [ + 6, + 34, + 5, + ], + ), + Tri3d3Connectivity( + [ + 5, + 52, + 4, + ], + ), + Tri3d3Connectivity( + [ + 38, + 41, + 40, + ], + ), + Tri3d3Connectivity( + [ + 37, + 51, + 38, + ], + ), + Tri3d3Connectivity( + [ + 30, + 53, + 7, + ], + ), + Tri3d3Connectivity( + [ + 18, + 48, + 17, + ], + ), + Tri3d3Connectivity( + [ + 31, + 48, + 18, + ], + ), + Tri3d3Connectivity( + [ + 6, + 53, + 34, + ], + ), + Tri3d3Connectivity( + [ + 20, + 54, + 19, + ], + ), + Tri3d3Connectivity( + [ + 44, + 45, + 43, + ], + ), + Tri3d3Connectivity( + [ + 38, + 40, + 39, + ], + ), + Tri3d3Connectivity( + [ + 43, + 54, + 39, + ], + ), + Tri3d3Connectivity( + [ + 39, + 54, + 32, + ], + ), + Tri3d3Connectivity( + [ + 32, + 54, + 20, + ], + ), + Tri3d3Connectivity( + [ + 19, + 54, + 31, + ], + ), + Tri3d3Connectivity( + [ + 22, + 37, + 21, + ], + ), + Tri3d3Connectivity( + [ + 38, + 39, + 32, + ], + ), + Tri3d3Connectivity( + [ + 7, + 53, + 6, + ], + ), + Tri3d3Connectivity( + [ + 42, + 44, + 43, + ], + ), + Tri3d3Connectivity( + [ + 8, + 30, + 7, + ], + ), + Tri3d3Connectivity( + [ + 19, + 31, + 18, + ], + ), + Tri3d3Connectivity( + [ + 21, + 32, + 20, + ], + ), + Tri3d3Connectivity( + [ + 40, + 42, + 39, + ], + ), + Tri3d3Connectivity( + [ + 42, + 43, + 39, + ], + ), + Tri3d3Connectivity( + [ + 51, + 65, + 57, + ], + ), + Tri3d3Connectivity( + [ + 14, + 28, + 13, + ], + ), + Tri3d3Connectivity( + [ + 26, + 29, + 25, + ], + ), + Tri3d3Connectivity( + [ + 13, + 55, + 12, + ], + ), + Tri3d3Connectivity( + [ + 50, + 61, + 46, + ], + ), + Tri3d3Connectivity( + [ + 27, + 56, + 26, + ], + ), + Tri3d3Connectivity( + [ + 25, + 58, + 24, + ], + ), + Tri3d3Connectivity( + [ + 15, + 59, + 14, + ], + ), + Tri3d3Connectivity( + [ + 28, + 55, + 13, + ], + ), + Tri3d3Connectivity( + [ + 46, + 61, + 47, + ], + ), + Tri3d3Connectivity( + [ + 11, + 60, + 10, + ], + ), + Tri3d3Connectivity( + [ + 26, + 56, + 29, + ], + ), + Tri3d3Connectivity( + [ + 14, + 59, + 28, + ], + ), + Tri3d3Connectivity( + [ + 29, + 58, + 25, + ], + ), + Tri3d3Connectivity( + [ + 56, + 57, + 29, + ], + ), + Tri3d3Connectivity( + [ + 52, + 57, + 56, + ], + ), + Tri3d3Connectivity( + [ + 4, + 64, + 0, + ], + ), + Tri3d3Connectivity( + [ + 16, + 62, + 2, + ], + ), + Tri3d3Connectivity( + [ + 3, + 63, + 23, + ], + ), + Tri3d3Connectivity( + [ + 47, + 69, + 35, + ], + ), + Tri3d3Connectivity( + [ + 0, + 64, + 27, + ], + ), + Tri3d3Connectivity( + [ + 2, + 62, + 15, + ], + ), + Tri3d3Connectivity( + [ + 24, + 63, + 3, + ], + ), + Tri3d3Connectivity( + [ + 34, + 66, + 41, + ], + ), + Tri3d3Connectivity( + [ + 57, + 65, + 29, + ], + ), + Tri3d3Connectivity( + [ + 36, + 65, + 51, + ], + ), + Tri3d3Connectivity( + [ + 55, + 67, + 12, + ], + ), + Tri3d3Connectivity( + [ + 1, + 67, + 11, + ], + ), + Tri3d3Connectivity( + [ + 35, + 62, + 16, + ], + ), + Tri3d3Connectivity( + [ + 23, + 63, + 36, + ], + ), + Tri3d3Connectivity( + [ + 52, + 64, + 4, + ], + ), + Tri3d3Connectivity( + [ + 58, + 65, + 36, + ], + ), + Tri3d3Connectivity( + [ + 42, + 68, + 30, + ], + ), + Tri3d3Connectivity( + [ + 60, + 67, + 55, + ], + ), + Tri3d3Connectivity( + [ + 30, + 68, + 53, + ], + ), + Tri3d3Connectivity( + [ + 53, + 66, + 34, + ], + ), + Tri3d3Connectivity( + [ + 41, + 66, + 40, + ], + ), + Tri3d3Connectivity( + [ + 53, + 68, + 66, + ], + ), + Tri3d3Connectivity( + [ + 56, + 64, + 52, + ], + ), + Tri3d3Connectivity( + [ + 66, + 68, + 40, + ], + ), + Tri3d3Connectivity( + [ + 36, + 63, + 58, + ], + ), + Tri3d3Connectivity( + [ + 59, + 62, + 35, + ], + ), + Tri3d3Connectivity( + [ + 40, + 68, + 42, + ], + ), + Tri3d3Connectivity( + [ + 50, + 60, + 55, + ], + ), + Tri3d3Connectivity( + [ + 59, + 69, + 28, + ], + ), + Tri3d3Connectivity( + [ + 12, + 67, + 1, + ], + ), + Tri3d3Connectivity( + [ + 35, + 69, + 59, + ], + ), + Tri3d3Connectivity( + [ + 27, + 64, + 56, + ], + ), + Tri3d3Connectivity( + [ + 15, + 62, + 59, + ], + ), + Tri3d3Connectivity( + [ + 58, + 63, + 24, + ], + ), + Tri3d3Connectivity( + [ + 29, + 65, + 58, + ], + ), + Tri3d3Connectivity( + [ + 28, + 69, + 61, + ], + ), + Tri3d3Connectivity( + [ + 11, + 67, + 60, + ], + ), + Tri3d3Connectivity( + [ + 61, + 69, + 47, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_sphere_tet4_large.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_sphere_tet4_large.snap new file mode 100644 index 00000000..4026026d --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_sphere_tet4_large.snap @@ -0,0 +1,5669 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 3.061616997868383e-17, + -7.498798913309288e-33, + 0.5, + ], + [ + 3.061616997868383e-17, + -7.498798913309288e-33, + -0.5, + ], + [ + 0.154508497187474, + -3.784366730434158e-17, + -0.4755282581475767, + ], + [ + 0.2938926261462368, + -7.198293278059974e-17, + -0.4045084971874735, + ], + [ + 0.4045084971874742, + -9.907600726170927e-17, + -0.293892626146236, + ], + [ + 0.475528258147577, + -1.164708318489093e-16, + -0.154508497187473, + ], + [ + 0.5, + -1.224646799147353e-16, + 7.657137397853899e-16, + ], + [ + 0.4755282581475767, + -1.164708318489092e-16, + 0.154508497187474, + ], + [ + 0.4045084971874738, + -9.907600726170918e-17, + 0.2938926261462365, + ], + [ + 0.293892626146237, + -7.198293278059977e-17, + 0.4045084971874734, + ], + [ + 0.1545084971874747, + -3.784366730434174e-17, + 0.4755282581475765, + ], + [ + 0.4158877395554504, + -0.1456713995105231, + 0.2362567066817436, + ], + [ + 0.4701087081244726, + -0.1467242552635264, + 0.0864279784728471, + ], + [ + -0.2135327492237171, + 0.4230691856321082, + -0.1594246818329769, + ], + [ + -0.06527347014796313, + 0.4354054887299242, + -0.2369840384471048, + ], + [ + -0.1105761127248973, + 0.4792250972061351, + -0.09009011878347795, + ], + [ + -0.2171401264421488, + 0.2630182939556128, + -0.3656111903831261, + ], + [ + -0.3129389181568985, + 0.1426003935360014, + -0.3629522851094445, + ], + [ + -0.1898749211721884, + 0.136005874832733, + -0.4420971797250444, + ], + [ + -0.4795080440716736, + -0.003607058400304855, + -0.1416298866774054, + ], + [ + -0.4824283135327282, + 0.1313862227260057, + -0.0007634001310251592, + ], + [ + -0.492441974008117, + -0.08523434251799264, + 0.01536258736393594, + ], + [ + -0.4715417055658828, + 0.06388285606164806, + 0.1535167763256676, + ], + [ + 0.3736096685824444, + 0.3140856024093442, + -0.1084714243516483, + ], + [ + 0.3669702284754484, + 0.2557265913455963, + -0.223465348301341, + ], + [ + 0.4613052348462779, + 0.1717146106377624, + -0.08781556124595459, + ], + [ + -0.1744988437259525, + 0.3780740344099235, + -0.276785436833858, + ], + [ + 0.3625674967793044, + -0.3438777533336737, + 0.01711435191218547, + ], + [ + 0.3928422312873109, + -0.2966405964342111, + -0.08763183134205545, + ], + [ + 0.2825486996149991, + -0.4035185950133297, + -0.08566782257266371, + ], + [ + 0.3062625439452245, + -0.3328106064314421, + -0.2131674328384504, + ], + [ + 0.4266346929460104, + 0.1255206167249146, + -0.2285331782299029, + ], + [ + -0.05840521080758159, + 0.2087875951424959, + -0.4505514082378782, + ], + [ + 0.1072423531354483, + 0.2535848861899275, + -0.4173652874761068, + ], + [ + -0.04867480031540353, + 0.336266957669498, + -0.366817798087764, + ], + [ + 0.3460581676121462, + 0.1432064098182582, + -0.3312637450972998, + ], + [ + 0.05866869708862188, + 0.1209351813562803, + -0.4815938806632069, + ], + [ + -0.1875855164576987, + 0.009663611073520088, + 0.4633770480249515, + ], + [ + -0.07992338805643126, + 0.09333614161515374, + 0.484665468864842, + ], + [ + -0.1551333458321017, + 0.4690451660794241, + 0.07700829298499592, + ], + [ + -0.1554562650065536, + 0.4217401426417582, + 0.2190173549167317, + ], + [ + -0.305658491191207, + 0.3602751108071889, + 0.1636298606476904, + ], + [ + -0.01777659482483113, + 0.4786205876807214, + 0.1435490359584301, + ], + [ + 0.4712185143078323, + 0.1449387500479391, + 0.08334188927580304, + ], + [ + -0.378429564077937, + -0.1861922174416518, + 0.2685582305496207, + ], + [ + -0.3091002004642938, + -0.08398722777945258, + 0.3839312590072027, + ], + [ + -0.2476065420366563, + -0.2613891919812399, + 0.3469390301710721, + ], + [ + -0.2540017330793385, + 0.3018913816983113, + 0.3071558452137562, + ], + [ + -0.3799269911193713, + 0.1887046854100105, + 0.2646620923428402, + ], + [ + -0.1953963676553522, + -0.1427048775483979, + 0.4375563705752565, + ], + [ + 0.2258128675215508, + 0.1439060472370772, + -0.4222553711088761, + ], + [ + 0.4296828761948912, + -0.2546787081569443, + 0.02261374618226409, + ], + [ + 0.4755611233366577, + -0.1361789262232188, + -0.07277992871298676, + ], + [ + -0.09348838214238962, + -0.08148467455006736, + -0.4843760628043753, + ], + [ + -0.213328291998831, + -0.08591182208752703, + -0.4439709434844387, + ], + [ + -0.1170261283798715, + -0.2203313768685405, + -0.4333116310966404, + ], + [ + 0.06134684609647635, + 0.46800121663068, + -0.1649588606477947, + ], + [ + 0.1639543628500442, + 0.4690757642426878, + -0.05555982633679173, + ], + [ + 0.00843739725818468, + 0.4999228628072177, + -0.002437533618923663, + ], + [ + -0.4468746911529405, + -0.1692957648903036, + -0.1471120470837486, + ], + [ + -0.4357984907948296, + -0.242905044002788, + -0.03281485972775747, + ], + [ + -0.3503392151362078, + -0.318890696082485, + -0.1599098442553618, + ], + [ + -0.3564658081992754, + -0.3505186556151023, + 0.008294555480481542, + ], + [ + -0.424834520568036, + -0.2370635215619693, + 0.11539721347747, + ], + [ + -0.4588384959510035, + -0.09473602941240569, + 0.1746205009859744, + ], + [ + 0.09639748129830845, + -0.4758362038975249, + 0.1195300491915542, + ], + [ + 0.1273432427329731, + -0.3923175246543383, + 0.2826139741402462, + ], + [ + 0.2413800981267285, + -0.397115286830191, + 0.1844860352278895, + ], + [ + 0.2946458610686576, + -0.2721922321809346, + 0.2984881995916582, + ], + [ + 0.1404535811823167, + -0.2558583136345826, + 0.4059671352180246, + ], + [ + -0.00163920396126154, + -0.351308516578924, + 0.35578032434283, + ], + [ + -0.265554004389228, + 0.4233630089754744, + -0.01564715258691496, + ], + [ + 0.3095250101084956, + 0.3910939609419863, + -0.03521053581023341, + ], + [ + 0.2128346859909538, + 0.4477520455284829, + 0.06495769518841904, + ], + [ + 0.1982115487412691, + -0.326051136577816, + -0.3231142805291989, + ], + [ + 0.0537955420986783, + -0.2736837442423576, + -0.4149737916878524, + ], + [ + 0.04886636004584515, + -0.3837014306235838, + -0.3168363788981388, + ], + [ + -0.1895445378039821, + 0.1950884833038641, + 0.4195394521029849, + ], + [ + -0.01943195425579273, + 0.2250193129386276, + 0.4460815037170099, + ], + [ + -0.2277964879586381, + -0.3149411509535779, + -0.3145168223000889, + ], + [ + -0.2210123819853276, + -0.4015070925403003, + -0.1998639078198122, + ], + [ + -0.09917628423182656, + -0.4169069072922044, + -0.2575901692573248, + ], + [ + -0.4047509315388036, + 0.0522776524002518, + -0.288866284772019, + ], + [ + -0.4209847065264581, + -0.09206223470829053, + -0.2535673910646785, + ], + [ + -0.05682048062296562, + -0.4945775157705429, + 0.0465243363844506, + ], + [ + -0.1026419931266927, + -0.4762748507500014, + -0.1123694255126539, + ], + [ + -0.1717929176835693, + -0.4695559795657088, + -0.002091766682493965, + ], + [ + -0.3023816283400289, + 0.3346328605886648, + -0.2158383641910768, + ], + [ + -0.331085440731693, + 0.3628788787999394, + -0.09328102838412254, + ], + [ + 0.09829287407843633, + -0.4851933542422143, + -0.07018489798090376, + ], + [ + 0.02767956800946586, + -0.4548076721302108, + -0.2058733175676442, + ], + [ + -0.4141194200145805, + 0.2551517821409662, + -0.115769918532736, + ], + [ + -0.3928101435363168, + 0.3092182625238692, + 0.009179175164344461, + ], + [ + -0.2726838667932122, + -0.1941572335735967, + -0.3714114664920154, + ], + [ + -0.3647678680505264, + -0.2011396023576733, + -0.2765633070406681, + ], + [ + -0.3377657002215724, + -0.08231503337353652, + -0.3593585494106749, + ], + [ + 0.1297840668903675, + 0.1824475751148293, + 0.4470670848050831, + ], + [ + 0.09017538415531026, + 0.3281983389944413, + 0.3662707337117341, + ], + [ + 0.2240428633501645, + 0.2352180879397128, + 0.3801016265261766, + ], + [ + -0.1861964590794329, + -0.4479004122791685, + 0.121309930782405, + ], + [ + -0.2008023599916325, + -0.3882185941062563, + 0.2428265541738643, + ], + [ + -0.05716602296350332, + -0.4471834149746891, + 0.2162383850987407, + ], + [ + 0.2748870161281802, + 0.3198938611106684, + 0.2685238275979507, + ], + [ + -0.3156074782600776, + -0.34797211465854, + 0.1711938289961953, + ], + [ + 0.3425173017528959, + 0.1476894361582884, + 0.3329710624771506, + ], + [ + 0.2432902179482652, + 0.1044354109361912, + 0.4241498730322508, + ], + [ + 0.3623685763017869, + -0.300789218317363, + 0.167972798550973, + ], + [ + 0.1392989817962232, + 0.4341303898929652, + 0.2052476510021917, + ], + [ + 0.1063368162035578, + 0.4826023602362944, + 0.07607524836665762, + ], + [ + -0.02641969431138974, + 0.4219951869131014, + 0.2668746184534402, + ], + [ + -0.4094741107804477, + -0.005555887680184298, + 0.2868799134004451, + ], + [ + -0.3145842000201001, + 0.07715183658812846, + 0.3808994292576354, + ], + [ + -0.2729024629436255, + 0.02888437650258808, + -0.4179592546090586, + ], + [ + -0.07596088844256259, + -0.3464737436166833, + -0.352400182195267, + ], + [ + -0.08930919520814745, + -0.1261784126849034, + 0.4755027611103759, + ], + [ + -0.1147143938441127, + 0.05623405158975593, + -0.4834028747191916, + ], + [ + -0.374586456294395, + 0.2105312985317507, + -0.2556590680952706, + ], + [ + 0.255847062166688, + -0.4258706209710642, + 0.05636040253932778, + ], + [ + -0.4327161001642869, + 0.2221724051704678, + 0.1157419502141743, + ], + [ + 0.4242258890236966, + -0.1200989598432338, + -0.2358148318631115, + ], + [ + 0.4018150853850618, + -0.2313073383959267, + -0.18719388975388, + ], + [ + 0.3189934635068028, + -0.2249009848453423, + -0.3125103474375355, + ], + [ + -0.1106368461503492, + 0.3397390720214876, + 0.3497668526545682, + ], + [ + 0.4367509884675619, + 0.1213281770901419, + 0.2110166996154351, + ], + [ + 0.1769525657303826, + -0.4159179330938155, + -0.2137757292407234, + ], + [ + 0.1019531936899382, + 0.3809450568189033, + -0.3073864180175573, + ], + [ + 0.2521882082575316, + 0.281232417643368, + -0.3275811882302189, + ], + [ + 0.4110888381422016, + 0.2832283775716202, + 0.0280651615538285, + ], + [ + 0.3036731660872533, + 0.3742963921602127, + 0.1329842810801028, + ], + [ + 0.3925777444760763, + 0.2452253403727389, + 0.1890694237076712, + ], + [ + 0.0658346330099029, + 0.1009538272846974, + 0.4852567628101878, + ], + [ + 0.2475009728709568, + 0.3938815208035738, + -0.1833047080611783, + ], + [ + 0.07347880262030809, + -0.1404459776831848, + 0.4742107051913739, + ], + [ + 0.2083154986325242, + -0.1686458085838958, + -0.4220938808802691, + ], + [ + 0.068726308224029, + -0.1408235292199574, + -0.4748109394021283, + ], + [ + -0.2532442537221255, + -0.4247921878148671, + -0.07361348468984726, + ], + [ + -0.1291014456888445, + -0.3573098748638944, + 0.3250576411127702, + ], + [ + -0.299757178470583, + 0.2013896436742175, + 0.3458147558681191, + ], + [ + 0.002624764945186355, + -0.2294938482786748, + 0.4442135569872076, + ], + [ + 0.2277162480366098, + -0.141312810952596, + 0.4221089904761625, + ], + [ + -0.2643902379011895, + -0.4220538364603005, + 0.04436621723444877, + ], + [ + -0.4527369540746685, + 0.1349879098594029, + -0.1637300052127932, + ], + [ + -0.1144144519849817, + -0.2496379463368161, + 0.4178399561144353, + ], + [ + 0.3509952058893313, + -0.1210073567762881, + 0.3349023515126791, + ], + [ + 0.3328721682286099, + -0.1106925026354772, + -0.3562910179601485, + ], + [ + 1.748601263784622e-15, + 3.108624468950438e-15, + -1.305379415672547e-16, + ], + [ + -0.117471851934148, + -0.2232040366554859, + -0.005917359644382421, + ], + [ + -0.02438383664223391, + -0.1353697319983022, + 0.2116042602130914, + ], + [ + -0.1674842517074833, + 0.06961830496095356, + 0.1757443446507982, + ], + [ + 0.1579209094177677, + 0.03997913444201651, + 0.1942807376216578, + ], + [ + 0.07955980011569996, + 0.2398783270948981, + 0.01017436484260566, + ], + [ + -0.1947826778401475, + -0.03592946311611307, + -0.1565332383633062, + ], + [ + -0.1575019686626051, + 0.1877365807676774, + -0.05068288195810759, + ], + [ + 0.2002423407017843, + 0.04266007576793104, + -0.1497154667212567, + ], + [ + 0.200557979246442, + -0.1515343887716993, + 0.01021892869771939, + ], + [ + 0.04539936267032788, + -0.1614803521552167, + -0.1888388395712138, + ], + [ + -0.01721612018858096, + 0.1105298503688769, + -0.2327489309628623, + ], + [ + 0.2614768846965055, + 0.1322416899798564, + 0.03312822632161846, + ], + [ + -0.2735631047306224, + -0.07533865859580866, + 0.04648105309563219, + ], + [ + 0.006643782745309607, + 0.197176868533288, + 0.2120981002375384, + ], + [ + 0.05738836060359032, + -0.2768597847475529, + 0.08733026596941446, + ], + [ + 0.133698450802934, + 0.2263059491266006, + -0.1793419126697154, + ], + [ + -0.03041979051796079, + 0.03277218087597655, + 0.3075037983320426, + ], + [ + -0.1979852524082856, + 0.1351032600121258, + -0.2210062768128836, + ], + [ + -0.3086980050813251, + 0.07654938630148556, + -0.05828634079637307, + ], + [ + 0.2446334571000572, + -0.1357940507027747, + -0.1686201858252507, + ], + [ + 0.1700829903085172, + -0.1550599028841939, + 0.2034304863053825, + ], + [ + -0.07078305573553687, + -0.05904907877908984, + -0.2977432565933854, + ], + [ + 0.01954128570542114, + -0.3134242949874317, + -0.08874955310559728, + ], + [ + -0.1350979999888379, + -0.2094594132639445, + -0.1913574739221787, + ], + [ + -0.02885063710702439, + 0.2930610100380727, + -0.1275806702427836, + ], + [ + 0.3015952571304522, + -0.0315559650318737, + 0.1053907209105493, + ], + [ + -0.1959758523812988, + -0.2010965478519028, + 0.1651641866277269, + ], + [ + 0.1116789163384611, + -0.02645331680204203, + -0.297143663807217, + ], + [ + -0.08340873537147073, + 0.2965520156844182, + 0.08195250477364069, + ], + [ + -0.1688758668862578, + -0.06929399942881725, + 0.2822008589230531, + ], + [ + 0.3315407076868924, + -0.02946855233631751, + -0.06438148382605197, + ], + [ + -0.2698862334916184, + 0.1729099717207509, + 0.08087058186417279, + ], + [ + -0.1598414574651499, + 0.02958208958139151, + -0.01147013765126415, + ], + [ + -0.1054207173356558, + -0.08926446308836686, + 0.08125394721603997, + ], + [ + 0.03281198942752863, + -0.1592019864705706, + -0.02489382248092743, + ], + [ + 0.1624599381124119, + 0.006474709392367162, + 0.004286603517292232, + ], + [ + -0.06356940689291687, + 0.1319684339212275, + 0.06860866912820228, + ], + ], + connectivity: [ + Tet4Connectivity( + [ + 149, + 157, + 150, + 159, + ], + ), + Tet4Connectivity( + [ + 150, + 157, + 102, + 159, + ], + ), + Tet4Connectivity( + [ + 147, + 162, + 132, + 166, + ], + ), + Tet4Connectivity( + [ + 145, + 150, + 153, + 161, + ], + ), + Tet4Connectivity( + [ + 145, + 153, + 150, + 181, + ], + ), + Tet4Connectivity( + [ + 149, + 102, + 157, + 159, + ], + ), + Tet4Connectivity( + [ + 145, + 156, + 150, + 161, + ], + ), + Tet4Connectivity( + [ + 146, + 61, + 158, + 169, + ], + ), + Tet4Connectivity( + [ + 152, + 156, + 150, + 182, + ], + ), + Tet4Connectivity( + [ + 150, + 156, + 152, + 170, + ], + ), + Tet4Connectivity( + [ + 145, + 153, + 156, + 161, + ], + ), + Tet4Connectivity( + [ + 145, + 147, + 162, + 179, + ], + ), + Tet4Connectivity( + [ + 132, + 162, + 10, + 166, + ], + ), + Tet4Connectivity( + [ + 145, + 147, + 149, + 162, + ], + ), + Tet4Connectivity( + [ + 145, + 150, + 156, + 182, + ], + ), + Tet4Connectivity( + [ + 146, + 158, + 151, + 169, + ], + ), + Tet4Connectivity( + [ + 154, + 165, + 29, + 168, + ], + ), + Tet4Connectivity( + [ + 153, + 155, + 145, + 156, + ], + ), + Tet4Connectivity( + [ + 10, + 162, + 149, + 166, + ], + ), + Tet4Connectivity( + [ + 145, + 156, + 152, + 182, + ], + ), + Tet4Connectivity( + [ + 60, + 146, + 61, + 158, + ], + ), + Tet4Connectivity( + [ + 72, + 157, + 150, + 161, + ], + ), + Tet4Connectivity( + [ + 151, + 156, + 145, + 167, + ], + ), + Tet4Connectivity( + [ + 60, + 62, + 146, + 158, + ], + ), + Tet4Connectivity( + [ + 99, + 160, + 146, + 172, + ], + ), + Tet4Connectivity( + [ + 145, + 179, + 162, + 182, + ], + ), + Tet4Connectivity( + [ + 149, + 145, + 162, + 182, + ], + ), + Tet4Connectivity( + [ + 151, + 145, + 155, + 167, + ], + ), + Tet4Connectivity( + [ + 128, + 102, + 150, + 157, + ], + ), + Tet4Connectivity( + [ + 124, + 165, + 155, + 168, + ], + ), + Tet4Connectivity( + [ + 30, + 124, + 29, + 165, + ], + ), + Tet4Connectivity( + [ + 155, + 156, + 153, + 173, + ], + ), + Tet4Connectivity( + [ + 60, + 62, + 61, + 146, + ], + ), + Tet4Connectivity( + [ + 145, + 156, + 155, + 167, + ], + ), + Tet4Connectivity( + [ + 145, + 149, + 147, + 166, + ], + ), + Tet4Connectivity( + [ + 124, + 29, + 165, + 168, + ], + ), + Tet4Connectivity( + [ + 145, + 166, + 147, + 180, + ], + ), + Tet4Connectivity( + [ + 72, + 23, + 157, + 161, + ], + ), + Tet4Connectivity( + [ + 96, + 149, + 105, + 162, + ], + ), + Tet4Connectivity( + [ + 105, + 149, + 10, + 162, + ], + ), + Tet4Connectivity( + [ + 153, + 157, + 24, + 161, + ], + ), + Tet4Connectivity( + [ + 29, + 160, + 154, + 168, + ], + ), + Tet4Connectivity( + [ + 129, + 123, + 149, + 157, + ], + ), + Tet4Connectivity( + [ + 26, + 152, + 163, + 170, + ], + ), + Tet4Connectivity( + [ + 145, + 149, + 166, + 181, + ], + ), + Tet4Connectivity( + [ + 145, + 166, + 180, + 181, + ], + ), + Tet4Connectivity( + [ + 94, + 151, + 59, + 169, + ], + ), + Tet4Connectivity( + [ + 139, + 132, + 10, + 166, + ], + ), + Tet4Connectivity( + [ + 146, + 145, + 151, + 179, + ], + ), + Tet4Connectivity( + [ + 114, + 132, + 138, + 147, + ], + ), + Tet4Connectivity( + [ + 146, + 151, + 145, + 180, + ], + ), + Tet4Connectivity( + [ + 59, + 60, + 61, + 158, + ], + ), + Tet4Connectivity( + [ + 4, + 153, + 144, + 165, + ], + ), + Tet4Connectivity( + [ + 151, + 155, + 145, + 180, + ], + ), + Tet4Connectivity( + [ + 136, + 147, + 101, + 172, + ], + ), + Tet4Connectivity( + [ + 107, + 150, + 102, + 159, + ], + ), + Tet4Connectivity( + [ + 23, + 24, + 157, + 161, + ], + ), + Tet4Connectivity( + [ + 150, + 181, + 149, + 182, + ], + ), + Tet4Connectivity( + [ + 47, + 159, + 148, + 174, + ], + ), + Tet4Connectivity( + [ + 102, + 149, + 98, + 159, + ], + ), + Tet4Connectivity( + [ + 13, + 152, + 26, + 170, + ], + ), + Tet4Connectivity( + [ + 34, + 26, + 163, + 170, + ], + ), + Tet4Connectivity( + [ + 162, + 179, + 148, + 182, + ], + ), + Tet4Connectivity( + [ + 47, + 174, + 148, + 177, + ], + ), + Tet4Connectivity( + [ + 72, + 150, + 57, + 161, + ], + ), + Tet4Connectivity( + [ + 96, + 105, + 10, + 162, + ], + ), + Tet4Connectivity( + [ + 50, + 153, + 161, + 173, + ], + ), + Tet4Connectivity( + [ + 26, + 152, + 87, + 163, + ], + ), + Tet4Connectivity( + [ + 156, + 163, + 18, + 167, + ], + ), + Tet4Connectivity( + [ + 132, + 147, + 114, + 162, + ], + ), + Tet4Connectivity( + [ + 145, + 178, + 151, + 179, + ], + ), + Tet4Connectivity( + [ + 129, + 149, + 102, + 157, + ], + ), + Tet4Connectivity( + [ + 72, + 128, + 150, + 157, + ], + ), + Tet4Connectivity( + [ + 147, + 160, + 101, + 172, + ], + ), + Tet4Connectivity( + [ + 153, + 145, + 155, + 181, + ], + ), + Tet4Connectivity( + [ + 136, + 70, + 101, + 147, + ], + ), + Tet4Connectivity( + [ + 123, + 149, + 157, + 171, + ], + ), + Tet4Connectivity( + [ + 144, + 165, + 153, + 173, + ], + ), + Tet4Connectivity( + [ + 34, + 163, + 156, + 170, + ], + ), + Tet4Connectivity( + [ + 152, + 156, + 145, + 178, + ], + ), + Tet4Connectivity( + [ + 139, + 10, + 149, + 166, + ], + ), + Tet4Connectivity( + [ + 50, + 153, + 35, + 161, + ], + ), + Tet4Connectivity( + [ + 67, + 154, + 160, + 166, + ], + ), + Tet4Connectivity( + [ + 59, + 158, + 151, + 164, + ], + ), + Tet4Connectivity( + [ + 84, + 86, + 99, + 146, + ], + ), + Tet4Connectivity( + [ + 149, + 162, + 147, + 166, + ], + ), + Tet4Connectivity( + [ + 154, + 180, + 166, + 181, + ], + ), + Tet4Connectivity( + [ + 132, + 69, + 138, + 147, + ], + ), + Tet4Connectivity( + [ + 25, + 24, + 31, + 153, + ], + ), + Tet4Connectivity( + [ + 145, + 179, + 146, + 180, + ], + ), + Tet4Connectivity( + [ + 10, + 130, + 96, + 162, + ], + ), + Tet4Connectivity( + [ + 84, + 146, + 99, + 160, + ], + ), + Tet4Connectivity( + [ + 123, + 104, + 129, + 149, + ], + ), + Tet4Connectivity( + [ + 47, + 77, + 137, + 148, + ], + ), + Tet4Connectivity( + [ + 8, + 149, + 123, + 171, + ], + ), + Tet4Connectivity( + [ + 62, + 146, + 158, + 172, + ], + ), + Tet4Connectivity( + [ + 72, + 128, + 73, + 150, + ], + ), + Tet4Connectivity( + [ + 24, + 153, + 25, + 157, + ], + ), + Tet4Connectivity( + [ + 101, + 147, + 70, + 160, + ], + ), + Tet4Connectivity( + [ + 87, + 26, + 13, + 152, + ], + ), + Tet4Connectivity( + [ + 47, + 77, + 148, + 159, + ], + ), + Tet4Connectivity( + [ + 151, + 145, + 156, + 178, + ], + ), + Tet4Connectivity( + [ + 107, + 108, + 150, + 174, + ], + ), + Tet4Connectivity( + [ + 86, + 146, + 84, + 168, + ], + ), + Tet4Connectivity( + [ + 128, + 102, + 107, + 150, + ], + ), + Tet4Connectivity( + [ + 151, + 146, + 169, + 180, + ], + ), + Tet4Connectivity( + [ + 74, + 155, + 124, + 165, + ], + ), + Tet4Connectivity( + [ + 96, + 98, + 105, + 149, + ], + ), + Tet4Connectivity( + [ + 99, + 101, + 160, + 172, + ], + ), + Tet4Connectivity( + [ + 30, + 74, + 124, + 165, + ], + ), + Tet4Connectivity( + [ + 145, + 149, + 181, + 182, + ], + ), + Tet4Connectivity( + [ + 148, + 162, + 111, + 175, + ], + ), + Tet4Connectivity( + [ + 132, + 69, + 147, + 166, + ], + ), + Tet4Connectivity( + [ + 137, + 47, + 148, + 177, + ], + ), + Tet4Connectivity( + [ + 86, + 140, + 99, + 146, + ], + ), + Tet4Connectivity( + [ + 4, + 3, + 144, + 153, + ], + ), + Tet4Connectivity( + [ + 96, + 98, + 149, + 159, + ], + ), + Tet4Connectivity( + [ + 150, + 161, + 156, + 170, + ], + ), + Tet4Connectivity( + [ + 145, + 180, + 155, + 181, + ], + ), + Tet4Connectivity( + [ + 61, + 94, + 59, + 169, + ], + ), + Tet4Connectivity( + [ + 96, + 159, + 149, + 162, + ], + ), + Tet4Connectivity( + [ + 151, + 169, + 155, + 180, + ], + ), + Tet4Connectivity( + [ + 150, + 157, + 149, + 181, + ], + ), + Tet4Connectivity( + [ + 33, + 156, + 36, + 173, + ], + ), + Tet4Connectivity( + [ + 143, + 149, + 8, + 171, + ], + ), + Tet4Connectivity( + [ + 145, + 181, + 150, + 182, + ], + ), + Tet4Connectivity( + [ + 155, + 165, + 153, + 181, + ], + ), + Tet4Connectivity( + [ + 57, + 161, + 150, + 170, + ], + ), + Tet4Connectivity( + [ + 25, + 153, + 31, + 176, + ], + ), + Tet4Connectivity( + [ + 153, + 157, + 150, + 181, + ], + ), + Tet4Connectivity( + [ + 156, + 167, + 1, + 173, + ], + ), + Tet4Connectivity( + [ + 73, + 128, + 107, + 150, + ], + ), + Tet4Connectivity( + [ + 69, + 70, + 147, + 166, + ], + ), + Tet4Connectivity( + [ + 140, + 146, + 62, + 172, + ], + ), + Tet4Connectivity( + [ + 91, + 163, + 152, + 164, + ], + ), + Tet4Connectivity( + [ + 18, + 163, + 112, + 167, + ], + ), + Tet4Connectivity( + [ + 149, + 159, + 150, + 182, + ], + ), + Tet4Connectivity( + [ + 95, + 151, + 93, + 167, + ], + ), + Tet4Connectivity( + [ + 50, + 35, + 153, + 173, + ], + ), + Tet4Connectivity( + [ + 66, + 160, + 147, + 166, + ], + ), + Tet4Connectivity( + [ + 71, + 152, + 13, + 170, + ], + ), + Tet4Connectivity( + [ + 61, + 62, + 135, + 146, + ], + ), + Tet4Connectivity( + [ + 154, + 165, + 180, + 181, + ], + ), + Tet4Connectivity( + [ + 82, + 83, + 151, + 164, + ], + ), + Tet4Connectivity( + [ + 152, + 163, + 156, + 178, + ], + ), + Tet4Connectivity( + [ + 8, + 143, + 9, + 149, + ], + ), + Tet4Connectivity( + [ + 3, + 144, + 153, + 173, + ], + ), + Tet4Connectivity( + [ + 77, + 148, + 159, + 162, + ], + ), + Tet4Connectivity( + [ + 70, + 147, + 66, + 160, + ], + ), + Tet4Connectivity( + [ + 150, + 157, + 153, + 161, + ], + ), + Tet4Connectivity( + [ + 112, + 163, + 151, + 167, + ], + ), + Tet4Connectivity( + [ + 77, + 111, + 148, + 162, + ], + ), + Tet4Connectivity( + [ + 155, + 180, + 165, + 181, + ], + ), + Tet4Connectivity( + [ + 110, + 158, + 148, + 175, + ], + ), + Tet4Connectivity( + [ + 73, + 57, + 72, + 150, + ], + ), + Tet4Connectivity( + [ + 117, + 154, + 29, + 160, + ], + ), + Tet4Connectivity( + [ + 114, + 138, + 142, + 147, + ], + ), + Tet4Connectivity( + [ + 33, + 36, + 50, + 173, + ], + ), + Tet4Connectivity( + [ + 25, + 157, + 153, + 176, + ], + ), + Tet4Connectivity( + [ + 76, + 168, + 155, + 169, + ], + ), + Tet4Connectivity( + [ + 86, + 135, + 140, + 146, + ], + ), + Tet4Connectivity( + [ + 22, + 148, + 158, + 177, + ], + ), + Tet4Connectivity( + [ + 115, + 156, + 18, + 167, + ], + ), + Tet4Connectivity( + [ + 76, + 155, + 113, + 169, + ], + ), + Tet4Connectivity( + [ + 107, + 108, + 73, + 150, + ], + ), + Tet4Connectivity( + [ + 136, + 142, + 147, + 172, + ], + ), + Tet4Connectivity( + [ + 107, + 42, + 108, + 174, + ], + ), + Tet4Connectivity( + [ + 149, + 162, + 159, + 182, + ], + ), + Tet4Connectivity( + [ + 66, + 147, + 70, + 166, + ], + ), + Tet4Connectivity( + [ + 70, + 138, + 69, + 147, + ], + ), + Tet4Connectivity( + [ + 102, + 129, + 104, + 149, + ], + ), + Tet4Connectivity( + [ + 71, + 152, + 170, + 174, + ], + ), + Tet4Connectivity( + [ + 139, + 10, + 9, + 149, + ], + ), + Tet4Connectivity( + [ + 143, + 166, + 149, + 171, + ], + ), + Tet4Connectivity( + [ + 156, + 163, + 151, + 178, + ], + ), + Tet4Connectivity( + [ + 150, + 159, + 107, + 174, + ], + ), + Tet4Connectivity( + [ + 104, + 123, + 8, + 149, + ], + ), + Tet4Connectivity( + [ + 1, + 156, + 115, + 167, + ], + ), + Tet4Connectivity( + [ + 9, + 149, + 143, + 166, + ], + ), + Tet4Connectivity( + [ + 61, + 146, + 135, + 169, + ], + ), + Tet4Connectivity( + [ + 87, + 152, + 91, + 163, + ], + ), + Tet4Connectivity( + [ + 34, + 156, + 161, + 170, + ], + ), + Tet4Connectivity( + [ + 3, + 153, + 35, + 173, + ], + ), + Tet4Connectivity( + [ + 67, + 154, + 117, + 160, + ], + ), + Tet4Connectivity( + [ + 23, + 24, + 25, + 157, + ], + ), + Tet4Connectivity( + [ + 146, + 160, + 84, + 168, + ], + ), + Tet4Connectivity( + [ + 112, + 151, + 95, + 167, + ], + ), + Tet4Connectivity( + [ + 36, + 156, + 1, + 173, + ], + ), + Tet4Connectivity( + [ + 72, + 57, + 131, + 161, + ], + ), + Tet4Connectivity( + [ + 124, + 155, + 76, + 168, + ], + ), + Tet4Connectivity( + [ + 18, + 156, + 32, + 163, + ], + ), + Tet4Connectivity( + [ + 51, + 154, + 106, + 171, + ], + ), + Tet4Connectivity( + [ + 37, + 111, + 162, + 175, + ], + ), + Tet4Connectivity( + [ + 135, + 86, + 85, + 146, + ], + ), + Tet4Connectivity( + [ + 28, + 165, + 154, + 176, + ], + ), + Tet4Connectivity( + [ + 16, + 34, + 26, + 163, + ], + ), + Tet4Connectivity( + [ + 35, + 153, + 24, + 161, + ], + ), + Tet4Connectivity( + [ + 51, + 28, + 154, + 176, + ], + ), + Tet4Connectivity( + [ + 10, + 105, + 9, + 149, + ], + ), + Tet4Connectivity( + [ + 106, + 154, + 67, + 166, + ], + ), + Tet4Connectivity( + [ + 88, + 91, + 87, + 152, + ], + ), + Tet4Connectivity( + [ + 104, + 98, + 102, + 149, + ], + ), + Tet4Connectivity( + [ + 59, + 94, + 83, + 151, + ], + ), + Tet4Connectivity( + [ + 99, + 146, + 140, + 172, + ], + ), + Tet4Connectivity( + [ + 31, + 153, + 4, + 176, + ], + ), + Tet4Connectivity( + [ + 93, + 167, + 151, + 169, + ], + ), + Tet4Connectivity( + [ + 135, + 62, + 140, + 146, + ], + ), + Tet4Connectivity( + [ + 77, + 111, + 137, + 148, + ], + ), + Tet4Connectivity( + [ + 117, + 160, + 29, + 168, + ], + ), + Tet4Connectivity( + [ + 29, + 154, + 28, + 165, + ], + ), + Tet4Connectivity( + [ + 71, + 88, + 152, + 177, + ], + ), + Tet4Connectivity( + [ + 85, + 146, + 86, + 168, + ], + ), + Tet4Connectivity( + [ + 145, + 147, + 179, + 180, + ], + ), + Tet4Connectivity( + [ + 24, + 35, + 31, + 153, + ], + ), + Tet4Connectivity( + [ + 34, + 156, + 33, + 161, + ], + ), + Tet4Connectivity( + [ + 155, + 165, + 133, + 173, + ], + ), + Tet4Connectivity( + [ + 139, + 149, + 9, + 166, + ], + ), + Tet4Connectivity( + [ + 82, + 151, + 112, + 163, + ], + ), + Tet4Connectivity( + [ + 110, + 22, + 148, + 158, + ], + ), + Tet4Connectivity( + [ + 58, + 150, + 108, + 174, + ], + ), + Tet4Connectivity( + [ + 113, + 155, + 55, + 169, + ], + ), + Tet4Connectivity( + [ + 58, + 57, + 108, + 150, + ], + ), + Tet4Connectivity( + [ + 57, + 150, + 58, + 170, + ], + ), + Tet4Connectivity( + [ + 133, + 155, + 74, + 165, + ], + ), + Tet4Connectivity( + [ + 70, + 136, + 142, + 147, + ], + ), + Tet4Connectivity( + [ + 146, + 168, + 85, + 169, + ], + ), + Tet4Connectivity( + [ + 114, + 162, + 147, + 175, + ], + ), + Tet4Connectivity( + [ + 108, + 57, + 73, + 150, + ], + ), + Tet4Connectivity( + [ + 100, + 136, + 101, + 172, + ], + ), + Tet4Connectivity( + [ + 31, + 35, + 4, + 153, + ], + ), + Tet4Connectivity( + [ + 70, + 142, + 138, + 147, + ], + ), + Tet4Connectivity( + [ + 1, + 36, + 115, + 156, + ], + ), + Tet4Connectivity( + [ + 87, + 13, + 88, + 152, + ], + ), + Tet4Connectivity( + [ + 155, + 167, + 156, + 173, + ], + ), + Tet4Connectivity( + [ + 101, + 99, + 100, + 172, + ], + ), + Tet4Connectivity( + [ + 16, + 156, + 34, + 163, + ], + ), + Tet4Connectivity( + [ + 156, + 161, + 153, + 173, + ], + ), + Tet4Connectivity( + [ + 105, + 98, + 104, + 149, + ], + ), + Tet4Connectivity( + [ + 146, + 160, + 147, + 172, + ], + ), + Tet4Connectivity( + [ + 147, + 166, + 160, + 180, + ], + ), + Tet4Connectivity( + [ + 155, + 167, + 55, + 169, + ], + ), + Tet4Connectivity( + [ + 142, + 147, + 172, + 175, + ], + ), + Tet4Connectivity( + [ + 50, + 35, + 126, + 161, + ], + ), + Tet4Connectivity( + [ + 19, + 158, + 59, + 164, + ], + ), + Tet4Connectivity( + [ + 77, + 37, + 111, + 162, + ], + ), + Tet4Connectivity( + [ + 82, + 95, + 112, + 151, + ], + ), + Tet4Connectivity( + [ + 151, + 163, + 82, + 164, + ], + ), + Tet4Connectivity( + [ + 106, + 154, + 166, + 171, + ], + ), + Tet4Connectivity( + [ + 4, + 35, + 3, + 153, + ], + ), + Tet4Connectivity( + [ + 55, + 113, + 75, + 155, + ], + ), + Tet4Connectivity( + [ + 142, + 114, + 147, + 175, + ], + ), + Tet4Connectivity( + [ + 50, + 3, + 35, + 173, + ], + ), + Tet4Connectivity( + [ + 91, + 164, + 152, + 177, + ], + ), + Tet4Connectivity( + [ + 71, + 88, + 13, + 152, + ], + ), + Tet4Connectivity( + [ + 153, + 165, + 4, + 176, + ], + ), + Tet4Connectivity( + [ + 94, + 93, + 95, + 151, + ], + ), + Tet4Connectivity( + [ + 47, + 122, + 77, + 159, + ], + ), + Tet4Connectivity( + [ + 122, + 159, + 47, + 174, + ], + ), + Tet4Connectivity( + [ + 95, + 93, + 54, + 167, + ], + ), + Tet4Connectivity( + [ + 76, + 124, + 74, + 155, + ], + ), + Tet4Connectivity( + [ + 110, + 44, + 158, + 175, + ], + ), + Tet4Connectivity( + [ + 29, + 28, + 30, + 165, + ], + ), + Tet4Connectivity( + [ + 94, + 93, + 151, + 169, + ], + ), + Tet4Connectivity( + [ + 71, + 13, + 15, + 170, + ], + ), + Tet4Connectivity( + [ + 117, + 106, + 27, + 154, + ], + ), + Tet4Connectivity( + [ + 95, + 82, + 83, + 151, + ], + ), + Tet4Connectivity( + [ + 44, + 64, + 110, + 158, + ], + ), + Tet4Connectivity( + [ + 82, + 19, + 83, + 164, + ], + ), + Tet4Connectivity( + [ + 62, + 158, + 63, + 172, + ], + ), + Tet4Connectivity( + [ + 152, + 174, + 71, + 177, + ], + ), + Tet4Connectivity( + [ + 77, + 159, + 78, + 162, + ], + ), + Tet4Connectivity( + [ + 75, + 55, + 155, + 167, + ], + ), + Tet4Connectivity( + [ + 95, + 83, + 94, + 151, + ], + ), + Tet4Connectivity( + [ + 44, + 172, + 158, + 175, + ], + ), + Tet4Connectivity( + [ + 54, + 112, + 95, + 167, + ], + ), + Tet4Connectivity( + [ + 128, + 129, + 102, + 157, + ], + ), + Tet4Connectivity( + [ + 154, + 168, + 160, + 180, + ], + ), + Tet4Connectivity( + [ + 57, + 56, + 161, + 170, + ], + ), + Tet4Connectivity( + [ + 71, + 170, + 15, + 174, + ], + ), + Tet4Connectivity( + [ + 84, + 99, + 101, + 160, + ], + ), + Tet4Connectivity( + [ + 27, + 28, + 29, + 154, + ], + ), + Tet4Connectivity( + [ + 113, + 76, + 75, + 155, + ], + ), + Tet4Connectivity( + [ + 137, + 148, + 48, + 177, + ], + ), + Tet4Connectivity( + [ + 72, + 127, + 128, + 157, + ], + ), + Tet4Connectivity( + [ + 58, + 170, + 150, + 174, + ], + ), + Tet4Connectivity( + [ + 147, + 160, + 146, + 179, + ], + ), + Tet4Connectivity( + [ + 72, + 131, + 23, + 161, + ], + ), + Tet4Connectivity( + [ + 51, + 52, + 28, + 176, + ], + ), + Tet4Connectivity( + [ + 48, + 148, + 22, + 177, + ], + ), + Tet4Connectivity( + [ + 117, + 67, + 106, + 154, + ], + ), + Tet4Connectivity( + [ + 115, + 32, + 18, + 156, + ], + ), + Tet4Connectivity( + [ + 80, + 61, + 135, + 169, + ], + ), + Tet4Connectivity( + [ + 75, + 155, + 133, + 173, + ], + ), + Tet4Connectivity( + [ + 69, + 66, + 70, + 166, + ], + ), + Tet4Connectivity( + [ + 43, + 171, + 157, + 176, + ], + ), + Tet4Connectivity( + [ + 151, + 167, + 155, + 169, + ], + ), + Tet4Connectivity( + [ + 145, + 152, + 178, + 182, + ], + ), + Tet4Connectivity( + [ + 107, + 159, + 109, + 174, + ], + ), + Tet4Connectivity( + [ + 32, + 156, + 16, + 163, + ], + ), + Tet4Connectivity( + [ + 72, + 23, + 127, + 157, + ], + ), + Tet4Connectivity( + [ + 122, + 47, + 40, + 174, + ], + ), + Tet4Connectivity( + [ + 34, + 161, + 125, + 170, + ], + ), + Tet4Connectivity( + [ + 18, + 32, + 16, + 163, + ], + ), + Tet4Connectivity( + [ + 27, + 106, + 51, + 154, + ], + ), + Tet4Connectivity( + [ + 60, + 63, + 62, + 158, + ], + ), + Tet4Connectivity( + [ + 117, + 27, + 29, + 154, + ], + ), + Tet4Connectivity( + [ + 42, + 107, + 109, + 174, + ], + ), + Tet4Connectivity( + [ + 22, + 158, + 164, + 177, + ], + ), + Tet4Connectivity( + [ + 132, + 139, + 69, + 166, + ], + ), + Tet4Connectivity( + [ + 47, + 41, + 174, + 177, + ], + ), + Tet4Connectivity( + [ + 139, + 9, + 143, + 166, + ], + ), + Tet4Connectivity( + [ + 121, + 133, + 74, + 165, + ], + ), + Tet4Connectivity( + [ + 34, + 33, + 125, + 161, + ], + ), + Tet4Connectivity( + [ + 115, + 18, + 112, + 167, + ], + ), + Tet4Connectivity( + [ + 75, + 74, + 133, + 155, + ], + ), + Tet4Connectivity( + [ + 146, + 172, + 147, + 179, + ], + ), + Tet4Connectivity( + [ + 96, + 78, + 159, + 162, + ], + ), + Tet4Connectivity( + [ + 8, + 9, + 104, + 149, + ], + ), + Tet4Connectivity( + [ + 51, + 28, + 27, + 154, + ], + ), + Tet4Connectivity( + [ + 137, + 48, + 47, + 177, + ], + ), + Tet4Connectivity( + [ + 156, + 163, + 152, + 170, + ], + ), + Tet4Connectivity( + [ + 51, + 106, + 12, + 171, + ], + ), + Tet4Connectivity( + [ + 133, + 165, + 144, + 173, + ], + ), + Tet4Connectivity( + [ + 111, + 110, + 148, + 175, + ], + ), + Tet4Connectivity( + [ + 97, + 102, + 98, + 159, + ], + ), + Tet4Connectivity( + [ + 160, + 166, + 154, + 180, + ], + ), + Tet4Connectivity( + [ + 96, + 130, + 78, + 162, + ], + ), + Tet4Connectivity( + [ + 9, + 105, + 104, + 149, + ], + ), + Tet4Connectivity( + [ + 48, + 137, + 111, + 148, + ], + ), + Tet4Connectivity( + [ + 32, + 34, + 16, + 156, + ], + ), + Tet4Connectivity( + [ + 58, + 108, + 42, + 174, + ], + ), + Tet4Connectivity( + [ + 48, + 110, + 22, + 148, + ], + ), + Tet4Connectivity( + [ + 148, + 174, + 159, + 182, + ], + ), + Tet4Connectivity( + [ + 123, + 157, + 43, + 171, + ], + ), + Tet4Connectivity( + [ + 71, + 92, + 88, + 177, + ], + ), + Tet4Connectivity( + [ + 115, + 36, + 32, + 156, + ], + ), + Tet4Connectivity( + [ + 110, + 64, + 22, + 158, + ], + ), + Tet4Connectivity( + [ + 82, + 112, + 17, + 163, + ], + ), + Tet4Connectivity( + [ + 106, + 166, + 11, + 171, + ], + ), + Tet4Connectivity( + [ + 126, + 35, + 24, + 161, + ], + ), + Tet4Connectivity( + [ + 4, + 165, + 119, + 176, + ], + ), + Tet4Connectivity( + [ + 85, + 168, + 81, + 169, + ], + ), + Tet4Connectivity( + [ + 80, + 85, + 81, + 169, + ], + ), + Tet4Connectivity( + [ + 43, + 157, + 25, + 176, + ], + ), + Tet4Connectivity( + [ + 31, + 4, + 5, + 176, + ], + ), + Tet4Connectivity( + [ + 132, + 114, + 0, + 162, + ], + ), + Tet4Connectivity( + [ + 76, + 81, + 90, + 168, + ], + ), + Tet4Connectivity( + [ + 153, + 165, + 155, + 173, + ], + ), + Tet4Connectivity( + [ + 33, + 34, + 32, + 156, + ], + ), + Tet4Connectivity( + [ + 140, + 62, + 103, + 172, + ], + ), + Tet4Connectivity( + [ + 0, + 10, + 132, + 162, + ], + ), + Tet4Connectivity( + [ + 148, + 177, + 174, + 182, + ], + ), + Tet4Connectivity( + [ + 74, + 75, + 76, + 155, + ], + ), + Tet4Connectivity( + [ + 116, + 163, + 91, + 164, + ], + ), + Tet4Connectivity( + [ + 6, + 171, + 43, + 176, + ], + ), + Tet4Connectivity( + [ + 65, + 84, + 160, + 168, + ], + ), + Tet4Connectivity( + [ + 50, + 126, + 33, + 161, + ], + ), + Tet4Connectivity( + [ + 56, + 57, + 58, + 170, + ], + ), + Tet4Connectivity( + [ + 151, + 163, + 156, + 167, + ], + ), + Tet4Connectivity( + [ + 136, + 46, + 142, + 172, + ], + ), + Tet4Connectivity( + [ + 89, + 117, + 29, + 168, + ], + ), + Tet4Connectivity( + [ + 121, + 144, + 133, + 165, + ], + ), + Tet4Connectivity( + [ + 166, + 171, + 154, + 181, + ], + ), + Tet4Connectivity( + [ + 160, + 179, + 147, + 180, + ], + ), + Tet4Connectivity( + [ + 48, + 111, + 110, + 148, + ], + ), + Tet4Connectivity( + [ + 158, + 148, + 175, + 179, + ], + ), + Tet4Connectivity( + [ + 97, + 107, + 102, + 159, + ], + ), + Tet4Connectivity( + [ + 85, + 86, + 84, + 168, + ], + ), + Tet4Connectivity( + [ + 77, + 78, + 38, + 162, + ], + ), + Tet4Connectivity( + [ + 148, + 159, + 162, + 182, + ], + ), + Tet4Connectivity( + [ + 78, + 77, + 122, + 159, + ], + ), + Tet4Connectivity( + [ + 146, + 179, + 160, + 180, + ], + ), + Tet4Connectivity( + [ + 87, + 91, + 116, + 163, + ], + ), + Tet4Connectivity( + [ + 149, + 171, + 166, + 181, + ], + ), + Tet4Connectivity( + [ + 47, + 41, + 40, + 174, + ], + ), + Tet4Connectivity( + [ + 90, + 124, + 76, + 168, + ], + ), + Tet4Connectivity( + [ + 21, + 158, + 19, + 164, + ], + ), + Tet4Connectivity( + [ + 119, + 4, + 144, + 165, + ], + ), + Tet4Connectivity( + [ + 33, + 32, + 36, + 156, + ], + ), + Tet4Connectivity( + [ + 11, + 166, + 143, + 171, + ], + ), + Tet4Connectivity( + [ + 150, + 170, + 152, + 174, + ], + ), + Tet4Connectivity( + [ + 67, + 160, + 66, + 166, + ], + ), + Tet4Connectivity( + [ + 19, + 21, + 59, + 158, + ], + ), + Tet4Connectivity( + [ + 142, + 172, + 46, + 175, + ], + ), + Tet4Connectivity( + [ + 96, + 97, + 98, + 159, + ], + ), + Tet4Connectivity( + [ + 150, + 174, + 152, + 182, + ], + ), + Tet4Connectivity( + [ + 101, + 70, + 66, + 160, + ], + ), + Tet4Connectivity( + [ + 58, + 15, + 170, + 174, + ], + ), + Tet4Connectivity( + [ + 22, + 158, + 21, + 164, + ], + ), + Tet4Connectivity( + [ + 41, + 71, + 174, + 177, + ], + ), + Tet4Connectivity( + [ + 75, + 133, + 134, + 173, + ], + ), + Tet4Connectivity( + [ + 112, + 18, + 17, + 163, + ], + ), + Tet4Connectivity( + [ + 127, + 129, + 128, + 157, + ], + ), + Tet4Connectivity( + [ + 152, + 164, + 163, + 178, + ], + ), + Tet4Connectivity( + [ + 43, + 25, + 6, + 176, + ], + ), + Tet4Connectivity( + [ + 131, + 57, + 56, + 161, + ], + ), + Tet4Connectivity( + [ + 77, + 38, + 37, + 162, + ], + ), + Tet4Connectivity( + [ + 55, + 167, + 93, + 169, + ], + ), + Tet4Connectivity( + [ + 121, + 74, + 30, + 165, + ], + ), + Tet4Connectivity( + [ + 168, + 169, + 146, + 180, + ], + ), + Tet4Connectivity( + [ + 148, + 158, + 177, + 178, + ], + ), + Tet4Connectivity( + [ + 129, + 43, + 123, + 157, + ], + ), + Tet4Connectivity( + [ + 25, + 127, + 23, + 157, + ], + ), + Tet4Connectivity( + [ + 109, + 122, + 40, + 174, + ], + ), + Tet4Connectivity( + [ + 12, + 106, + 11, + 171, + ], + ), + Tet4Connectivity( + [ + 109, + 159, + 122, + 174, + ], + ), + Tet4Connectivity( + [ + 158, + 175, + 172, + 179, + ], + ), + Tet4Connectivity( + [ + 103, + 99, + 140, + 172, + ], + ), + Tet4Connectivity( + [ + 163, + 164, + 151, + 178, + ], + ), + Tet4Connectivity( + [ + 123, + 43, + 7, + 171, + ], + ), + Tet4Connectivity( + [ + 142, + 49, + 114, + 175, + ], + ), + Tet4Connectivity( + [ + 11, + 143, + 8, + 171, + ], + ), + Tet4Connectivity( + [ + 12, + 52, + 51, + 176, + ], + ), + Tet4Connectivity( + [ + 89, + 29, + 124, + 168, + ], + ), + Tet4Connectivity( + [ + 63, + 64, + 44, + 158, + ], + ), + Tet4Connectivity( + [ + 62, + 63, + 103, + 172, + ], + ), + Tet4Connectivity( + [ + 120, + 119, + 165, + 176, + ], + ), + Tet4Connectivity( + [ + 78, + 130, + 38, + 162, + ], + ), + Tet4Connectivity( + [ + 30, + 28, + 120, + 165, + ], + ), + Tet4Connectivity( + [ + 1, + 167, + 134, + 173, + ], + ), + Tet4Connectivity( + [ + 65, + 89, + 84, + 168, + ], + ), + Tet4Connectivity( + [ + 154, + 176, + 165, + 181, + ], + ), + Tet4Connectivity( + [ + 24, + 23, + 131, + 161, + ], + ), + Tet4Connectivity( + [ + 25, + 31, + 5, + 176, + ], + ), + Tet4Connectivity( + [ + 165, + 176, + 153, + 181, + ], + ), + Tet4Connectivity( + [ + 164, + 177, + 158, + 178, + ], + ), + Tet4Connectivity( + [ + 59, + 21, + 60, + 158, + ], + ), + Tet4Connectivity( + [ + 155, + 169, + 168, + 180, + ], + ), + Tet4Connectivity( + [ + 2, + 50, + 36, + 173, + ], + ), + Tet4Connectivity( + [ + 37, + 162, + 114, + 175, + ], + ), + Tet4Connectivity( + [ + 44, + 63, + 158, + 172, + ], + ), + Tet4Connectivity( + [ + 26, + 34, + 14, + 170, + ], + ), + Tet4Connectivity( + [ + 26, + 87, + 16, + 163, + ], + ), + Tet4Connectivity( + [ + 0, + 130, + 10, + 162, + ], + ), + Tet4Connectivity( + [ + 109, + 107, + 97, + 159, + ], + ), + Tet4Connectivity( + [ + 54, + 115, + 112, + 167, + ], + ), + Tet4Connectivity( + [ + 75, + 134, + 55, + 167, + ], + ), + Tet4Connectivity( + [ + 6, + 7, + 43, + 171, + ], + ), + Tet4Connectivity( + [ + 22, + 164, + 20, + 177, + ], + ), + Tet4Connectivity( + [ + 96, + 78, + 97, + 159, + ], + ), + Tet4Connectivity( + [ + 120, + 52, + 119, + 176, + ], + ), + Tet4Connectivity( + [ + 110, + 45, + 44, + 175, + ], + ), + Tet4Connectivity( + [ + 8, + 123, + 7, + 171, + ], + ), + Tet4Connectivity( + [ + 82, + 141, + 19, + 164, + ], + ), + Tet4Connectivity( + [ + 5, + 4, + 119, + 176, + ], + ), + Tet4Connectivity( + [ + 54, + 93, + 55, + 167, + ], + ), + Tet4Connectivity( + [ + 2, + 36, + 1, + 173, + ], + ), + Tet4Connectivity( + [ + 21, + 22, + 64, + 158, + ], + ), + Tet4Connectivity( + [ + 20, + 22, + 21, + 164, + ], + ), + Tet4Connectivity( + [ + 116, + 91, + 141, + 164, + ], + ), + Tet4Connectivity( + [ + 56, + 125, + 161, + 170, + ], + ), + Tet4Connectivity( + [ + 71, + 15, + 39, + 174, + ], + ), + Tet4Connectivity( + [ + 129, + 127, + 43, + 157, + ], + ), + Tet4Connectivity( + [ + 34, + 125, + 14, + 170, + ], + ), + Tet4Connectivity( + [ + 3, + 133, + 144, + 173, + ], + ), + Tet4Connectivity( + [ + 111, + 45, + 110, + 175, + ], + ), + Tet4Connectivity( + [ + 1, + 53, + 134, + 167, + ], + ), + Tet4Connectivity( + [ + 174, + 177, + 152, + 182, + ], + ), + Tet4Connectivity( + [ + 101, + 65, + 84, + 160, + ], + ), + Tet4Connectivity( + [ + 25, + 43, + 127, + 157, + ], + ), + Tet4Connectivity( + [ + 148, + 179, + 178, + 182, + ], + ), + Tet4Connectivity( + [ + 37, + 0, + 114, + 162, + ], + ), + Tet4Connectivity( + [ + 92, + 71, + 41, + 177, + ], + ), + Tet4Connectivity( + [ + 67, + 66, + 68, + 166, + ], + ), + Tet4Connectivity( + [ + 79, + 94, + 61, + 169, + ], + ), + Tet4Connectivity( + [ + 101, + 66, + 65, + 160, + ], + ), + Tet4Connectivity( + [ + 142, + 46, + 49, + 175, + ], + ), + Tet4Connectivity( + [ + 153, + 176, + 157, + 181, + ], + ), + Tet4Connectivity( + [ + 14, + 13, + 26, + 170, + ], + ), + Tet4Connectivity( + [ + 148, + 158, + 178, + 179, + ], + ), + Tet4Connectivity( + [ + 103, + 100, + 99, + 172, + ], + ), + Tet4Connectivity( + [ + 65, + 67, + 117, + 160, + ], + ), + Tet4Connectivity( + [ + 178, + 179, + 145, + 182, + ], + ), + Tet4Connectivity( + [ + 151, + 164, + 158, + 178, + ], + ), + Tet4Connectivity( + [ + 157, + 171, + 149, + 181, + ], + ), + Tet4Connectivity( + [ + 146, + 158, + 172, + 179, + ], + ), + Tet4Connectivity( + [ + 65, + 66, + 67, + 160, + ], + ), + Tet4Connectivity( + [ + 94, + 79, + 93, + 169, + ], + ), + Tet4Connectivity( + [ + 106, + 67, + 68, + 166, + ], + ), + Tet4Connectivity( + [ + 16, + 17, + 18, + 163, + ], + ), + Tet4Connectivity( + [ + 11, + 68, + 143, + 166, + ], + ), + Tet4Connectivity( + [ + 134, + 53, + 55, + 167, + ], + ), + Tet4Connectivity( + [ + 58, + 39, + 15, + 174, + ], + ), + Tet4Connectivity( + [ + 106, + 68, + 11, + 166, + ], + ), + Tet4Connectivity( + [ + 152, + 177, + 178, + 182, + ], + ), + Tet4Connectivity( + [ + 17, + 116, + 82, + 163, + ], + ), + Tet4Connectivity( + [ + 53, + 1, + 115, + 167, + ], + ), + Tet4Connectivity( + [ + 69, + 68, + 66, + 166, + ], + ), + Tet4Connectivity( + [ + 160, + 168, + 146, + 180, + ], + ), + Tet4Connectivity( + [ + 125, + 131, + 56, + 161, + ], + ), + Tet4Connectivity( + [ + 125, + 33, + 126, + 161, + ], + ), + Tet4Connectivity( + [ + 47, + 48, + 41, + 177, + ], + ), + Tet4Connectivity( + [ + 150, + 159, + 174, + 182, + ], + ), + Tet4Connectivity( + [ + 79, + 61, + 80, + 169, + ], + ), + Tet4Connectivity( + [ + 148, + 178, + 177, + 182, + ], + ), + Tet4Connectivity( + [ + 53, + 115, + 54, + 167, + ], + ), + Tet4Connectivity( + [ + 55, + 93, + 79, + 169, + ], + ), + Tet4Connectivity( + [ + 50, + 2, + 3, + 173, + ], + ), + Tet4Connectivity( + [ + 60, + 21, + 63, + 158, + ], + ), + Tet4Connectivity( + [ + 122, + 97, + 78, + 159, + ], + ), + Tet4Connectivity( + [ + 37, + 38, + 0, + 162, + ], + ), + Tet4Connectivity( + [ + 39, + 41, + 71, + 174, + ], + ), + Tet4Connectivity( + [ + 113, + 55, + 79, + 169, + ], + ), + Tet4Connectivity( + [ + 21, + 64, + 63, + 158, + ], + ), + Tet4Connectivity( + [ + 85, + 90, + 81, + 168, + ], + ), + Tet4Connectivity( + [ + 37, + 114, + 49, + 175, + ], + ), + Tet4Connectivity( + [ + 144, + 121, + 119, + 165, + ], + ), + Tet4Connectivity( + [ + 58, + 15, + 56, + 170, + ], + ), + Tet4Connectivity( + [ + 2, + 1, + 134, + 173, + ], + ), + Tet4Connectivity( + [ + 126, + 24, + 131, + 161, + ], + ), + Tet4Connectivity( + [ + 120, + 121, + 30, + 165, + ], + ), + Tet4Connectivity( + [ + 12, + 171, + 6, + 176, + ], + ), + Tet4Connectivity( + [ + 46, + 172, + 44, + 175, + ], + ), + Tet4Connectivity( + [ + 8, + 7, + 11, + 171, + ], + ), + Tet4Connectivity( + [ + 171, + 176, + 154, + 181, + ], + ), + Tet4Connectivity( + [ + 172, + 175, + 147, + 179, + ], + ), + Tet4Connectivity( + [ + 109, + 97, + 122, + 159, + ], + ), + Tet4Connectivity( + [ + 157, + 176, + 171, + 181, + ], + ), + Tet4Connectivity( + [ + 152, + 177, + 164, + 178, + ], + ), + Tet4Connectivity( + [ + 20, + 21, + 19, + 164, + ], + ), + Tet4Connectivity( + [ + 139, + 143, + 68, + 166, + ], + ), + Tet4Connectivity( + [ + 100, + 46, + 136, + 172, + ], + ), + Tet4Connectivity( + [ + 113, + 79, + 81, + 169, + ], + ), + Tet4Connectivity( + [ + 6, + 25, + 5, + 176, + ], + ), + Tet4Connectivity( + [ + 42, + 109, + 40, + 174, + ], + ), + Tet4Connectivity( + [ + 90, + 89, + 124, + 168, + ], + ), + Tet4Connectivity( + [ + 42, + 39, + 58, + 174, + ], + ), + Tet4Connectivity( + [ + 13, + 14, + 15, + 170, + ], + ), + Tet4Connectivity( + [ + 38, + 130, + 0, + 162, + ], + ), + Tet4Connectivity( + [ + 56, + 14, + 125, + 170, + ], + ), + Tet4Connectivity( + [ + 2, + 133, + 3, + 173, + ], + ), + Tet4Connectivity( + [ + 22, + 20, + 118, + 177, + ], + ), + Tet4Connectivity( + [ + 118, + 48, + 22, + 177, + ], + ), + Tet4Connectivity( + [ + 40, + 41, + 39, + 174, + ], + ), + Tet4Connectivity( + [ + 80, + 81, + 79, + 169, + ], + ), + Tet4Connectivity( + [ + 46, + 44, + 45, + 175, + ], + ), + Tet4Connectivity( + [ + 116, + 16, + 87, + 163, + ], + ), + Tet4Connectivity( + [ + 139, + 68, + 69, + 166, + ], + ), + Tet4Connectivity( + [ + 85, + 84, + 89, + 168, + ], + ), + Tet4Connectivity( + [ + 37, + 45, + 111, + 175, + ], + ), + Tet4Connectivity( + [ + 116, + 17, + 16, + 163, + ], + ), + Tet4Connectivity( + [ + 125, + 126, + 131, + 161, + ], + ), + Tet4Connectivity( + [ + 120, + 119, + 121, + 165, + ], + ), + Tet4Connectivity( + [ + 7, + 6, + 12, + 171, + ], + ), + Tet4Connectivity( + [ + 54, + 55, + 53, + 167, + ], + ), + Tet4Connectivity( + [ + 118, + 20, + 92, + 177, + ], + ), + Tet4Connectivity( + [ + 12, + 6, + 52, + 176, + ], + ), + Tet4Connectivity( + [ + 119, + 52, + 5, + 176, + ], + ), + Tet4Connectivity( + [ + 44, + 103, + 63, + 172, + ], + ), + Tet4Connectivity( + [ + 85, + 89, + 90, + 168, + ], + ), + Tet4Connectivity( + [ + 91, + 20, + 141, + 164, + ], + ), + Tet4Connectivity( + [ + 45, + 49, + 46, + 175, + ], + ), + Tet4Connectivity( + [ + 2, + 134, + 133, + 173, + ], + ), + Tet4Connectivity( + [ + 11, + 7, + 12, + 171, + ], + ), + Tet4Connectivity( + [ + 41, + 48, + 118, + 177, + ], + ), + Tet4Connectivity( + [ + 14, + 56, + 15, + 170, + ], + ), + Tet4Connectivity( + [ + 141, + 20, + 19, + 164, + ], + ), + Tet4Connectivity( + [ + 44, + 46, + 103, + 172, + ], + ), + Tet4Connectivity( + [ + 42, + 40, + 39, + 174, + ], + ), + Tet4Connectivity( + [ + 100, + 103, + 46, + 172, + ], + ), + Tet4Connectivity( + [ + 37, + 49, + 45, + 175, + ], + ), + Tet4Connectivity( + [ + 92, + 41, + 118, + 177, + ], + ), + Tet4Connectivity( + [ + 5, + 52, + 6, + 176, + ], + ), + Tet4Connectivity( + [ + 59, + 169, + 158, + 61, + ], + ), + Tet4Connectivity( + [ + 158, + 169, + 59, + 151, + ], + ), + Tet4Connectivity( + [ + 173, + 33, + 161, + 50, + ], + ), + Tet4Connectivity( + [ + 173, + 161, + 33, + 156, + ], + ), + Tet4Connectivity( + [ + 151, + 179, + 158, + 146, + ], + ), + Tet4Connectivity( + [ + 158, + 179, + 151, + 178, + ], + ), + Tet4Connectivity( + [ + 169, + 76, + 81, + 113, + ], + ), + Tet4Connectivity( + [ + 169, + 81, + 76, + 168, + ], + ), + Tet4Connectivity( + [ + 135, + 169, + 85, + 80, + ], + ), + Tet4Connectivity( + [ + 85, + 169, + 135, + 146, + ], + ), + Tet4Connectivity( + [ + 162, + 179, + 175, + 148, + ], + ), + Tet4Connectivity( + [ + 175, + 179, + 162, + 147, + ], + ), + Tet4Connectivity( + [ + 164, + 83, + 59, + 19, + ], + ), + Tet4Connectivity( + [ + 164, + 59, + 83, + 151, + ], + ), + Tet4Connectivity( + [ + 177, + 88, + 91, + 92, + ], + ), + Tet4Connectivity( + [ + 177, + 91, + 88, + 152, + ], + ), + Tet4Connectivity( + [ + 171, + 51, + 176, + 12, + ], + ), + Tet4Connectivity( + [ + 171, + 176, + 51, + 154, + ], + ), + Tet4Connectivity( + [ + 165, + 180, + 168, + 154, + ], + ), + Tet4Connectivity( + [ + 168, + 180, + 165, + 155, + ], + ), + Tet4Connectivity( + [ + 173, + 75, + 167, + 134, + ], + ), + Tet4Connectivity( + [ + 173, + 167, + 75, + 155, + ], + ), + Tet4Connectivity( + [ + 164, + 116, + 82, + 141, + ], + ), + Tet4Connectivity( + [ + 164, + 82, + 116, + 163, + ], + ), + Tet4Connectivity( + [ + 168, + 65, + 117, + 160, + ], + ), + Tet4Connectivity( + [ + 168, + 117, + 65, + 89, + ], + ), + Tet4Connectivity( + [ + 176, + 120, + 28, + 165, + ], + ), + Tet4Connectivity( + [ + 176, + 28, + 120, + 52, + ], + ), + Tet4Connectivity( + [ + 177, + 91, + 20, + 92, + ], + ), + Tet4Connectivity( + [ + 177, + 20, + 91, + 164, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad4d2.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad4d2.snap new file mode 100644 index 00000000..62821913 --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad4d2.snap @@ -0,0 +1,78 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + ], + [ + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + ], + [ + 0.0, + 0.5, + ], + [ + 0.25, + 0.0, + ], + [ + 0.5, + 0.25, + ], + [ + 0.25, + 0.5, + ], + [ + 0.0, + 0.25, + ], + [ + 0.25, + 0.25, + ], + ], + connectivity: [ + Quad4d2Connectivity( + [ + 0, + 4, + 8, + 7, + ], + ), + Quad4d2Connectivity( + [ + 4, + 1, + 5, + 8, + ], + ), + Quad4d2Connectivity( + [ + 8, + 5, + 2, + 6, + ], + ), + Quad4d2Connectivity( + [ + 7, + 8, + 6, + 3, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad4d2_large.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad4d2_large.snap new file mode 100644 index 00000000..1fa4cde6 --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad4d2_large.snap @@ -0,0 +1,1026 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + ], + [ + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + ], + [ + 0.0, + 0.5, + ], + [ + 0.0625000000000001, + 0.0, + ], + [ + 0.1250000000000001, + 0.0, + ], + [ + 0.1875000000000001, + 0.0, + ], + [ + 0.2500000000000001, + 0.0, + ], + [ + 0.3125000000000001, + 0.0, + ], + [ + 0.3750000000000001, + 0.0, + ], + [ + 0.4375, + 0.0, + ], + [ + 0.5, + 0.0625000000000001, + ], + [ + 0.5, + 0.1250000000000001, + ], + [ + 0.5, + 0.1875000000000001, + ], + [ + 0.5, + 0.2500000000000001, + ], + [ + 0.5, + 0.3125000000000001, + ], + [ + 0.5, + 0.3750000000000001, + ], + [ + 0.5, + 0.4375, + ], + [ + 0.4374999999999999, + 0.5, + ], + [ + 0.3749999999999999, + 0.5, + ], + [ + 0.3124999999999999, + 0.5, + ], + [ + 0.2499999999999999, + 0.5, + ], + [ + 0.1874999999999999, + 0.5, + ], + [ + 0.1249999999999999, + 0.5, + ], + [ + 0.0625, + 0.5, + ], + [ + 0.0, + 0.4374999999999999, + ], + [ + 0.0, + 0.3749999999999999, + ], + [ + 0.0, + 0.3124999999999999, + ], + [ + 0.0, + 0.2499999999999999, + ], + [ + 0.0, + 0.1874999999999999, + ], + [ + 0.0, + 0.1249999999999999, + ], + [ + 0.0, + 0.0625, + ], + [ + 0.05822998290347076, + 0.2605649934272224, + ], + [ + 0.2690625499678753, + 0.4373741634969621, + ], + [ + 0.4394063223897706, + 0.2532266282495676, + ], + [ + 0.218731571670798, + 0.05413444603683523, + ], + [ + 0.4485296952607269, + 0.3514543919622855, + ], + [ + 0.1562572613976605, + 0.4430017882804914, + ], + [ + 0.3139361519575364, + 0.05655977493085765, + ], + [ + 0.06317620356498166, + 0.143322085838519, + ], + [ + 0.09487783772320771, + 0.05177176608767001, + ], + [ + 0.4346802809668467, + 0.1254847795829751, + ], + [ + 0.385835561124088, + 0.4424107541217095, + ], + [ + 0.05642710595914754, + 0.3800935995942247, + ], + [ + 0.2206910771762775, + 0.4223319654557284, + ], + [ + 0.2409669046111134, + 0.3803342651533306, + ], + [ + 0.2796523091247737, + 0.3809670135891468, + ], + [ + 0.2811532273431561, + 0.3278775056845646, + ], + [ + 0.2226036411773187, + 0.3311968358436785, + ], + [ + 0.2383195344809018, + 0.2774912466426128, + ], + [ + 0.2785950269114238, + 0.275688209913682, + ], + [ + 0.2811213160111221, + 0.22424678930415, + ], + [ + 0.2051718789543341, + 0.2190264006807288, + ], + [ + 0.2437323515129852, + 0.1510889946253526, + ], + [ + 0.2955104382677184, + 0.1705633178693746, + ], + [ + 0.170775327327602, + 0.1496636539918524, + ], + [ + 0.1214950554939795, + 0.1549693083706915, + ], + [ + 0.1571075604841364, + 0.1175566591042925, + ], + [ + 0.3096864964698186, + 0.1137240137759864, + ], + [ + 0.3600135006231731, + 0.1960897704484206, + ], + [ + 0.1223462154153212, + 0.2116835515605153, + ], + [ + 0.1160915762585152, + 0.2719530266180434, + ], + [ + 0.1103153596848872, + 0.3288204042469799, + ], + [ + 0.1503778448299227, + 0.3343952793879381, + ], + [ + 0.1108085553193199, + 0.3847477195247274, + ], + [ + 0.1722344345729996, + 0.388665431896197, + ], + [ + 0.4451386678415112, + 0.3111850878656598, + ], + [ + 0.3810973352747714, + 0.2611286164327285, + ], + [ + 0.4349323164015576, + 0.1902737625983149, + ], + [ + 0.2602460266589819, + 0.05295883471215043, + ], + [ + 0.169321158311335, + 0.2933206700284435, + ], + [ + 0.3901133716683218, + 0.3173464068481684, + ], + [ + 0.4042022912715102, + 0.3789676816396894, + ], + [ + 0.1591573024428046, + 0.04559816201766287, + ], + [ + 0.3260818403833355, + 0.4401545419132589, + ], + [ + 0.2067505282756192, + 0.1228710534088913, + ], + [ + 0.3737227477880348, + 0.06011343705045663, + ], + [ + 0.4477468983095898, + 0.402878525370986, + ], + [ + 0.07366106010639908, + 0.09356062491854583, + ], + [ + 0.1150073732639813, + 0.4420073499310098, + ], + [ + 0.3344198772063799, + 0.3243065221373092, + ], + [ + 0.3216841712974912, + 0.2322442333286768, + ], + [ + 0.1243251727668242, + 0.1096855974361544, + ], + [ + 0.3697587371967951, + 0.1225195262768584, + ], + [ + 0.06043027625340477, + 0.2006739036270033, + ], + [ + 0.05640733571939122, + 0.3204727192992418, + ], + [ + 0.05704756158401425, + 0.03578978132756394, + ], + [ + 0.4363834543890258, + 0.0619771294693556, + ], + [ + 0.4434497320434642, + 0.443296169676297, + ], + [ + 0.05864054073426955, + 0.4399127167621574, + ], + [ + 0.3286863771347082, + 0.2710301016990295, + ], + [ + 0.2280270786306877, + 0.09529701131120621, + ], + [ + 0.1773829335529767, + 0.09451185524609806, + ], + [ + 0.2598706027949543, + 0.1025253630660608, + ], + [ + 0.1405036776174168, + 0.07236710706135094, + ], + [ + 0.3345858245375794, + 0.3811534603906345, + ], + ], + connectivity: [ + Quad4d2Connectivity( + [ + 67, + 59, + 68, + 34, + ], + ), + Quad4d2Connectivity( + [ + 76, + 83, + 58, + 38, + ], + ), + Quad4d2Connectivity( + [ + 56, + 60, + 84, + 39, + ], + ), + Quad4d2Connectivity( + [ + 64, + 43, + 85, + 62, + ], + ), + Quad4d2Connectivity( + [ + 13, + 68, + 41, + 12, + ], + ), + Quad4d2Connectivity( + [ + 70, + 48, + 65, + 63, + ], + ), + Quad4d2Connectivity( + [ + 70, + 63, + 62, + 61, + ], + ), + Quad4d2Connectivity( + [ + 78, + 40, + 94, + 82, + ], + ), + Quad4d2Connectivity( + [ + 65, + 64, + 62, + 63, + ], + ), + Quad4d2Connectivity( + [ + 65, + 37, + 79, + 64, + ], + ), + Quad4d2Connectivity( + [ + 44, + 45, + 46, + 33, + ], + ), + Quad4d2Connectivity( + [ + 34, + 14, + 15, + 66, + ], + ), + Quad4d2Connectivity( + [ + 71, + 67, + 34, + 66, + ], + ), + Quad4d2Connectivity( + [ + 72, + 71, + 66, + 36, + ], + ), + Quad4d2Connectivity( + [ + 16, + 36, + 66, + 15, + ], + ), + Quad4d2Connectivity( + [ + 48, + 47, + 46, + 45, + ], + ), + Quad4d2Connectivity( + [ + 44, + 65, + 48, + 45, + ], + ), + Quad4d2Connectivity( + [ + 35, + 73, + 5, + 6, + ], + ), + Quad4d2Connectivity( + [ + 7, + 8, + 38, + 69, + ], + ), + Quad4d2Connectivity( + [ + 68, + 13, + 14, + 34, + ], + ), + Quad4d2Connectivity( + [ + 65, + 44, + 22, + 37, + ], + ), + Quad4d2Connectivity( + [ + 52, + 70, + 61, + 60, + ], + ), + Quad4d2Connectivity( + [ + 42, + 19, + 20, + 74, + ], + ), + Quad4d2Connectivity( + [ + 33, + 21, + 22, + 44, + ], + ), + Quad4d2Connectivity( + [ + 69, + 35, + 6, + 7, + ], + ), + Quad4d2Connectivity( + [ + 48, + 70, + 52, + 49, + ], + ), + Quad4d2Connectivity( + [ + 52, + 53, + 54, + 51, + ], + ), + Quad4d2Connectivity( + [ + 52, + 60, + 56, + 55, + ], + ), + Quad4d2Connectivity( + [ + 48, + 49, + 50, + 47, + ], + ), + Quad4d2Connectivity( + [ + 52, + 51, + 50, + 49, + ], + ), + Quad4d2Connectivity( + [ + 74, + 20, + 21, + 33, + ], + ), + Quad4d2Connectivity( + [ + 52, + 55, + 75, + 53, + ], + ), + Quad4d2Connectivity( + [ + 61, + 32, + 84, + 60, + ], + ), + Quad4d2Connectivity( + [ + 22, + 23, + 79, + 37, + ], + ), + Quad4d2Connectivity( + [ + 61, + 62, + 85, + 32, + ], + ), + Quad4d2Connectivity( + [ + 72, + 36, + 16, + 77, + ], + ), + Quad4d2Connectivity( + [ + 8, + 9, + 76, + 38, + ], + ), + Quad4d2Connectivity( + [ + 31, + 78, + 39, + 30, + ], + ), + Quad4d2Connectivity( + [ + 30, + 39, + 84, + 29, + ], + ), + Quad4d2Connectivity( + [ + 28, + 32, + 85, + 27, + ], + ), + Quad4d2Connectivity( + [ + 54, + 58, + 83, + 59, + ], + ), + Quad4d2Connectivity( + [ + 17, + 2, + 18, + 88, + ], + ), + Quad4d2Connectivity( + [ + 25, + 89, + 24, + 3, + ], + ), + Quad4d2Connectivity( + [ + 4, + 86, + 31, + 0, + ], + ), + Quad4d2Connectivity( + [ + 11, + 87, + 10, + 1, + ], + ), + Quad4d2Connectivity( + [ + 72, + 42, + 74, + 95, + ], + ), + Quad4d2Connectivity( + [ + 59, + 81, + 51, + 54, + ], + ), + Quad4d2Connectivity( + [ + 71, + 72, + 95, + 80, + ], + ), + Quad4d2Connectivity( + [ + 55, + 56, + 82, + 57, + ], + ), + Quad4d2Connectivity( + [ + 47, + 50, + 90, + 80, + ], + ), + Quad4d2Connectivity( + [ + 47, + 80, + 95, + 46, + ], + ), + Quad4d2Connectivity( + [ + 59, + 83, + 41, + 68, + ], + ), + Quad4d2Connectivity( + [ + 56, + 39, + 78, + 82, + ], + ), + Quad4d2Connectivity( + [ + 51, + 81, + 90, + 50, + ], + ), + Quad4d2Connectivity( + [ + 32, + 28, + 29, + 84, + ], + ), + Quad4d2Connectivity( + [ + 16, + 17, + 88, + 77, + ], + ), + Quad4d2Connectivity( + [ + 9, + 10, + 87, + 76, + ], + ), + Quad4d2Connectivity( + [ + 43, + 26, + 27, + 85, + ], + ), + Quad4d2Connectivity( + [ + 19, + 42, + 88, + 18, + ], + ), + Quad4d2Connectivity( + [ + 26, + 43, + 89, + 25, + ], + ), + Quad4d2Connectivity( + [ + 12, + 41, + 87, + 11, + ], + ), + Quad4d2Connectivity( + [ + 5, + 40, + 86, + 4, + ], + ), + Quad4d2Connectivity( + [ + 59, + 67, + 90, + 81, + ], + ), + Quad4d2Connectivity( + [ + 23, + 24, + 89, + 79, + ], + ), + Quad4d2Connectivity( + [ + 93, + 91, + 35, + 69, + ], + ), + Quad4d2Connectivity( + [ + 58, + 93, + 69, + 38, + ], + ), + Quad4d2Connectivity( + [ + 80, + 90, + 67, + 71, + ], + ), + Quad4d2Connectivity( + [ + 75, + 92, + 35, + 91, + ], + ), + Quad4d2Connectivity( + [ + 93, + 53, + 75, + 91, + ], + ), + Quad4d2Connectivity( + [ + 54, + 53, + 93, + 58, + ], + ), + Quad4d2Connectivity( + [ + 55, + 57, + 92, + 75, + ], + ), + Quad4d2Connectivity( + [ + 35, + 92, + 94, + 73, + ], + ), + Quad4d2Connectivity( + [ + 5, + 73, + 94, + 40, + ], + ), + Quad4d2Connectivity( + [ + 33, + 46, + 95, + 74, + ], + ), + Quad4d2Connectivity( + [ + 83, + 76, + 87, + 41, + ], + ), + Quad4d2Connectivity( + [ + 31, + 86, + 40, + 78, + ], + ), + Quad4d2Connectivity( + [ + 72, + 77, + 88, + 42, + ], + ), + Quad4d2Connectivity( + [ + 64, + 79, + 89, + 43, + ], + ), + Quad4d2Connectivity( + [ + 92, + 57, + 82, + 94, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad9d2.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad9d2.snap new file mode 100644 index 00000000..e8f241ea --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_quad9d2.snap @@ -0,0 +1,162 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + ], + [ + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + ], + [ + 0.0, + 0.5, + ], + [ + 0.25, + 0.0, + ], + [ + 0.125, + 0.0, + ], + [ + 0.375, + 0.0, + ], + [ + 0.5, + 0.25, + ], + [ + 0.5, + 0.125, + ], + [ + 0.5, + 0.375, + ], + [ + 0.25, + 0.5, + ], + [ + 0.375, + 0.5, + ], + [ + 0.125, + 0.5, + ], + [ + 0.0, + 0.25, + ], + [ + 0.0, + 0.375, + ], + [ + 0.0, + 0.125, + ], + [ + 0.25, + 0.25, + ], + [ + 0.25, + 0.125, + ], + [ + 0.125, + 0.25, + ], + [ + 0.125, + 0.125, + ], + [ + 0.375, + 0.25, + ], + [ + 0.375, + 0.125, + ], + [ + 0.25, + 0.375, + ], + [ + 0.375, + 0.375, + ], + [ + 0.125, + 0.375, + ], + ], + connectivity: [ + Quad9d2Connectivity( + [ + 0, + 4, + 16, + 13, + 5, + 17, + 18, + 15, + 19, + ], + ), + Quad9d2Connectivity( + [ + 4, + 1, + 7, + 16, + 6, + 8, + 20, + 17, + 21, + ], + ), + Quad9d2Connectivity( + [ + 16, + 7, + 2, + 10, + 20, + 9, + 11, + 22, + 23, + ], + ), + Quad9d2Connectivity( + [ + 13, + 16, + 10, + 3, + 18, + 22, + 12, + 14, + 24, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_tri3d2.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_tri3d2.snap new file mode 100644 index 00000000..776bb4a6 --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_tri3d2.snap @@ -0,0 +1,58 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + ], + [ + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + ], + [ + 0.0, + 0.5, + ], + [ + 0.25, + 0.25, + ], + ], + connectivity: [ + Tri3d2Connectivity( + [ + 1, + 4, + 0, + ], + ), + Tri3d2Connectivity( + [ + 0, + 4, + 3, + ], + ), + Tri3d2Connectivity( + [ + 2, + 4, + 1, + ], + ), + Tri3d2Connectivity( + [ + 3, + 4, + 2, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_tri6d2.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_tri6d2.snap new file mode 100644 index 00000000..db8410d7 --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_square_tri6d2.snap @@ -0,0 +1,102 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + ], + [ + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + ], + [ + 0.0, + 0.5, + ], + [ + 0.25, + 0.0, + ], + [ + 0.5, + 0.25, + ], + [ + 0.25, + 0.5, + ], + [ + 0.0, + 0.25, + ], + [ + 0.25, + 0.25, + ], + [ + 0.375, + 0.125, + ], + [ + 0.125, + 0.125, + ], + [ + 0.125, + 0.375, + ], + [ + 0.375, + 0.375, + ], + ], + connectivity: [ + Tri6d2Connectivity( + [ + 1, + 8, + 0, + 9, + 10, + 4, + ], + ), + Tri6d2Connectivity( + [ + 0, + 8, + 3, + 10, + 11, + 7, + ], + ), + Tri6d2Connectivity( + [ + 2, + 8, + 1, + 12, + 9, + 5, + ], + ), + Tri6d2Connectivity( + [ + 3, + 8, + 2, + 11, + 12, + 6, + ], + ), + ], +} diff --git a/tests/unit_tests/mod.rs b/tests/unit_tests/mod.rs index 6292fc9d..f20af133 100644 --- a/tests/unit_tests/mod.rs +++ b/tests/unit_tests/mod.rs @@ -3,6 +3,7 @@ mod basis; mod element; mod error; mod fe_mesh; +mod io; mod mesh; mod quadrature; mod reorder; From 01df4b9fa9792f6da4b1e0074a04ece1a5699638 Mon Sep 17 00:00:00 2001 From: Fabian Loeschner Date: Thu, 10 Nov 2022 16:00:41 +0100 Subject: [PATCH 11/15] Implement MshConnectivity for Tet10, add tests --- assets/meshes/cube_tet10_24.msh | 287 ++++++++ assets/meshes/cube_tet4_24.msh | 189 +++++ src/io/msh.rs | 12 +- tests/unit_tests/io/msh.rs | 46 +- ...t_tests__io__msh__load_msh_cube_tet10.snap | 661 ++++++++++++++++++ ...it_tests__io__msh__load_msh_cube_tet4.snap | 272 +++++++ 6 files changed, 1445 insertions(+), 22 deletions(-) create mode 100644 assets/meshes/cube_tet10_24.msh create mode 100644 assets/meshes/cube_tet4_24.msh create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_tet10.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_tet4.snap diff --git a/assets/meshes/cube_tet10_24.msh b/assets/meshes/cube_tet10_24.msh new file mode 100644 index 00000000..50c58865 --- /dev/null +++ b/assets/meshes/cube_tet10_24.msh @@ -0,0 +1,287 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +8 12 6 1 +1 0 0 1 0 +2 0 0 0 0 +3 0 1 1 0 +4 0 1 0 0 +5 1 0 1 0 +6 1 0 0 0 +7 1 1 1 0 +8 1 1 0 0 +1 -1e-07 -1e-07 -9.999999994736442e-08 1e-07 1e-07 1.0000001 0 2 2 -1 +2 -1e-07 -9.999999994736442e-08 0.9999999000000001 1e-07 1.0000001 1.0000001 0 2 1 -3 +3 -1e-07 0.9999999000000001 -9.999999994736442e-08 1e-07 1.0000001 1.0000001 0 2 4 -3 +4 -1e-07 -9.999999994736442e-08 -1e-07 1e-07 1.0000001 1e-07 0 2 2 -4 +5 0.9999999000000001 -1e-07 -9.999999994736442e-08 1.0000001 1e-07 1.0000001 0 2 6 -5 +6 0.9999999000000001 -9.999999994736442e-08 0.9999999000000001 1.0000001 1.0000001 1.0000001 0 2 5 -7 +7 0.9999999000000001 0.9999999000000001 -9.999999994736442e-08 1.0000001 1.0000001 1.0000001 0 2 8 -7 +8 0.9999999000000001 -9.999999994736442e-08 -1e-07 1.0000001 1.0000001 1e-07 0 2 6 -8 +9 -9.999999994736442e-08 -1e-07 -1e-07 1.0000001 1e-07 1e-07 0 2 2 -6 +10 -9.999999994736442e-08 -1e-07 0.9999999000000001 1.0000001 1e-07 1.0000001 0 2 1 -5 +11 -9.999999994736442e-08 0.9999999000000001 -1e-07 1.0000001 1.0000001 1e-07 0 2 4 -8 +12 -9.999999994736442e-08 0.9999999000000001 0.9999999000000001 1.0000001 1.0000001 1.0000001 0 2 3 -7 +1 -1e-07 -9.999999994736442e-08 -9.999999994736442e-08 1e-07 1.0000001 1.0000001 0 4 -1 4 3 -2 +2 0.9999999000000001 -9.999999994736442e-08 -9.999999994736442e-08 1.0000001 1.0000001 1.0000001 0 4 -5 8 7 -6 +3 -9.999999994736442e-08 -1e-07 -9.999999994736442e-08 1.0000001 1e-07 1.0000001 0 4 -9 1 10 -5 +4 -9.999999994736442e-08 0.9999999000000001 -9.999999994736442e-08 1.0000001 1.0000001 1.0000001 0 4 -11 3 12 -7 +5 -9.999999994736442e-08 -9.999999994736442e-08 -1e-07 1.0000001 1.0000001 1e-07 0 4 -4 9 8 -11 +6 -9.999999994736442e-08 -9.999999994736442e-08 0.9999999000000001 1.0000001 1.0000001 1.0000001 0 4 -2 10 6 -12 +1 -9.999999994736442e-08 -9.999999994736442e-08 -9.999999994736442e-08 1.0000001 1.0000001 1.0000001 0 6 -1 2 -3 4 -5 6 +$EndEntities +$Nodes +27 63 1 63 +0 1 0 1 +1 +0 0 1 +0 2 0 1 +2 +0 0 0 +0 3 0 1 +3 +0 1 1 +0 4 0 1 +4 +0 1 0 +0 5 0 1 +5 +1 0 1 +0 6 0 1 +6 +1 0 0 +0 7 0 1 +7 +1 1 1 +0 8 0 1 +8 +1 1 0 +1 1 0 1 +9 +0 0 0.4999999999999999 +1 2 0 1 +10 +0 0.4999999999999999 1 +1 3 0 1 +11 +0 1 0.4999999999999999 +1 4 0 1 +12 +0 0.4999999999999999 0 +1 5 0 1 +13 +1 0 0.4999999999999999 +1 6 0 1 +14 +1 0.4999999999999999 1 +1 7 0 1 +15 +1 1 0.4999999999999999 +1 8 0 1 +16 +1 0.4999999999999999 0 +1 9 0 1 +17 +0.4999999999999999 0 0 +1 10 0 1 +18 +0.4999999999999999 0 1 +1 11 0 1 +19 +0.4999999999999999 1 0 +1 12 0 1 +20 +0.4999999999999999 1 1 +2 1 0 5 +21 +22 +23 +24 +25 +0 0.5 0.5 +0 0.25 0.75 +0 0.25 0.25 +0 0.75 0.75 +0 0.75 0.25 +2 2 0 5 +26 +27 +28 +29 +30 +1 0.5 0.5 +1 0.25 0.25 +1 0.25 0.75 +1 0.75 0.75 +1 0.75 0.25 +2 3 0 5 +31 +32 +33 +34 +35 +0.5 0 0.5 +0.25 0 0.25 +0.25 0 0.75 +0.75 0 0.75 +0.75 0 0.25 +2 4 0 5 +36 +37 +38 +39 +40 +0.5 1 0.5 +0.25 1 0.75 +0.25 1 0.25 +0.75 1 0.75 +0.75 1 0.25 +2 5 0 5 +41 +42 +43 +44 +45 +0.5 0.5 0 +0.25 0.75 0 +0.25 0.25 0 +0.75 0.25 0 +0.75 0.75 0 +2 6 0 5 +46 +47 +48 +49 +50 +0.5 0.5 1 +0.25 0.25 1 +0.25 0.75 1 +0.75 0.25 1 +0.75 0.75 1 +3 1 0 13 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +0.25 0.25 0.5 +0.25 0.5 0.75 +0.5 0.25 0.75 +0.25 0.75 0.5 +0.5 0.5 0.5 +0.5 0.75 0.75 +0.25 0.5 0.25 +0.5 0.75 0.25 +0.5 0.25 0.25 +0.75 0.5 0.25 +0.75 0.25 0.5 +0.75 0.75 0.5 +0.75 0.5 0.75 +$EndNodes +$Elements +27 68 1 68 +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 +0 6 15 1 +6 6 +0 7 15 1 +7 7 +0 8 15 1 +8 8 +1 1 8 1 +9 2 1 9 +1 2 8 1 +10 1 3 10 +1 3 8 1 +11 4 3 11 +1 4 8 1 +12 2 4 12 +1 5 8 1 +13 6 5 13 +1 6 8 1 +14 5 7 14 +1 7 8 1 +15 8 7 15 +1 8 8 1 +16 6 8 16 +1 9 8 1 +17 2 6 17 +1 10 8 1 +18 1 5 18 +1 11 8 1 +19 4 8 19 +1 12 8 1 +20 3 7 20 +2 1 9 4 +21 2 1 21 9 22 23 +22 1 3 21 10 24 22 +23 4 2 21 12 23 25 +24 3 4 21 11 25 24 +2 2 9 4 +25 6 26 5 27 28 13 +26 5 26 7 28 29 14 +27 8 26 6 30 27 16 +28 7 26 8 29 30 15 +2 3 9 4 +29 1 2 31 9 32 33 +30 5 1 31 18 33 34 +31 2 6 31 17 35 32 +32 6 5 31 13 34 35 +2 4 9 4 +33 3 36 4 37 38 11 +34 7 36 3 39 37 20 +35 4 36 8 38 40 19 +36 8 36 7 40 39 15 +2 5 9 4 +37 2 4 41 12 42 43 +38 6 2 41 17 43 44 +39 4 8 41 19 45 42 +40 8 6 41 16 44 45 +2 6 9 4 +41 1 46 3 47 48 10 +42 5 46 1 49 47 18 +43 3 46 7 48 50 20 +44 7 46 5 50 49 14 +3 1 11 24 +45 1 31 21 46 33 51 22 47 52 53 +46 36 21 31 46 54 51 55 56 53 52 +47 21 36 3 46 54 37 24 52 48 56 +48 21 41 36 31 57 58 54 51 55 59 +49 41 4 36 8 42 38 58 45 40 19 +50 41 2 21 4 43 23 57 42 25 12 +51 21 41 4 36 57 42 25 54 38 58 +52 36 4 21 3 38 25 54 37 24 11 +53 1 21 3 46 22 24 10 47 48 52 +54 41 36 31 26 58 55 59 60 61 62 +55 21 2 41 31 23 43 57 51 59 32 +56 21 2 31 1 23 32 51 22 33 9 +57 2 41 31 6 43 59 32 17 35 44 +58 46 1 31 5 47 33 53 49 34 18 +59 36 3 46 7 37 48 56 39 50 20 +60 7 5 46 26 14 49 50 29 63 28 +61 31 46 5 26 53 49 34 61 28 63 +62 46 31 36 26 53 55 56 63 62 61 +63 8 7 36 26 15 39 40 30 62 29 +64 7 46 36 26 50 56 39 29 62 63 +65 36 41 8 26 58 45 40 62 30 60 +66 26 5 31 6 28 34 61 27 35 13 +67 26 31 41 6 61 59 60 27 44 35 +68 26 41 8 6 60 45 30 27 16 44 +$EndElements diff --git a/assets/meshes/cube_tet4_24.msh b/assets/meshes/cube_tet4_24.msh new file mode 100644 index 00000000..55f75729 --- /dev/null +++ b/assets/meshes/cube_tet4_24.msh @@ -0,0 +1,189 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +8 12 6 1 +1 0 0 1 0 +2 0 0 0 0 +3 0 1 1 0 +4 0 1 0 0 +5 1 0 1 0 +6 1 0 0 0 +7 1 1 1 0 +8 1 1 0 0 +1 -1e-07 -1e-07 -9.999999994736442e-08 1e-07 1e-07 1.0000001 0 2 2 -1 +2 -1e-07 -9.999999994736442e-08 0.9999999000000001 1e-07 1.0000001 1.0000001 0 2 1 -3 +3 -1e-07 0.9999999000000001 -9.999999994736442e-08 1e-07 1.0000001 1.0000001 0 2 4 -3 +4 -1e-07 -9.999999994736442e-08 -1e-07 1e-07 1.0000001 1e-07 0 2 2 -4 +5 0.9999999000000001 -1e-07 -9.999999994736442e-08 1.0000001 1e-07 1.0000001 0 2 6 -5 +6 0.9999999000000001 -9.999999994736442e-08 0.9999999000000001 1.0000001 1.0000001 1.0000001 0 2 5 -7 +7 0.9999999000000001 0.9999999000000001 -9.999999994736442e-08 1.0000001 1.0000001 1.0000001 0 2 8 -7 +8 0.9999999000000001 -9.999999994736442e-08 -1e-07 1.0000001 1.0000001 1e-07 0 2 6 -8 +9 -9.999999994736442e-08 -1e-07 -1e-07 1.0000001 1e-07 1e-07 0 2 2 -6 +10 -9.999999994736442e-08 -1e-07 0.9999999000000001 1.0000001 1e-07 1.0000001 0 2 1 -5 +11 -9.999999994736442e-08 0.9999999000000001 -1e-07 1.0000001 1.0000001 1e-07 0 2 4 -8 +12 -9.999999994736442e-08 0.9999999000000001 0.9999999000000001 1.0000001 1.0000001 1.0000001 0 2 3 -7 +1 -1e-07 -9.999999994736442e-08 -9.999999994736442e-08 1e-07 1.0000001 1.0000001 0 4 -1 4 3 -2 +2 0.9999999000000001 -9.999999994736442e-08 -9.999999994736442e-08 1.0000001 1.0000001 1.0000001 0 4 -5 8 7 -6 +3 -9.999999994736442e-08 -1e-07 -9.999999994736442e-08 1.0000001 1e-07 1.0000001 0 4 -9 1 10 -5 +4 -9.999999994736442e-08 0.9999999000000001 -9.999999994736442e-08 1.0000001 1.0000001 1.0000001 0 4 -11 3 12 -7 +5 -9.999999994736442e-08 -9.999999994736442e-08 -1e-07 1.0000001 1.0000001 1e-07 0 4 -4 9 8 -11 +6 -9.999999994736442e-08 -9.999999994736442e-08 0.9999999000000001 1.0000001 1.0000001 1.0000001 0 4 -2 10 6 -12 +1 -9.999999994736442e-08 -9.999999994736442e-08 -9.999999994736442e-08 1.0000001 1.0000001 1.0000001 0 6 -1 2 -3 4 -5 6 +$EndEntities +$Nodes +27 14 1 14 +0 1 0 1 +1 +0 0 1 +0 2 0 1 +2 +0 0 0 +0 3 0 1 +3 +0 1 1 +0 4 0 1 +4 +0 1 0 +0 5 0 1 +5 +1 0 1 +0 6 0 1 +6 +1 0 0 +0 7 0 1 +7 +1 1 1 +0 8 0 1 +8 +1 1 0 +1 1 0 0 +1 2 0 0 +1 3 0 0 +1 4 0 0 +1 5 0 0 +1 6 0 0 +1 7 0 0 +1 8 0 0 +1 9 0 0 +1 10 0 0 +1 11 0 0 +1 12 0 0 +2 1 0 1 +9 +0 0.5 0.5 +2 2 0 1 +10 +1 0.5 0.5 +2 3 0 1 +11 +0.5 0 0.5 +2 4 0 1 +12 +0.5 1 0.5 +2 5 0 1 +13 +0.5 0.5 0 +2 6 0 1 +14 +0.5 0.5 1 +3 1 0 0 +$EndNodes +$Elements +27 68 1 68 +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 +0 6 15 1 +6 6 +0 7 15 1 +7 7 +0 8 15 1 +8 8 +1 1 1 1 +9 2 1 +1 2 1 1 +10 1 3 +1 3 1 1 +11 4 3 +1 4 1 1 +12 2 4 +1 5 1 1 +13 6 5 +1 6 1 1 +14 5 7 +1 7 1 1 +15 8 7 +1 8 1 1 +16 6 8 +1 9 1 1 +17 2 6 +1 10 1 1 +18 1 5 +1 11 1 1 +19 4 8 +1 12 1 1 +20 3 7 +2 1 2 4 +21 2 1 9 +22 1 3 9 +23 4 2 9 +24 3 4 9 +2 2 2 4 +25 6 10 5 +26 5 10 7 +27 8 10 6 +28 7 10 8 +2 3 2 4 +29 1 2 11 +30 5 1 11 +31 2 6 11 +32 6 5 11 +2 4 2 4 +33 3 12 4 +34 7 12 3 +35 4 12 8 +36 8 12 7 +2 5 2 4 +37 2 4 13 +38 6 2 13 +39 4 8 13 +40 8 6 13 +2 6 2 4 +41 1 14 3 +42 5 14 1 +43 3 14 7 +44 7 14 5 +3 1 4 24 +45 1 11 9 14 +46 12 9 11 14 +47 9 12 3 14 +48 9 13 12 11 +49 13 4 12 8 +50 13 2 9 4 +51 9 13 4 12 +52 12 4 9 3 +53 1 9 3 14 +54 13 12 11 10 +55 9 2 13 11 +56 9 2 11 1 +57 2 13 11 6 +58 14 1 11 5 +59 12 3 14 7 +60 7 5 14 10 +61 11 14 5 10 +62 14 11 12 10 +63 8 7 12 10 +64 7 14 12 10 +65 12 13 8 10 +66 10 5 11 6 +67 10 11 13 6 +68 10 13 8 6 +$EndElements diff --git a/src/io/msh.rs b/src/io/msh.rs index c6f4bd4c..2fbbcc45 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -1,6 +1,6 @@ use crate::connectivity::{ - Quad4d2Connectivity, Quad9d2Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity, - Tri6d2Connectivity, + Quad4d2Connectivity, Quad9d2Connectivity, Tet10Connectivity, Tet4Connectivity, Tri3d2Connectivity, + Tri3d3Connectivity, Tri6d2Connectivity, }; use crate::mesh::Mesh; use eyre::{eyre, Context}; @@ -255,6 +255,10 @@ impl_msh_connectivity!(Tri3d3Connectivity, Tri3, num_nodes = 3); impl_msh_connectivity!(Tri6d2Connectivity, Tri6, num_nodes = 6); impl_msh_connectivity!(Quad4d2Connectivity, Qua4, num_nodes = 4); impl_msh_connectivity!(Quad9d2Connectivity, Qua9, num_nodes = 9); -// Quad4d3Connectivity does not implement ElementConnectivity -//impl_msh_connectivity!(Quad4d3Connectivity, Qua4, num_nodes = 4); impl_msh_connectivity!(Tet4Connectivity, Tet4, num_nodes = 4); +impl_msh_connectivity!(Tet10Connectivity, Tet10, num_nodes = 10); + +// The following connectivities do not implement ElementConnectivity yet +//impl_msh_connectivity!(Tri6d3Connectivity, Tri6, num_nodes = 6); +//impl_msh_connectivity!(Quad4d3Connectivity, Qua4, num_nodes = 4); +//impl_msh_connectivity!(Quad9d3Connectivity, Qua9, num_nodes = 9); diff --git a/tests/unit_tests/io/msh.rs b/tests/unit_tests/io/msh.rs index 43b170a6..6c4ee391 100644 --- a/tests/unit_tests/io/msh.rs +++ b/tests/unit_tests/io/msh.rs @@ -1,7 +1,7 @@ use crate::export_mesh_vtk; use fenris::connectivity::{ - Quad4d2Connectivity, Quad9d2Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity, - Tri6d2Connectivity, + Quad4d2Connectivity, Quad9d2Connectivity, Tet10Connectivity, Tet4Connectivity, Tri3d2Connectivity, + Tri3d3Connectivity, Tri6d2Connectivity, }; use fenris::io::msh::load_msh_from_file; use insta::assert_debug_snapshot; @@ -60,22 +60,6 @@ fn load_msh_square_quad4d2_large() -> eyre::Result<()> { Ok(()) } -// Quad4d3Connectivity does not implement ElementConnectivity -/* -#[test] -fn load_msh_square_quad4d3_large() -> eyre::Result<()> { - let mesh = load_msh_from_file::("assets/meshes/square_quad4_79.msh")?; - - assert_eq!(mesh.vertices().len(), 96); - assert_eq!(mesh.connectivity().len(), 79); - - export_mesh_vtk("io_msh", "load_msh_square_quad4d3_large", &mesh); - assert_debug_snapshot!(mesh); - - Ok(()) -} -*/ - #[test] fn load_msh_square_tri3d2() -> eyre::Result<()> { let mesh = load_msh_from_file::("assets/meshes/square_tri3_4.msh")?; @@ -127,3 +111,29 @@ fn load_msh_square_quad9d2() -> eyre::Result<()> { Ok(()) } + +#[test] +fn load_msh_cube_tet4() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/cube_tet4_24.msh")?; + + assert_eq!(mesh.vertices().len(), 14); + assert_eq!(mesh.connectivity().len(), 24); + + export_mesh_vtk("io_msh", "load_msh_cube_tet4", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +#[test] +fn load_msh_cube_tet10() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/cube_tet10_24.msh")?; + + assert_eq!(mesh.vertices().len(), 63); + assert_eq!(mesh.connectivity().len(), 24); + + export_mesh_vtk("io_msh", "load_msh_cube_tet10", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_tet10.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_tet10.snap new file mode 100644 index 00000000..4de9c5c4 --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_tet10.snap @@ -0,0 +1,661 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + 1.0, + ], + [ + 0.0, + 0.0, + 0.0, + ], + [ + 0.0, + 1.0, + 1.0, + ], + [ + 0.0, + 1.0, + 0.0, + ], + [ + 1.0, + 0.0, + 1.0, + ], + [ + 1.0, + 0.0, + 0.0, + ], + [ + 1.0, + 1.0, + 1.0, + ], + [ + 1.0, + 1.0, + 0.0, + ], + [ + 0.0, + 0.0, + 0.4999999999999999, + ], + [ + 0.0, + 0.4999999999999999, + 1.0, + ], + [ + 0.0, + 1.0, + 0.4999999999999999, + ], + [ + 0.0, + 0.4999999999999999, + 0.0, + ], + [ + 1.0, + 0.0, + 0.4999999999999999, + ], + [ + 1.0, + 0.4999999999999999, + 1.0, + ], + [ + 1.0, + 1.0, + 0.4999999999999999, + ], + [ + 1.0, + 0.4999999999999999, + 0.0, + ], + [ + 0.4999999999999999, + 0.0, + 0.0, + ], + [ + 0.4999999999999999, + 0.0, + 1.0, + ], + [ + 0.4999999999999999, + 1.0, + 0.0, + ], + [ + 0.4999999999999999, + 1.0, + 1.0, + ], + [ + 0.0, + 0.5, + 0.5, + ], + [ + 0.0, + 0.25, + 0.75, + ], + [ + 0.0, + 0.25, + 0.25, + ], + [ + 0.0, + 0.75, + 0.75, + ], + [ + 0.0, + 0.75, + 0.25, + ], + [ + 1.0, + 0.5, + 0.5, + ], + [ + 1.0, + 0.25, + 0.25, + ], + [ + 1.0, + 0.25, + 0.75, + ], + [ + 1.0, + 0.75, + 0.75, + ], + [ + 1.0, + 0.75, + 0.25, + ], + [ + 0.5, + 0.0, + 0.5, + ], + [ + 0.25, + 0.0, + 0.25, + ], + [ + 0.25, + 0.0, + 0.75, + ], + [ + 0.75, + 0.0, + 0.75, + ], + [ + 0.75, + 0.0, + 0.25, + ], + [ + 0.5, + 1.0, + 0.5, + ], + [ + 0.25, + 1.0, + 0.75, + ], + [ + 0.25, + 1.0, + 0.25, + ], + [ + 0.75, + 1.0, + 0.75, + ], + [ + 0.75, + 1.0, + 0.25, + ], + [ + 0.5, + 0.5, + 0.0, + ], + [ + 0.25, + 0.75, + 0.0, + ], + [ + 0.25, + 0.25, + 0.0, + ], + [ + 0.75, + 0.25, + 0.0, + ], + [ + 0.75, + 0.75, + 0.0, + ], + [ + 0.5, + 0.5, + 1.0, + ], + [ + 0.25, + 0.25, + 1.0, + ], + [ + 0.25, + 0.75, + 1.0, + ], + [ + 0.75, + 0.25, + 1.0, + ], + [ + 0.75, + 0.75, + 1.0, + ], + [ + 0.25, + 0.25, + 0.5, + ], + [ + 0.25, + 0.5, + 0.75, + ], + [ + 0.5, + 0.25, + 0.75, + ], + [ + 0.25, + 0.75, + 0.5, + ], + [ + 0.5, + 0.5, + 0.5, + ], + [ + 0.5, + 0.75, + 0.75, + ], + [ + 0.25, + 0.5, + 0.25, + ], + [ + 0.5, + 0.75, + 0.25, + ], + [ + 0.5, + 0.25, + 0.25, + ], + [ + 0.75, + 0.5, + 0.25, + ], + [ + 0.75, + 0.25, + 0.5, + ], + [ + 0.75, + 0.75, + 0.5, + ], + [ + 0.75, + 0.5, + 0.75, + ], + ], + connectivity: [ + Tet10Connectivity( + [ + 0, + 30, + 20, + 45, + 32, + 50, + 21, + 46, + 51, + 52, + ], + ), + Tet10Connectivity( + [ + 35, + 20, + 30, + 45, + 53, + 50, + 54, + 55, + 52, + 51, + ], + ), + Tet10Connectivity( + [ + 20, + 35, + 2, + 45, + 53, + 36, + 23, + 51, + 47, + 55, + ], + ), + Tet10Connectivity( + [ + 20, + 40, + 35, + 30, + 56, + 57, + 53, + 50, + 54, + 58, + ], + ), + Tet10Connectivity( + [ + 40, + 3, + 35, + 7, + 41, + 37, + 57, + 44, + 39, + 18, + ], + ), + Tet10Connectivity( + [ + 40, + 1, + 20, + 3, + 42, + 22, + 56, + 41, + 24, + 11, + ], + ), + Tet10Connectivity( + [ + 20, + 40, + 3, + 35, + 56, + 41, + 24, + 53, + 37, + 57, + ], + ), + Tet10Connectivity( + [ + 35, + 3, + 20, + 2, + 37, + 24, + 53, + 36, + 23, + 10, + ], + ), + Tet10Connectivity( + [ + 0, + 20, + 2, + 45, + 21, + 23, + 9, + 46, + 47, + 51, + ], + ), + Tet10Connectivity( + [ + 40, + 35, + 30, + 25, + 57, + 54, + 58, + 59, + 60, + 61, + ], + ), + Tet10Connectivity( + [ + 20, + 1, + 40, + 30, + 22, + 42, + 56, + 50, + 58, + 31, + ], + ), + Tet10Connectivity( + [ + 20, + 1, + 30, + 0, + 22, + 31, + 50, + 21, + 32, + 8, + ], + ), + Tet10Connectivity( + [ + 1, + 40, + 30, + 5, + 42, + 58, + 31, + 16, + 34, + 43, + ], + ), + Tet10Connectivity( + [ + 45, + 0, + 30, + 4, + 46, + 32, + 52, + 48, + 33, + 17, + ], + ), + Tet10Connectivity( + [ + 35, + 2, + 45, + 6, + 36, + 47, + 55, + 38, + 49, + 19, + ], + ), + Tet10Connectivity( + [ + 6, + 4, + 45, + 25, + 13, + 48, + 49, + 28, + 62, + 27, + ], + ), + Tet10Connectivity( + [ + 30, + 45, + 4, + 25, + 52, + 48, + 33, + 60, + 27, + 62, + ], + ), + Tet10Connectivity( + [ + 45, + 30, + 35, + 25, + 52, + 54, + 55, + 62, + 61, + 60, + ], + ), + Tet10Connectivity( + [ + 7, + 6, + 35, + 25, + 14, + 38, + 39, + 29, + 61, + 28, + ], + ), + Tet10Connectivity( + [ + 6, + 45, + 35, + 25, + 49, + 55, + 38, + 28, + 61, + 62, + ], + ), + Tet10Connectivity( + [ + 35, + 40, + 7, + 25, + 57, + 44, + 39, + 61, + 29, + 59, + ], + ), + Tet10Connectivity( + [ + 25, + 4, + 30, + 5, + 27, + 33, + 60, + 26, + 34, + 12, + ], + ), + Tet10Connectivity( + [ + 25, + 30, + 40, + 5, + 60, + 58, + 59, + 26, + 43, + 34, + ], + ), + Tet10Connectivity( + [ + 25, + 40, + 7, + 5, + 59, + 44, + 29, + 26, + 15, + 43, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_tet4.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_tet4.snap new file mode 100644 index 00000000..6fdbc8bb --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_tet4.snap @@ -0,0 +1,272 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + 1.0, + ], + [ + 0.0, + 0.0, + 0.0, + ], + [ + 0.0, + 1.0, + 1.0, + ], + [ + 0.0, + 1.0, + 0.0, + ], + [ + 1.0, + 0.0, + 1.0, + ], + [ + 1.0, + 0.0, + 0.0, + ], + [ + 1.0, + 1.0, + 1.0, + ], + [ + 1.0, + 1.0, + 0.0, + ], + [ + 0.0, + 0.5, + 0.5, + ], + [ + 1.0, + 0.5, + 0.5, + ], + [ + 0.5, + 0.0, + 0.5, + ], + [ + 0.5, + 1.0, + 0.5, + ], + [ + 0.5, + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + 1.0, + ], + ], + connectivity: [ + Tet4Connectivity( + [ + 0, + 10, + 8, + 13, + ], + ), + Tet4Connectivity( + [ + 11, + 8, + 10, + 13, + ], + ), + Tet4Connectivity( + [ + 8, + 11, + 2, + 13, + ], + ), + Tet4Connectivity( + [ + 8, + 12, + 11, + 10, + ], + ), + Tet4Connectivity( + [ + 12, + 3, + 11, + 7, + ], + ), + Tet4Connectivity( + [ + 12, + 1, + 8, + 3, + ], + ), + Tet4Connectivity( + [ + 8, + 12, + 3, + 11, + ], + ), + Tet4Connectivity( + [ + 11, + 3, + 8, + 2, + ], + ), + Tet4Connectivity( + [ + 0, + 8, + 2, + 13, + ], + ), + Tet4Connectivity( + [ + 12, + 11, + 10, + 9, + ], + ), + Tet4Connectivity( + [ + 8, + 1, + 12, + 10, + ], + ), + Tet4Connectivity( + [ + 8, + 1, + 10, + 0, + ], + ), + Tet4Connectivity( + [ + 1, + 12, + 10, + 5, + ], + ), + Tet4Connectivity( + [ + 13, + 0, + 10, + 4, + ], + ), + Tet4Connectivity( + [ + 11, + 2, + 13, + 6, + ], + ), + Tet4Connectivity( + [ + 6, + 4, + 13, + 9, + ], + ), + Tet4Connectivity( + [ + 10, + 13, + 4, + 9, + ], + ), + Tet4Connectivity( + [ + 13, + 10, + 11, + 9, + ], + ), + Tet4Connectivity( + [ + 7, + 6, + 11, + 9, + ], + ), + Tet4Connectivity( + [ + 6, + 13, + 11, + 9, + ], + ), + Tet4Connectivity( + [ + 11, + 12, + 7, + 9, + ], + ), + Tet4Connectivity( + [ + 9, + 4, + 10, + 5, + ], + ), + Tet4Connectivity( + [ + 9, + 10, + 12, + 5, + ], + ), + Tet4Connectivity( + [ + 9, + 12, + 7, + 5, + ], + ), + ], +} From 19988be4b6fb56fc580051dd0f378f102c46f13c Mon Sep 17 00:00:00 2001 From: Fabian Loeschner Date: Thu, 10 Nov 2022 16:02:27 +0100 Subject: [PATCH 12/15] Formatting --- tests/unit.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/unit.rs b/tests/unit.rs index 84e468e6..598b68a8 100644 --- a/tests/unit.rs +++ b/tests/unit.rs @@ -1,16 +1,16 @@ -use std::path::Path; -use nalgebra::{DefaultAllocator, DimName}; -use nalgebra::allocator::Allocator; use fenris::io::vtk::{FiniteElementMeshDataSetBuilder, VtkCellConnectivity}; use fenris::mesh::Mesh; +use nalgebra::allocator::Allocator; +use nalgebra::{DefaultAllocator, DimName}; +use std::path::Path; mod unit_tests; fn export_mesh_vtk(test_name: &str, file_stem: &str, mesh: &Mesh) - where - D: DimName, - DefaultAllocator: Allocator, - C: VtkCellConnectivity, +where + D: DimName, + DefaultAllocator: Allocator, + C: VtkCellConnectivity, { let output_path = Path::new("data/unit_tests/") .join(test_name) @@ -19,4 +19,3 @@ fn export_mesh_vtk(test_name: &str, file_stem: &str, mesh: &Mesh Date: Fri, 11 Nov 2022 09:33:37 +0100 Subject: [PATCH 13/15] Add io::msh module documentation --- src/io/msh.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/io/msh.rs b/src/io/msh.rs index 2fbbcc45..af736f02 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -1,3 +1,22 @@ +//! Support for loading Gmsh MSH 4.1 files as [`Mesh`]es. +//! +//! This module supports Gmsh MSH files with the file format version 4.1 as specified in the +//! [Gmsh documentation](https://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format). All element types +//! that implement the [`MshConnectivity`] trait are supported. +//! +//! Example usage: +//! ``` +//! use nalgebra::U2; +//! use fenris::connectivity::Tri3d2Connectivity; +//! use fenris::io::msh::load_msh_from_file; +//! +//! let mesh = load_msh_from_file::( +//! "assets/meshes/square_tri3_4.msh").unwrap(); +//! +//! assert_eq!(mesh.vertices().len(), 5); +//! assert_eq!(mesh.connectivity().len(), 4); +//! ``` + use crate::connectivity::{ Quad4d2Connectivity, Quad9d2Connectivity, Tet10Connectivity, Tet4Connectivity, Tri3d2Connectivity, Tri3d3Connectivity, Tri6d2Connectivity, From b5d7a2a58033c22401ec6e274e4b42c090032a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Fri, 11 Nov 2022 11:13:22 +0100 Subject: [PATCH 14/15] Implement MshConnectivity for Hex8 and Hex27 and add tests --- assets/meshes/cube_hex27_8.msh | 273 ++++++ assets/meshes/cube_hex8_8.msh | 77 ++ src/io/msh.rs | 6 +- tests/unit_tests/io/msh.rs | 30 +- ...t_tests__io__msh__load_msh_cube_hex27.snap | 883 ++++++++++++++++++ ...it_tests__io__msh__load_msh_cube_hex8.snap | 241 +++++ 6 files changed, 1506 insertions(+), 4 deletions(-) create mode 100644 assets/meshes/cube_hex27_8.msh create mode 100644 assets/meshes/cube_hex8_8.msh create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_hex27.snap create mode 100644 tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_hex8.snap diff --git a/assets/meshes/cube_hex27_8.msh b/assets/meshes/cube_hex27_8.msh new file mode 100644 index 00000000..04d4be0a --- /dev/null +++ b/assets/meshes/cube_hex27_8.msh @@ -0,0 +1,273 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +0 0 0 1 +0 0 0 0 1 1 1 0 0 +$EndEntities +$Nodes +1 125 1 125 +3 0 0 125 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +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 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +0 0 0 +0.5 0 0 +1 0 0 +0 0.5 0 +0.5 0.5 0 +1 0.5 0 +0 1 0 +0.5 1 0 +1 1 0 +0 0 0.5 +0.5 0 0.5 +1 0 0.5 +0 0.5 0.5 +0.5 0.5 0.5 +1 0.5 0.5 +0 1 0.5 +0.5 1 0.5 +1 1 0.5 +0 0 1 +0.5 0 1 +1 0 1 +0 0.5 1 +0.5 0.5 1 +1 0.5 1 +0 1 1 +0.5 1 1 +1 1 1 +0.25 0 0 +0 0.25 0 +0 0 0.25 +0.5 0.25 0 +0.5 0 0.25 +0.25 0.5 0 +0.5 0.5 0.25 +0 0.5 0.25 +0.25 0 0.5 +0 0.25 0.5 +0.5 0.25 0.5 +0.25 0.5 0.5 +0.25 0.25 0 +0.25 0 0.25 +0 0.25 0.25 +0.5 0.25 0.25 +0.25 0.5 0.25 +0.25 0.25 0.5 +0.25 0.25 0.25 +0.75 0 0 +1 0.25 0 +1 0 0.25 +0.75 0.5 0 +1 0.5 0.25 +0.75 0 0.5 +1 0.25 0.5 +0.75 0.5 0.5 +0.75 0.25 0 +0.75 0 0.25 +1 0.25 0.25 +0.75 0.5 0.25 +0.75 0.25 0.5 +0.75 0.25 0.25 +0 0.75 0 +0.5 0.75 0 +0.25 1 0 +0.5 1 0.25 +0 1 0.25 +0 0.75 0.5 +0.5 0.75 0.5 +0.25 1 0.5 +0.25 0.75 0 +0 0.75 0.25 +0.5 0.75 0.25 +0.25 1 0.25 +0.25 0.75 0.5 +0.25 0.75 0.25 +1 0.75 0 +0.75 1 0 +1 1 0.25 +1 0.75 0.5 +0.75 1 0.5 +0.75 0.75 0 +1 0.75 0.25 +0.75 1 0.25 +0.75 0.75 0.5 +0.75 0.75 0.25 +0 0 0.75 +0.5 0 0.75 +0.5 0.5 0.75 +0 0.5 0.75 +0.25 0 1 +0 0.25 1 +0.5 0.25 1 +0.25 0.5 1 +0.25 0 0.75 +0 0.25 0.75 +0.5 0.25 0.75 +0.25 0.5 0.75 +0.25 0.25 1 +0.25 0.25 0.75 +1 0 0.75 +1 0.5 0.75 +0.75 0 1 +1 0.25 1 +0.75 0.5 1 +0.75 0 0.75 +1 0.25 0.75 +0.75 0.5 0.75 +0.75 0.25 1 +0.75 0.25 0.75 +0.5 1 0.75 +0 1 0.75 +0 0.75 1 +0.5 0.75 1 +0.25 1 1 +0 0.75 0.75 +0.5 0.75 0.75 +0.25 1 0.75 +0.25 0.75 1 +0.25 0.75 0.75 +1 1 0.75 +1 0.75 1 +0.75 1 1 +1 0.75 0.75 +0.75 1 0.75 +0.75 0.75 1 +0.75 0.75 0.75 +$EndNodes +$Elements +1 8 1 8 +3 0 12 8 +1 1 2 5 4 10 11 14 13 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 +2 2 3 6 5 11 12 15 14 47 31 32 48 49 50 51 34 52 38 53 54 55 56 43 57 58 59 60 +3 4 5 8 7 13 14 17 16 33 61 35 62 34 63 64 65 39 66 67 68 69 44 70 71 72 73 74 +4 5 6 9 8 14 15 18 17 50 62 34 75 51 76 77 64 54 67 78 79 80 58 71 81 82 83 84 +5 10 11 14 13 19 20 23 22 36 37 85 38 86 39 87 88 89 90 91 92 45 93 94 95 96 97 98 +6 11 12 15 14 20 21 24 23 52 38 86 53 99 54 100 87 101 91 102 103 59 104 95 105 106 107 108 +7 13 14 17 16 22 23 26 25 39 66 88 67 87 68 109 110 92 111 112 113 73 96 114 115 116 117 118 +8 14 15 18 17 23 24 27 26 54 67 87 78 100 79 119 109 103 112 120 121 83 106 115 122 123 124 125 +$EndElements diff --git a/assets/meshes/cube_hex8_8.msh b/assets/meshes/cube_hex8_8.msh new file mode 100644 index 00000000..6046aef7 --- /dev/null +++ b/assets/meshes/cube_hex8_8.msh @@ -0,0 +1,77 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +0 0 0 1 +0 0 0 0 1 1 1 0 0 +$EndEntities +$Nodes +1 27 1 27 +3 0 0 27 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +0 0 0 +0.5 0 0 +1 0 0 +0 0.5 0 +0.5 0.5 0 +1 0.5 0 +0 1 0 +0.5 1 0 +1 1 0 +0 0 0.5 +0.5 0 0.5 +1 0 0.5 +0 0.5 0.5 +0.5 0.5 0.5 +1 0.5 0.5 +0 1 0.5 +0.5 1 0.5 +1 1 0.5 +0 0 1 +0.5 0 1 +1 0 1 +0 0.5 1 +0.5 0.5 1 +1 0.5 1 +0 1 1 +0.5 1 1 +1 1 1 +$EndNodes +$Elements +1 8 1 8 +3 0 5 8 +1 1 2 5 4 10 11 14 13 +2 2 3 6 5 11 12 15 14 +3 4 5 8 7 13 14 17 16 +4 5 6 9 8 14 15 18 17 +5 10 11 14 13 19 20 23 22 +6 11 12 15 14 20 21 24 23 +7 13 14 17 16 22 23 26 25 +8 14 15 18 17 23 24 27 26 +$EndElements diff --git a/src/io/msh.rs b/src/io/msh.rs index af736f02..d8b0e207 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -18,8 +18,8 @@ //! ``` use crate::connectivity::{ - Quad4d2Connectivity, Quad9d2Connectivity, Tet10Connectivity, Tet4Connectivity, Tri3d2Connectivity, - Tri3d3Connectivity, Tri6d2Connectivity, + Hex27Connectivity, Hex8Connectivity, Quad4d2Connectivity, Quad9d2Connectivity, Tet10Connectivity, Tet4Connectivity, + Tri3d2Connectivity, Tri3d3Connectivity, Tri6d2Connectivity, }; use crate::mesh::Mesh; use eyre::{eyre, Context}; @@ -276,6 +276,8 @@ impl_msh_connectivity!(Quad4d2Connectivity, Qua4, num_nodes = 4); impl_msh_connectivity!(Quad9d2Connectivity, Qua9, num_nodes = 9); impl_msh_connectivity!(Tet4Connectivity, Tet4, num_nodes = 4); impl_msh_connectivity!(Tet10Connectivity, Tet10, num_nodes = 10); +impl_msh_connectivity!(Hex8Connectivity, Hex8, num_nodes = 8); +impl_msh_connectivity!(Hex27Connectivity, Hex27, num_nodes = 27); // The following connectivities do not implement ElementConnectivity yet //impl_msh_connectivity!(Tri6d3Connectivity, Tri6, num_nodes = 6); diff --git a/tests/unit_tests/io/msh.rs b/tests/unit_tests/io/msh.rs index 6c4ee391..a462c2ca 100644 --- a/tests/unit_tests/io/msh.rs +++ b/tests/unit_tests/io/msh.rs @@ -1,7 +1,7 @@ use crate::export_mesh_vtk; use fenris::connectivity::{ - Quad4d2Connectivity, Quad9d2Connectivity, Tet10Connectivity, Tet4Connectivity, Tri3d2Connectivity, - Tri3d3Connectivity, Tri6d2Connectivity, + Hex27Connectivity, Hex8Connectivity, Quad4d2Connectivity, Quad9d2Connectivity, Tet10Connectivity, Tet4Connectivity, + Tri3d2Connectivity, Tri3d3Connectivity, Tri6d2Connectivity, }; use fenris::io::msh::load_msh_from_file; use insta::assert_debug_snapshot; @@ -137,3 +137,29 @@ fn load_msh_cube_tet10() -> eyre::Result<()> { Ok(()) } + +#[test] +fn load_msh_cube_hex8() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/cube_hex8_8.msh")?; + + assert_eq!(mesh.vertices().len(), 27); + assert_eq!(mesh.connectivity().len(), 8); + + export_mesh_vtk("io_msh", "load_msh_cube_hex8", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} + +#[test] +fn load_msh_cube_hex27() -> eyre::Result<()> { + let mesh = load_msh_from_file::("assets/meshes/cube_hex27_8.msh")?; + + assert_eq!(mesh.vertices().len(), 125); + assert_eq!(mesh.connectivity().len(), 8); + + export_mesh_vtk("io_msh", "load_msh_cube_hex27", &mesh); + assert_debug_snapshot!(mesh); + + Ok(()) +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_hex27.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_hex27.snap new file mode 100644 index 00000000..aa304159 --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_hex27.snap @@ -0,0 +1,883 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + 0.0, + ], + [ + 0.5, + 0.0, + 0.0, + ], + [ + 1.0, + 0.0, + 0.0, + ], + [ + 0.0, + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + 0.0, + ], + [ + 1.0, + 0.5, + 0.0, + ], + [ + 0.0, + 1.0, + 0.0, + ], + [ + 0.5, + 1.0, + 0.0, + ], + [ + 1.0, + 1.0, + 0.0, + ], + [ + 0.0, + 0.0, + 0.5, + ], + [ + 0.5, + 0.0, + 0.5, + ], + [ + 1.0, + 0.0, + 0.5, + ], + [ + 0.0, + 0.5, + 0.5, + ], + [ + 0.5, + 0.5, + 0.5, + ], + [ + 1.0, + 0.5, + 0.5, + ], + [ + 0.0, + 1.0, + 0.5, + ], + [ + 0.5, + 1.0, + 0.5, + ], + [ + 1.0, + 1.0, + 0.5, + ], + [ + 0.0, + 0.0, + 1.0, + ], + [ + 0.5, + 0.0, + 1.0, + ], + [ + 1.0, + 0.0, + 1.0, + ], + [ + 0.0, + 0.5, + 1.0, + ], + [ + 0.5, + 0.5, + 1.0, + ], + [ + 1.0, + 0.5, + 1.0, + ], + [ + 0.0, + 1.0, + 1.0, + ], + [ + 0.5, + 1.0, + 1.0, + ], + [ + 1.0, + 1.0, + 1.0, + ], + [ + 0.25, + 0.0, + 0.0, + ], + [ + 0.0, + 0.25, + 0.0, + ], + [ + 0.0, + 0.0, + 0.25, + ], + [ + 0.5, + 0.25, + 0.0, + ], + [ + 0.5, + 0.0, + 0.25, + ], + [ + 0.25, + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + 0.25, + ], + [ + 0.0, + 0.5, + 0.25, + ], + [ + 0.25, + 0.0, + 0.5, + ], + [ + 0.0, + 0.25, + 0.5, + ], + [ + 0.5, + 0.25, + 0.5, + ], + [ + 0.25, + 0.5, + 0.5, + ], + [ + 0.25, + 0.25, + 0.0, + ], + [ + 0.25, + 0.0, + 0.25, + ], + [ + 0.0, + 0.25, + 0.25, + ], + [ + 0.5, + 0.25, + 0.25, + ], + [ + 0.25, + 0.5, + 0.25, + ], + [ + 0.25, + 0.25, + 0.5, + ], + [ + 0.25, + 0.25, + 0.25, + ], + [ + 0.75, + 0.0, + 0.0, + ], + [ + 1.0, + 0.25, + 0.0, + ], + [ + 1.0, + 0.0, + 0.25, + ], + [ + 0.75, + 0.5, + 0.0, + ], + [ + 1.0, + 0.5, + 0.25, + ], + [ + 0.75, + 0.0, + 0.5, + ], + [ + 1.0, + 0.25, + 0.5, + ], + [ + 0.75, + 0.5, + 0.5, + ], + [ + 0.75, + 0.25, + 0.0, + ], + [ + 0.75, + 0.0, + 0.25, + ], + [ + 1.0, + 0.25, + 0.25, + ], + [ + 0.75, + 0.5, + 0.25, + ], + [ + 0.75, + 0.25, + 0.5, + ], + [ + 0.75, + 0.25, + 0.25, + ], + [ + 0.0, + 0.75, + 0.0, + ], + [ + 0.5, + 0.75, + 0.0, + ], + [ + 0.25, + 1.0, + 0.0, + ], + [ + 0.5, + 1.0, + 0.25, + ], + [ + 0.0, + 1.0, + 0.25, + ], + [ + 0.0, + 0.75, + 0.5, + ], + [ + 0.5, + 0.75, + 0.5, + ], + [ + 0.25, + 1.0, + 0.5, + ], + [ + 0.25, + 0.75, + 0.0, + ], + [ + 0.0, + 0.75, + 0.25, + ], + [ + 0.5, + 0.75, + 0.25, + ], + [ + 0.25, + 1.0, + 0.25, + ], + [ + 0.25, + 0.75, + 0.5, + ], + [ + 0.25, + 0.75, + 0.25, + ], + [ + 1.0, + 0.75, + 0.0, + ], + [ + 0.75, + 1.0, + 0.0, + ], + [ + 1.0, + 1.0, + 0.25, + ], + [ + 1.0, + 0.75, + 0.5, + ], + [ + 0.75, + 1.0, + 0.5, + ], + [ + 0.75, + 0.75, + 0.0, + ], + [ + 1.0, + 0.75, + 0.25, + ], + [ + 0.75, + 1.0, + 0.25, + ], + [ + 0.75, + 0.75, + 0.5, + ], + [ + 0.75, + 0.75, + 0.25, + ], + [ + 0.0, + 0.0, + 0.75, + ], + [ + 0.5, + 0.0, + 0.75, + ], + [ + 0.5, + 0.5, + 0.75, + ], + [ + 0.0, + 0.5, + 0.75, + ], + [ + 0.25, + 0.0, + 1.0, + ], + [ + 0.0, + 0.25, + 1.0, + ], + [ + 0.5, + 0.25, + 1.0, + ], + [ + 0.25, + 0.5, + 1.0, + ], + [ + 0.25, + 0.0, + 0.75, + ], + [ + 0.0, + 0.25, + 0.75, + ], + [ + 0.5, + 0.25, + 0.75, + ], + [ + 0.25, + 0.5, + 0.75, + ], + [ + 0.25, + 0.25, + 1.0, + ], + [ + 0.25, + 0.25, + 0.75, + ], + [ + 1.0, + 0.0, + 0.75, + ], + [ + 1.0, + 0.5, + 0.75, + ], + [ + 0.75, + 0.0, + 1.0, + ], + [ + 1.0, + 0.25, + 1.0, + ], + [ + 0.75, + 0.5, + 1.0, + ], + [ + 0.75, + 0.0, + 0.75, + ], + [ + 1.0, + 0.25, + 0.75, + ], + [ + 0.75, + 0.5, + 0.75, + ], + [ + 0.75, + 0.25, + 1.0, + ], + [ + 0.75, + 0.25, + 0.75, + ], + [ + 0.5, + 1.0, + 0.75, + ], + [ + 0.0, + 1.0, + 0.75, + ], + [ + 0.0, + 0.75, + 1.0, + ], + [ + 0.5, + 0.75, + 1.0, + ], + [ + 0.25, + 1.0, + 1.0, + ], + [ + 0.0, + 0.75, + 0.75, + ], + [ + 0.5, + 0.75, + 0.75, + ], + [ + 0.25, + 1.0, + 0.75, + ], + [ + 0.25, + 0.75, + 1.0, + ], + [ + 0.25, + 0.75, + 0.75, + ], + [ + 1.0, + 1.0, + 0.75, + ], + [ + 1.0, + 0.75, + 1.0, + ], + [ + 0.75, + 1.0, + 1.0, + ], + [ + 1.0, + 0.75, + 0.75, + ], + [ + 0.75, + 1.0, + 0.75, + ], + [ + 0.75, + 0.75, + 1.0, + ], + [ + 0.75, + 0.75, + 0.75, + ], + ], + connectivity: [ + Hex27Connectivity( + [ + 0, + 1, + 4, + 3, + 9, + 10, + 13, + 12, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + ], + ), + Hex27Connectivity( + [ + 1, + 2, + 5, + 4, + 10, + 11, + 14, + 13, + 46, + 30, + 31, + 47, + 48, + 49, + 50, + 33, + 51, + 37, + 52, + 53, + 54, + 55, + 42, + 56, + 57, + 58, + 59, + ], + ), + Hex27Connectivity( + [ + 3, + 4, + 7, + 6, + 12, + 13, + 16, + 15, + 32, + 60, + 34, + 61, + 33, + 62, + 63, + 64, + 38, + 65, + 66, + 67, + 68, + 43, + 69, + 70, + 71, + 72, + 73, + ], + ), + Hex27Connectivity( + [ + 4, + 5, + 8, + 7, + 13, + 14, + 17, + 16, + 49, + 61, + 33, + 74, + 50, + 75, + 76, + 63, + 53, + 66, + 77, + 78, + 79, + 57, + 70, + 80, + 81, + 82, + 83, + ], + ), + Hex27Connectivity( + [ + 9, + 10, + 13, + 12, + 18, + 19, + 22, + 21, + 35, + 36, + 84, + 37, + 85, + 38, + 86, + 87, + 88, + 89, + 90, + 91, + 44, + 92, + 93, + 94, + 95, + 96, + 97, + ], + ), + Hex27Connectivity( + [ + 10, + 11, + 14, + 13, + 19, + 20, + 23, + 22, + 51, + 37, + 85, + 52, + 98, + 53, + 99, + 86, + 100, + 90, + 101, + 102, + 58, + 103, + 94, + 104, + 105, + 106, + 107, + ], + ), + Hex27Connectivity( + [ + 12, + 13, + 16, + 15, + 21, + 22, + 25, + 24, + 38, + 65, + 87, + 66, + 86, + 67, + 108, + 109, + 91, + 110, + 111, + 112, + 72, + 95, + 113, + 114, + 115, + 116, + 117, + ], + ), + Hex27Connectivity( + [ + 13, + 14, + 17, + 16, + 22, + 23, + 26, + 25, + 53, + 66, + 86, + 77, + 99, + 78, + 118, + 108, + 102, + 111, + 119, + 120, + 82, + 105, + 114, + 121, + 122, + 123, + 124, + ], + ), + ], +} diff --git a/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_hex8.snap b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_hex8.snap new file mode 100644 index 00000000..845cf389 --- /dev/null +++ b/tests/unit_tests/io/snapshots/unit__unit_tests__io__msh__load_msh_cube_hex8.snap @@ -0,0 +1,241 @@ +--- +source: tests/unit_tests/io/msh.rs +expression: mesh +--- +Mesh { + vertices: [ + [ + 0.0, + 0.0, + 0.0, + ], + [ + 0.5, + 0.0, + 0.0, + ], + [ + 1.0, + 0.0, + 0.0, + ], + [ + 0.0, + 0.5, + 0.0, + ], + [ + 0.5, + 0.5, + 0.0, + ], + [ + 1.0, + 0.5, + 0.0, + ], + [ + 0.0, + 1.0, + 0.0, + ], + [ + 0.5, + 1.0, + 0.0, + ], + [ + 1.0, + 1.0, + 0.0, + ], + [ + 0.0, + 0.0, + 0.5, + ], + [ + 0.5, + 0.0, + 0.5, + ], + [ + 1.0, + 0.0, + 0.5, + ], + [ + 0.0, + 0.5, + 0.5, + ], + [ + 0.5, + 0.5, + 0.5, + ], + [ + 1.0, + 0.5, + 0.5, + ], + [ + 0.0, + 1.0, + 0.5, + ], + [ + 0.5, + 1.0, + 0.5, + ], + [ + 1.0, + 1.0, + 0.5, + ], + [ + 0.0, + 0.0, + 1.0, + ], + [ + 0.5, + 0.0, + 1.0, + ], + [ + 1.0, + 0.0, + 1.0, + ], + [ + 0.0, + 0.5, + 1.0, + ], + [ + 0.5, + 0.5, + 1.0, + ], + [ + 1.0, + 0.5, + 1.0, + ], + [ + 0.0, + 1.0, + 1.0, + ], + [ + 0.5, + 1.0, + 1.0, + ], + [ + 1.0, + 1.0, + 1.0, + ], + ], + connectivity: [ + Hex8Connectivity( + [ + 0, + 1, + 4, + 3, + 9, + 10, + 13, + 12, + ], + ), + Hex8Connectivity( + [ + 1, + 2, + 5, + 4, + 10, + 11, + 14, + 13, + ], + ), + Hex8Connectivity( + [ + 3, + 4, + 7, + 6, + 12, + 13, + 16, + 15, + ], + ), + Hex8Connectivity( + [ + 4, + 5, + 8, + 7, + 13, + 14, + 17, + 16, + ], + ), + Hex8Connectivity( + [ + 9, + 10, + 13, + 12, + 18, + 19, + 22, + 21, + ], + ), + Hex8Connectivity( + [ + 10, + 11, + 14, + 13, + 19, + 20, + 23, + 22, + ], + ), + Hex8Connectivity( + [ + 12, + 13, + 16, + 15, + 21, + 22, + 25, + 24, + ], + ), + Hex8Connectivity( + [ + 13, + 14, + 17, + 16, + 22, + 23, + 26, + 25, + ], + ), + ], +} From 6a1115271f7480ca5ef40b68458f334e0bc44bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Tue, 20 Dec 2022 10:41:48 +0100 Subject: [PATCH 15/15] Update comment --- src/io/msh.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/io/msh.rs b/src/io/msh.rs index d8b0e207..a3409ff5 100644 --- a/src/io/msh.rs +++ b/src/io/msh.rs @@ -121,14 +121,17 @@ where )); } - // Note: The MSH `node_block`'s `entity_dim` does not seem to correspond to the geometrical + // Note: The following check is commented out because it can lead to missing nodes. + // Probable explanation: + // The MSH `node_block`'s `entity_dim` does not seem to correspond to the geometrical // dimension of the points. Rather it seems to correspond to the dimension of the "physical" // object represented by the node block. // When creating primitives in Gmsh for example, the nodes of a triangulation of a sphere are // divided into node_blocks representing its equator, surface and volume and all of them are // referenced by the volumetric elements. - // In addition, all node blocks have to be read in order for the global `node_tag` indexing to - // be consistent work. + // In addition, all node blocks have to be read anyway in order for the global `node_tag` indexing to + // work consistently. + // TODO: Revisit this after some more experience with loading MSH files and delete this. /* if node_block .entity_dim