From e247e10ca9daafa66ba39ebb865f0a5c05b05255 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 10 Nov 2022 13:48:47 -0700 Subject: [PATCH] Simplify testing whether a cell is a hypercube. --- source/base/data_out_base.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 50012e2e30..8de6329e59 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -725,7 +725,7 @@ namespace if (write_higher_order_cells) { - if (patch.reference_cell == ReferenceCells::get_hypercube()) + if (patch.reference_cell.is_hyper_cube()) { const std::array cell_type_by_dim{ {VTK_VERTEX, @@ -781,7 +781,7 @@ namespace vtk_cell_id[0] = VTK_PYRAMID; vtk_cell_id[1] = 1; } - else if (patch.reference_cell == ReferenceCells::get_hypercube()) + else if (patch.reference_cell.is_hyper_cube()) { const std::array cell_type_by_dim{ {VTK_VERTEX, VTK_LINE, VTK_QUAD, VTK_HEXAHEDRON}}; @@ -819,8 +819,7 @@ namespace const unsigned int n_subdivisions) { // This function only makes sense when called on hypercube cells - Assert(patch.reference_cell == ReferenceCells::get_hypercube(), - ExcInternalError()); + Assert(patch.reference_cell.is_hyper_cube(), ExcInternalError()); Assert(lattice_location.size() == dim, ExcInternalError()); @@ -1132,7 +1131,7 @@ namespace "but that is clearly not a valid choice. Did you forget " "to set the reference cell for the patch?")); - if (patch.reference_cell == ReferenceCells::get_hypercube()) + if (patch.reference_cell.is_hyper_cube()) { n_nodes += Utilities::fixed_power(patch.n_subdivisions + 1); n_cells += Utilities::fixed_power(patch.n_subdivisions); @@ -1164,7 +1163,7 @@ namespace for (const auto &patch : patches) { - if (patch.reference_cell == ReferenceCells::get_hypercube()) + if (patch.reference_cell.is_hyper_cube()) { n_nodes += Utilities::fixed_power(patch.n_subdivisions + 1); -- 2.39.5