From 1ce4c90c9a38a1bce086e53348d39de8ab21e14c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 30 Oct 2012 13:05:57 +0000 Subject: [PATCH] Add a bunch of assertions to kill invalid behavior as early as possible (currently we get some really weird follow-up errors deep down in the machinery. git-svn-id: https://svn.dealii.org/trunk@27234 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/dofs/dof_accessor.templates.h | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h index cefac603cc..9dd7fc8122 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h @@ -1477,6 +1477,11 @@ inline unsigned int DoFAccessor::n_active_fe_indices () const { + if (dim == DH::dimension) + Assert (this->active(), + ExcMessage ("You can't query information about active FE indices on " + "cells that have children and are therefore not active.")); + // access the respective DoF return dealii::internal::DoFAccessor::Implementation:: @@ -1493,6 +1498,11 @@ inline unsigned int DoFAccessor::nth_active_fe_index (const unsigned int n) const { + if (dim == DH::dimension) + Assert (this->active(), + ExcMessage ("You can't query information about active FE indices on " + "cells that have children and are therefore not active.")); + // access the respective DoF return dealii::internal::DoFAccessor::Implementation:: @@ -1510,6 +1520,11 @@ inline bool DoFAccessor::fe_index_is_active (const unsigned int fe_index) const { + if (dim == DH::dimension) + Assert (this->active(), + ExcMessage ("You can't query information about active FE indices on " + "cells that have children and are therefore not active.")); + // access the respective DoF return dealii::internal::DoFAccessor::Implementation:: @@ -3299,6 +3314,10 @@ inline unsigned int DoFCellAccessor::active_fe_index () const { + Assert (this->active(), + ExcMessage ("You can't query information about active FE indices on " + "cells that have children and are therefore not active.")); + return dealii::internal::DoFCellAccessor::Implementation::active_fe_index (*this); } @@ -3309,6 +3328,10 @@ inline void DoFCellAccessor::set_active_fe_index (const unsigned int i) { + Assert (this->active(), + ExcMessage ("You can't query information about active FE indices on " + "cells that have children and are therefore not active.")); + dealii::internal::DoFCellAccessor::Implementation::set_active_fe_index (*this, i); } -- 2.39.5