From 2c8e49bcf562b75e8ff1576c664cb7600b28e158 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 24 Jan 2022 12:01:40 -0700 Subject: [PATCH] Un-hardcode some numbers. --- source/grid/tria.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 77845fcc54..3547f45123 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -5108,23 +5108,26 @@ namespace internal triangulation.active_cell_iterators_on_level(level)) if (cell->refine_flag_set()) { + // Only support isotropic refinement Assert(cell->refine_flag_set() == RefinementCase::cut_xyz, ExcInternalError()); + // Now count up how many new cells, faces, edges, and vertices + // we will need to allocate to do this refinement. + new_cells += cell->reference_cell().n_isotropic_children(); + if (cell->reference_cell() == ReferenceCells::Hexahedron) { ++needed_vertices; needed_lines_single += 6; needed_quads_single += 12; - new_cells += 8; } else if (cell->reference_cell() == ReferenceCells::Tetrahedron) { needed_lines_single += 1; needed_quads_single += 8; - new_cells += 8; } else { -- 2.39.5