]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move a bunch of internal functions into anonymous namespaces.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 24 Aug 2015 02:35:41 +0000 (21:35 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 25 Aug 2015 01:57:17 +0000 (20:57 -0500)
The MappingQ1 class had a bunch of internal functions that were part of the class
declaration but are in fact only ever used internally and do not need a whole
lot of information from the class itself. Move these functions into an anonymous
namespace in the .cc file so as to keep the external interface of the class
as small as possible.

include/deal.II/fe/mapping_q1.h
source/fe/mapping_q1.cc

index 14a1cba1cbe0c9656ec578e64f0ac20ef137016a..c735f065ae8229b4032c9422e7aee30153549e0b 100644 (file)
@@ -103,6 +103,7 @@ public:
              const typename Mapping<dim,spacedim>::InternalDataBase &internal,
              const MappingType type) const;
 
+  // for documentation, see the Mapping base class
   virtual
   void
   transform (const VectorSlice<const std::vector<DerivativeForm<1, dim,spacedim> > >    input,
@@ -110,6 +111,7 @@ public:
              const typename Mapping<dim,spacedim>::InternalDataBase &internal,
              const MappingType type) const;
 
+  // for documentation, see the Mapping base class
   virtual
   void
   transform (const VectorSlice<const std::vector<Tensor<2, dim> > >     input,
@@ -117,6 +119,7 @@ public:
              const typename Mapping<dim,spacedim>::InternalDataBase &internal,
              const MappingType type) const;
 
+  // for documentation, see the Mapping base class
   virtual
   void
   transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
@@ -124,58 +127,17 @@ public:
              const typename Mapping<dim,spacedim>::InternalDataBase &internal,
              const MappingType type) const;
 
+  // for documentation, see the Mapping base class
   virtual
   void
   transform (const VectorSlice<const std::vector<Tensor<3, dim> > >     input,
              VectorSlice<std::vector<Tensor<3,spacedim> > >             output,
              const typename Mapping<dim,spacedim>::InternalDataBase &internal,
              const MappingType type) const;
-  // for documentation, see the Mapping base class
-
-
-protected:
-  /**
-   * This function and the next ones allow to generate the transform required by the
-   * virtual transform() in mapping, but unfortunately in C++ one cannot
-   * declare a virtual template function.
-   */
-  template < int rank >
-  void
-  transform_fields(const VectorSlice<const std::vector<Tensor<rank,dim>      > > input,
-                   VectorSlice<      std::vector<Tensor<rank,spacedim> > > output,
-                   const typename Mapping<dim,spacedim>::InternalDataBase &internal,
-                   const MappingType type) const;
 
   /**
-   * see doc in transform_fields
-   */
-  template < int rank >
-  void
-  transform_gradients(const VectorSlice<const std::vector<Tensor<rank,dim>      > > input,
-                      VectorSlice<      std::vector<Tensor<rank,spacedim> > > output,
-                      const typename Mapping<dim,spacedim>::InternalDataBase &internal,
-                      const MappingType type) const;
-
-  /**
-   * see doc in transform_fields
-   */
-  void
-  transform_hessians(const VectorSlice<const std::vector<Tensor<3,dim> > > input,
-                     VectorSlice<std::vector<Tensor<3,spacedim> > > output,
-                     const typename Mapping<dim,spacedim>::InternalDataBase &internal,
-                     const MappingType mapping_type) const;
-
-  /**
-   * see doc in transform_fields
+   * @}
    */
