From ec7d6ee1cf00b4dd074bd92e3efcca53e93331f3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 13 Feb 2016 07:23:37 -0600 Subject: [PATCH] Add an assertion. --- include/deal.II/dofs/dof_accessor.templates.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index f2597af26e..e599d0a863 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -48,18 +48,22 @@ DoFAccessor::DoFAccessor () template inline -DoFAccessor::DoFAccessor ( - const Triangulation *tria, - const int level, - const int index, - const DoFHandlerType *dof_handler) +DoFAccessor:: +DoFAccessor (const Triangulation *tria, + const int level, + const int index, + const DoFHandlerType *dof_handler) : dealii::internal::DoFAccessor::Inheritance::BaseClass (tria, level, index), dof_handler(const_cast(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.")); +} -- 2.39.5