]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a rather complicated assertion.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Sep 2002 14:26:41 +0000 (14:26 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Sep 2002 14:26:41 +0000 (14:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@6501 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_base.h

index f40a7e25cc0d715b1dde0126e2ecffdc19567daa..271eb473212ca27c662246f44da22f02a012e7c9 100644 (file)
@@ -1495,9 +1495,68 @@ FiniteElementBase<dim>::face_system_to_component_index (const unsigned int index
 {
   Assert(index < face_system_to_component_table.size(),
         ExcIndexRange(index, 0, face_system_to_component_table.size()));
-//TODO: check for primitivity of this shape function. this needs the global dof index
-//    Assert (is_primitive (face_to_cell_index(index)),
-//       typename FiniteElementBase<dim>::ExcShapeFunctionNotPrimitive(index));
+
+                                   // in debug mode, check whether the
+                                   // function is primitive, since
+                                   // otherwise the result may have no
+                                   // meaning
+                                   //
+                                   // since the primitivity tables are
+                                   // all geared towards cell dof
+                                   // indices, rather than face dof
+                                   // indices, we have to work a
+                                   // little bit...
+                                   //
+                                   // in 1d, the face index is equal
+                                   // to the cell index
+  Assert (((dim == 1) && is_primitive(index))
+          ||
+                                           // in 2d, construct it like
+                                           // this:
+          ((dim == 2) &&
+           is_primitive (index < (GeometryInfo<2>::vertices_per_face *
+                                  this->dofs_per_vertex)
+                         ?
+                         index
+                         :
+                         GeometryInfo<2>::vertices_per_cell *
+                         this->dofs_per_vertex +
+                         (index -
+                          GeometryInfo<2>::vertices_per_face *
+                          this->dofs_per_vertex)))
+          ||
+                                           // likewise in 3d, but more
+                                           // complicated
+          ((dim == 3) &&
+           is_primitive (index < (GeometryInfo<3>::vertices_per_face *
+                                  this->dofs_per_vertex)
+                         ?
+                         index
+                         :
+                         (index < (GeometryInfo<3>::vertices_per_face *
+                                   this->dofs_per_vertex
+                                   +
+                                   GeometryInfo<3>::lines_per_face *
+                                   this->dofs_per_line)
+                          ?
+                          GeometryInfo<3>::vertices_per_cell *
+                          this->dofs_per_vertex +
+                          (index -
+                           GeometryInfo<3>::vertices_per_face *
+                           this->dofs_per_vertex)
+                          :
+                          GeometryInfo<3>::vertices_per_cell *
+                          this->dofs_per_vertex +
+                          GeometryInfo<3>::lines_per_cell *
+                          this->dofs_per_line +
+                          (index -
+                           GeometryInfo<3>::vertices_per_face *
+                           this->dofs_per_vertex
+                           -
+                           GeometryInfo<3>::lines_per_face *
+                           this->dofs_per_line)))),
+          typename FiniteElementBase<dim>::ExcShapeFunctionNotPrimitive(index));
+
   return face_system_to_component_table[index];
 }
 

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.