From 239240538e1a27abf97b3e7f0b72da67c5d0bb5a Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 26 Jun 2007 05:06:52 +0000 Subject: [PATCH] Resolve a TODO by adding assertions git-svn-id: https://svn.dealii.org/trunk@14813 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_handler.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index b2115f03bd..d8480ceb1c 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -1426,10 +1426,15 @@ template template inline unsigned int -DoFHandler::n_active_fe_indices (const unsigned int, - const unsigned int) const +DoFHandler::n_active_fe_indices (const unsigned int obj_level, + const unsigned int obj_index) const { -//TODO[WB]: this isn't true -- the function should return zero if the object is inactive + Assert (raw_cell_iterator (tria, + obj_level, + obj_index, + this)->used() == true, + ExcMessage ("This cell is not active and therefore can't be " + "queried for the number of active FE indices")); return 1; } @@ -1439,11 +1444,16 @@ template template inline unsigned int -DoFHandler::nth_active_fe_index (const unsigned int, - const unsigned int, +DoFHandler::nth_active_fe_index (const unsigned int obj_level, + const unsigned int obj_index, const unsigned int n) const { -//TODO[WB]: this isn't true -- we should error out unconditionally if the object is inactive + Assert (raw_cell_iterator (tria, + obj_level, + obj_index, + this)->used() == true, + ExcMessage ("This cell is not active and therefore can't be " + "queried for its active FE indices")); Assert (n == 0, ExcIndexRange (n, 0, 1)); return default_fe_index; -- 2.39.5