From: Peter Munch Date: Mon, 4 Jul 2022 17:21:02 +0000 (+0200) Subject: DoFTools::make_periodicity_constraints move asserts X-Git-Tag: v9.5.0-rc1~1117^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14091%2Fhead;p=dealii.git DoFTools::make_periodicity_constraints move asserts --- diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 478f3628e7..00e35675a7 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -2298,14 +2298,6 @@ namespace DoFTools const std::vector & first_vector_components, const number periodicity_factor) { - // TODO: the implementation makes the assumption that all faces have the - // same number of dofs - AssertDimension( - face_1->get_fe(face_1->nth_active_fe_index(0)).n_unique_faces(), 1); - AssertDimension( - face_2->get_fe(face_2->nth_active_fe_index(0)).n_unique_faces(), 1); - const unsigned int face_no = 0; - static const int dim = FaceIterator::AccessorType::dimension; static const int spacedim = FaceIterator::AccessorType::space_dimension; @@ -2339,6 +2331,12 @@ namespace DoFTools #ifdef DEBUG if (!face_1->has_children()) { + // TODO: the implementation makes the assumption that all faces have the + // same number of dofs + AssertDimension( + face_1->get_fe(face_1->nth_active_fe_index(0)).n_unique_faces(), 1); + const unsigned int face_no = 0; + Assert(face_1->n_active_fe_indices() == 1, ExcInternalError()); const unsigned int n_dofs_per_face = face_1->get_fe(face_1->nth_active_fe_index(0)) @@ -2357,6 +2355,12 @@ namespace DoFTools if (!face_2->has_children()) { + // TODO: the implementation makes the assumption that all faces have the + // same number of dofs + AssertDimension( + face_2->get_fe(face_2->nth_active_fe_index(0)).n_unique_faces(), 1); + const unsigned int face_no = 0; + Assert(face_2->n_active_fe_indices() == 1, ExcInternalError()); const unsigned int n_dofs_per_face = face_2->get_fe(face_2->nth_active_fe_index(0)) @@ -2459,6 +2463,11 @@ namespace DoFTools face_2->get_fe(face_2->nth_active_fe_index(0)) : face_1->get_fe(face_1->nth_active_fe_index(0)); + // TODO: the implementation makes the assumption that all faces have the + // same number of dofs + AssertDimension(fe.n_unique_faces(), 1); + const unsigned int face_no = 0; + const unsigned int n_dofs_per_face = fe.n_dofs_per_face(face_no); // Sometimes we just have nothing to do (for all finite elements, or