]> https://gitweb.dealii.org/ - dealii.git/commitdiff
minor changes to add recommendations 10727/head
authorDaniel Paukner <daniel.paukner@gmx.de>
Mon, 27 Jul 2020 09:32:10 +0000 (11:32 +0200)
committerDaniel Paukner <daniel.paukner@gmx.de>
Mon, 27 Jul 2020 09:32:10 +0000 (11:32 +0200)
source/grid/grid_in.cc
tests/simplex/grid_in_msh.cc

index 0fe7e290983e6b9ef00b736f63d28aed690f6089..5ab35d45668145884e75bde786ae4e8c6157df06 100644 (file)
@@ -1731,8 +1731,8 @@ GridIn<dim, spacedim>::read_msh(std::istream &in)
   std::vector<CellData<dim>>                 cells;
   SubCellData                                subcelldata;
   std::map<unsigned int, types::boundary_id> 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<dim, spacedim>::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<dim, spacedim>::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<dim, spacedim>::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);
index 397ddab50fab0438bee721451f2b3ae879767774..087581a00984eb80a81589fdf3544a1ef49f24f2 100644 (file)
@@ -27,7 +27,7 @@
 
 template <int dim, int spacedim>
 void
-check_file(const std::string &file_name, const unsigned int vertices_per_cell)
+check_file(const std::string &file_name)
 {
   Triangulation<dim, spacedim> 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();
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.