From f4c0ccb7faa2effabb4424c77b735f700222e102 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 27 May 2022 22:37:31 +0200 Subject: [PATCH] FESystem::build_interface_constraints() for wedges/pyramids --- source/fe/fe.cc | 15 ++++++++------- source/fe/fe_system.cc | 12 +++++------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/source/fe/fe.cc b/source/fe/fe.cc index a31744c878..857c3fac99 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -840,14 +840,15 @@ bool FiniteElement::constraints_are_implemented( const internal::SubfaceCase &subface_case) const { - // TODO: the implementation makes the assumption that all faces have the - // same number of dofs - AssertDimension(this->n_unique_faces(), 1); - const unsigned int face_no = 0; - if (subface_case == internal::SubfaceCase::case_isotropic) - return (this->n_dofs_per_face(face_no) == 0) || - (interface_constraints.m() != 0); + { + unsigned int n_dofs_on_faces = 0; + + for (const auto face_no : this->reference_cell().face_indices()) + n_dofs_on_faces += this->n_dofs_per_face(face_no); + + return (n_dofs_on_faces == 0) || (interface_constraints.m() != 0); + } else return false; } diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 2975be1af8..2e7f0fd5e5 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -1534,13 +1534,6 @@ template void FESystem::build_interface_constraints() { - // TODO: the implementation makes the assumption that all faces have the - // same number of dofs - if (this->n_unique_faces() != 1) - return; - - const unsigned int face_no = 0; - // check whether all base elements implement their interface constraint // matrices. if this is not the case, then leave the interface costraints of // this composed element empty as well; however, the rest of the element is @@ -1549,6 +1542,11 @@ FESystem::build_interface_constraints() if (base_element(base).constraints_are_implemented() == false) return; + // TODO: the implementation makes the assumption that all faces have the + // same number of dofs + AssertDimension(this->n_unique_faces(), 1); + const unsigned int face_no = 0; + this->interface_constraints.TableBase<2, double>::reinit( this->interface_constraints_size()); -- 2.39.5