]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Compute second derivatives only when needed
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 5 Jul 2000 21:50:14 +0000 (21:50 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 5 Jul 2000 21:50:14 +0000 (21:50 +0000)
git-svn-id: https://svn.dealii.org/trunk@3137 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 95763dcce3feba7da5ac5ba918f6986bd21cef4b..3a8e6318914475123be66968abb2e60f3fa277f3 100644 (file)
@@ -346,8 +346,9 @@ FEValues<dim>::FEValues (const FiniteElement<dim> &fe,
        shape_values[0](i,j) = fe.shape_value(i, unit_quadrature_points[j]);
        unit_shape_gradients[i][j]
          = fe.shape_grad(i, unit_quadrature_points[j]);
-       unit_shape_2nd_derivatives[i][j]
-         = fe.shape_grad_grad(i, unit_quadrature_points[j]);
+       if (update_flags & update_second_derivatives)
+         unit_shape_2nd_derivatives[i][j]
+           = fe.shape_grad_grad(i, unit_quadrature_points[j]);
       };
 
   for (unsigned int i=0; i<n_transform_functions; ++i)
@@ -538,8 +539,9 @@ FEFaceValues<dim>::FEFaceValues (const FiniteElement<dim> &fe,
            = fe.shape_value(i, unit_quadrature_points[face][j]);
          unit_shape_gradients[face][i][j]
            = fe.shape_grad(i, unit_quadrature_points[face][j]);
-         unit_shape_2nd_derivatives[face][i][j]
-           = fe.shape_grad_grad(i, unit_quadrature_points[face][j]);
+         if (update_flags & update_second_derivatives)
+           unit_shape_2nd_derivatives[face][i][j]
+             = fe.shape_grad_grad(i, unit_quadrature_points[face][j]);
        };
 
   for (unsigned int i=0; i<n_transform_functions; ++i)
@@ -707,8 +709,9 @@ FESubfaceValues<dim>::FESubfaceValues (const FiniteElement<dim> &fe,
              = fe.shape_grad(i, unit_quadrature_points[face *
                                                       GeometryInfo<dim>::
                                                       subfaces_per_face+subface][j]);
-           unit_shape_2nd_derivatives[face*GeometryInfo<dim>::subfaces_per_face+subface][i][j]
-             = fe.shape_grad_grad(i, unit_quadrature_points[face *
+           if (update_flags & update_second_derivatives)
+             unit_shape_2nd_derivatives[face*GeometryInfo<dim>::subfaces_per_face+subface][i][j]
+               = fe.shape_grad_grad(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.