// allocate and read indices
cells.emplace_back();
for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
- in >> cells.back().vertices[i];
+ in >> cells.back().vertices[GeometryInfo<dim>::ucd_to_deal[i]];
// to make sure that the cast won't fail
Assert(material_id <= std::numeric_limits<types::material_id>::max(),
// boundary info
{
subcelldata.boundary_quads.emplace_back();
- in >> subcelldata.boundary_quads.back().vertices[0] >>
- subcelldata.boundary_quads.back().vertices[1] >>
- subcelldata.boundary_quads.back().vertices[2] >>
- subcelldata.boundary_quads.back().vertices[3];
+ for (const unsigned int i : GeometryInfo<2>::vertex_indices())
+ in >> subcelldata.boundary_quads.back()
+ .vertices[GeometryInfo<2>::ucd_to_deal[i]];
// to make sure that the cast won't fail
Assert(material_id <= std::numeric_limits<types::boundary_id>::max(),
// ... and cells
if (dim == spacedim)
GridReordering<dim, spacedim>::invert_all_cells_of_negative_grid(vertices,
- cells);
- GridReordering<dim, spacedim>::reorder_cells(cells);
- tria->create_triangulation_compatibility(vertices, cells, subcelldata);
+ cells,
+ true);
+ GridReordering<dim, spacedim>::reorder_cells(cells, true);
+ tria->create_triangulation(vertices, cells, subcelldata);
}
namespace
{
++n_negative_cells;
// reorder vertices: swap front and back face
- for (unsigned int i = 0; i < 4; ++i)
- std::swap(cell.vertices[i], cell.vertices[i + 4]);
+ if (use_new_style_ordering)
+ {
+ std::swap(cell.vertices[0], cell.vertices[2]);
+ std::swap(cell.vertices[1], cell.vertices[3]);
+ std::swap(cell.vertices[4], cell.vertices[6]);
+ std::swap(cell.vertices[5], cell.vertices[7]);
+ }
+ else
+ {
+ for (unsigned int i = 0; i < 4; ++i)
+ std::swap(cell.vertices[i], cell.vertices[i + 4]);
+ }
copy_vertices_to_temp(cell);
// Check whether the resulting cell is now ok.