This is useful for loading codim 1 and codim 2 meshes.
numbers.end()),
type_name_2.end());
- if (type_name_2 == "TRI" || type_name_2 == "TRIANGLE")
+ // The manual specifies BAR, BEAM, and TRUSS: in practice people use EDGE
+ if (type_name_2 == "BAR" || type_name_2 == "BEAM" ||
+ type_name_2 == "EDGE" || type_name_2 == "TRUSS")
+ return ReferenceCells::Line;
+ else if (type_name_2 == "TRI" || type_name_2 == "TRIANGLE")
return ReferenceCells::Triangle;
else if (type_name_2 == "QUAD" || type_name_2 == "QUADRILATERAL")
return ReferenceCells::Quadrilateral;
AssertThrowExodusII(ierr);
const ReferenceCell type =
exodusii_name_to_type(string_temp.data(), n_nodes_per_element);
+ AssertThrow(type.get_dimension() == dim,
+ ExcMessage(
+ "The ExodusII block " + std::to_string(element_block_id) +
+ " with element type " + std::string(string_temp.data()) +
+ " has dimension " + std::to_string(type.get_dimension()) +
+ ", which does not match the topological mesh dimension " +
+ std::to_string(dim) + "."));
// The number of nodes per element may be larger than what we want to
// read - for example, if the Exodus file contains a QUAD9 element, we
deallog << std::endl;
}
- for (const auto &face : tria.active_face_iterators())
- {
- if (face->at_boundary())
- {
- deallog << "face center = " << face->center();
- if (read_as_manifolds)
- deallog << " face manifold id = " << face->manifold_id();
- else
- deallog << " face boundary id = " << face->boundary_id();
- deallog << std::endl;
- }
- }
+ if (dim > 1)
+ for (const auto &face : tria.active_face_iterators())
+ {
+ if (face->at_boundary())
+ {
+ deallog << "face center = " << face->center();
+ if (read_as_manifolds)
+ deallog << " face manifold id = " << face->manifold_id();
+ else
+ deallog << " face boundary id = " << face->boundary_id();
+ deallog << std::endl;
+ }
+ }
deallog << "Number of vertices: " << tria.get_vertices().size() << std::endl;
deallog << "Number of cells: " << tria.n_cells() << std::endl;
deallog << "--------------------------------------" << std::endl;
read_and_print<3>(SOURCE_DIR "/grids/exodusii/four-sidesets.e", true);
+ deallog << "-------------" << std::endl;
+ deallog << "codim 1 lines" << std::endl;
+ deallog << "-------------" << std::endl;
+ read_and_print<1, 2>(SOURCE_DIR "/grids/exodusii/lines.e");
deallog << "OK" << std::endl;
}
-1 -1 -1 -1
1 2 5 3 4 1 5 1 4 3 1 4 6 3
+DEAL::-------------
+DEAL::codim 1 lines
+DEAL::-------------
+DEAL::boundary id = 0 sideset ids =
+DEAL::Number of vertices: 9
+DEAL::Number of cells: 8
+DEAL::cell 0 type = Line volume = 3.50000
+DEAL::cell 1 type = Line volume = 7.00000
+DEAL::cell 2 type = Line volume = 2.82843
+DEAL::cell 3 type = Line volume = 3.00000
+DEAL::cell 4 type = Line volume = 7.00000
+DEAL::cell 5 type = Line volume = 2.82843
+DEAL::cell 6 type = Line volume = 7.00000
+DEAL::cell 7 type = Line volume = 2.82843
+# vtk DataFile Version 3.0
+Triangulation generated with deal.II
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 9 double
+0.0 0.0 0
+7.0 0.0 0
+5.0 2.0 0
+2.0 2.0 0
+2.0 5.0 0
+0.0 7.0 0
+5.0 5.0 0
+7.0 3.5 0
+7.0 7.0 0
+
+CELLS 8 24
+2 7 1
+2 1 0
+2 0 3
+2 3 2
+2 0 5
+2 5 4
+2 5 8
+2 8 6
+
+CELL_TYPES 8
+3 3 3 3 3 3 3 3
+
+
+
+CELL_DATA 8
+SCALARS MaterialID int 1
+LOOKUP_TABLE default
+1 1 1 1 1 1 1 1
+
+
+
+SCALARS ManifoldID int 1
+LOOKUP_TABLE default
+-1 -1 -1 -1 -1 -1 -1 -1
+
+
DEAL::OK