]> https://gitweb.dealii.org/ - dealii.git/commitdiff
One more case of using arrays for static data.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 14 Aug 2010 03:41:12 +0000 (03:41 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 14 Aug 2010 03:41:12 +0000 (03:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@21659 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/vectors.templates.h

index 1ecd8b47f9ae5bf811d4f7474a1d3fb62518cc8f..e0ecc1f6b88de08903f05a166f9cc95e3316dd4e 100644 (file)
@@ -3439,21 +3439,12 @@ namespace internals
       Point<dim> shifted_reference_point_2;
       Tensor<1, dim> tmp;
       Tensor<1, dim> shape_value;
-      unsigned int face_coordinate_direction;
 
-                                      // Get coordinate directions of the face.
-      switch (face)
-       {
-         case 0:
-         case 1:
-         {
-           face_coordinate_direction = 1;
-           break;
-         }
+                                      // coordinate directions of the face.
+      const unsigned int
+       face_coordinate_direction[GeometryInfo<dim>::faces_per_cell]
+       = { 1, 1, 0, 0 };
 
-         default:
-               face_coordinate_direction = 0;
-       }
 
                                       // The interpolation for the
                                       // lowest order face shape
@@ -3473,8 +3464,8 @@ namespace internals
              shifted_reference_point_2 (d) = quadrature_points[q_point] (d);
            }
 
-         shifted_reference_point_1 (face_coordinate_direction) += 1e-13;
-         shifted_reference_point_2 (face_coordinate_direction) -= 1e-13;
+         shifted_reference_point_1 (face_coordinate_direction[face]) += 1e-13;
+         shifted_reference_point_2 (face_coordinate_direction[face]) -= 1e-13;
          tangentials[q_point] = 2e13
                                 * (fe_values.get_mapping ()
                                    .transform_unit_to_real_cell (cell,
@@ -3490,10 +3481,10 @@ namespace internals
                              * tangentials[q_point] (0)
                              +
                              values[q_point] (1) * tangentials[q_point] (1))
-                          / (jacobians[q_point][0][face_coordinate_direction]
-                             * jacobians[q_point][0][face_coordinate_direction]
-                             + jacobians[q_point][1][face_coordinate_direction]
-                             * jacobians[q_point][1][face_coordinate_direction]);
+                          / (jacobians[q_point][0][face_coordinate_direction[face]]
+                             * jacobians[q_point][0][face_coordinate_direction[face]]
+                             + jacobians[q_point][1][face_coordinate_direction[face]]
+                             * jacobians[q_point][1][face_coordinate_direction[face]]);
        }
 
                                       // If there are also higher
@@ -3522,10 +3513,10 @@ namespace internals
                                               // the interpolated part
                                               // above.
              tmp = std::sqrt (fe_values.JxW (q_point)
-                              / std::sqrt (jacobians[q_point][0][face_coordinate_direction]
-                                           * jacobians[q_point][0][face_coordinate_direction]
-                                           + jacobians[q_point][1][face_coordinate_direction]
-                                           * jacobians[q_point][1][face_coordinate_direction])) * tangentials[q_point];
+                              / std::sqrt (jacobians[q_point][0][face_coordinate_direction[face]]
+                                           * jacobians[q_point][0][face_coordinate_direction[face]]
+                                           + jacobians[q_point][1][face_coordinate_direction[face]]
+                                           * jacobians[q_point][1][face_coordinate_direction[face]])) * tangentials[q_point];
              shape_value
                = fe_values[vec].value (cell->get_fe ().face_to_cell_index (0, face), q_point);
              assembling_vector (q_point) = (values[q_point] (0)

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.