]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Do away with a global function in a header file
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 10 Aug 2006 18:42:49 +0000 (18:42 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 10 Aug 2006 18:42:49 +0000 (18:42 +0000)
git-svn-id: https://svn.dealii.org/trunk@13634 0785d39b-7218-0410-832d-ea1e28bc413d

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

index e956d7248ea7d5ffb931c3331ff1d0cec4b8b32e..efb99a2b99c6c9816f95b3ca65484a358f2cea00 100644 (file)
 
 //TODO[RH]: Use StaticQ1Mapping where appropriate
 
-template <int dim>
-inline double sqr_point (const Tensor<1,dim> &p)
-{
-  return p * p;
-}
-
-
 template <int dim, class VECTOR>
 void VectorTools::interpolate (const Mapping<dim>    &mapping,
                               const DoFHandler<dim> &dof,
@@ -1678,7 +1671,7 @@ namespace internal
                     std::fill_n (psi_scalar.begin(), n_q_points, 0.0);
                     for (unsigned int k=0; k<n_components; ++k)
                       for (unsigned int q=0; q<n_q_points; ++q)
-                        psi_scalar[q] += std::pow(sqr_point(psi_grads[q][k]),
+                        psi_scalar[q] += std::pow(psi_grads[q][k] * psi_grads[q][k],
                                                   exponent/2.)
                                          * weight_vectors[q](k);
            
@@ -1693,7 +1686,7 @@ namespace internal
                     std::fill_n (psi_scalar.begin(), n_q_points, 0.0);
                     for (unsigned int k=0; k<n_components; ++k)
                       for (unsigned int q=0; q<n_q_points; ++q)
-                        psi_scalar[q] += sqr_point(psi_grads[q][k])
+                        psi_scalar[q] += (psi_grads[q][k] * psi_grads[q][k])
                                          * weight_vectors[q](k);
 
                                                      // add seminorm to L_2 norm or

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.