From: Wolfgang Bangerth Date: Sun, 3 Sep 2006 04:59:38 +0000 (+0000) Subject: Check whether a finite element is attached before returning it. X-Git-Tag: v8.0.0~11157 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a22832fc4ee32a31b3e32bb699aa722cc8d075d5;p=dealii.git Check whether a finite element is attached before returning it. git-svn-id: https://svn.dealii.org/trunk@13815 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/hp_dof_handler.h b/deal.II/deal.II/include/dofs/hp_dof_handler.h index d4b3315b62..c49c8e165f 100644 --- a/deal.II/deal.II/include/dofs/hp_dof_handler.h +++ b/deal.II/deal.II/include/dofs/hp_dof_handler.h @@ -1412,6 +1412,9 @@ namespace hp unsigned int DoFHandler::n_dofs () const { + Assert (finite_elements != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); return used_dofs; } @@ -1422,6 +1425,9 @@ namespace hp const hp::FECollection & DoFHandler::get_fe () const { + Assert (finite_elements != 0, + ExcMessage ("No finite element collection is associated with " + "this DoFHandler")); return *finite_elements; }