]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add assert to FEImmersedSurfaceValues 12976/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 20 Nov 2021 12:25:33 +0000 (13:25 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 22 Nov 2021 16:48:57 +0000 (17:48 +0100)
source/non_matching/fe_immersed_values.cc

index a844126daf6c6b5c06135393b256b5df9d1827ae..f741815e8590cb7933bffb708af07d2b9a9310e2 100644 (file)
@@ -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<const FiniteElementData<dim> &>(cell->get_fe()),
            (typename FEValuesBase<dim>::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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.