]> https://gitweb.dealii.org/ - dealii.git/commitdiff
FESystem::build_interface_constraints() for wedges/pyramids 13842/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 27 May 2022 20:37:31 +0000 (22:37 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sun, 26 Jun 2022 07:40:04 +0000 (09:40 +0200)
source/fe/fe.cc
source/fe/fe_system.cc

index a31744c878a75b26497d1b55a963612bd37b8613..857c3fac9992033e78a024c6c6d2f4d1eb0bb011 100644 (file)
@@ -840,14 +840,15 @@ bool
 FiniteElement<dim, spacedim>::constraints_are_implemented(
   const internal::SubfaceCase<dim> &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<dim>::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;
 }
index 2975be1af8460e00ffd75b95ca6ab44518ae8b26..2e7f0fd5e5fca6333dac3b64b7dafb78028938af 100644 (file)
@@ -1534,13 +1534,6 @@ template <int dim, int spacedim>
 void
 FESystem<dim, spacedim>::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<dim, spacedim>::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());
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.