]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
modified fill_fe_face_values so that it works for 3D
authorangela.klewinghaus <angela.klewinghaus@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Feb 2013 12:06:26 +0000 (12:06 +0000)
committerangela.klewinghaus <angela.klewinghaus@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Feb 2013 12:06:26 +0000 (12:06 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_face_elements@28606 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/fe/fe_poly_face.templates.h
deal.II/source/fe/fe_tools.cc

index 043ca943bdac6ce4429d96f6e45ebc3ea8823ff5..8b5a28a792e62ab703046c73cfaa1c24ca538a00 100644 (file)
@@ -208,24 +208,42 @@ FE_PolyFace<POLY,dim,spacedim>::fill_fe_face_values (
   if (flags & update_values)
     for (unsigned int i=0; i<quadrature.size(); ++i)
       {
-        for (unsigned int k=0; k<this->dofs_per_cell; ++k)
+       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
           data.shape_values(k,i) = 0.;
-       // Fill data for vertex shape functions
-       if (this->n_dofs_per_vertex() != 0)
-         for (unsigned int lvertex=0; lvertex<GeometryInfo<dim>::vertices_per_face; ++lvertex)
-           data.shape_values(GeometryInfo<dim>::face_to_cell_vertices(face, lvertex),i) = fe_data.shape_values[lvertex][i];
-
-
-       // Fill data for line shape functions
-
-       // in 3D, this should be a loop over all lines of the face,
-       // and the multiplier should not be the face itself
-       const unsigned int foffset = this->first_line_index + this->dofs_per_line * face;
-
-        for (unsigned int k=0; k<this->dofs_per_line; ++k)
-          data.shape_values(foffset+k,i) = fe_data.shape_values[k+this->first_face_line_index][i];
-
-       // Fill data for quad shape functions
+       switch (dim)
+         {
+           case 3:
+             {
+               // Fill data for quad shape functions           
+               if (this->dofs_per_quad !=0)
+                 {
+                   const unsigned int foffset = this->first_quad_index + this->dofs_per_quad * face;
+                   for (unsigned int k=0; k<this->dofs_per_quad; ++k)
+                     data.shape_values(foffset+k,i) = fe_data.shape_values[k+this->first_face_quad_index][i];
+                 }
+             }
+           case 2:
+             {
+               // Fill data for line shape functions
+               if (this->dofs_per_line != 0)
+                 {
+                   const unsigned int foffset = this->first_line_index;
+                   for (unsigned int line=0; line<GeometryInfo<dim>::lines_per_face; ++line)
+                     {
+                       for (unsigned int k=0; k<this->dofs_per_line; ++k)
+                         data.shape_values(foffset+GeometryInfo<dim>::face_to_cell_lines(face, line)+k,i) = fe_data.shape_values[k+(line*this->dofs_per_line)+this->first_face_line_index][i];
+                     }
+                 }
+             }
+           case 1:
+             {
+               // Fill data for vertex shape functions
+               if (this->dofs_per_vertex != 0)
+                 for (unsigned int lvertex=0; lvertex<GeometryInfo<dim>::vertices_per_face; ++lvertex)
+                   data.shape_values(GeometryInfo<dim>::face_to_cell_vertices(face, lvertex),i) = fe_data.shape_values[lvertex][i];
+               break;
+             }
+         }
       }
 }
 
index 79fc4159aab2438702ee555eb58b321dbee7c1c2..9c13ed2bc53a1f9dcc717e62efdca9dbbe2ca298 100644 (file)
@@ -2668,8 +2668,6 @@ namespace FETools
           h2l[next_index++] = n*(n-1)+i+1;
 
         // inside quad
-       // Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
-       //         ExcInternalError());
         for (unsigned int i=0; i<dofs_per_line; ++i)
           for (unsigned int j=0; j<dofs_per_line; ++j)
             h2l[next_index++] = n*(i+1)+j+1;
@@ -2733,8 +2731,6 @@ namespace FETools
 
 
         // inside quads
-       // Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
-        //        ExcInternalError());
         // face 0
         for (unsigned int i=0; i<dofs_per_line; ++i)
           for (unsigned int j=0; j<dofs_per_line; ++j)
@@ -2761,8 +2757,6 @@ namespace FETools
             h2l[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
 
         // inside hex
-       // Assert (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
-        //        ExcInternalError());
         for (unsigned int i=0; i<dofs_per_line; ++i)
           for (unsigned int j=0; j<dofs_per_line; ++j)
             for (unsigned int k=0; k<dofs_per_line; ++k)
@@ -2776,8 +2770,6 @@ namespace FETools
       default:
         Assert (false, ExcNotImplemented());
       }
-
-    // return h2l;
   }
 
 

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.