-  template < int rank >
-  void
-  transform_differential_forms(
-    const VectorSlice<const std::vector<DerivativeForm<rank, dim, spacedim> > >    input,
-    VectorSlice<std::vector<Tensor<rank+1, spacedim> > > output,
-    const typename Mapping<dim,spacedim>::InternalDataBase &internal,
-    const MappingType type) const;
-
 
   /**
    * @name Interface with FEValues
index 3de4e63f44d99a0b755187612071c5463a7bb36e..b1e4ec2a6e1c14e8701016b74e94b07a95356e4f 100644 (file)
@@ -1298,6 +1298,305 @@ fill_fe_subface_values (const typename Triangulation<dim,spacedim>::cell_iterato
 
 
 
+namespace
+{
+  template <int dim, int spacedim, int rank>
+  void
+  transform_fields(const VectorSlice<const std::vector<Tensor<rank,dim> > > input,
+                   VectorSlice<std::vector<Tensor<rank,spacedim> > > output,
+                   const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+                   const MappingType mapping_type)
+  {
+    AssertDimension (input.size(), output.size());
+    Assert ((dynamic_cast<const typename MappingQ1<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+            ExcInternalError());
+    const typename MappingQ1<dim,spacedim>::InternalData
+    &data = static_cast<const typename MappingQ1<dim,spacedim>::InternalData &>(mapping_data);
+
+    switch (mapping_type)
+      {
+      case mapping_contravariant:
+      {
+        Assert (data.update_each & update_contravariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
+
+        for (unsigned int i=0; i<output.size(); ++i)
+          output[i] = apply_transformation(data.contravariant[i], input[i]);
+
+        return;
+      }
+
+      case mapping_piola:
+      {
+        Assert (data.update_each & update_contravariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
+        Assert (data.update_each & update_volume_elements,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements"));
+        Assert (rank==1, ExcMessage("Only for rank 1"));
+        if (rank!=1)
+          return;
+
+        for (unsigned int i=0; i<output.size(); ++i)
+          {
+            output[i] = apply_transformation(data.contravariant[i], input[i]);
+            output[i] /= data.volume_elements[i];
+          }
+        return;
+      }
+      //We still allow this operation as in the
+      //reference cell Derivatives are Tensor
+      //rather than DerivativeForm
+      case mapping_covariant:
+      {
+        Assert (data.update_each & update_contravariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
+
+        for (unsigned int i=0; i<output.size(); ++i)
+          output[i] = apply_transformation(data.covariant[i], input[i]);
+
+        return;
+      }
+
+      default:
+        Assert(false, ExcNotImplemented());
+      }
+  }
+
+
+  template <int dim, int spacedim, int rank>
+  void
+  transform_gradients(const VectorSlice<const std::vector<Tensor<rank,dim> > > input,
+                      VectorSlice<std::vector<Tensor<rank,spacedim> > > output,
+                      const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+                      const MappingType mapping_type)
+  {
+    AssertDimension (input.size(), output.size());
+    Assert ((dynamic_cast<const typename MappingQ1<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+            ExcInternalError());
+    const typename MappingQ1<dim,spacedim>::InternalData
+    &data = static_cast<const typename MappingQ1<dim,spacedim>::InternalData &>(mapping_data);
+
+    switch (mapping_type)
+      {
+      case mapping_contravariant_gradient:
+      {
+        Assert (data.update_each & update_covariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
+        Assert (data.update_each & update_contravariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
+        Assert (rank==2, ExcMessage("Only for rank 2"));
+
+        for (unsigned int i=0; i<output.size(); ++i)
+          {
+            DerivativeForm<1,spacedim,dim> A =
+              apply_transformation(data.contravariant[i], transpose(input[i]) );
+            output[i] = apply_transformation(data.covariant[i], A.transpose() );
+          }
+
+        return;
+      }
+
+      case mapping_covariant_gradient:
+      {
+        Assert (data.update_each & update_covariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
+        Assert (rank==2, ExcMessage("Only for rank 2"));
+
+        for (unsigned int i=0; i<output.size(); ++i)
+          {
+            DerivativeForm<1,spacedim,dim> A =
+              apply_transformation(data.covariant[i], transpose(input[i]) );
+            output[i] = apply_transformation(data.covariant[i], A.transpose() );
+          }
+
+        return;
+      }
+
+      case mapping_piola_gradient:
+      {
+        Assert (data.update_each & update_covariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
+        Assert (data.update_each & update_contravariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
+        Assert (data.update_each & update_volume_elements,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements"));
+        Assert (rank==2, ExcMessage("Only for rank 2"));
+
+        for (unsigned int i=0; i<output.size(); ++i)
+          {
+            DerivativeForm<1,spacedim,dim> A =
+              apply_transformation(data.covariant[i], input[i] );
+            Tensor<2,spacedim> T =
+              apply_transformation(data.contravariant[i], A.transpose() );
+
+            output[i] = transpose(T);
+            output[i] /= data.volume_elements[i];
+          }
+
+        return;
+      }
+
+      default:
+        Assert(false, ExcNotImplemented());
+      }
+  }
+
+
+
+
+  template <int dim, int spacedim>
+  void
+  transform_hessians(const VectorSlice<const std::vector<Tensor<3,dim> > > input,
+                     VectorSlice<std::vector<Tensor<3,spacedim> > > output,
+                     const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+                     const MappingType mapping_type)
+  {
+    AssertDimension (input.size(), output.size());
+    Assert ((dynamic_cast<const typename MappingQ1<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+            ExcInternalError());
+    const typename MappingQ1<dim,spacedim>::InternalData
+    &data = static_cast<const typename MappingQ1<dim,spacedim>::InternalData &>(mapping_data);
+
+    switch (mapping_type)
+      {
+      case mapping_contravariant_hessian:
+      {
+        Assert (data.update_each & update_covariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
+        Assert (data.update_each & update_contravariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
+
+        for (unsigned int q=0; q<output.size(); ++q)
+          for (unsigned int i=0; i<spacedim; ++i)
+            for (unsigned int j=0; j<spacedim; ++j)
+              for (unsigned int k=0; k<spacedim; ++k)
+                {
+                  output[q][i][j][k] =    data.contravariant[q][i][0]
+                                          * data.covariant[q][j][0]
+                                          * data.covariant[q][k][0]
+                                          * input[q][0][0][0];
+                  for (unsigned int I=0; I<dim; ++I)
+                    for (unsigned int J=0; J<dim; ++J)
+                      {
+                        const unsigned int K0 = (0==(I+J))? 1 : 0;
+                        for (unsigned int K=K0; K<dim; ++K)
+                          output[q][i][j][k] +=    data.contravariant[q][i][I]
+                                                   * data.covariant[q][j][J]
+                                                   * data.covariant[q][k][K]
+                                                   * input[q][I][J][K];
+                      }
+
+                }
+        return;
+      }
+
+      case mapping_covariant_hessian:
+      {
+        Assert (data.update_each & update_covariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
+
+        for (unsigned int q=0; q<output.size(); ++q)
+          for (unsigned int i=0; i<spacedim; ++i)
+            for (unsigned int j=0; j<spacedim; ++j)
+              for (unsigned int k=0; k<spacedim; ++k)
+                {
+                  output[q][i][j][k] =    data.covariant[q][i][0]
+                                          * data.covariant[q][j][0]
+                                          * data.covariant[q][k][0]
+                                          * input[q][0][0][0];
+                  for (unsigned int I=0; I<dim; ++I)
+                    for (unsigned int J=0; J<dim; ++J)
+                      {
+                        const unsigned int K0 = (0==(I+J))? 1 : 0;
+                        for (unsigned int K=K0; K<dim; ++K)
+                          output[q][i][j][k] +=   data.covariant[q][i][I]
+                                                  * data.covariant[q][j][J]
+                                                  * data.covariant[q][k][K]
+                                                  * input[q][I][J][K];
+                      }
+
+                }
+
+        return;
+      }
+
+      case mapping_piola_hessian:
+      {
+        Assert (data.update_each & update_covariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
+        Assert (data.update_each & update_contravariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
+        Assert (data.update_each & update_volume_elements,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements"));
+
+        for (unsigned int q=0; q<output.size(); ++q)
+          for (unsigned int i=0; i<spacedim; ++i)
+            for (unsigned int j=0; j<spacedim; ++j)
+              for (unsigned int k=0; k<spacedim; ++k)
+                {
+                  output[q][i][j][k] =    data.contravariant[q][i][0]
+                                          / data.volume_elements[q]
+                                          * data.covariant[q][j][0]
+                                          * data.covariant[q][k][0]
+                                          * input[q][0][0][0];
+                  for (unsigned int I=0; I<dim; ++I)
+                    for (unsigned int J=0; J<dim; ++J)
+                      {
+                        const unsigned int K0 = (0==(I+J))? 1 : 0;
+                        for (unsigned int K=K0; K<dim; ++K)
+                          output[q][i][j][k] +=    data.contravariant[q][i][I]
+                                                   / data.volume_elements[q]
+                                                   * data.covariant[q][j][J]
+                                                   * data.covariant[q][k][K]
+                                                   * input[q][I][J][K];
+                      }
+
+                }
+
+        return;
+      }
+
+      default:
+        Assert(false, ExcNotImplemented());
+      }
+  }
+
+
+
+
+  template <int dim, int spacedim, int rank>
+  void
+  transform_differential_forms(const VectorSlice<const std::vector<DerivativeForm<rank, dim,spacedim> > >    input,
+                               VectorSlice<std::vector<Tensor<rank+1, spacedim> > > output,
+                               const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+                               const MappingType mapping_type)
+  {
+    AssertDimension (input.size(), output.size());
+    Assert ((dynamic_cast<const typename MappingQ1<dim,spacedim>::InternalData *>(&mapping_data) != 0),
+            ExcInternalError());
+    const typename MappingQ1<dim,spacedim>::InternalData
+    &data = static_cast<const typename MappingQ1<dim,spacedim>::InternalData &>(mapping_data);
+
+    switch (mapping_type)
+      {
+      case mapping_covariant:
+      {
+        Assert (data.update_each & update_contravariant_transformation,
+                typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
+
+        for (unsigned int i=0; i<output.size(); ++i)
+          output[i] = apply_transformation(data.covariant[i], input[i]);
+
+        return;
+      }
+      default:
+        Assert(false, ExcNotImplemented());
+      }
+  }
+}
+
+
+
 template<int dim, int spacedim>
 void
 MappingQ1<dim,spacedim>::transform (
@@ -1319,9 +1618,7 @@ MappingQ1<dim,spacedim>::transform (
   const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
   const MappingType mapping_type) const
 {
-
   transform_differential_forms(input, output, mapping_data, mapping_type);
-
 }
 
 
@@ -1334,7 +1631,6 @@ MappingQ1<dim,spacedim>::transform (
   const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
   const MappingType mapping_type) const
 {
-
   switch (mapping_type)
     {
     case mapping_contravariant:
@@ -1349,7 +1645,6 @@ MappingQ1<dim,spacedim>::transform (
     default:
       Assert(false, ExcNotImplemented());
     }
-
 }
 
 
@@ -1395,12 +1690,14 @@ MappingQ1<dim,spacedim>::transform (
               }
       return;
     }
+
     default:
       Assert(false, ExcNotImplemented());
     }
-
 }
 
+
+
 template<int dim, int spacedim>
 void
 MappingQ1<dim,spacedim>::transform (
@@ -1423,302 +1720,6 @@ MappingQ1<dim,spacedim>::transform (
 
 }
 
-template<int dim, int spacedim>
-template < int rank >
-void MappingQ1<dim,spacedim>::transform_fields(
-  const VectorSlice<const std::vector<Tensor<rank,dim> > > input,
-  VectorSlice<std::vector<Tensor<rank,spacedim> > > output,
-  const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
-  const MappingType mapping_type) const
-{
-  AssertDimension (input.size(), output.size());
-  Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
-          ExcInternalError());
-  const InternalData &data = static_cast<const InternalData &>(mapping_data);
-
-  switch (mapping_type)
-    {
-    case mapping_contravariant:
-    {
-      Assert (data.update_each & update_contravariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
-
-      for (unsigned int i=0; i<output.size(); ++i)
-        output[i] = apply_transformation(data.contravariant[i], input[i]);
-
-      return;
-    }
-
-    case mapping_piola:
-    {
-      Assert (data.update_each & update_contravariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
-      Assert (data.update_each & update_volume_elements,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements"));
-      Assert (rank==1, ExcMessage("Only for rank 1"));
-      if (rank!=1)
-        return;
-
-      for (unsigned int i=0; i<output.size(); ++i)
-        {
-          output[i] = apply_transformation(data.contravariant[i], input[i]);
-          output[i] /= data.volume_elements[i];
-        }
-      return;
-    }
-    //We still allow this operation as in the
-    //reference cell Derivatives are Tensor
-    //rather than DerivativeForm
-    case mapping_covariant:
-    {
-      Assert (data.update_each & update_contravariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
-
-      for (unsigned int i=0; i<output.size(); ++i)
-        output[i] = apply_transformation(data.covariant[i], input[i]);
-
-      return;
-    }
-
-    default:
-      Assert(false, ExcNotImplemented());
-    }
-}
-
-
-template<int dim, int spacedim>
-template < int rank >
-void MappingQ1<dim,spacedim>::transform_gradients(
-  const VectorSlice<const std::vector<Tensor<rank,dim> > > input,
-  VectorSlice<std::vector<Tensor<rank,spacedim> > > output,
-  const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
-  const MappingType mapping_type) const
-{
-  AssertDimension (input.size(), output.size());
-  Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
-          ExcInternalError());
-  const InternalData &data = static_cast<const InternalData &>(mapping_data);
-
-  switch (mapping_type)
-    {
-    case mapping_contravariant_gradient:
-    {
-      Assert (data.update_each & update_covariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
-      Assert (data.update_each & update_contravariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
-      Assert (rank==2, ExcMessage("Only for rank 2"));
-
-      for (unsigned int i=0; i<output.size(); ++i)
-        {
-          DerivativeForm<1,spacedim,dim> A =
-            apply_transformation(data.contravariant[i], transpose(input[i]) );
-          output[i] = apply_transformation(data.covariant[i], A.transpose() );
-        }
-
-      return;
-    }
-
-    case mapping_covariant_gradient:
-    {
-      Assert (data.update_each & update_covariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
-      Assert (rank==2, ExcMessage("Only for rank 2"));
-
-      for (unsigned int i=0; i<output.size(); ++i)
-        {
-          DerivativeForm<1,spacedim,dim> A =
-            apply_transformation(data.covariant[i], transpose(input[i]) );
-          output[i] = apply_transformation(data.covariant[i], A.transpose() );
-        }
-
-      return;
-    }
-
-    case mapping_piola_gradient:
-    {
-      Assert (data.update_each & update_covariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
-      Assert (data.update_each & update_contravariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
-      Assert (data.update_each & update_volume_elements,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements"));
-      Assert (rank==2, ExcMessage("Only for rank 2"));
-
-      for (unsigned int i=0; i<output.size(); ++i)
-        {
-          DerivativeForm<1,spacedim,dim> A =
-            apply_transformation(data.covariant[i], input[i] );
-          Tensor<2,spacedim> T =
-            apply_transformation(data.contravariant[i], A.transpose() );
-
-          output[i] = transpose(T);
-          output[i] /= data.volume_elements[i];
-        }
-
-      return;
-    }
-
-    default:
-      Assert(false, ExcNotImplemented());
-    }
-}
-
-
-
-
-template<int dim, int spacedim>
-void MappingQ1<dim,spacedim>::transform_hessians(
-  const VectorSlice<const std::vector<Tensor<3,dim> > > input,
-  VectorSlice<std::vector<Tensor<3,spacedim> > > output,
-  const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
-  const MappingType mapping_type) const
-{
-  AssertDimension (input.size(), output.size());
-  Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
-          ExcInternalError());
-  const InternalData &data = static_cast<const InternalData &>(mapping_data);
-
-  switch (mapping_type)
-    {
-    case mapping_contravariant_hessian:
-    {
-      Assert (data.update_each & update_covariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
-      Assert (data.update_each & update_contravariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
-
-      for (unsigned int q=0; q<output.size(); ++q)
-        for (unsigned int i=0; i<spacedim; ++i)
-          for (unsigned int j=0; j<spacedim; ++j)
-            for (unsigned int k=0; k<spacedim; ++k)
-              {
-                output[q][i][j][k] =    data.contravariant[q][i][0]
-                                        * data.covariant[q][j][0]
-                                        * data.covariant[q][k][0]
-                                        * input[q][0][0][0];
-                for (unsigned int I=0; I<dim; ++I)
-                  for (unsigned int J=0; J<dim; ++J)
-                    {
-                      const unsigned int K0 = (0==(I+J))? 1 : 0;
-                      for (unsigned int K=K0; K<dim; ++K)
-                        output[q][i][j][k] +=    data.contravariant[q][i][I]
-                                                 * data.covariant[q][j][J]
-                                                 * data.covariant[q][k][K]
-                                                 * input[q][I][J][K];
-                    }
-
-              }
-      return;
-    }
-
-    case mapping_covariant_hessian:
-    {
-      Assert (data.update_each & update_covariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
-
-      for (unsigned int q=0; q<output.size(); ++q)
-        for (unsigned int i=0; i<spacedim; ++i)
-          for (unsigned int j=0; j<spacedim; ++j)
-            for (unsigned int k=0; k<spacedim; ++k)
-              {
-                output[q][i][j][k] =    data.covariant[q][i][0]
-                                        * data.covariant[q][j][0]
-                                        * data.covariant[q][k][0]
-                                        * input[q][0][0][0];
-                for (unsigned int I=0; I<dim; ++I)
-                  for (unsigned int J=0; J<dim; ++J)
-                    {
-                      const unsigned int K0 = (0==(I+J))? 1 : 0;
-                      for (unsigned int K=K0; K<dim; ++K)
-                        output[q][i][j][k] +=   data.covariant[q][i][I]
-                                                * data.covariant[q][j][J]
-                                                * data.covariant[q][k][K]
-                                                * input[q][I][J][K];
-                    }
-
-              }
-
-      return;
-    }
-
-    case mapping_piola_hessian:
-    {
-      Assert (data.update_each & update_covariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
-      Assert (data.update_each & update_contravariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation"));
-      Assert (data.update_each & update_volume_elements,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements"));
-
-      for (unsigned int q=0; q<output.size(); ++q)
-        for (unsigned int i=0; i<spacedim; ++i)
-          for (unsigned int j=0; j<spacedim; ++j)
-            for (unsigned int k=0; k<spacedim; ++k)
-              {
-                output[q][i][j][k] =    data.contravariant[q][i][0]
-                                        / data.volume_elements[q]
-                                        * data.covariant[q][j][0]
-                                        * data.covariant[q][k][0]
-                                        * input[q][0][0][0];
-                for (unsigned int I=0; I<dim; ++I)
-                  for (unsigned int J=0; J<dim; ++J)
-                    {
-                      const unsigned int K0 = (0==(I+J))? 1 : 0;
-                      for (unsigned int K=K0; K<dim; ++K)
-                        output[q][i][j][k] +=    data.contravariant[q][i][I]
-                                                 / data.volume_elements[q]
-                                                 * data.covariant[q][j][J]
-                                                 * data.covariant[q][k][K]
-                                                 * input[q][I][J][K];
-                    }
-
-              }
-
-      return;
-    }
-
-    default:
-      Assert(false, ExcNotImplemented());
-    }
-}
-
-
-
-
-template<int dim, int spacedim>
-template < int rank >
-void MappingQ1<dim,spacedim>::transform_differential_forms(
-  const VectorSlice<const std::vector<DerivativeForm<rank, dim,spacedim> > >    input,
-  VectorSlice<std::vector<Tensor<rank+1, spacedim> > > output,
-  const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
-  const MappingType mapping_type) const
-{
-
-  AssertDimension (input.size(), output.size());
-  Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
-          ExcInternalError());
-  const InternalData &data = static_cast<const InternalData &>(mapping_data);
-
-  switch (mapping_type)
-    {
-    case mapping_covariant:
-    {
-      Assert (data.update_each & update_contravariant_transformation,
-              typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation"));
-
-      for (unsigned int i=0; i<output.size(); ++i)
-        output[i] = apply_transformation(data.covariant[i], input[i]);
-
-      return;
-    }
-    default:
-      Assert(false, ExcNotImplemented());
-    }
-
-}
-
-
 
 
 template<int dim, int spacedim>

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.