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;
}
-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
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();
}
+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"
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;
}