]> https://gitweb.dealii.org/ - dealii.git/commitdiff
address comments
authorTimo Heister <timo.heister@gmail.com>
Mon, 25 Jan 2021 16:44:44 +0000 (11:44 -0500)
committerTimo Heister <timo.heister@gmail.com>
Mon, 25 Jan 2021 16:44:44 +0000 (11:44 -0500)
include/deal.II/fe/mapping.h
include/deal.II/fe/mapping_fe.h
source/fe/mapping_cartesian.cc
source/fe/mapping_fe.cc
source/fe/mapping_fe_field.cc

index ede2ebe400742a4128a7daff4a6acf825f56a3c4..7f8db1c26bba8b015ca54152a9c064cd31e20efb 100644 (file)
@@ -402,9 +402,8 @@ public:
   preserves_vertex_locations() const = 0;
 
   /**
-   * Returns is this instance of Mapping is compatible with the type of cell
+   * Returns if this instance of Mapping is compatible with the type of cell
    * in @p cell_type.
-   *
    */
   virtual bool
   is_compatible_with(const ReferenceCell::Type &cell_type) const = 0;
index 0e0bb66592bf1e076ed9b7b86f66fdcbb52f16a4..15d90cfa64e3e055a0e15b48e0ba88d3e652ca7e 100644 (file)
@@ -608,16 +608,6 @@ MappingFE<dim, spacedim>::preserves_vertex_locations() const
 }
 
 
-template <int dim, int spacedim>
-bool
-MappingFE<dim, spacedim>::is_compatible_with(
-  const ReferenceCell::Type &cell_type) const
-{
-  if (cell_type.get_dimension() != dim)
-    return false; // TODO: or is this an error?
-
-  return true;
-}
 
 #endif // DOXYGEN
 
index 1a138613d11bf50c78eb4e59f6093fd9be1091a1..e445960cc4e4a59369dfae5f8246cd13c37ae134 100644 (file)
@@ -75,13 +75,14 @@ bool
 MappingCartesian<dim, spacedim>::is_compatible_with(
   const ReferenceCell::Type &cell_type) const
 {
-  if (cell_type.get_dimension() != dim)
-    return false; // TODO: or is this an error?
-
-  if (cell_type.is_hyper_cube())
-    return true;
-
-  return false;
+  Assert(dim == cell_type.get_dimension(),
+         ExcMessage("The dimension of your mapping (" +
+                    Utilities::to_string(dim) +
+                    ") and the reference cell cell_type (" +
+                    Utilities::to_string(cell_type.get_dimension()) +
+                    " ) do not agree."));
+
+  return cell_type.is_hyper_cube();
 }
 
 
index 3b8415b4d865ba5e7fa4160dfcc93a399b1d2768..b84cad10f3b98e33d16169190379f358915bceaf 100644 (file)
@@ -2309,6 +2309,25 @@ MappingFE<dim, spacedim>::get_bounding_box(
 
 
 
+template <int dim, int spacedim>
+bool
+MappingFE<dim, spacedim>::is_compatible_with(
+  const ReferenceCell::Type &cell_type) const
+{
+  Assert(dim == cell_type.get_dimension(),
+         ExcMessage("The dimension of your mapping (" +
+                    Utilities::to_string(dim) +
+                    ") and the reference cell cell_type (" +
+                    Utilities::to_string(cell_type.get_dimension()) +
+                    " ) do not agree."));
+
+  // TODO: query fe->reference_cell() to compare once is exists.
+
+  return true;
+}
+
+
+
 //--------------------------- Explicit instantiations -----------------------
 #include "mapping_fe.inst"
 
index c9815c61b3a21bb76d9d26df4496faecb5d3081f..9d1d800389b79cf6f07fdc6a0abe26a4c1b15806 100644 (file)
@@ -347,8 +347,16 @@ bool
 MappingFEField<dim, spacedim, VectorType, void>::is_compatible_with(
   const ReferenceCell::Type &cell_type) const
 {
-  if (cell_type.get_dimension() != dim)
-    return false; // TODO: or is this an error?
+  Assert(dim == cell_type.get_dimension(),
+         ExcMessage("The dimension of your mapping (" +
+                    Utilities::to_string(dim) +
+                    ") and the reference cell cell_type (" +
+                    Utilities::to_string(cell_type.get_dimension()) +
+                    " ) do not agree."));
+
+
+  // TODO: check euler_dof_handler->get_fe()
+
 
   return true;
 }

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.