Assert(tria != nullptr, ExcNoTriangulationSelected());
AssertThrow(in, ExcIO());
+ const auto reference_cell = ReferenceCells::get_hypercube<2>();
+
std::string line;
// skip comments at start of file
getline(in, line);
// should still be input here,
// so check this:
AssertThrow(in, ExcIO());
- Assert(GeometryInfo<2>::vertices_per_cell == 4, ExcInternalError());
- for (unsigned int &vertex : cells[cell].vertices)
- in >> vertex;
+ // XDA happens to use ExodusII's numbering because XDA/XDR is libMesh's
+ // native format, and libMesh's node numberings come from ExodusII:
+ for (unsigned int i = 0; i < GeometryInfo<2>::vertices_per_cell; i++)
+ in >> cells[cell].vertices[reference_cell.exodusii_vertex_to_deal_vertex(i)];
}
// do some clean-up on vertices...
GridTools::delete_unused_vertices(vertices, cells, subcelldata);
// ... and cells
- GridReordering<2>::invert_all_cells_of_negative_grid(vertices, cells);
- GridReordering<2>::reorder_cells(cells);
- tria->create_triangulation_compatibility(vertices, cells, subcelldata);
+ GridReordering<2>::invert_all_cells_of_negative_grid(vertices, cells, true);
+ GridReordering<2>::reorder_cells(cells, true);
+ tria->create_triangulation(vertices, cells, subcelldata);
}
Assert(tria != nullptr, ExcNoTriangulationSelected());
AssertThrow(in, ExcIO());
- static const unsigned int xda_to_dealII_map[] = {0, 1, 5, 4, 3, 2, 6, 7};
+ const auto reference_cell = ReferenceCells::get_hypercube<3>();
std::string line;
// skip comments at start of file
getline(in, line);
-
unsigned int n_vertices;
unsigned int n_cells;
// should still be input here,
// so check this:
AssertThrow(in, ExcIO());
- Assert(GeometryInfo<3>::vertices_per_cell == 8, ExcInternalError());
-
- unsigned int xda_ordered_nodes[8];
- for (unsigned int &xda_ordered_node : xda_ordered_nodes)
- in >> xda_ordered_node;
-
- for (unsigned int i = 0; i < 8; i++)
- cells[cell].vertices[i] = xda_ordered_nodes[xda_to_dealII_map[i]];
+ // XDA happens to use ExodusII's numbering because XDA/XDR is libMesh's
+ // native format, and libMesh's node numberings come from ExodusII:
+ for (unsigned int i = 0; i < GeometryInfo<3>::vertices_per_cell; i++)
+ in >> cells[cell].vertices[reference_cell.exodusii_vertex_to_deal_vertex(i)];
}
-
-
// set up array of vertices
std::vector<Point<3>> vertices(n_vertices);
for (unsigned int vertex = 0; vertex < n_vertices; ++vertex)
// do some clean-up on vertices...
GridTools::delete_unused_vertices(vertices, cells, subcelldata);
// ... and cells
- GridReordering<3>::invert_all_cells_of_negative_grid(vertices, cells);
- GridReordering<3>::reorder_cells(cells);
- tria->create_triangulation_compatibility(vertices, cells, subcelldata);
+ GridReordering<3>::invert_all_cells_of_negative_grid(vertices, cells, true);
+ GridReordering<3>::reorder_cells(cells, true);
+ tria->create_triangulation(vertices, cells, subcelldata);
}