From: Peter Munch Date: Sat, 20 Nov 2021 12:25:33 +0000 (+0100) Subject: Add assert to FEImmersedSurfaceValues X-Git-Tag: v9.4.0-rc1~813^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12976%2Fhead;p=dealii.git Add assert to FEImmersedSurfaceValues --- diff --git a/source/non_matching/fe_immersed_values.cc b/source/non_matching/fe_immersed_values.cc index a844126daf..f741815e85 100644 --- a/source/non_matching/fe_immersed_values.cc +++ b/source/non_matching/fe_immersed_values.cc @@ -47,12 +47,17 @@ namespace NonMatching // Check that mapping and reference cell type are compatible: Assert(this->get_mapping().is_compatible_with(cell->reference_cell()), ExcMessage( - "You are trying to call FEValues::reinit() with a cell of type " + + "You are trying to call FEImmersedSurfaceValues::reinit() with " + " a cell of type " + cell->reference_cell().to_string() + " with a Mapping that is not compatible with it.")); // No FE in this cell, so no assertion necessary here. - this->maybe_invalidate_previous_present_cell(cell); + Assert( + this->present_cell.is_initialized() == false, + ExcMessage( + "FEImmersedSurfaceValues::reinit() can only be used for one cell!")); + this->present_cell = {cell}; // This was the part of the work that is dependent on the actual data type @@ -71,7 +76,8 @@ namespace NonMatching // Check that mapping and reference cell type are compatible: Assert(this->get_mapping().is_compatible_with(cell->reference_cell()), ExcMessage( - "You are trying to call FEValues::reinit() with a cell of type " + + "You are trying to call FEImmersedSurfaceValues::reinit() with " + "a cell of type " + cell->reference_cell().to_string() + " with a Mapping that is not compatible with it.")); @@ -81,7 +87,11 @@ namespace NonMatching static_cast &>(cell->get_fe()), (typename FEValuesBase::ExcFEDontMatch())); - this->maybe_invalidate_previous_present_cell(cell); + Assert( + this->present_cell.is_initialized() == false, + ExcMessage( + "FEImmersedSurfaceValues::reinit() can only be used for one cell!")); + this->present_cell = {cell}; // This was the part of the work that is dependent on the actual data type