]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Do the right thing in 1d for has_support_on_face
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Jun 2002 13:30:51 +0000 (13:30 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Jun 2002 13:30:51 +0000 (13:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@6095 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_q.cc
deal.II/doc/news/2002/c-3-4.html

index edd1802fcef3c7dda2617ef3d527b4321c8c898d..37a0d34288904034167c980fba08e07de7fed87a 100644 (file)
@@ -1314,79 +1314,66 @@ FE_Q<dim>::has_support_on_face (const unsigned int shape_index_,
          ExcIndexRange (face_index, 0, GeometryInfo<dim>::faces_per_cell));
 
   unsigned int shape_index = shape_index_;
-    
+
+                                  // in 1d, things are simple. since
+                                  // there is only one degree of
+                                  // freedom per vertex in this
+                                  // class, the first is on vertex 0
+                                  // (==face 0 in some sense), the
+                                  // second on face 1:
   if (dim==1)
-    return true;
-  const unsigned int cell_start = (dim==2)
-                                 ? first_quad_index
-                                 : first_hex_index;
-  const unsigned int face_start = (dim==2)
-                                 ? first_line_index
-                                 : first_quad_index;
-  
-                                  // Interior degrees of
-                                  // freedom correspond to
-                                  // shape functions with
-                                  // support inside the cell.
-  if (shape_index >= cell_start)
-    return false;
-                                  // Shape functions are sorted
-                                  // by face. If we dived by
-                                  // the number of shapes per
-                                  // face, the result must be
-                                  // equal to the face index.
-  if (shape_index >= face_start)
-    {
-      shape_index -= first_line_index;
-      shape_index /=  dofs_per_face;
-      return (shape_index == face_index);
-    }
-                                  // Only degrees of freedom on
-                                  // a vertex are left.
-  shape_index /=  dofs_per_vertex;
-                                  // Use a table to figure out
-                                  // which face is neighbor to
-                                  // which vertex.
-  switch (100*dim+10*face_index+shape_index)
+    return (((shape_index == 0) && (face_index == 0)) ||
+           ((shape_index == 1) && (face_index == 1)));
+  else
+                                    // more dimensions
     {
-      case 200:
-      case 230:
-      case 201:
-      case 211:
-      case 212:
-      case 222:
-      case 223:
-      case 233:
-      case 300:
-      case 320:
-      case 350:
-      case 301:
-      case 321:
-      case 331:
-      case 302:
-      case 332:
-      case 342:
-      case 303:
-      case 343:
-      case 353:
-      case 314:
-      case 324:
-      case 354:
-      case 315:
-      case 325:
-      case 335:
-      case 316:
-      case 336:
-      case 346:
-      case 317:
-      case 347:
-      case 357:
-       return true;
-      default:
+      const unsigned int cell_start = (dim==2)
+                                     ? first_quad_index
+                                     : first_hex_index;
+      const unsigned int face_start = (dim==2)
+                                     ? first_line_index
+                                     : first_quad_index;
+  
+                                      // Interior degrees of
+                                      // freedom correspond to
+                                      // shape functions with
+                                      // support inside the cell.
+      if (shape_index >= cell_start)
        return false;
-    }
-  return true;
-}
+                                      // Shape functions are sorted
+                                      // by face. If we dived by
+                                      // the number of shapes per
+                                      // face, the result must be
+                                      // equal to the face index.
+      if (shape_index >= face_start)
+       {
+         shape_index -= first_line_index;
+         shape_index /=  dofs_per_face;
+         return (shape_index == face_index);
+       }
+                                      // Only degrees of freedom on
+                                      // a vertex are left.
+      shape_index /=  dofs_per_vertex;
+                                      // Use a table to figure out
+                                      // which face is neighbor to
+                                      // which vertex.
+      switch (100*dim+10*face_index+shape_index)
+       {
+         case 200:       case 230:       case 201:       case 211:
+         case 212:       case 222:       case 223:       case 233:
+         case 300:       case 320:       case 350:       case 301:
+         case 321:       case 331:       case 302:       case 332:
+         case 342:       case 303:       case 343:       case 353:
+         case 314:       case 324:       case 354:       case 315:
+         case 325:       case 335:       case 316:       case 336:
+         case 346:       case 317:       case 347:       case 357:
+               return true;
+         default:
+               return false;
+       }
+      return true;
+    };
+};
 
 
 
index 50c6aa2f5a6e142f6b9cd0a8d1b762710b696697..30dbab888e8bd73717d4947b257fd5e4240f6f7e 100644 (file)
@@ -105,6 +105,15 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>deal.II</h3>
 
 <ol>
+  <li> <p> Fixed: <code
+       class="member">FE_Q::has_support_on_face</code> always returned
+       true in 1d, partly because faces are not really an issue in
+       1d. It now does so only when the support point of the
+       respective shape function is actually the requested vertex.
+       <br>
+       (WB 2002/06/13)
+       </p>
+
   <li> <p> New: The existing <code
        class="member">FETools::interpolate</code>, <code
        class="member">FETools::back_interpolate</code> and <code
@@ -121,14 +130,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        (RH 2002/06/13)
        </p>
 
-  <li> <p> Change: The constructor of <code
+  <li> <p> Changed: The constructor of <code
        class="class">DoFHandler</code> now takes a reference to a
        <tt>const</tt> <code class="class">Triangulation</code>.
        <br>
        (RH 2002/06/12)
        </p>
 
-  <li> <p> Change: The constructors of all <code
+  <li> <p> Changed: The constructors of all <code
        class="class">DoFAccessor</code>, <code
        class="class">TriaAccessor</code> and <code
        class="class">TriaIterator</code> classes now take pointers to
@@ -137,7 +146,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        (RH 2002/06/12)
        </p>
 
-  <li> <p> Change: <code
+  <li> <p> Changed: <code
        class="member">Triangulation::clear_user_flags</code> and <code
        class="member">Triangulation::clear_user_pointers</code> are
        now <tt>const</tt> functions.

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.