26 #include <boost/algorithm/string.hpp>
27 #include <boost/archive/binary_iarchive.hpp>
28 #include <boost/io/ios_state.hpp>
29 #include <boost/property_tree/ptree.hpp>
30 #include <boost/property_tree/xml_parser.hpp>
31 #include <boost/serialization/serialization.hpp>
33 #ifdef DEAL_II_GMSH_WITH_API
44 #ifdef DEAL_II_WITH_ASSIMP
45 # include <assimp/Importer.hpp>
46 # include <assimp/postprocess.h>
47 # include <assimp/scene.h>
50 #ifdef DEAL_II_TRILINOS_WITH_SEACAS
51 # include <exodusII.h>
77 template <
int spacedim>
79 assign_1d_boundary_ids(
86 if (cell->face(face_no)->at_boundary())
87 for (
const auto &pair : boundary_ids)
88 if (cell->face(face_no)->vertex(0) == pair.first)
90 cell->face(face_no)->set_boundary_id(pair.second);
96 template <
int dim,
int spacedim>
98 assign_1d_boundary_ids(
110 template <
int dim,
int spacedim>
118 const auto n_hypercube_vertices =
119 ReferenceCells::get_hypercube<dim>().n_vertices();
120 bool is_only_hypercube =
true;
122 if (cell.vertices.size() != n_hypercube_vertices)
124 is_only_hypercube =
false;
132 if (is_only_hypercube)
137 template <
int dim,
int spacedim>
139 :
tria(nullptr, typeid(*this).name())
145 template <
int dim,
int spacedim>
147 :
tria(&t, typeid(*this).name())
153 template <
int dim,
int spacedim>
162 template <
int dim,
int spacedim>
174 text[0] =
"# vtk DataFile Version 3.0";
177 text[3] =
"DATASET UNSTRUCTURED_GRID";
179 for (
unsigned int i = 0; i < 4; ++i)
184 line.compare(text[i]) == 0,
187 "While reading VTK file, failed to find a header line with text <") +
194 std::vector<Point<spacedim>>
vertices;
195 std::vector<CellData<dim>> cells;
204 if (keyword ==
"POINTS")
206 unsigned int n_vertices;
211 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
215 in >> x(0) >> x(1) >> x(2);
218 for (
unsigned int d = 0;
d < spacedim; ++
d)
226 "While reading VTK file, failed to find POINTS section"));
230 unsigned int n_geometric_objects = 0;
233 if (keyword ==
"CELLS")
236 std::vector<unsigned int> cell_types;
238 std::streampos oldpos = in.tellg();
241 while (in >> keyword)
242 if (keyword ==
"CELL_TYPES")
246 cell_types.resize(n_ints);
248 for (
unsigned int i = 0; i < n_ints; ++i)
257 in >> n_geometric_objects;
262 for (
unsigned int count = 0; count < n_geometric_objects; ++count)
264 unsigned int n_vertices;
268 if (cell_types[count] == 10 || cell_types[count] == 12)
276 cells.emplace_back(n_vertices);
278 for (
unsigned int j = 0; j < n_vertices;
280 in >> cells.back().vertices[j];
284 if (cell_types[count] == 12)
287 cells.back().vertices[3]);
289 cells.back().vertices[7]);
292 cells.back().material_id = 0;
295 else if (cell_types[count] == 5 || cell_types[count] == 9)
304 for (
unsigned int j = 0; j < n_vertices;
311 else if (cell_types[count] == 3)
315 for (
unsigned int j = 0; j < n_vertices;
326 "While reading VTK file, unknown cell type encountered"));
331 for (
unsigned int count = 0; count < n_geometric_objects; ++count)
333 unsigned int n_vertices;
337 if (cell_types[count] == 5 || cell_types[count] == 9)
344 cells.emplace_back(n_vertices);
346 for (
unsigned int j = 0; j < n_vertices;
348 in >> cells.back().vertices[j];
352 if (cell_types[count] == 9)
357 cells.back().vertices[3]);
360 cells.back().material_id = 0;
363 else if (cell_types[count] == 3)
369 for (
unsigned int j = 0; j < n_vertices;
382 "While reading VTK file, unknown cell type encountered"));
387 for (
unsigned int count = 0; count < n_geometric_objects; ++count)
393 cell_types[count] == 3 && type == 2,
395 "While reading VTK file, unknown cell type encountered"));
396 cells.emplace_back(type);
398 for (
unsigned int j = 0; j < type; ++j)
399 in >> cells.back().vertices[j];
401 cells.back().material_id = 0;
407 "While reading VTK file, failed to find CELLS section"));
414 keyword ==
"CELL_TYPES",
416 "While reading VTK file, missing CELL_TYPES section. Found <" +
417 keyword +
"> instead.")));
421 n_ints == n_geometric_objects,
422 ExcMessage(
"The VTK reader found a CELL_DATA statement "
423 "that lists a total of " +
425 " cell data objects, but this needs to "
426 "equal the number of cells (which is " +
428 ") plus the number of quads (" +
430 " in 3d or the number of lines (" +
435 for (
unsigned int i = 0; i < n_ints; ++i)
439 while (in >> keyword)
440 if (keyword ==
"CELL_DATA")
446 ExcMessage(
"The VTK reader found a CELL_DATA statement "
447 "that lists a total of " +
449 " cell data objects, but this needs to "
450 "equal the number of cells (which is " +
452 ") plus the number of quads (" +
455 " in 3d or the number of lines (" +
460 const std::vector<std::string> data_sets{
"MaterialID",
463 for (
unsigned int i = 0; i < data_sets.size(); ++i)
466 while (in >> keyword)
467 if (keyword ==
"SCALARS")
472 std::string field_name;
474 if (std::find(data_sets.begin(),
476 field_name) == data_sets.end())
488 std::getline(in, line);
491 std::min(
static_cast<std::size_t
>(3),
492 line.size() - 1)) ==
"int",
494 "While reading VTK file, material- and manifold IDs can only have type 'int'."));
498 keyword ==
"LOOKUP_TABLE",
500 "While reading VTK file, missing keyword 'LOOKUP_TABLE'."));
504 keyword ==
"default",
506 "While reading VTK file, missing keyword 'default'."));
513 for (
unsigned int i = 0; i < cells.size(); ++i)
517 if (field_name ==
"MaterialID")
518 cells[i].material_id =
520 else if (field_name ==
"ManifoldID")
521 cells[i].manifold_id =
533 if (field_name ==
"MaterialID")
534 boundary_quad.material_id =
536 else if (field_name ==
"ManifoldID")
537 boundary_quad.manifold_id =
546 if (field_name ==
"MaterialID")
547 boundary_line.material_id =
549 else if (field_name ==
"ManifoldID")
550 boundary_line.manifold_id =
562 if (field_name ==
"MaterialID")
563 boundary_line.material_id =
565 else if (field_name ==
"ManifoldID")
566 boundary_line.manifold_id =
576 apply_grid_fixup_functions(
vertices, cells, subcelldata);
582 "While reading VTK file, failed to find CELLS section"));
587 template <
int dim,
int spacedim>
591 namespace pt = boost::property_tree;
593 pt::read_xml(in, tree);
594 auto section = tree.get_optional<std::string>(
"VTKFile.dealiiData");
598 "While reading a VTU file, failed to find dealiiData section. "
599 "Notice that we can only read grid files in .vtu format that "
600 "were created by the deal.II library, using a call to "
601 "GridOut::write_vtu(), where the flag "
602 "GridOutFlags::Vtu::serialize_triangulation is set to true."));
606 const auto string_archive =
608 std::istringstream in_stream(string_archive);
609 boost::archive::binary_iarchive ia(in_stream);
614 template <
int dim,
int spacedim>
622 skip_comment_lines(in,
'#');
633 "Expected '-1' before and after a section."));
645 std::getline(in, line);
648 if (line.compare(
"-1") == 0)
659 std::vector<Point<spacedim>>
vertices;
678 in >> dummy >> dummy >> dummy;
681 in >> x[0] >> x[1] >> x[2];
685 for (
unsigned int d = 0;
d < spacedim; ++
d)
700 AssertThrow(tmp == 2412, ExcUnknownSectionType(tmp));
702 std::vector<CellData<dim>> cells;
729 in >> type >> dummy >> dummy >> dummy >> dummy;
731 AssertThrow((type == 11) || (type == 44) || (type == 94) || (type == 115),
732 ExcUnknownElementType(type));
734 if ((((type == 44) || (type == 94)) && (dim == 2)) ||
735 ((type == 115) && (dim == 3)))
738 cells.emplace_back();
745 cells.back().material_id = 0;
748 cells.back().vertices[v] =
vertex_indices[cells.back().vertices[v]];
750 cell_indices[no] = no_cell;
754 else if (((type == 11) && (dim == 2)) ||
755 ((type == 11) && (dim == 3)))
758 in >> dummy >> dummy >> dummy;
763 for (
unsigned int &vertex :
769 for (
unsigned int &vertex :
773 line_indices[no] = no_line;
777 else if (((type == 44) || (type == 94)) && (dim == 3))
792 for (
unsigned int &vertex :
796 quad_indices[no] = no_quad;
804 "> when running in dim=" +
823 AssertThrow((tmp == 2467) || (tmp == 2477), ExcUnknownSectionType(tmp));
839 in >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >>
850 std::getline(in, line);
853 "The line before the line containing an ID has too "
854 "many entries. This is not a valid UNV file."));
856 std::getline(in, line);
858 std::istringstream id_stream(line);
861 !id_stream.fail() && id_stream.eof(),
863 "The given UNV file contains a boundary or material id set to '" +
865 "', which cannot be parsed as a fixed-width integer, whereas "
866 "deal.II only supports integer boundary and material ids. To fix "
867 "this, ensure that all such ids are given integer values."));
872 "' is not convertible to either types::material_id nor "
873 "types::boundary_id."));
875 const unsigned int n_lines =
876 (n_entities % 2 == 0) ? (n_entities / 2) : ((n_entities + 1) / 2);
878 for (
unsigned int line = 0; line < n_lines; ++line)
880 unsigned int n_fragments;
882 if (line == n_lines - 1)
883 n_fragments = (n_entities % 2 == 0) ? (2) : (1);
887 for (
unsigned int no_fragment = 0; no_fragment < n_fragments;
891 in >> dummy >> no >> dummy >> dummy;
893 if (cell_indices.count(no) > 0)
894 cells[cell_indices[no]].material_id = id;
896 if (line_indices.count(no) > 0)
900 if (quad_indices.count(no) > 0)
908 apply_grid_fixup_functions(
vertices, cells, subcelldata);
914 template <
int dim,
int spacedim>
917 const bool apply_all_indicators_to_manifolds)
923 skip_comment_lines(in,
'#');
926 unsigned int n_vertices;
930 in >> n_vertices >>
n_cells >> dummy
936 std::vector<Point<spacedim>>
vertices(n_vertices);
942 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
949 in >> vertex_number >> x[0] >> x[1] >> x[2];
952 for (
unsigned int d = 0;
d < spacedim; ++
d)
961 std::vector<CellData<dim>> cells;
964 for (
unsigned int cell = 0; cell <
n_cells; ++cell)
973 std::string cell_type;
983 if (((cell_type ==
"line") && (dim == 1)) ||
984 ((cell_type ==
"quad") && (dim == 2)) ||
985 ((cell_type ==
"hex") && (dim == 3)))
989 cells.emplace_back();
1002 if (apply_all_indicators_to_manifolds)
1003 cells.back().manifold_id =
1013 cells.back().vertices[i] =
1020 cells.back().vertices[i]));
1025 else if ((cell_type ==
"line") && ((dim == 2) || (dim == 3)))
1045 if (apply_all_indicators_to_manifolds)
1062 for (
unsigned int &vertex :
1074 else if ((cell_type ==
"quad") && (dim == 3))
1095 if (apply_all_indicators_to_manifolds)
1112 for (
unsigned int &vertex :
1126 AssertThrow(
false, ExcUnknownIdentifier(cell_type));
1131 apply_grid_fixup_functions(
vertices, cells, subcelldata);
1137 template <
int dim,
int spacedim>
1144 read_in_abaqus(std::istream &in);
1146 write_out_avs_ucd(std::ostream &out)
const;
1149 const double tolerance;
1152 get_global_node_numbers(
const int face_cell_no,
1153 const int face_cell_face_no)
const;
1156 std::vector<std::vector<double>> node_list;
1159 std::vector<std::vector<double>> cell_list;
1161 std::vector<std::vector<double>> face_list;
1164 std::map<std::string, std::vector<int>> elsets_list;
1168 template <
int dim,
int spacedim>
1171 const bool apply_all_indicators_to_manifolds)
1178 Assert((spacedim == 2 && dim == spacedim) ||
1179 (spacedim == 3 && (dim == spacedim || dim == spacedim - 1)),
1185 Abaqus_to_UCD<dim, spacedim> abaqus_to_ucd;
1186 abaqus_to_ucd.read_in_abaqus(in);
1188 std::stringstream in_ucd;
1189 abaqus_to_ucd.write_out_avs_ucd(in_ucd);
1197 read_ucd(in_ucd, apply_all_indicators_to_manifolds);
1199 catch (std::exception &exc)
1201 std::cerr <<
"Exception on processing internal UCD data: " << std::endl
1202 << exc.what() << std::endl;
1207 "Internal conversion from ABAQUS file to UCD format was unsuccessful. "
1208 "More information is provided in an error message printed above. "
1209 "Are you sure that your ABAQUS mesh file conforms with the requirements "
1210 "listed in the documentation?"));
1217 "Internal conversion from ABAQUS file to UCD format was unsuccessful. "
1218 "Are you sure that your ABAQUS mesh file conforms with the requirements "
1219 "listed in the documentation?"));
1224 template <
int dim,
int spacedim>
1234 skip_comment_lines(in,
'#');
1240 AssertThrow(line ==
"MeshVersionFormatted 0", ExcInvalidDBMESHInput(line));
1242 skip_empty_lines(in);
1246 AssertThrow(line ==
"Dimension", ExcInvalidDBMESHInput(line));
1247 unsigned int dimension;
1249 AssertThrow(dimension == dim, ExcDBMESHWrongDimension(dimension));
1250 skip_empty_lines(in);
1263 while (getline(in, line), line.find(
"# END") == std::string::npos)
1265 skip_empty_lines(in);
1270 AssertThrow(line ==
"Vertices", ExcInvalidDBMESHInput(line));
1272 unsigned int n_vertices;
1276 std::vector<Point<spacedim>>
vertices(n_vertices);
1277 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
1280 for (
unsigned int d = 0;
d < dim; ++
d)
1287 skip_empty_lines(in);
1293 AssertThrow(line ==
"Edges", ExcInvalidDBMESHInput(line));
1295 unsigned int n_edges;
1297 for (
unsigned int edge = 0; edge < n_edges; ++edge)
1300 in >> dummy >> dummy;
1306 skip_empty_lines(in);
1315 AssertThrow(line ==
"CrackedEdges", ExcInvalidDBMESHInput(line));
1318 for (
unsigned int edge = 0; edge < n_edges; ++edge)
1321 in >> dummy >> dummy;
1327 skip_empty_lines(in);
1333 AssertThrow(line ==
"Quadrilaterals", ExcInvalidDBMESHInput(line));
1335 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
1336 {0, 1, 5, 4, 2, 3, 7, 6}};
1337 std::vector<CellData<dim>> cells;
1341 for (
unsigned int cell = 0; cell <
n_cells; ++cell)
1345 cells.emplace_back();
1349 cells.back().vertices[dim == 3 ? local_vertex_numbering[i] :
1353 (
static_cast<unsigned int>(cells.back().vertices[i]) <=
1357 --cells.back().vertices[i];
1365 skip_empty_lines(in);
1373 while (getline(in, line), ((line.find(
"End") == std::string::npos) && (in)))
1379 apply_grid_fixup_functions(
vertices, cells, subcelldata);
1385 template <
int dim,
int spacedim>
1392 const auto reference_cell = ReferenceCells::get_hypercube<dim>();
1396 std::getline(in, line);
1398 unsigned int n_vertices;
1403 std::getline(in, line);
1406 std::getline(in, line);
1409 for (
unsigned int i = 0; i < 8; ++i)
1410 std::getline(in, line);
1413 std::vector<CellData<dim>> cells(
n_cells);
1424 for (
unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
1425 in >> cell.vertices[
reference_cell.exodusii_vertex_to_deal_vertex(i)];
1429 std::vector<Point<spacedim>>
vertices(n_vertices);
1432 for (
unsigned int d = 0;
d < spacedim; ++
d)
1434 for (
unsigned int d = spacedim;
d < 3; ++
d)
1443 apply_grid_fixup_functions(
vertices, cells, subcelldata);
1449 template <
int dim,
int spacedim>
1466 std::stringstream whole_file;
1471 std::getline(in, line);
1479 if ((line.size() > 0) && (line.back() ==
'\r'))
1480 line.erase(line.size() - 1);
1485 if (line.find(
'#') != std::string::npos)
1486 line.erase(line.find(
'#'), std::string::npos);
1487 while ((line.size() > 0) && (line.back() ==
' '))
1488 line.erase(line.size() - 1);
1490 if (line.size() > 0)
1491 whole_file <<
'\n' << line;
1510 unsigned int version_major, version_minor;
1511 whole_file >> version_major >> version_minor;
1512 AssertThrow((version_major == 0) && (version_minor == 1),
1513 ExcMessage(
"deal.II can currently only read version 0.1 "
1514 "of the mphtxt file format."));
1519 unsigned int n_tags;
1520 whole_file >> n_tags;
1521 for (
unsigned int i = 0; i < n_tags; ++i)
1524 while (whole_file.peek() ==
'\n')
1526 std::getline(whole_file, dummy);
1532 unsigned int n_types;
1533 whole_file >> n_types;
1534 for (
unsigned int i = 0; i < n_types; ++i)
1537 while (whole_file.peek() ==
'\n')
1539 std::getline(whole_file, dummy);
1559 whole_file >> dummy >> dummy >> dummy;
1563 while (whole_file.peek() ==
'\n')
1565 std::getline(whole_file, s);
1567 ExcMessage(
"Expected '4 Mesh', but got '" + s +
"'."));
1570 unsigned int version;
1571 whole_file >> version;
1575 unsigned int file_space_dim;
1576 whole_file >> file_space_dim;
1580 "The mesh file uses a different number of space dimensions "
1581 "than the triangulation you want to read it into."));
1583 unsigned int n_vertices;
1584 whole_file >> n_vertices;
1586 unsigned int starting_vertex_index;
1587 whole_file >> starting_vertex_index;
1589 std::vector<Point<spacedim>>
vertices(n_vertices);
1590 for (
unsigned int v = 0; v < n_vertices; ++v)
1621 std::vector<CellData<dim>> cells;
1624 unsigned int n_types;
1625 whole_file >> n_types;
1626 for (
unsigned int type = 0; type < n_types; ++type)
1633 whole_file >> dummy;
1637 std::string object_name;
1638 whole_file >> object_name;
1640 static const std::map<std::string, ReferenceCell> name_to_type = {
1650 AssertThrow(name_to_type.find(object_name) != name_to_type.end(),
1651 ExcMessage(
"The input file contains a cell type <" +
1653 "> that the reader does not "
1654 "current support"));
1655 const ReferenceCell object_type = name_to_type.at(object_name);
1657 unsigned int n_vertices_per_element;
1658 whole_file >> n_vertices_per_element;
1660 unsigned int n_elements;
1661 whole_file >> n_elements;
1675 ExcMessage(
"Triangles should not appear in input files "
1683 "Quadrilaterals should not appear in input files "
1690 ExcMessage(
"Tetrahedra should not appear in input files "
1691 "for 1d or 2d meshes."));
1698 "Prisms (wedges) should not appear in input files "
1699 "for 1d or 2d meshes."));
1718 std::vector<unsigned int> vertices_for_this_element(
1719 n_vertices_per_element);
1720 for (
unsigned int e = 0;
e < n_elements; ++
e)
1723 for (
unsigned int v = 0; v < n_vertices_per_element; ++v)
1725 whole_file >> vertices_for_this_element[v];
1726 vertices_for_this_element[v] -= starting_vertex_index;
1735 cells.emplace_back();
1736 cells.back().vertices = vertices_for_this_element;
1742 vertices_for_this_element;
1750 cells.emplace_back();
1751 cells.back().vertices = vertices_for_this_element;
1757 vertices_for_this_element;
1765 cells.emplace_back();
1766 cells.back().vertices = vertices_for_this_element;
1779 unsigned int n_geom_entity_indices;
1780 whole_file >> n_geom_entity_indices;
1782 (n_geom_entity_indices == n_elements),
1789 if (n_geom_entity_indices != 0)
1791 for (
unsigned int e = 0;
e < n_geom_entity_indices; ++
e)
1794 unsigned int geometric_entity_index;
1795 whole_file >> geometric_entity_index;
1801 cells[cells.size() - n_elements +
e].material_id =
1802 geometric_entity_index;
1807 .boundary_id = geometric_entity_index;
1813 cells[cells.size() - n_elements +
e].material_id =
1814 geometric_entity_index;
1819 .boundary_id = geometric_entity_index;
1825 cells[cells.size() - n_elements +
e].material_id =
1826 geometric_entity_index;
1852 if (line.vertices[1] < line.vertices[0])
1853 std::swap(line.vertices[0], line.vertices[1]);
1858 return std::lexicographical_compare(a.vertices.begin(),
1880 Assert((face.vertices.size() == 3) || (face.vertices.size() == 4),
1882 std::sort(face.vertices.begin(), face.vertices.end());
1887 return std::lexicographical_compare(a.vertices.begin(),
1898 for (
const auto &face : cell->face_iterators())
1899 if (face->at_boundary())
1905 std::array<unsigned int, 2> face_vertex_indices = {
1906 {face->vertex_index(0), face->vertex_index(1)}};
1907 if (face_vertex_indices[0] > face_vertex_indices[1])
1908 std::swap(face_vertex_indices[0], face_vertex_indices[1]);
1914 face_vertex_indices,
1916 const std::array<unsigned int, 2>
1917 &face_vertex_indices) ->
bool {
1918 return std::lexicographical_compare(
1921 face_vertex_indices.begin(),
1922 face_vertex_indices.end());
1926 (p->vertices[0] == face_vertex_indices[0]) &&
1927 (p->vertices[1] == face_vertex_indices[1]))
1929 face->set_boundary_id(p->boundary_id);
1937 std::vector<unsigned int> face_vertex_indices(
1938 face->n_vertices());
1939 for (
unsigned int v = 0; v < face->n_vertices(); ++v)
1940 face_vertex_indices[v] = face->vertex_index(v);
1941 std::sort(face_vertex_indices.begin(),
1942 face_vertex_indices.end());
1948 face_vertex_indices,
1950 const std::vector<unsigned int>
1951 &face_vertex_indices) ->
bool {
1952 return std::lexicographical_compare(
1955 face_vertex_indices.begin(),
1956 face_vertex_indices.end());
1960 (p->vertices == face_vertex_indices))
1962 face->set_boundary_id(p->boundary_id);
1967 for (
unsigned int e = 0;
e < face->n_lines(); ++
e)
1969 const auto edge = face->line(
e);
1971 std::array<unsigned int, 2> edge_vertex_indices = {
1972 {edge->vertex_index(0), edge->vertex_index(1)}};
1973 if (edge_vertex_indices[0] > edge_vertex_indices[1])
1975 edge_vertex_indices[1]);
1981 edge_vertex_indices,
1983 const std::array<unsigned int, 2>
1984 &edge_vertex_indices) ->
bool {
1985 return std::lexicographical_compare(
1988 edge_vertex_indices.begin(),
1989 edge_vertex_indices.end());
1993 (p->vertices[0] == edge_vertex_indices[0]) &&
1994 (p->vertices[1] == edge_vertex_indices[1]))
1996 edge->set_boundary_id(p->boundary_id);
2005 template <
int dim,
int spacedim>
2012 unsigned int n_vertices;
2019 std::array<std::map<int, int>, 4> tag_maps;
2024 unsigned int gmsh_file_format = 0;
2025 if (line ==
"@f$NOD")
2026 gmsh_file_format = 10;
2027 else if (line ==
"@f$MeshFormat")
2028 gmsh_file_format = 20;
2034 if (gmsh_file_format == 20)
2037 unsigned int file_type, data_size;
2039 in >> version >> file_type >> data_size;
2042 gmsh_file_format =
static_cast<unsigned int>(version * 10);
2050 AssertThrow(line ==
"@f$EndMeshFormat", ExcInvalidGMSHInput(line));
2054 if (line ==
"@f$PhysicalNames")
2060 while (line !=
"@f$EndPhysicalNames");
2065 if (line ==
"@f$Entities")
2067 unsigned long n_points, n_curves, n_surfaces, n_volumes;
2069 in >> n_points >> n_curves >> n_surfaces >> n_volumes;
2070 for (
unsigned int i = 0; i < n_points; ++i)
2074 unsigned int n_physicals;
2075 double box_min_x, box_min_y, box_min_z, box_max_x, box_max_y,
2079 if (gmsh_file_format > 40)
2081 in >> tag >> box_min_x >> box_min_y >> box_min_z >>
2083 box_max_x = box_min_x;
2084 box_max_y = box_min_y;
2085 box_max_z = box_min_z;
2089 in >> tag >> box_min_x >> box_min_y >> box_min_z >>
2090 box_max_x >> box_max_y >> box_max_z >> n_physicals;
2095 ExcMessage(
"More than one tag is not supported!"));
2097 int physical_tag = 0;
2098 for (
unsigned int j = 0; j < n_physicals; ++j)
2100 tag_maps[0][tag] = physical_tag;
2102 for (
unsigned int i = 0; i < n_curves; ++i)
2106 unsigned int n_physicals;
2107 double box_min_x, box_min_y, box_min_z, box_max_x, box_max_y,
2111 in >> tag >> box_min_x >> box_min_y >> box_min_z >> box_max_x >>
2112 box_max_y >> box_max_z >> n_physicals;
2116 ExcMessage(
"More than one tag is not supported!"));
2118 int physical_tag = 0;
2119 for (
unsigned int j = 0; j < n_physicals; ++j)
2121 tag_maps[1][tag] = physical_tag;
2126 for (
unsigned int j = 0; j < n_points; ++j)
2130 for (
unsigned int i = 0; i < n_surfaces; ++i)
2134 unsigned int n_physicals;
2135 double box_min_x, box_min_y, box_min_z, box_max_x, box_max_y,
2139 in >> tag >> box_min_x >> box_min_y >> box_min_z >> box_max_x >>
2140 box_max_y >> box_max_z >> n_physicals;
2144 ExcMessage(
"More than one tag is not supported!"));
2146 int physical_tag = 0;
2147 for (
unsigned int j = 0; j < n_physicals; ++j)
2149 tag_maps[2][tag] = physical_tag;
2154 for (
unsigned int j = 0; j < n_curves; ++j)
2157 for (
unsigned int i = 0; i < n_volumes; ++i)
2161 unsigned int n_physicals;
2162 double box_min_x, box_min_y, box_min_z, box_max_x, box_max_y,
2166 in >> tag >> box_min_x >> box_min_y >> box_min_z >> box_max_x >>
2167 box_max_y >> box_max_z >> n_physicals;
2171 ExcMessage(
"More than one tag is not supported!"));
2173 int physical_tag = 0;
2174 for (
unsigned int j = 0; j < n_physicals; ++j)
2176 tag_maps[3][tag] = physical_tag;
2181 for (
unsigned int j = 0; j < n_surfaces; ++j)
2185 AssertThrow(line ==
"@f$EndEntities", ExcInvalidGMSHInput(line));
2190 if (line ==
"@f$PartitionedEntities")
2196 while (line !=
"@f$EndPartitionedEntities");
2203 AssertThrow(line ==
"@f$Nodes", ExcInvalidGMSHInput(line));
2207 int n_entity_blocks = 1;
2208 if (gmsh_file_format > 40)
2212 in >> n_entity_blocks >> n_vertices >> min_node_tag >> max_node_tag;
2214 else if (gmsh_file_format == 40)
2216 in >> n_entity_blocks >> n_vertices;
2220 std::vector<Point<spacedim>>
vertices(n_vertices);
2227 unsigned int global_vertex = 0;
2228 for (
int entity_block = 0; entity_block < n_entity_blocks; ++entity_block)
2231 unsigned long numNodes;
2233 if (gmsh_file_format < 40)
2235 numNodes = n_vertices;
2242 int tagEntity, dimEntity;
2243 in >> tagEntity >> dimEntity >> parametric >> numNodes;
2246 std::vector<int> vertex_numbers;
2248 if (gmsh_file_format > 40)
2249 for (
unsigned long vertex_per_entity = 0;
2250 vertex_per_entity < numNodes;
2251 ++vertex_per_entity)
2253 in >> vertex_number;
2254 vertex_numbers.push_back(vertex_number);
2257 for (
unsigned long vertex_per_entity = 0; vertex_per_entity < numNodes;
2258 ++vertex_per_entity, ++global_vertex)
2264 if (gmsh_file_format > 40)
2266 vertex_number = vertex_numbers[vertex_per_entity];
2267 in >> x[0] >> x[1] >> x[2];
2270 in >> vertex_number >> x[0] >> x[1] >> x[2];
2272 for (
unsigned int d = 0;
d < spacedim; ++
d)
2278 if (parametric != 0)
2293 static const std::string end_nodes_marker[] = {
"@f$ENDNOD",
"@f$EndNodes"};
2294 AssertThrow(line == end_nodes_marker[gmsh_file_format == 10 ? 0 : 1],
2295 ExcInvalidGMSHInput(line));
2299 static const std::string begin_elements_marker[] = {
"@f$ELM",
"@f$Elements"};
2300 AssertThrow(line == begin_elements_marker[gmsh_file_format == 10 ? 0 : 1],
2301 ExcInvalidGMSHInput(line));
2304 if (gmsh_file_format > 40)
2308 in >> n_entity_blocks >>
n_cells >> min_node_tag >> max_node_tag;
2310 else if (gmsh_file_format == 40)
2312 in >> n_entity_blocks >>
n_cells;
2316 n_entity_blocks = 1;
2323 std::vector<CellData<dim>> cells;
2325 std::map<unsigned int, types::boundary_id> boundary_ids_1d;
2331 std::map<unsigned int, unsigned int> vertex_counts;
2334 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
2335 {0, 1, 5, 4, 2, 3, 7, 6}};
2336 unsigned int global_cell = 0;
2337 for (
int entity_block = 0; entity_block < n_entity_blocks; ++entity_block)
2340 unsigned long numElements;
2343 if (gmsh_file_format < 40)
2349 else if (gmsh_file_format == 40)
2351 int tagEntity, dimEntity;
2352 in >> tagEntity >> dimEntity >> cell_type >> numElements;
2358 int tagEntity, dimEntity;
2359 in >> dimEntity >> tagEntity >> cell_type >> numElements;
2363 for (
unsigned int cell_per_entity = 0; cell_per_entity < numElements;
2364 ++cell_per_entity, ++global_cell)
2373 unsigned int nod_num;
2394 unsigned int elm_number = 0;
2395 if (gmsh_file_format < 40)
2401 if (gmsh_file_format < 20)
2407 else if (gmsh_file_format < 40)
2412 unsigned int n_tags;
2419 for (
unsigned int i = 1; i < n_tags; ++i)
2424 else if (cell_type == 2)
2426 else if (cell_type == 3)
2428 else if (cell_type == 4)
2430 else if (cell_type == 5)
2441 else if (cell_type == 2)
2443 else if (cell_type == 3)
2445 else if (cell_type == 4)
2447 else if (cell_type == 5)
2473 if (((cell_type == 1) && (dim == 1)) ||
2474 ((cell_type == 2) && (dim == 2)) ||
2475 ((cell_type == 3) && (dim == 2)) ||
2476 ((cell_type == 4) && (dim == 3)) ||
2477 ((cell_type == 5) && (dim == 3)))
2480 unsigned int vertices_per_cell = 0;
2482 vertices_per_cell = 2;
2483 else if (cell_type == 2)
2484 vertices_per_cell = 3;
2485 else if (cell_type == 3)
2486 vertices_per_cell = 4;
2487 else if (cell_type == 4)
2488 vertices_per_cell = 4;
2489 else if (cell_type == 5)
2490 vertices_per_cell = 8;
2494 "Number of nodes does not coincide with the "
2495 "number required for this object"));
2498 cells.emplace_back();
2500 cell.
vertices.resize(vertices_per_cell);
2501 for (
unsigned int i = 0; i < vertices_per_cell; ++i)
2504 if (vertices_per_cell ==
2507 local_vertex_numbering[i] :
2527 for (
unsigned int i = 0; i < vertices_per_cell; ++i)
2531 ExcInvalidVertexIndexGmsh(cell_per_entity,
2537 vertex_counts[vertex] += 1u;
2541 else if ((cell_type == 1) &&
2542 ((dim == 2) || (dim == 3)))
2566 for (
unsigned int &vertex :
2580 else if ((cell_type == 2 || cell_type == 3) &&
2584 unsigned int vertices_per_cell = 0;
2587 vertices_per_cell = 3;
2588 else if (cell_type == 3)
2589 vertices_per_cell = 4;
2597 for (
unsigned int i = 0; i < vertices_per_cell; ++i)
2617 for (
unsigned int &vertex :
2630 else if (cell_type == 15)
2633 unsigned int node_index = 0;
2634 if (gmsh_file_format < 20)
2654 AssertThrow(
false, ExcGmshUnsupportedGeometry(cell_type));
2662 static const std::string end_elements_marker[] = {
"@f$ENDELM",
"@f$EndElements"};
2663 AssertThrow(line == end_elements_marker[gmsh_file_format == 10 ? 0 : 1],
2664 ExcInvalidGMSHInput(line));
2677 for (
const auto &pair : vertex_counts)
2678 if (pair.second == 1u)
2679 boundary_id_pairs.emplace_back(
vertices[pair.first],
2680 boundary_ids_1d[pair.first]);
2682 apply_grid_fixup_functions(
vertices, cells, subcelldata);
2688 assign_1d_boundary_ids(boundary_id_pairs, *
tria);
2693 #ifdef DEAL_II_GMSH_WITH_API
2694 template <
int dim,
int spacedim>
2700 const std::map<int, std::uint8_t> gmsh_to_dealii_type = {
2701 {{15, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {7, 5}, {6, 6}, {5, 7}}};
2704 const std::array<std::vector<unsigned int>, 8> gmsh_to_dealii = {
2711 {{0, 1, 2, 3, 4, 5}},
2712 {{0, 1, 3, 2, 4, 5, 7, 6}}}};
2714 std::vector<Point<spacedim>>
vertices;
2715 std::vector<CellData<dim>> cells;
2717 std::map<unsigned int, types::boundary_id> boundary_ids_1d;
2723 std::map<unsigned int, unsigned int> vertex_counts;
2726 gmsh::option::setNumber(
"General.Verbosity", 0);
2730 ExcMessage(
"You are trying to read a gmsh file with dimension " +
2737 gmsh::model::mesh::removeDuplicateNodes();
2738 gmsh::model::mesh::renumberNodes();
2739 std::vector<std::size_t> node_tags;
2740 std::vector<double> coord;
2741 std::vector<double> parametricCoord;
2742 gmsh::model::mesh::getNodes(
2743 node_tags, coord, parametricCoord, -1, -1,
false,
false);
2745 for (
unsigned int i = 0; i < node_tags.size(); ++i)
2749 for (
unsigned int d = 0;
d < spacedim; ++
d)
2753 for (
unsigned int d = spacedim;
d < 3; ++
d)
2754 Assert(std::abs(coord[i * 3 +
d]) < 1
e-10,
2755 ExcMessage(
"The grid you are reading contains nodes that are "
2756 "nonzero in the coordinate with index " +
2758 ", but you are trying to save "
2759 "it on a grid embedded in a " +
2767 std::vector<std::pair<int, int>> entities;
2768 gmsh::model::getEntities(entities);
2770 for (
const auto &
e : entities)
2773 const int &entity_dim =
e.first;
2774 const int &entity_tag =
e.second;
2780 std::vector<int> physical_tags;
2781 gmsh::model::getPhysicalGroupsForEntity(entity_dim,
2786 if (physical_tags.size())
2787 for (
auto physical_tag : physical_tags)
2790 gmsh::model::getPhysicalName(entity_dim, physical_tag, name);
2794 std::map<std::string, int> id_names;
2796 bool throw_anyway =
false;
2797 bool found_boundary_id =
false;
2800 for (
const auto &it : id_names)
2802 const auto &name = it.first;
2803 const auto &
id = it.second;
2804 if (entity_dim == dim && name ==
"MaterialID")
2807 found_boundary_id =
true;
2809 else if (entity_dim < dim && name ==
"BoundaryID")
2812 found_boundary_id =
true;
2814 else if (name ==
"ManifoldID")
2820 throw_anyway =
true;
2826 if (throw_anyway && !found_boundary_id)
2840 std::vector<int> element_types;
2841 std::vector<std::vector<std::size_t>> element_ids, element_nodes;
2842 gmsh::model::mesh::getElements(
2843 element_types, element_ids, element_nodes, entity_dim, entity_tag);
2845 for (
unsigned int i = 0; i < element_types.size(); ++i)
2847 const auto &type = gmsh_to_dealii_type.at(element_types[i]);
2848 const auto n_vertices = gmsh_to_dealii[type].size();
2849 const auto &elements = element_ids[i];
2850 const auto &nodes = element_nodes[i];
2851 for (
unsigned int j = 0; j < elements.size(); ++j)
2853 if (entity_dim == dim)
2855 cells.emplace_back(n_vertices);
2856 auto &cell = cells.back();
2857 for (
unsigned int v = 0; v < n_vertices; ++v)
2860 nodes[n_vertices * j + gmsh_to_dealii[type][v]] - 1;
2862 vertex_counts[cell.vertices[v]] += 1u;
2867 else if (entity_dim == 2)
2871 for (
unsigned int v = 0; v < n_vertices; ++v)
2873 nodes[n_vertices * j + gmsh_to_dealii[type][v]] - 1;
2878 else if (entity_dim == 1)
2882 for (
unsigned int v = 0; v < n_vertices; ++v)
2884 nodes[n_vertices * j + gmsh_to_dealii[type][v]] - 1;
2889 else if (entity_dim == 0)
2893 for (
unsigned int j = 0; j < elements.size(); ++j)
2905 for (
const auto &pair : vertex_counts)
2906 if (pair.second == 1u)
2907 boundary_id_pairs.emplace_back(
vertices[pair.first],
2908 boundary_ids_1d[pair.first]);
2910 apply_grid_fixup_functions(
vertices, cells, subcelldata);
2916 assign_1d_boundary_ids(boundary_id_pairs, *
tria);
2925 template <
int dim,
int spacedim>
2928 std::string &header,
2929 std::vector<unsigned int> &tecplot2deal,
2930 unsigned int &n_vars,
2931 unsigned int &n_vertices,
2933 std::vector<unsigned int> &IJK,
2958 std::transform(header.begin(), header.end(), header.begin(), ::toupper);
2962 std::replace(header.begin(), header.end(),
'\t',
' ');
2963 std::replace(header.begin(), header.end(),
',',
' ');
2964 std::replace(header.begin(), header.end(),
'\n',
' ');
2971 if (header[pos + 1] ==
' ')
2972 header.erase(pos + 1, 1);
2973 else if (header[pos - 1] ==
' ')
2975 header.erase(pos - 1, 1);
2979 pos = header.find(
'=', ++pos);
2982 std::vector<std::string> entries =
2986 for (
unsigned int i = 0; i < entries.size(); ++i)
2995 tecplot2deal[0] = 0;
2998 while (entries[i][0] ==
'"')
3000 if (entries[i] ==
"\"X\"")
3001 tecplot2deal[0] = n_vars;
3002 else if (entries[i] ==
"\"Y\"")
3008 tecplot2deal[1] = n_vars;
3010 else if (entries[i] ==
"\"Z\"")
3016 tecplot2deal[2] = n_vars;
3028 "Tecplot file must contain at least one variable for each dimension"));
3029 for (
unsigned int d = 1;
d < dim; ++
d)
3031 tecplot2deal[
d] > 0,
3033 "Tecplot file must contain at least one variable for each dimension."));
3038 "ZONETYPE=FELINESEG") &&
3042 "ZONETYPE=FEQUADRILATERAL") &&
3046 "ZONETYPE=FEBRICK") &&
3054 "The tecplot file contains an unsupported ZONETYPE."));
3057 "DATAPACKING=POINT"))
3060 "DATAPACKING=BLOCK"))
3083 "ET=QUADRILATERAL") &&
3095 "The tecplot file contains an unsupported ElementType."));
3103 dim > 1 || IJK[1] == 1,
3105 "Parameter 'J=' found in tecplot, although this is only possible for dimensions greater than 1."));
3111 dim > 2 || IJK[2] == 1,
3113 "Parameter 'K=' found in tecplot, although this is only possible for dimensions greater than 2."));
3128 for (
unsigned int d = 0;
d < dim; ++
d)
3133 "Tecplot file does not contain a complete and consistent set of parameters"));
3134 n_vertices *= IJK[
d];
3143 "Tecplot file does not contain a complete and consistent set of parameters"));
3149 n_cells = *std::max_element(IJK.begin(), IJK.end());
3153 "Tecplot file does not contain a complete and consistent set of parameters"));
3163 const unsigned int dim = 2;
3164 const unsigned int spacedim = 2;
3169 skip_comment_lines(in,
'#');
3172 std::string line, header;
3179 std::string letters =
"abcdfghijklmnopqrstuvwxyzABCDFGHIJKLMNOPQRSTUVWXYZ";
3182 while (line.find_first_of(letters) != std::string::npos)
3184 header +=
" " + line;
3191 std::vector<unsigned int> tecplot2deal(dim);
3192 std::vector<unsigned int> IJK(dim);
3193 unsigned int n_vars, n_vertices,
n_cells;
3194 bool structured, blocked;
3196 parse_tecplot_header(header,
3211 std::vector<Point<spacedim>>
vertices(n_vertices + 1);
3214 std::vector<CellData<dim>> cells(
n_cells);
3230 unsigned int next_index = 0;
3234 if (tecplot2deal[0] == 0)
3238 std::vector<std::string> first_var =
3241 for (
unsigned int i = 1; i < first_var.size() + 1; ++i)
3242 vertices[i](0) = std::strtod(first_var[i - 1].c_str(), &endptr);
3247 for (
unsigned int j = first_var.size() + 1; j < n_vertices + 1; ++j)
3255 for (
unsigned int i = 1; i < n_vars; ++i)
3264 if (next_index == dim && structured)
3267 if ((next_index < dim) && (i == tecplot2deal[next_index]))
3270 for (
unsigned int j = 1; j < n_vertices + 1; ++j)
3278 for (
unsigned int j = 1; j < n_vertices + 1; ++j)
3290 std::vector<double> vars(n_vars);
3295 std::vector<std::string> first_vertex =
3298 for (
unsigned int d = 0;
d < dim; ++
d)
3300 std::strtod(first_vertex[tecplot2deal[
d]].c_str(), &endptr);
3304 for (
unsigned int v = 2; v < n_vertices + 1; ++v)
3306 for (
unsigned int i = 0; i < n_vars; ++i)
3312 for (
unsigned int i = 0; i < dim; ++i)
3313 vertices[v](i) = vars[tecplot2deal[i]];
3321 unsigned int I = IJK[0], J = IJK[1];
3323 unsigned int cell = 0;
3325 for (
unsigned int j = 0; j < J - 1; ++j)
3326 for (
unsigned int i = 1; i < I; ++i)
3328 cells[cell].vertices[0] = i + j * I;
3329 cells[cell].vertices[1] = i + 1 + j * I;
3330 cells[cell].vertices[2] = i + (j + 1) * I;
3331 cells[cell].vertices[3] = i + 1 + (j + 1) * I;
3335 std::vector<unsigned int> boundary_vertices(2 * I + 2 * J - 4);
3337 for (
unsigned int i = 1; i < I + 1; ++i)
3339 boundary_vertices[k] = i;
3341 boundary_vertices[k] = i + (J - 1) * I;
3344 for (
unsigned int j = 1; j < J - 1; ++j)
3346 boundary_vertices[k] = 1 + j * I;
3348 boundary_vertices[k] = I + j * I;
3367 for (
unsigned int i = 0; i <
n_cells; ++i)
3384 apply_grid_fixup_functions(
vertices, cells, subcelldata);
3390 template <
int dim,
int spacedim>
3399 template <
int dim,
int spacedim>
3402 const unsigned int mesh_index,
3403 const bool remove_duplicates,
3405 const bool ignore_unsupported_types)
3407 #ifdef DEAL_II_WITH_ASSIMP
3412 Assimp::Importer importer;
3415 const aiScene *scene =
3416 importer.ReadFile(filename.c_str(),
3417 aiProcess_RemoveComponent |
3418 aiProcess_JoinIdenticalVertices |
3419 aiProcess_ImproveCacheLocality | aiProcess_SortByPType |
3420 aiProcess_OptimizeGraph | aiProcess_OptimizeMeshes);
3426 ExcMessage(
"Input file contains no meshes."));
3429 (mesh_index < scene->mNumMeshes),
3432 unsigned int start_mesh =
3434 unsigned int end_mesh =
3439 std::vector<Point<spacedim>>
vertices;
3440 std::vector<CellData<dim>> cells;
3444 unsigned int v_offset = 0;
3445 unsigned int c_offset = 0;
3447 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
3448 {0, 1, 5, 4, 2, 3, 7, 6}};
3450 for (
unsigned int m = start_mesh; m < end_mesh; ++m)
3452 const aiMesh *mesh = scene->mMeshes[m];
3456 if ((dim == 2) && mesh->mPrimitiveTypes != aiPrimitiveType_POLYGON)
3463 else if ((dim == 1) && mesh->mPrimitiveTypes != aiPrimitiveType_LINE)
3471 const unsigned int n_vertices = mesh->mNumVertices;
3472 const aiVector3D *mVertices = mesh->mVertices;
3475 const unsigned int n_faces = mesh->mNumFaces;
3476 const aiFace *mFaces = mesh->mFaces;
3478 vertices.resize(v_offset + n_vertices);
3479 cells.resize(c_offset + n_faces);
3481 for (
unsigned int i = 0; i < n_vertices; ++i)
3482 for (
unsigned int d = 0;
d < spacedim; ++
d)
3485 unsigned int valid_cell = c_offset;
3486 for (
unsigned int i = 0; i < n_faces; ++i)
3493 .vertices[dim == 3 ? local_vertex_numbering[f] :
3495 mFaces[i].mIndices[f] + v_offset;
3497 cells[valid_cell].material_id = m;
3506 " vertices. We expected only " +
3511 cells.resize(valid_cell);
3516 v_offset += n_vertices;
3517 c_offset = valid_cell;
3524 if (remove_duplicates)
3529 unsigned int n_verts = 0;
3533 std::vector<unsigned int> considered_vertices;
3535 vertices, cells, subcelldata, considered_vertices, tol);
3539 apply_grid_fixup_functions(
vertices, cells, subcelldata);
3545 (void)remove_duplicates;
3547 (void)ignore_unsupported_types;
3552 #ifdef DEAL_II_TRILINOS_WITH_SEACAS
3559 exodusii_name_to_type(
const std::string &type_name,
3560 const int n_nodes_per_element)
3566 std::string type_name_2 = type_name;
3569 type_name_2.begin(),
3570 [](
unsigned char c) { return std::toupper(c); });
3571 const std::string
numbers =
"0123456789";
3572 type_name_2.erase(std::find_first_of(type_name_2.begin(),
3579 if (type_name_2 ==
"BAR" || type_name_2 ==
"BEAM" ||
3580 type_name_2 ==
"EDGE" || type_name_2 ==
"TRUSS")
3582 else if (type_name_2 ==
"TRI" || type_name_2 ==
"TRIANGLE")
3584 else if (type_name_2 ==
"QUAD" || type_name_2 ==
"QUADRILATERAL")
3586 else if (type_name_2 ==
"SHELL")
3588 if (n_nodes_per_element == 3)
3593 else if (type_name_2 ==
"TET" || type_name_2 ==
"TETRA" ||
3594 type_name_2 ==
"TETRAHEDRON")
3596 else if (type_name_2 ==
"PYRA" || type_name_2 ==
"PYRAMID")
3598 else if (type_name_2 ==
"WEDGE")
3600 else if (type_name_2 ==
"HEX" || type_name_2 ==
"HEXAHEDRON")
3610 template <
int dim,
int spacedim = dim>
3611 std::pair<SubCellData, std::vector<std::vector<int>>>
3612 read_exodusii_sidesets(
const int ex_id,
3613 const int n_side_sets,
3615 const bool apply_all_indicators_to_manifolds)
3618 std::vector<std::vector<int>> b_or_m_id_to_sideset_ids;
3620 b_or_m_id_to_sideset_ids.emplace_back();
3626 if (dim == spacedim && n_side_sets > 0)
3628 std::vector<int> side_set_ids(n_side_sets);
3629 int ierr = ex_get_ids(ex_id, EX_SIDE_SET, side_set_ids.data());
3630 AssertThrowExodusII(ierr);
3638 std::map<std::size_t, std::vector<int>> face_side_sets;
3639 for (
const int side_set_id : side_set_ids)
3642 int n_distribution_factors = -1;
3644 ierr = ex_get_set_param(ex_id,
3648 &n_distribution_factors);
3649 AssertThrowExodusII(ierr);
3652 std::vector<int> elements(n_sides);
3653 std::vector<int> faces(n_sides);
3654 ierr = ex_get_set(ex_id,
3659 AssertThrowExodusII(ierr);
3667 for (
int side_n = 0; side_n < n_sides; ++side_n)
3669 const long element_n = elements[side_n] - 1;
3670 const long face_n = faces[side_n] - 1;
3671 const std::size_t face_id =
3672 element_n * max_faces_per_cell + face_n;
3673 face_side_sets[face_id].push_back(side_set_id);
3679 std::vector<std::pair<std::size_t, std::vector<int>>>
3680 face_id_to_side_sets;
3681 face_id_to_side_sets.reserve(face_side_sets.size());
3682 for (
auto &pair : face_side_sets)
3685 face_id_to_side_sets.push_back(std::move(pair));
3689 std::sort(face_id_to_side_sets.begin(),
3690 face_id_to_side_sets.end(),
3691 [](
const auto &a,
const auto &
b) {
3692 return std::lexicographical_compare(a.second.begin(),
3703 for (
const auto &pair : face_id_to_side_sets)
3705 const std::size_t face_id = pair.first;
3706 const std::vector<int> &face_sideset_ids = pair.second;
3707 if (face_sideset_ids != b_or_m_id_to_sideset_ids.back())
3712 ++current_b_or_m_id;
3713 b_or_m_id_to_sideset_ids.push_back(face_sideset_ids);
3714 Assert(current_b_or_m_id == b_or_m_id_to_sideset_ids.size() - 1,
3718 const unsigned int local_face_n = face_id % max_faces_per_cell;
3719 const CellData<dim> &cell = cells[face_id / max_faces_per_cell];
3722 const unsigned int deal_face_n =
3733 if (apply_all_indicators_to_manifolds)
3734 boundary_line.manifold_id = current_b_or_m_id;
3736 boundary_line.boundary_id = current_b_or_m_id;
3737 for (
unsigned int j = 0; j < face_reference_cell.
n_vertices();
3739 boundary_line.vertices[j] =
3741 deal_face_n, j, 0)];
3748 if (apply_all_indicators_to_manifolds)
3749 boundary_quad.manifold_id = current_b_or_m_id;
3751 boundary_quad.boundary_id = current_b_or_m_id;
3752 for (
unsigned int j = 0; j < face_reference_cell.
n_vertices();
3754 boundary_quad.vertices[j] =
3756 deal_face_n, j, 0)];
3763 return std::make_pair(std::move(subcelldata),
3764 std::move(b_or_m_id_to_sideset_ids));
3769 template <
int dim,
int spacedim>
3772 const std::string &filename,
3773 const bool apply_all_indicators_to_manifolds)
3775 #ifdef DEAL_II_TRILINOS_WITH_SEACAS
3777 int component_word_size =
sizeof(
double);
3779 int floating_point_word_size = 0;
3780 float ex_version = 0.0;
3782 const int ex_id = ex_open(filename.c_str(),
3784 &component_word_size,
3785 &floating_point_word_size,
3788 ExcMessage(
"ExodusII failed to open the specified input file."));
3791 std::vector<char> string_temp(MAX_LINE_LENGTH + 1,
'\0');
3792 int mesh_dimension = 0;
3795 int n_element_blocks = 0;
3796 int n_node_sets = 0;
3797 int n_side_sets = 0;
3799 int ierr = ex_get_init(ex_id,
3807 AssertThrowExodusII(ierr);
3818 std::vector<Point<spacedim>>
vertices;
3821 std::vector<double> xs(n_nodes);
3822 std::vector<double> ys(n_nodes);
3823 std::vector<double> zs(n_nodes);
3825 ierr = ex_get_coord(ex_id, xs.data(), ys.data(), zs.data());
3826 AssertThrowExodusII(ierr);
3828 for (
int vertex_n = 0; vertex_n < n_nodes; ++vertex_n)
3833 vertices.emplace_back(xs[vertex_n]);
3836 vertices.emplace_back(xs[vertex_n], ys[vertex_n]);
3839 vertices.emplace_back(xs[vertex_n], ys[vertex_n], zs[vertex_n]);
3847 std::vector<int> element_block_ids(n_element_blocks);
3848 ierr = ex_get_ids(ex_id, EX_ELEM_BLOCK, element_block_ids.data());
3849 AssertThrowExodusII(ierr);
3851 std::vector<CellData<dim>> cells;
3852 cells.reserve(n_elements);
3856 for (
const int element_block_id : element_block_ids)
3858 std::fill(string_temp.begin(), string_temp.end(),
'\0');
3859 int n_block_elements = 0;
3860 int n_nodes_per_element = 0;
3861 int n_edges_per_element = 0;
3862 int n_faces_per_element = 0;
3863 int n_attributes_per_element = 0;
3866 ierr = ex_get_block(ex_id,
3871 &n_nodes_per_element,
3872 &n_edges_per_element,
3873 &n_faces_per_element,
3874 &n_attributes_per_element);
3875 AssertThrowExodusII(ierr);
3877 exodusii_name_to_type(string_temp.data(), n_nodes_per_element);
3881 " with element type " + std::string(string_temp.data()) +
3883 ", which does not match the topological mesh dimension " +
3891 std::vector<int> connection(n_nodes_per_element * n_block_elements);
3892 ierr = ex_get_conn(ex_id,
3898 AssertThrowExodusII(ierr);
3900 for (
unsigned int elem_n = 0; elem_n < connection.size();
3901 elem_n += n_nodes_per_element)
3907 connection[elem_n + i] - 1;
3910 cells.push_back(std::move(cell));
3915 auto pair = read_exodusii_sidesets<dim, spacedim>(
3916 ex_id, n_side_sets, cells, apply_all_indicators_to_manifolds);
3917 ierr = ex_close(ex_id);
3918 AssertThrowExodusII(ierr);
3920 apply_grid_fixup_functions(
vertices, cells, pair.first);
3927 (void)apply_all_indicators_to_manifolds;
3934 template <
int dim,
int spacedim>
3948 if (std::find_if(line.begin(), line.end(), [](
const char c) {
3953 for (
int i = line.size() - 1; i >= 0; --i)
3954 in.putback(line[i]);
3964 template <
int dim,
int spacedim>
3967 const char comment_start)
3972 while (in.get(c) && c == comment_start)
3975 while (in.get() !=
'\n')
3985 skip_empty_lines(in);
3990 template <
int dim,
int spacedim>
4013 for (
unsigned int i = 0; i < cells.size(); ++i)
4015 for (
const auto vertex : cells[i].
vertices)
4029 out <<
"# cell " << i << std::endl;
4031 for (
const auto vertex : cells[i].
vertices)
4035 out <<
"set label \"" << i <<
"\" at " <<
center(0) <<
',' <<
center(1)
4036 <<
" center" << std::endl;
4039 for (
unsigned int f = 0; f < 2; ++f)
4045 for (
unsigned int f = 2; f < 4; ++f)
4055 <<
"set nokey" << std::endl
4056 <<
"pl [" << min_x <<
':' << max_x <<
"][" << min_y <<
':' << max_y
4057 <<
"] " << min_y << std::endl
4058 <<
"pause -1" << std::endl;
4069 for (
const auto &cell : cells)
4136 template <
int dim,
int spacedim>
4144 if (format == Default)
4145 name = search.
find(filename);
4150 if (format == Default)
4154 if (dotpos < name.size() &&
4155 (dotpos > slashpos || slashpos == std::string::npos))
4157 std::string ext = name.substr(dotpos + 1);
4158 format = parse_format(ext);
4162 if (format == assimp)
4166 else if (format == exodusii)
4168 read_exodusii(name);
4172 std::ifstream in(name);
4178 template <
int dim,
int spacedim>
4182 if (format == Default)
4225 ExcMessage(
"There is no read_assimp(istream &) function. "
4226 "Use the read_assimp(string &filename, ...) "
4227 "functions, instead."));
4232 ExcMessage(
"There is no read_exodusii(istream &) function. "
4233 "Use the read_exodusii(string &filename, ...) "
4234 "function, instead."));
4245 template <
int dim,
int spacedim>
4274 return ".unknown_format";
4280 template <
int dim,
int spacedim>
4284 if (format_name ==
"dbmesh")
4287 if (format_name ==
"exodusii")
4290 if (format_name ==
"msh")
4293 if (format_name ==
"unv")
4296 if (format_name ==
"vtk")
4299 if (format_name ==
"vtu")
4303 if (format_name ==
"inp")
4306 if (format_name ==
"ucd")
4309 if (format_name ==
"xda")
4312 if (format_name ==
"tecplot")
4315 if (format_name ==
"dat")
4318 if (format_name ==
"plt")
4337 template <
int dim,
int spacedim>
4341 return "dbmesh|exodusii|msh|unv|vtk|vtu|ucd|abaqus|xda|tecplot|assimp";
4348 template <
int dim,
int spacedim>
4349 Abaqus_to_UCD<dim, spacedim>::Abaqus_to_UCD()
4362 from_string(
T &t,
const std::string &s, std::ios_base &(*f)(std::ios_base &))
4364 std::istringstream iss(s);
4365 return !(iss >> f >> t).fail();
4372 extract_int(
const std::string &s)
4375 for (
const char c : s)
4377 if (isdigit(c) != 0)
4384 from_string(number, tmp, std::dec);
4390 template <
int dim,
int spacedim>
4392 Abaqus_to_UCD<dim, spacedim>::read_in_abaqus(std::istream &input_stream)
4401 while (std::getline(input_stream, line))
4404 std::transform(line.begin(), line.end(), line.begin(), ::toupper);
4406 if (line.compare(
"*HEADING") == 0 || line.compare(0, 2,
"**") == 0 ||
4407 line.compare(0, 5,
"*PART") == 0)
4410 while (std::getline(input_stream, line))
4416 else if (line.compare(0, 5,
"*NODE") == 0)
4425 while (std::getline(input_stream, line))
4430 std::vector<double> node(spacedim + 1);
4432 std::istringstream iss(line);
4434 for (
unsigned int i = 0; i < spacedim + 1; ++i)
4435 iss >> node[i] >> comma;
4437 node_list.push_back(node);
4440 else if (line.compare(0, 8,
"*ELEMENT") == 0)
4455 const std::string before_material =
"ELSET=EB";
4456 const std::size_t idx = line.find(before_material);
4457 if (idx != std::string::npos)
4459 from_string(material,
4460 line.substr(idx + before_material.size()),
4466 while (std::getline(input_stream, line))
4471 std::istringstream iss(line);
4477 const unsigned int n_data_per_cell =
4479 std::vector<double> cell(n_data_per_cell);
4480 for (
unsigned int i = 0; i < n_data_per_cell; ++i)
4481 iss >> cell[i] >> comma;
4484 cell[0] =
static_cast<double>(material);
4485 cell_list.push_back(cell);
4488 else if (line.compare(0, 8,
"*SURFACE") == 0)
4499 const std::string name_key =
"NAME=";
4500 const std::size_t name_idx_start =
4501 line.find(name_key) + name_key.size();
4502 std::size_t name_idx_end = line.find(
',', name_idx_start);
4503 if (name_idx_end == std::string::npos)
4505 name_idx_end = line.size();
4507 const int b_indicator = extract_int(
4508 line.substr(name_idx_start, name_idx_end - name_idx_start));
4515 while (std::getline(input_stream, line))
4529 std::istringstream iss(line);
4536 std::vector<double> quad_node_list;
4537 const std::string elset_name = line.substr(0, line.find(
','));
4538 if (elsets_list.count(elset_name) != 0)
4542 iss >> stmp >> temp >> face_number;
4544 const std::vector<int> cells = elsets_list[elset_name];
4545 for (
const int cell : cells)
4549 get_global_node_numbers(el_idx, face_number);
4550 quad_node_list.insert(quad_node_list.begin(),
4553 face_list.push_back(quad_node_list);
4560 iss >> el_idx >> comma >> temp >> face_number;
4562 get_global_node_numbers(el_idx, face_number);
4563 quad_node_list.insert(quad_node_list.begin(), b_indicator);
4565 face_list.push_back(quad_node_list);
4569 else if (line.compare(0, 6,
"*ELSET") == 0)
4573 std::string elset_name;
4575 const std::string elset_key =
"*ELSET, ELSET=";
4576 const std::size_t idx = line.find(elset_key);
4577 if (idx != std::string::npos)
4579 const std::string comma =
",";
4580 const std::size_t first_comma = line.find(comma);
4581 const std::size_t second_comma =
4582 line.find(comma, first_comma + 1);
4583 const std::size_t elset_name_start =
4584 line.find(elset_key) + elset_key.size();
4585 elset_name = line.substr(elset_name_start,
4586 second_comma - elset_name_start);
4596 std::vector<int> elements;
4597 const std::size_t generate_idx = line.find(
"GENERATE");
4598 if (generate_idx != std::string::npos)
4601 std::getline(input_stream, line);
4602 std::istringstream iss(line);
4612 iss >> elid_start >> comma >> elid_end;
4616 "While reading an ABAQUS file, the reader "
4617 "expected a comma but found a <") +
4618 comma +
"> in the line <" + line +
">."));
4620 elid_start <= elid_end,
4623 "While reading an ABAQUS file, the reader encountered "
4624 "a GENERATE statement in which the upper bound <") +
4626 "> for the element numbers is not larger or equal "
4627 "than the lower bound <" +
4631 if (iss.rdbuf()->in_avail() != 0)
4632 iss >> comma >> elis_step;
4636 "While reading an ABAQUS file, the reader "
4637 "expected a comma but found a <") +
4638 comma +
"> in the line <" + line +
">."));
4640 for (
int i = elid_start; i <= elid_end; i += elis_step)
4641 elements.push_back(i);
4642 elsets_list[elset_name] = elements;
4644 std::getline(input_stream, line);
4649 while (std::getline(input_stream, line))
4654 std::istringstream iss(line);
4659 iss >> elid >> comma;
4664 "While reading an ABAQUS file, the reader "
4665 "expected a comma but found a <") +
4666 comma +
"> in the line <" + line +
">."));
4668 elements.push_back(elid);
4672 elsets_list[elset_name] = elements;
4677 else if (line.compare(0, 5,
"*NSET") == 0)
4680 while (std::getline(input_stream, line))
4686 else if (line.compare(0, 14,
"*SOLID SECTION") == 0)
4690 const std::string elset_key =
"ELSET=";
4691 const std::size_t elset_start =
4692 line.find(
"ELSET=") + elset_key.size();
4693 const std::size_t elset_end = line.find(
',', elset_start + 1);
4694 const std::string elset_name =
4695 line.substr(elset_start, elset_end - elset_start);
4700 const std::string material_key =
"MATERIAL=";
4701 const std::size_t last_equal =
4702 line.find(
"MATERIAL=") + material_key.size();
4703 const std::size_t material_id_start = line.find(
'-', last_equal);
4706 line.substr(material_id_start + 1),
4710 const std::vector<int> &elset_cells = elsets_list[elset_name];
4711 for (
const int elset_cell : elset_cells)
4713 const int cell_id = elset_cell - 1;
4721 template <
int dim,
int spacedim>
4723 Abaqus_to_UCD<dim, spacedim>::get_global_node_numbers(
4724 const int face_cell_no,
4725 const int face_cell_face_no)
const
4735 if (face_cell_face_no == 1)
4737 quad_node_list[0] = cell_list[face_cell_no - 1][1];
4738 quad_node_list[1] = cell_list[face_cell_no - 1][2];
4740 else if (face_cell_face_no == 2)
4742 quad_node_list[0] = cell_list[face_cell_no - 1][2];
4743 quad_node_list[1] = cell_list[face_cell_no - 1][3];
4745 else if (face_cell_face_no == 3)
4747 quad_node_list[0] = cell_list[face_cell_no - 1][3];
4748 quad_node_list[1] = cell_list[face_cell_no - 1][4];
4750 else if (face_cell_face_no == 4)
4752 quad_node_list[0] = cell_list[face_cell_no - 1][4];
4753 quad_node_list[1] = cell_list[face_cell_no - 1][1];
4763 if (face_cell_face_no == 1)
4765 quad_node_list[0] = cell_list[face_cell_no - 1][1];
4766 quad_node_list[1] = cell_list[face_cell_no - 1][4];
4767 quad_node_list[2] = cell_list[face_cell_no - 1][3];
4768 quad_node_list[3] = cell_list[face_cell_no - 1][2];
4770 else if (face_cell_face_no == 2)
4772 quad_node_list[0] = cell_list[face_cell_no - 1][5];
4773 quad_node_list[1] = cell_list[face_cell_no - 1][8];
4774 quad_node_list[2] = cell_list[face_cell_no - 1][7];
4775 quad_node_list[3] = cell_list[face_cell_no - 1][6];
4777 else if (face_cell_face_no == 3)
4779 quad_node_list[0] = cell_list[face_cell_no - 1][1];
4780 quad_node_list[1] = cell_list[face_cell_no - 1][2];
4781 quad_node_list[2] = cell_list[face_cell_no - 1][6];
4782 quad_node_list[3] = cell_list[face_cell_no - 1][5];
4784 else if (face_cell_face_no == 4)
4786 quad_node_list[0] = cell_list[face_cell_no - 1][2];
4787 quad_node_list[1] = cell_list[face_cell_no - 1][3];
4788 quad_node_list[2] = cell_list[face_cell_no - 1][7];
4789 quad_node_list[3] = cell_list[face_cell_no - 1][6];
4791 else if (face_cell_face_no == 5)
4793 quad_node_list[0] = cell_list[face_cell_no - 1][3];
4794 quad_node_list[1] = cell_list[face_cell_no - 1][4];
4795 quad_node_list[2] = cell_list[face_cell_no - 1][8];
4796 quad_node_list[3] = cell_list[face_cell_no - 1][7];
4798 else if (face_cell_face_no == 6)
4800 quad_node_list[0] = cell_list[face_cell_no - 1][1];
4801 quad_node_list[1] = cell_list[face_cell_no - 1][5];
4802 quad_node_list[2] = cell_list[face_cell_no - 1][8];
4803 quad_node_list[3] = cell_list[face_cell_no - 1][4];
4816 return quad_node_list;
4819 template <
int dim,
int spacedim>
4821 Abaqus_to_UCD<dim, spacedim>::write_out_avs_ucd(std::ostream &output)
const
4830 const boost::io::ios_base_all_saver formatting_saver(output);
4834 output <<
"# Abaqus to UCD mesh conversion" << std::endl;
4835 output <<
"# Mesh type: AVS UCD" << std::endl;
4864 output << node_list.size() <<
"\t" << (cell_list.size() + face_list.size())
4865 <<
"\t0\t0\t0" << std::endl;
4868 output.precision(8);
4872 for (
const auto &node : node_list)
4875 output << node[0] <<
"\t";
4878 output.setf(std::ios::scientific, std::ios::floatfield);
4879 for (
unsigned int jj = 1; jj < spacedim + 1; ++jj)
4882 if (std::abs(node[jj]) > tolerance)
4883 output <<
static_cast<double>(node[jj]) <<
"\t";
4885 output << 0.0 <<
"\t";
4888 output << 0.0 <<
"\t";
4890 output << std::endl;
4891 output.unsetf(std::ios::floatfield);
4895 for (
unsigned int ii = 0; ii < cell_list.size(); ++ii)
4897 output << ii + 1 <<
"\t" << cell_list[ii][0] <<
"\t"
4898 << (dim == 2 ?
"quad" :
"hex") <<
"\t";
4899 for (
unsigned int jj = 1; jj < GeometryInfo<dim>::vertices_per_cell + 1;
4901 output << cell_list[ii][jj] <<
"\t";
4903 output << std::endl;
4907 for (
unsigned int ii = 0; ii < face_list.size(); ++ii)
4909 output << ii + 1 <<
"\t" << face_list[ii][0] <<
"\t"
4910 << (dim == 2 ?
"line" :
"quad") <<
"\t";
4911 for (
unsigned int jj = 1; jj < GeometryInfo<dim>::vertices_per_face + 1;
4913 output << face_list[ii][jj] <<
"\t";
4915 output << std::endl;
4922 #include "grid_in.inst"
void read_vtk(std::istream &in)
static void skip_empty_lines(std::istream &in)
void read_assimp(const std::string &filename, const unsigned int mesh_index=numbers::invalid_unsigned_int, const bool remove_duplicates=true, const double tol=1e-12, const bool ignore_unsupported_element_types=true)
static void debug_output_grid(const std::vector< CellData< dim >> &cells, const std::vector< Point< spacedim >> &vertices, std::ostream &out)
void read_abaqus(std::istream &in, const bool apply_all_indicators_to_manifolds=false)
static std::string default_suffix(const Format format)
void read_xda(std::istream &in)
void read_comsol_mphtxt(std::istream &in)
static void skip_comment_lines(std::istream &in, const char comment_start)
void attach_triangulation(Triangulation< dim, spacedim > &tria)
void read_msh(std::istream &in)
static Format parse_format(const std::string &format_name)
void read_vtu(std::istream &in)
void read_tecplot(std::istream &in)
ExodusIIData read_exodusii(const std::string &filename, const bool apply_all_indicators_to_manifolds=false)
void read_dbmesh(std::istream &in)
void read_ucd(std::istream &in, const bool apply_all_indicators_to_manifolds=false)
void read(std::istream &in, Format format=Default)
static std::string get_format_names()
void read_unv(std::istream &in)
static void parse_tecplot_header(std::string &header, std::vector< unsigned int > &tecplot2deal, unsigned int &n_vars, unsigned int &n_vertices, unsigned int &n_cells, std::vector< unsigned int > &IJK, bool &structured, bool &blocked)
std::string find(const std::string &filename, const char *open_mode="r")
std_cxx20::ranges::iota_view< unsigned int, unsigned int > vertex_indices() const
unsigned int n_vertices() const
unsigned int face_to_cell_vertices(const unsigned int face, const unsigned int vertex, const unsigned char face_orientation) const
unsigned int exodusii_vertex_to_deal_vertex(const unsigned int vertex_n) const
unsigned int get_dimension() const
ReferenceCell face_reference_cell(const unsigned int face_no) const
unsigned int exodusii_face_to_deal_face(const unsigned int face_n) const
static ReferenceCell n_vertices_to_type(const int dim, const unsigned int n_vertices)
virtual void create_triangulation(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata)
void load(Archive &ar, const unsigned int version)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_FALLTHROUGH
IteratorRange< active_cell_iterator > active_cell_iterators() const
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNeedsAssimp()
static ::ExceptionBase & ExcNoTriangulationSelected()
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcInvalidState()
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInvalidVertexIndex(int arg1, int arg2, int arg3)
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcNeedsExodusII()
#define AssertThrow(cond, exc)
void consistently_order_cells(std::vector< CellData< dim >> &cells)
std::string default_suffix(const OutputFormat output_format)
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
types::global_dof_index size_type
void swap(MemorySpaceData< T, MemorySpace > &u, MemorySpaceData< T, MemorySpace > &v)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
constexpr const ReferenceCell Tetrahedron
constexpr const ReferenceCell Quadrilateral
constexpr const ReferenceCell Wedge
constexpr const ReferenceCell Pyramid
constexpr const ReferenceCell Invalid
constexpr const ReferenceCell Triangle
constexpr const ReferenceCell Hexahedron
constexpr const ReferenceCell Vertex
constexpr const ReferenceCell Line
std::pair< int, unsigned int > get_integer_at_position(const std::string &name, const unsigned int position)
std::vector< unsigned char > decode_base64(const std::string &base64_input)
std::vector< std::string > break_text_into_lines(const std::string &original_text, const unsigned int width, const char delimiter=' ')
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
bool match_at_string_start(const std::string &name, const std::string &pattern)
std::string decompress(const std::string &compressed_input)
Iterator lower_bound(Iterator first, Iterator last, const T &val)
std::string trim(const std::string &input)
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
const types::material_id invalid_material_id
const types::boundary_id internal_face_boundary_id
static const unsigned int invalid_unsigned_int
const types::manifold_id flat_manifold_id
void transform(const InputIterator &begin_in, const InputIterator &end_in, OutputIterator out, const Function &function, const unsigned int grainsize)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
std::vector< unsigned int > vertices
types::material_id material_id
std::vector< std::vector< int > > id_to_sideset_ids
std::vector< CellData< 2 > > boundary_quads
bool check_consistency(const unsigned int dim) const
std::vector< CellData< 1 > > boundary_lines
const ::Triangulation< dim, spacedim > & tria