From c6369899b4d3fe0b265f79fd38a4a7597243f84a Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 3 Sep 2006 04:59:38 +0000 Subject: [PATCH] Check whether a finite element is attached before returning it. git-svn-id: https://svn.dealii.org/trunk@13815 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/hp_dof_handler.h | 6 ++++++ 1 file changed, 6 insertions(+) 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; } -- 2.39.5