getline(in, line);
AssertThrow(line == "Quadrilaterals", ExcInvalidDBMESHInput(line));
+ static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
+ {0, 1, 5, 4, 2, 3, 7, 6}};
std::vector<CellData<dim>> cells;
SubCellData subcelldata;
unsigned int n_cells;
cells.emplace_back();
for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
- in >> cells.back().vertices[GeometryInfo<dim>::ucd_to_deal[i]];
+ in >>
+ cells.back().vertices[dim == 3 ? local_vertex_numbering[i] :
+ GeometryInfo<dim>::ucd_to_deal[i]];
AssertThrow((cells.back().vertices[i] >= 1) &&
(static_cast<unsigned int>(cells.back().vertices[i]) <=
std::map<unsigned int, types::boundary_id> boundary_ids_1d;
{
+ static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
+ {0, 1, 5, 4, 2, 3, 7, 6}};
unsigned int global_cell = 0;
for (int entity_block = 0; entity_block < n_entity_blocks; ++entity_block)
{
GeometryInfo<dim>::vertices_per_cell)
{
in >> cells.back()
- .vertices[GeometryInfo<dim>::ucd_to_deal[i]];
+ .vertices[dim == 3 ?
+ local_vertex_numbering[i] :
+ GeometryInfo<dim>::ucd_to_deal[i]];
}
else
{
unsigned int v_offset = 0;
unsigned int c_offset = 0;
+ static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
+ {0, 1, 5, 4, 2, 3, 7, 6}};
// The index of the mesh will be used as a material index.
for (unsigned int m = start_mesh; m < end_mesh; ++m)
{
for (const unsigned int f : GeometryInfo<dim>::vertex_indices())
{
cells[valid_cell]
- .vertices[GeometryInfo<dim>::ucd_to_deal[f]] =
+ .vertices[dim == 3 ? local_vertex_numbering[f] :
+ GeometryInfo<dim>::ucd_to_deal[f]] =
mFaces[i].mIndices[f] + v_offset;
}
cells[valid_cell].material_id = m;
(msh_flags.write_lines ? n_boundary_lines(tria) : 0))
<< '\n';
+ static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
+ {0, 1, 5, 4, 2, 3, 7, 6}};
+
// write cells. Enumerate cells
// consecutively, starting with 1
for (const auto &cell : tria.active_cell_iterators())
for (const unsigned int vertex : cell->vertex_indices())
{
if (cell->reference_cell() == ReferenceCells::get_hypercube<dim>())
- out << cell->vertex_index(GeometryInfo<dim>::ucd_to_deal[vertex]) +
+ out << cell->vertex_index(
+ dim == 3 ? local_vertex_numbering[vertex] :
+ GeometryInfo<dim>::ucd_to_deal[vertex]) +
1
<< ' ';
else if (cell->reference_cell() == ReferenceCells::get_simplex<dim>())
ReferenceCells::get_hypercube<dim>(), quadrature);
}
+ static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
+ {0, 1, 5, 4, 2, 3, 7, 6}};
for (const auto &cell : tria.active_cell_iterators())
{
if (gnuplot_flags.write_cell_numbers)
// points (+ the initial point again) in a row and lifting the
// drawing pencil at the end
for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
- out << cell->vertex(GeometryInfo<dim>::ucd_to_deal[i]) << ' '
- << cell->level() << ' ' << cell->material_id() << '\n';
+ out << cell->vertex(dim == 3 ?
+ local_vertex_numbering[i] :
+ GeometryInfo<dim>::ucd_to_deal[i])
+ << ' ' << cell->level() << ' ' << cell->material_id()
+ << '\n';
out << cell->vertex(0) << ' ' << cell->level() << ' '
<< cell->material_id() << '\n'
<< '\n' // double new line for gnuplot 3d plots