]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change the order of some loops to allow for better optimization by the compiler.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 1 Nov 1998 22:26:17 +0000 (22:26 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 1 Nov 1998 22:26:17 +0000 (22:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@621 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_lib.quadratic.cc
deal.II/deal.II/source/fe/fe_values.cc

index 3604b230165b880f300734cddf0d53f51fe14d09..793f36d5b8f9bd7b90516145b08b8a3a774f2880 100644 (file)
@@ -885,8 +885,8 @@ void FEQuadraticSub<2>::get_unit_support_points (vector<Point<2> > &unit_points)
 
 template <>
 void FEQuadraticSub<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell,
-                                          const Boundary<2>&,
-                                          vector<Point<2> >  &support_points) const {
+                                           const Boundary<2>&,
+                                           vector<Point<2> >  &support_points) const {
   Assert (support_points.size() == total_dofs,
          ExcWrongFieldDimension (support_points.size(), total_dofs));
   
@@ -898,16 +898,16 @@ void FEQuadraticSub<2>::get_support_points (const typename DoFHandler<2>::cell_i
                                   // to the mean coordinates of the vertices
   for (unsigned int line=0; line<4; ++line)
     support_points[4+line] = (cell->line(line)->vertex(0) +
-                            cell->line(line)->vertex(1)) / 2;
+                             cell->line(line)->vertex(1)) / 2;
                                   // same for the center of the square:
                                   // since all four linear basis functions
                                   // take on the value 1/4 at the center,
                                   // the center is mapped to the mean
                                   // coordinates of the four vertices
   support_points[8] = (support_points[0] +
-                     support_points[1] +
-                     support_points[2] +
-                     support_points[3]) / 4;
+                      support_points[1] +
+                      support_points[2] +
+                      support_points[3]) / 4;
 };
 
 
index 44e66ed7737861e7ecfb5a9a911cfd11af8aefef..89a9141faedd24ad364070085a805cefd48c1062 100644 (file)
@@ -332,9 +332,9 @@ FEFaceValues<dim>::FEFaceValues (const FiniteElement<dim> &fe,
   for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
     QProjector<dim>::project_to_face (quadrature, face, unit_quadrature_points[face]);
 
-  for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-    for (unsigned int i=0; i<fe.total_dofs; ++i)
-      for (unsigned int j=0; j<n_quadrature_points; ++j) 
+  for (unsigned int i=0; i<fe.total_dofs; ++i)
+    for (unsigned int j=0; j<n_quadrature_points; ++j) 
+      for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
        {
          shape_values[face](i,j)
            = fe.shape_value(i, unit_quadrature_points[face][j]);
@@ -342,15 +342,15 @@ FEFaceValues<dim>::FEFaceValues (const FiniteElement<dim> &fe,
            = fe.shape_grad(i, unit_quadrature_points[face][j]);
        };
 
-  for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-    for (unsigned int i=0; i<n_transform_functions; ++i)
-      for (unsigned int j=0; j<n_quadrature_points; ++j)
+  for (unsigned int i=0; i<n_transform_functions; ++i)
+    for (unsigned int j=0; j<n_quadrature_points; ++j)
+      for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
        {
          shape_values_transform[face] (i,j)
            = fe.shape_value_transform (i, unit_quadrature_points[face][j]);
          unit_shape_gradients_transform[face][i][j]
            = fe.shape_grad_transform(i, unit_quadrature_points[face][j]);
-      };
+       };
 };
 
 
@@ -456,25 +456,37 @@ FESubfaceValues<dim>::FESubfaceValues (const FiniteElement<dim> &fe,
                                           face, subface,
                                           unit_quadrature_points[face*(1<<(dim-1))+subface]);
 
-  for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-    for (unsigned int subface=0; subface<GeometryInfo<dim>::subfaces_per_face; ++subface)
-      for (unsigned int i=0; i<fe.total_dofs; ++i)
-       for (unsigned int j=0; j<n_quadrature_points; ++j) 
+  for (unsigned int i=0; i<fe.total_dofs; ++i)
+    for (unsigned int j=0; j<n_quadrature_points; ++j) 
+      for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+       for (unsigned int subface=0; subface<GeometryInfo<dim>::subfaces_per_face; ++subface)
          {
            shape_values[face*GeometryInfo<dim>::subfaces_per_face+subface](i,j)
-             = fe.shape_value(i, unit_quadrature_points[face*GeometryInfo<dim>::subfaces_per_face+subface][j]);
+             = fe.shape_value(i, unit_quadrature_points[face *
+                                                       GeometryInfo<dim>::
+                                                       subfaces_per_face+subface][j]);
            unit_shape_gradients[face*GeometryInfo<dim>::subfaces_per_face+subface][i][j]
-             = fe.shape_grad(i, unit_quadrature_points[face*GeometryInfo<dim>::subfaces_per_face+subface][j]);
+             = fe.shape_grad(i, unit_quadrature_points[face *
+                                                      GeometryInfo<dim>::
+                                                      subfaces_per_face+subface][j]);
          };
-  for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-    for (unsigned int subface=0; subface<GeometryInfo<dim>::subfaces_per_face; ++subface)
-      for (unsigned int i=0; i<n_transform_functions; ++i)
-       for (unsigned int j=0; j<n_quadrature_points; ++j)
+  for (unsigned int i=0; i<n_transform_functions; ++i)
+    for (unsigned int j=0; j<n_quadrature_points; ++j)
+      for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+       for (unsigned int subface=0; subface<GeometryInfo<dim>::subfaces_per_face; ++subface)
          {
            shape_values_transform[face*GeometryInfo<dim>::subfaces_per_face+subface] (i,j)
-             = fe.shape_value_transform (i, unit_quadrature_points[face*GeometryInfo<dim>::subfaces_per_face+subface][j]);
-           unit_shape_gradients_transform[face*GeometryInfo<dim>::subfaces_per_face+subface][i][j]
-             = fe.shape_grad_transform(i, unit_quadrature_points[face*GeometryInfo<dim>::subfaces_per_face+subface][j]);
+             = fe.shape_value_transform (i, unit_quadrature_points[face *
+                                                                  GeometryInfo<dim>::
+                                                                  subfaces_per_face +
+                                                                  subface][j]);
+           unit_shape_gradients_transform[face *
+                                         GeometryInfo<dim>::subfaces_per_face +
+                                         subface][i][j]
+             = fe.shape_grad_transform(i, unit_quadrature_points[face *
+                                                                GeometryInfo<dim>::
+                                                                subfaces_per_face +
+                                                                subface][j]);
          };
 };
 

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.