]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement the most important missing cases.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 10 Oct 2024 13:53:41 +0000 (07:53 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 10 Oct 2024 13:57:39 +0000 (07:57 -0600)
source/fe/fe.cc

index 0998b8801ced29f1fef80424ceb8441812778dac..1f5e56c6801ba95638b66b7371fea7aab0227126 100644 (file)
@@ -887,21 +887,39 @@ FiniteElement<dim, spacedim>::interface_constraints_size() const
     {
       case 1:
         return {0U, 0U};
+
       case 2:
         // We have to interpolate from the DoFs in the interior of the
         // the two child faces (=lines) and the one central vertex
         // to the DoFs of the parent face:
         return {this->n_dofs_per_vertex() + 2 * this->n_dofs_per_line(),
                 this->n_dofs_per_face(face_no)};
+
       case 3:
         // We have to interpolate from the DoFs in the interior of the
         // the child faces (=quads or tris) and the vertices that are
         // not part of the parent face, to the DoFs of the parent face:
-        Assert(this->reference_cell() == ReferenceCells::get_hypercube<dim>(),
-               ExcNotImplemented());
-        return {5 * this->n_dofs_per_vertex() + 12 * this->n_dofs_per_line() +
-                  4 * this->n_dofs_per_quad(face_no),
-                this->n_dofs_per_face(face_no)};
+        if (this->reference_cell() == ReferenceCells::Hexahedron)
+          return {
+            5 * this->n_dofs_per_vertex() +  // 4 vertices at mid-edge points
+                                             // + 1 at cell center
+              12 * this->n_dofs_per_line() + // 4*2 children of the old edges
+                                             // + 2*2 edges in the cell interior
+              4 * this->n_dofs_per_quad(face_no), // 4 child faces
+            this->n_dofs_per_face(face_no)};
+        else if (this->reference_cell() == ReferenceCells::Tetrahedron)
+          return {
+            3 * this->n_dofs_per_vertex() + // 3 vertices at mid-edge points
+              9 * this->n_dofs_per_line() + // 3*2 children of the old edges
+                                            // + 3 edges in the cell interior
+              4 * this->n_dofs_per_quad(face_no), // 4 child faces
+            this->n_dofs_per_face(face_no)};
+        else
+          {
+            Assert(this->n_dofs_per_face(face_no) == 0, ExcNotImplemented());
+            return {0U, 0U};
+          }
+
       default:
         DEAL_II_NOT_IMPLEMENTED();
     }

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.