From 99374c889a011247639e6292658530dc9ec4e250 Mon Sep 17 00:00:00 2001 From: Daniel Paukner Date: Mon, 27 Jul 2020 11:32:10 +0200 Subject: [PATCH] minor changes to add recommendations --- source/grid/grid_in.cc | 33 +++++++++++++++++---------------- tests/simplex/grid_in_msh.cc | 8 ++++---- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index 0fe7e29098..5ab35d4566 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -1731,8 +1731,8 @@ GridIn::read_msh(std::istream &in) std::vector> cells; SubCellData subcelldata; std::map boundary_ids_1d; - bool is_hex_mesh = false; - bool is_tet_mesh = false; + bool is_quad_or_hex_mesh = false; + bool is_tria_or_tet_mesh = false; { unsigned int global_cell = 0; @@ -1883,23 +1883,23 @@ GridIn::read_msh(std::istream &in) vertices_per_cell = 2; else if (cell_type == 2) // tri { - vertices_per_cell = 3; - is_tet_mesh = true; + vertices_per_cell = 3; + is_tria_or_tet_mesh = true; } else if (cell_type == 3) // quad { - vertices_per_cell = 4; - is_hex_mesh = true; + vertices_per_cell = 4; + is_quad_or_hex_mesh = true; } else if (cell_type == 4) // tet { - vertices_per_cell = 4; - is_tet_mesh = true; + vertices_per_cell = 4; + is_tria_or_tet_mesh = true; } else if (cell_type == 5) // hex { - vertices_per_cell = 8; - is_hex_mesh = true; + vertices_per_cell = 8; + is_quad_or_hex_mesh = true; } AssertThrow(nod_num == vertices_per_cell, @@ -1987,13 +1987,13 @@ GridIn::read_msh(std::istream &in) // check cell type if (cell_type == 2) // tri { - vertices_per_cell = 3; - is_tet_mesh = true; + vertices_per_cell = 3; + is_tria_or_tet_mesh = true; } else if (cell_type == 3) // quad { - vertices_per_cell = 4; - is_hex_mesh = true; + vertices_per_cell = 4; + is_quad_or_hex_mesh = true; } subcelldata.boundary_quads.emplace_back(); @@ -2085,9 +2085,10 @@ GridIn::read_msh(std::istream &in) // GridReordering::reorder_cells(), // Triangulation::create_triangulation_compatibility()) need to be revisited // for simplex meshes - AssertThrow(dim == 1 || (is_tet_mesh ^ is_hex_mesh), ExcNotImplemented()); + AssertThrow(dim == 1 || (is_tria_or_tet_mesh ^ is_quad_or_hex_mesh), + ExcNotImplemented()); - if (dim == 1 || is_hex_mesh) + if (dim == 1 || is_quad_or_hex_mesh) { // do some clean-up on vertices... GridTools::delete_unused_vertices(vertices, cells, subcelldata); diff --git a/tests/simplex/grid_in_msh.cc b/tests/simplex/grid_in_msh.cc index 397ddab50f..087581a009 100644 --- a/tests/simplex/grid_in_msh.cc +++ b/tests/simplex/grid_in_msh.cc @@ -27,7 +27,7 @@ template void -check_file(const std::string &file_name, const unsigned int vertices_per_cell) +check_file(const std::string &file_name) { Triangulation tria; @@ -55,12 +55,12 @@ main() // TRIANGULAR ELEMENTS // dim = spacedim = 2 deallog.push("triangluar_elements_dim2_spacedim2: "); - check_file<2, 2>(std::string(SOURCE_DIR "/grid_in_msh/tri.msh"), 3); + check_file<2, 2>(std::string(SOURCE_DIR "/grid_in_msh/tri.msh")); deallog.pop(); // dim = 2, spacedim = 3 deallog.push("triangluar_elements_dim2_spacedim3: "); - check_file<2, 3>(std::string(SOURCE_DIR "/grid_in_msh/tri.msh"), 3); + check_file<2, 3>(std::string(SOURCE_DIR "/grid_in_msh/tri.msh")); deallog.pop(); @@ -68,6 +68,6 @@ main() // TETRAHEDRAL ELEMENTS // dim = spacedim = 3 deallog.push("tetrahedral_elements_dim3_spacedim3: "); - check_file<3, 3>(std::string(SOURCE_DIR "/grid_in_msh/tet.msh"), 4); + check_file<3, 3>(std::string(SOURCE_DIR "/grid_in_msh/tet.msh")); deallog.pop(); } -- 2.39.5