From: Wolfgang Bangerth Date: Sat, 13 Feb 2016 13:23:37 +0000 (-0600) Subject: Add an assertion. X-Git-Tag: v8.5.0-rc1~1316^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2179%2Fhead;p=dealii.git Add an assertion. --- 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.")); +}