]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix bits/fe_face_to_cell_index, which yielded wrong results because face 0 now has...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 30 Jul 2006 22:19:50 +0000 (22:19 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 30 Jul 2006 22:19:50 +0000 (22:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@13527 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 89454d79b63576ef92d53dbf86d2005967b8a7b1..349df628d58d42a7b52df0784267f8ac734c5de2 100644 (file)
@@ -612,10 +612,17 @@ face_to_equivalent_cell_index (const unsigned int index) const
 {
   Assert (index < dofs_per_face,
          ExcIndexRange (index, 0, dofs_per_face));
-  return (index < (this->first_face_line_index)
-         ? index
-         : this->first_line_index +
-         (index - this->first_face_line_index));
+
+                                  // on face 0, the vertices are 0 and 2
+  if (index < this->dofs_per_vertex)
+    return index;
+  else if (index < 2*this->dofs_per_vertex)
+    return index + this->dofs_per_vertex;
+  else
+                                    // this is a dof on line 0, so on the
+                                    // cell there are now 4 vertices instead
+                                    // of only 2 ahead of this one
+    return index + 2*this->dofs_per_vertex;
 }
 
 
@@ -627,16 +634,10 @@ unsigned int
 FiniteElementData<3>::
 face_to_equivalent_cell_index (const unsigned int index) const
 {
-  Assert (index < dofs_per_face,
-         ExcIndexRange (index, 0, dofs_per_face));
-  return (index < (GeometryInfo<3>::vertices_per_face *
-                  this->dofs_per_vertex)
-         ? index
-         : (index < (this->first_face_quad_index)
-            ? this->first_line_index +
-            (index - this->first_face_line_index)
-            : this->first_quad_index +
-          (index - this->first_face_quad_index)));
+                                  // this case is just way too
+                                  // complicated. fall back to
+                                  // face_to_cell_index
+  return face_to_cell_index(index, 0, true);
 }
 
 

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.