]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add an assertion. 2179/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 13 Feb 2016 13:23:37 +0000 (07:23 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 13 Feb 2016 21:54:39 +0000 (15:54 -0600)
include/deal.II/dofs/dof_accessor.templates.h

index f2597af26ea7e7ce969c06ddffb035d00b496b74..e599d0a863ccfea3e7beebff577bb89744819ecb 100644 (file)
@@ -48,18 +48,22 @@ DoFAccessor<structdim,DoFHandlerType,level_dof_access>::DoFAccessor ()
 
 template <int structdim, typename DoFHandlerType, bool level_dof_access>
 inline
-DoFAccessor<structdim,DoFHandlerType,level_dof_access>::DoFAccessor (
-  const Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *tria,
-  const int             level,
-  const int             index,
-  const DoFHandlerType *dof_handler)
+DoFAccessor<structdim,DoFHandlerType,level_dof_access>::
+DoFAccessor (const Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *tria,
+             const int             level,
+             const int             index,
+             const DoFHandlerType *dof_handler)
   :
   dealii::internal::DoFAccessor::Inheritance<structdim,DoFHandlerType::dimension,
   DoFHandlerType::space_dimension>::BaseClass (tria,
                                                level,
                                                index),
   dof_handler(const_cast<DoFHandlerType *>(dof_handler))
-{}
+{
+  Assert (&dof_handler->get_triangulation() == tria,
+          ExcMessage ("You can't create a DoF accessor in which the DoFHandler object "
+                      "uses a different triangulation than the one you pass as argument."));
+}
 
 
 

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.