]> https://gitweb.dealii.org/ - dealii.git/commitdiff
start unifying names of gradients and hessians
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 11 Sep 2007 15:08:43 +0000 (15:08 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 11 Sep 2007 15:08:43 +0000 (15:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@15191 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_update_flags.h
deal.II/deal.II/include/fe/fe_values.h
deal.II/deal.II/source/fe/fe.cc
deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc
deal.II/deal.II/source/fe/fe_values.cc
deal.II/deal.II/source/fe/fe_values.instance.h
deal.II/deal.II/source/numerics/derivative_approximation.cc

index df31c2bf091581f6d9920c8bf91337c9adf6b460..51be7bd88fcd36ebed21c47e3456c073b142f6ff 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -109,7 +109,7 @@ enum UpdateFlags
                                        * functions in coordinates of
                                        * the real cell.
                                        */
-      update_second_derivatives           = 0x0004,
+      update_hessians                     = 0x0004,
                                       //! Outter normal vector, not normalized
                                       /**
                                        * Vector product of tangential
@@ -211,7 +211,13 @@ enum UpdateFlags
                                        * is used in conjunction with
                                        * H_div subspaces like RT and ABF.
                                        */
-      update_cell_JxW_values              = 0x2000
+      update_cell_JxW_values              = 0x2000,
+                                      /**
+                                       * @deprecated Update second
+                                       * derivatives.
+                                       */
+      update_second_derivatives = update_hessians
+                               
 
 };
 
index e081ead4aa4062ae9909061331d21f2269c22e28..4162fdd2c0e468924bfb4feedab55bef4cc64846 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name:  $
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -125,7 +125,7 @@ class FEValuesData
                                      * Likewise for second order
                                      * derivatives.
                                      */
-    typedef std::vector<std::vector<Tensor<2,dim> > > GradGradVector;
+    typedef std::vector<std::vector<Tensor<2,dim> > > HessianVector;
 
                                     /**
                                      * Store the values of the shape
@@ -154,7 +154,7 @@ class FEValuesData
                                      * for the layout of the data in
                                      * this field.
                                      */
-    GradGradVector shape_2nd_derivatives;
+    HessianVector shape_hessians;
 
                                     /**
                                      * Store an array of weights
@@ -238,7 +238,7 @@ class FEValuesData
                                      * given shape function occupies
                                      * in the #shape_values,
                                      * #shape_gradients and
-                                     * #shape_2nd_derivatives
+                                     * #shape_hessians
                                      * arrays. If all shape functions
                                      * are primitive, then this is
                                      * the identity mapping. If, on
@@ -357,7 +357,7 @@ class FEValuesData
  *    and you have to walk over all (or only the non-zero) components of
  *    the shape function using this set of functions.
  *   
- *  <li> get_function_values(), get_function_grads(), etc.: Compute a
+ *  <li> get_function_values(), get_function_gradients(), etc.: Compute a
  *    finite element function or its derivative in quadrature points.
  *
  *  <li> reinit: initialize the FEValues object for a certain cell.
@@ -591,6 +591,13 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * function.
                                      */
     const Tensor<2,dim> &
+    shape_hessian (const unsigned int function_no,
+                  const unsigned int point_no) const;
+
+                                    /**
+                                     * @deprecated Wrapper for shape_hessian()
+                                     */
+    const Tensor<2,dim> &
     shape_2nd_derivative (const unsigned int function_no,
                          const unsigned int point_no) const;
 
@@ -603,7 +610,7 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * is scalar, then only component
                                      * zero is allowed and the return
                                      * value equals that of the
-                                     * shape_2nd_derivative()
+                                     * shape_hessian()
                                      * function. If the finite
                                      * element is vector valued but
                                      * all shape functions are
@@ -611,7 +618,7 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * non-zero in only one
                                      * component), then the value
                                      * returned by
-                                     * shape_2nd_derivative()
+                                     * shape_hessian()
                                      * equals that of this function
                                      * for exactly one
                                      * component. This function is
@@ -622,6 +629,14 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * function cannot be used.
                                      */
     Tensor<2,dim>
+    shape_hessian_component (const unsigned int function_no,
+                                   const unsigned int point_no,
+                                   const unsigned int component) const;
+    
+                                    /**
+                                     * @deprecated Wrapper for shape_hessian_component()
+                                     */
+    Tensor<2,dim>
     shape_2nd_derivative_component (const unsigned int function_no,
                                    const unsigned int point_no,
                                    const unsigned int component) const;
@@ -860,7 +875,7 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * finite element in use is a scalar one,
                                      * i.e. has only one vector component. If
                                      * it is a vector-valued one, then use
-                                     * the other get_function_grads()
+                                     * the other get_function_gradients()
                                      * function.
                                      * 
                                      * The function assumes that the
@@ -884,6 +899,14 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * on the unit cell).
                                      */
     template <class InputVector>
+    void get_function_gradients (const InputVector      &fe_function,
+                            std::vector<Tensor<1,dim> > &gradients) const;
+
+                                    /**
+                                     * @deprecated Use
+                                     * get_function_gradients() instead.
+                                     */
+    template <class InputVector>
     void get_function_grads (const InputVector      &fe_function,
                             std::vector<Tensor<1,dim> > &gradients) const;
 
@@ -923,6 +946,15 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * on the unit cell).
                                      */
     template <class InputVector>
+    void get_function_gradients (const InputVector               &fe_function,
+                            std::vector<std::vector<Tensor<1,dim> > > &gradients) const;
+
+    
+                                    /**
+                                     * @deprecated Use
+                                     * get_function_gradients() instead.
+                                     */
+    template <class InputVector>
     void get_function_grads (const InputVector               &fe_function,
                             std::vector<std::vector<Tensor<1,dim> > > &gradients) const;
 
@@ -933,6 +965,15 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * corresponding arguments.
                                      */
     template <class InputVector>
+    void get_function_gradients (const InputVector& fe_function,
+                                const VectorSlice<const std::vector<unsigned int> >& indices,
+                                std::vector<Tensor<1,dim> >& gradients) const;
+
+                                    /**
+                                     * @deprecated Use
+                                     * get_function_gradients() instead.
+                                     */
+    template <class InputVector>
     void get_function_grads (const InputVector& fe_function,
                             const VectorSlice<const std::vector<unsigned int> >& indices,
                             std::vector<Tensor<1,dim> >& gradients) const;
@@ -944,6 +985,16 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * corresponding arguments.
                                      */
     template <class InputVector>
+    void get_function_gradients (const InputVector& fe_function,
+                                const VectorSlice<const std::vector<unsigned int> >& indices,
+                                std::vector<std::vector<Tensor<1,dim> > >& gradients,
+                                bool quadrature_points_fastest = false) const;
+
+                                    /**
+                                     * @deprecated Use
+                                     * get_function_gradients() instead.
+                                     */
+    template <class InputVector>
     void get_function_grads (const InputVector& fe_function,
                             const VectorSlice<const std::vector<unsigned int> >& indices,
                             std::vector<std::vector<Tensor<1,dim> > >& gradients,
@@ -958,7 +1009,7 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * points.
                                      *
                                      * The function assumes that the
-                                     * @p second_derivatives object
+                                     * @p hessians object
                                      * already has the correct size.
                                      *
                                      * This function may only be used if the
@@ -966,7 +1017,7 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * i.e. has only one vector component. If
                                      * it is a vector-valued one, then use
                                      * the other
-                                     * get_function_2nd_derivatives()
+                                     * get_function_hessians()
                                      * function.
                                      * 
                                      * The actual data type of the input
@@ -987,8 +1038,8 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      */
     template <class InputVector>
     void
-    get_function_2nd_derivatives (const InputVector& fe_function,
-                                  std::vector<Tensor<2,dim> >& second_derivatives) const;
+    get_function_hessians (const InputVector& fe_function,
+                          std::vector<Tensor<2,dim> >& hessians) const;
 
     
                                     /**
@@ -999,7 +1050,7 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      * @p cell at the quadrature points.
                                      *
                                      * The function assumes that the
-                                     * @p second_derivatives object already has
+                                     * @p hessians object already has
                                      * the right size.
                                      *
                                      * This function does the same as
@@ -1025,9 +1076,27 @@ class FEValuesBase : protected FEValuesData<dim>,
                                      */
     template <class InputVector>
     void
-    get_function_2nd_derivatives (const InputVector      &fe_function,
-                                  std::vector<std::vector<Tensor<2,dim> > > &second_derivatives,
-                                 bool quadrature_points_fastest = false) const;
+    get_function_hessians (const InputVector      &fe_function,
+                          std::vector<std::vector<Tensor<2,dim> > > &hessians,
+                          bool quadrature_points_fastest = false) const;
+
+                                    /**
+                                     * @deprecated Wrapper for get_function_hessians()
+                                     */
+    template <class InputVector>
+    void
+    get_function_2nd_derivatives (const InputVector&,
+                                 std::vector<Tensor<2,dim> >&) const;
+
+                                    /**
+                                     * @deprecated Wrapper for get_function_hessians()
+                                     */
+    template <class InputVector>
+    void
+    get_function_2nd_derivatives (const InputVector&,
+                                 std::vector<std::vector<Tensor<2,dim> > >&,
+                                 bool = false) const;
+    
                                     //@}
     
                                     /**
@@ -1768,7 +1837,7 @@ class FEValues : public FEValuesBase<dim>
                                      * about degrees of
                                      * freedom. These functions are,
                                      * above all, the
-                                     * <tt>get_function_value/grads/2nd_derivatives</tt>
+                                     * <tt>get_function_value/gradients/hessians</tt>
                                      * functions. If you want to call
                                      * these functions, you have to
                                      * call the @p reinit variants
@@ -2071,7 +2140,7 @@ class FEFaceValues : public FEFaceValuesBase<dim>
                                      * information about degrees of
                                      * freedom. These functions are,
                                      * above all, the
-                                     * <tt>get_function_value/grads/2nd_derivatives</tt>
+                                     * <tt>get_function_value/gradients/hessians</tt>
                                      * functions. If you want to call
                                      * these functions, you have to
                                      * call the @p reinit variants
@@ -2254,7 +2323,7 @@ class FESubfaceValues : public FEFaceValuesBase<dim>
                                      * information about degrees of
                                      * freedom. These functions are,
                                      * above all, the
-                                     * <tt>get_function_value/grads/2nd_derivatives</tt>
+                                     * <tt>get_function_value/gradients/hessians</tt>
                                      * functions. If you want to call
                                      * these functions, you have to
                                      * call the @p reinit variants
@@ -2522,22 +2591,22 @@ FEValuesBase<dim>::shape_grad_component (const unsigned int i,
 template <int dim>
 inline
 const Tensor<2,dim> &
-FEValuesBase<dim>::shape_2nd_derivative (const unsigned int i,
+FEValuesBase<dim>::shape_hessian (const unsigned int i,
                                         const unsigned int j) const
 {
-  Assert (this->update_flags & update_second_derivatives,
+  Assert (this->update_flags & update_hessians,
          ExcAccessToUninitializedField());
   Assert (fe->is_primitive (i),
          ExcShapeFunctionNotPrimitive(i));
-  Assert (i<this->shape_2nd_derivatives.size(),
-         ExcIndexRange (i, 0, this->shape_2nd_derivatives.size()));
-  Assert (j<this->shape_2nd_derivatives[0].size(),
-         ExcIndexRange (j, 0, this->shape_2nd_derivatives[0].size()));
+  Assert (i<this->shape_hessians.size(),
+         ExcIndexRange (i, 0, this->shape_hessians.size()));
+  Assert (j<this->shape_hessians[0].size(),
+         ExcIndexRange (j, 0, this->shape_hessians[0].size()));
 
                                   // if the entire FE is primitive,
                                   // then we can take a short-cut:
   if (fe->is_primitive())
-    return this->shape_2nd_derivatives[i][j];
+    return this->shape_hessians[i][j];
   else
                                     // otherwise, use the mapping
                                     // between shape function numbers
@@ -2548,19 +2617,29 @@ FEValuesBase<dim>::shape_2nd_derivative (const unsigned int i,
                                     // question to which vector
                                     // component the call of this
                                     // function refers
-    return this->shape_2nd_derivatives[this->shape_function_to_row_table[i]][j];
+    return this->shape_hessians[this->shape_function_to_row_table[i]][j];
 }
 
 
 
+template <int dim>
+inline
+const Tensor<2,dim> &
+FEValuesBase<dim>::shape_2nd_derivative (const unsigned int i,
+                                        const unsigned int j) const
+{
+  return shape_hessian(i,j);
+}
+
+
 template <int dim>
 inline
 Tensor<2,dim>
-FEValuesBase<dim>::shape_2nd_derivative_component (const unsigned int i,
+FEValuesBase<dim>::shape_hessian_component (const unsigned int i,
                                                   const unsigned int j,
                                                   const unsigned int component) const
 {
-  Assert (this->update_flags & update_second_derivatives,
+  Assert (this->update_flags & update_hessians,
          ExcAccessToUninitializedField());
   Assert (component < fe->n_components(),
          ExcIndexRange(component, 0, fe->n_components()));
@@ -2577,7 +2656,7 @@ FEValuesBase<dim>::shape_2nd_derivative_component (const unsigned int i,
   if (fe->is_primitive(i))
     {
       if (component == fe->system_to_component_index(i).first)
-       return this->shape_2nd_derivatives[this->shape_function_to_row_table[i]][j];
+       return this->shape_hessians[this->shape_function_to_row_table[i]][j];
       else
        return Tensor<2,dim>();
     }
@@ -2609,11 +2688,21 @@ FEValuesBase<dim>::shape_2nd_derivative_component (const unsigned int i,
               std::count (fe->get_nonzero_components(i).begin(),
                           fe->get_nonzero_components(i).begin()+component,
                           true));
-      return this->shape_2nd_derivatives[row][j];
+      return this->shape_hessians[row][j];
     };
 }
 
 
+template <int dim>
+inline
+Tensor<2,dim>
+FEValuesBase<dim>::shape_2nd_derivative_component (const unsigned int i,
+                                                  const unsigned int j,
+                                                  const unsigned int component) const
+{
+  return shape_hessian_component(i,j,component);
+}
+
 
 template <int dim>
 inline
@@ -2691,6 +2780,76 @@ FEValuesBase<dim>::JxW (const unsigned int i) const
 }
 
 
+template <int dim>
+template <class InputVector>
+void
+FEValuesBase<dim>::get_function_grads (const InputVector           &fe_function,
+                   std::vector<Tensor<1,dim> > &gradients) const
+{
+  get_function_gradients(fe_function, gradients);
+}
+
+
+template <int dim>
+template <class InputVector>
+void FEValuesBase<dim>::get_function_grads (
+  const InputVector& fe_function,
+  const VectorSlice<const std::vector<unsigned int> >& indices,
+  std::vector<Tensor<1,dim> > &values) const
+{
+  get_function_gradients(fe_function, indices, values);
+}
+
+
+template <int dim>
+template <class InputVector>
+void
+FEValuesBase<dim>::
+get_function_grads (const InputVector                         &fe_function,
+                   std::vector<std::vector<Tensor<1,dim> > > &gradients) const
+{
+  get_function_gradients(fe_function, gradients);
+}
+
+
+template <int dim>
+template <class InputVector>
+void FEValuesBase<dim>::get_function_grads (
+  const InputVector& fe_function,
+  const VectorSlice<const std::vector<unsigned int> >& indices,
+  std::vector<std::vector<Tensor<1,dim> > >& values,
+  bool q_points_fastest) const
+{
+  get_function_gradients(fe_function, indices, values, q_points_fastest);
+}
+
+
+
+template <int dim>
+template <class InputVector>
+inline void
+FEValuesBase<dim>::
+get_function_2nd_derivatives (const InputVector           &fe_function,
+                             std::vector<Tensor<2,dim> > &hessians) const
+{
+  get_function_hessians(fe_function, hessians);
+}
+
+
+
+template <int dim>
+template <class InputVector>
+void
+FEValuesBase<dim>::
+get_function_2nd_derivatives (const InputVector                         &fe_function,
+                             std::vector<std::vector<Tensor<2,dim> > > &hessians,
+                             bool quadrature_points_fastest) const
+{
+  get_function_hessians(fe_function, hessians, quadrature_points_fastest);
+}
+
+
+
 /*------------------------ Inline functions: FEValues ----------------------------*/
 
 
index 6def406a71bb6a49caa5dbe3f0f9d56b5f4d060a..91abd8868347707d40bee6f0697e5ca5e843fd30 100644 (file)
@@ -845,17 +845,17 @@ FiniteElement<dim>::compute_2nd (
   FEValuesData<dim>                    &data) const
 {
   Assert ((fe_internal.update_each | fe_internal.update_once)
-         & update_second_derivatives,
+         & update_hessians,
          ExcInternalError());
 
 // make sure we have as many entries as there are nonzero components  
-//  Assert (data.shape_2nd_derivatives.size() ==
+//  Assert (data.shape_hessians.size() ==
 //         std::accumulate (n_nonzero_components_table.begin(),
 //                        n_nonzero_components_table.end(),
 //                        0U),
 //       ExcInternalError());
                                   // Number of quadrature points
-  const unsigned int n_q_points = data.shape_2nd_derivatives[0].size();
+  const unsigned int n_q_points = data.shape_hessians[0].size();
 
                                   // first reinit the fe_values
                                   // objects used for the finite
@@ -971,7 +971,7 @@ FiniteElement<dim>::compute_2nd (
             
             for (unsigned int q=0; q<n_q_points; ++q)
               for (unsigned int d1=0; d1<dim; ++d1)
-                data.shape_2nd_derivatives[total_index][q][d][d1]
+                data.shape_hessians[total_index][q][d][d1]
                   = diff_quot2[q][d1];
           }
       }
index f3bc12df5305aa1429cbb1a786c8d7e81a5f6017..ce7e2266f3c3d0a352e41d7324dc14f77750ef35 100644 (file)
@@ -212,7 +212,7 @@ FE_DGPNonparametric<dim>::update_each (const UpdateFlags flags) const
 {
   UpdateFlags out = flags;
 
-  if (flags & (update_values | update_gradients | update_second_derivatives))
+  if (flags & (update_values | update_gradients | update_hessians))
     out |= update_q_points ;
 
   return out;
@@ -255,7 +255,7 @@ FE_DGPNonparametric<dim>::get_data (
       data->grads.resize (this->dofs_per_cell);
     }
 
-  if (flags & update_second_derivatives)
+  if (flags & update_hessians)
     {
       data->grad_grads.resize (this->dofs_per_cell);
     }
@@ -300,8 +300,8 @@ FE_DGPNonparametric<dim>::fill_fe_values (
              data.shape_values[k][i] = fe_data.values[k];
            if (flags & update_gradients)
              data.shape_gradients[k][i] = fe_data.grads[k];
-           if (flags & update_second_derivatives)
-             data.shape_2nd_derivatives[k][i] = fe_data.grad_grads[k];
+           if (flags & update_hessians)
+             data.shape_hessians[k][i] = fe_data.grad_grads[k];
          }
       }
 }
@@ -341,8 +341,8 @@ FE_DGPNonparametric<dim>::fill_fe_face_values (
              data.shape_values[k][i] = fe_data.values[k];
            if (flags & update_gradients)
              data.shape_gradients[k][i] = fe_data.grads[k];
-           if (flags & update_second_derivatives)
-             data.shape_2nd_derivatives[k][i] = fe_data.grad_grads[k];
+           if (flags & update_hessians)
+             data.shape_hessians[k][i] = fe_data.grad_grads[k];
          }
       }
 }
@@ -383,8 +383,8 @@ FE_DGPNonparametric<dim>::fill_fe_subface_values (
              data.shape_values[k][i] = fe_data.values[k];
            if (flags & update_gradients)
              data.shape_gradients[k][i] = fe_data.grads[k];
-           if (flags & update_second_derivatives)
-             data.shape_2nd_derivatives[k][i] = fe_data.grad_grads[k];
+           if (flags & update_hessians)
+             data.shape_hessians[k][i] = fe_data.grad_grads[k];
          }
       }
 }
index 5bdcf6b55d541e72d0a9dd2b0f9f0ce6bbf91796..a87b8d0be8259a9a060c7081398442ce7afb977d 100644 (file)
@@ -153,7 +153,7 @@ FEValuesBase<dim>::TriaCellIterator::message_string
 = ("You have previously called the FEValues::reinit function with a\n"
    "cell iterator of type Triangulation<dim>::cell_iterator. However,\n"
    "when you do this, you cannot call some functions in the FEValues\n"
-   "class, such as the get_function_values/grads/2nd_derivatives\n"
+   "class, such as the get_function_values/gradients/hessians\n"
    "functions. If you need these functions, then you need to call\n"
    "FEValues::reinit with an iterator type that allows to extract\n"
    "degrees of freedom, such as DoFHandler<dim>::cell_iterator.");
@@ -298,8 +298,8 @@ FEValuesData<dim>::initialize (const unsigned int        n_quadrature_points,
     this->shape_gradients.resize (n_nonzero_shape_components,
                                   std::vector<Tensor<1,dim> > (n_quadrature_points));
 
-  if (flags & update_second_derivatives)
-    this->shape_2nd_derivatives.resize (n_nonzero_shape_components,
+  if (flags & update_hessians)
+    this->shape_hessians.resize (n_nonzero_shape_components,
                                         std::vector<Tensor<2,dim> > (n_quadrature_points));
   
   if (flags & update_q_points)
@@ -663,7 +663,7 @@ template <int dim>
 template <class InputVector>
 void
 FEValuesBase<dim>::
-get_function_grads (const InputVector           &fe_function,
+get_function_gradients (const InputVector           &fe_function,
                    std::vector<Tensor<1,dim> > &gradients) const
 {
   Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField());
@@ -705,7 +705,7 @@ get_function_grads (const InputVector           &fe_function,
 
 template <int dim>
 template <class InputVector>
-void FEValuesBase<dim>::get_function_grads (
+void FEValuesBase<dim>::get_function_gradients (
   const InputVector& fe_function,
   const VectorSlice<const std::vector<unsigned int> >& indices,
   std::vector<Tensor<1,dim> > &values) const
@@ -745,7 +745,7 @@ template <int dim>
 template <class InputVector>
 void
 FEValuesBase<dim>::
-get_function_grads (const InputVector                         &fe_function,
+get_function_gradients (const InputVector                         &fe_function,
                    std::vector<std::vector<Tensor<1,dim> > > &gradients) const
 {
   Assert (gradients.size() == n_quadrature_points,
@@ -800,7 +800,7 @@ get_function_grads (const InputVector                         &fe_function,
 
 template <int dim>
 template <class InputVector>
-void FEValuesBase<dim>::get_function_grads (
+void FEValuesBase<dim>::get_function_gradients (
   const InputVector& fe_function,
   const VectorSlice<const std::vector<unsigned int> >& indices,
   std::vector<std::vector<Tensor<1,dim> > >& values,
@@ -893,14 +893,14 @@ template <int dim>
 template <class InputVector>
 void
 FEValuesBase<dim>::
-get_function_2nd_derivatives (const InputVector           &fe_function,
-                             std::vector<Tensor<2,dim> > &second_derivatives) const
+get_function_hessians (const InputVector           &fe_function,
+                             std::vector<Tensor<2,dim> > &hessians) const
 {
   Assert (fe->n_components() == 1,
          ExcDimensionMismatch(fe->n_components(), 1));
-  Assert (second_derivatives.size() == n_quadrature_points,
-         ExcDimensionMismatch(second_derivatives.size(), n_quadrature_points));
-  Assert (this->update_flags & update_second_derivatives, ExcAccessToUninitializedField());
+  Assert (hessians.size() == n_quadrature_points,
+         ExcDimensionMismatch(hessians.size(), n_quadrature_points));
+  Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField());
   Assert (present_cell.get() != 0,
          ExcMessage ("FEValues object is not reinit'ed to any cell"));
   Assert (fe_function.size() == present_cell->n_dofs_for_dof_handler(),
@@ -913,7 +913,7 @@ get_function_2nd_derivatives (const InputVector           &fe_function,
   present_cell->get_interpolated_dof_values(fe_function, dof_values);
 
                                   // initialize with zero
-  std::fill_n (second_derivatives.begin(), n_quadrature_points, Tensor<2,dim>());
+  std::fill_n (hessians.begin(), n_quadrature_points, Tensor<2,dim>());
 
                                   // add up contributions of trial
                                   // functions. note that here we
@@ -924,9 +924,9 @@ get_function_2nd_derivatives (const InputVector           &fe_function,
   for (unsigned int point=0; point<n_quadrature_points; ++point)
     for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
       {
-       Tensor<2,dim> tmp = this->shape_2nd_derivative(shape_func,point);
+       Tensor<2,dim> tmp = this->shape_hessian(shape_func,point);
        tmp *= dof_values(shape_func);
-       second_derivatives[point] += tmp;
+       hessians[point] += tmp;
       };
 }
 
@@ -936,7 +936,7 @@ template <int dim>
 template <class InputVector>
 void
 FEValuesBase<dim>::
-get_function_2nd_derivatives (const InputVector                         &fe_function,
+get_function_hessians (const InputVector                         &fe_function,
                              std::vector<std::vector<Tensor<2,dim> > > &second_derivs,
                              bool quadrature_points_fastest) const
 {
@@ -948,7 +948,7 @@ get_function_2nd_derivatives (const InputVector                         &fe_func
     Assert (second_derivs[i].size() == n_components,
            ExcDimensionMismatch(second_derivs[i].size(), n_components));
 
-  Assert (this->update_flags & update_second_derivatives, ExcAccessToUninitializedField());
+  Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField());
   Assert (present_cell.get() != 0,
          ExcMessage ("FEValues object is not reinit'ed to any cell"));
   Assert (fe_function.size() == present_cell->n_dofs_for_dof_handler(),
@@ -971,7 +971,7 @@ get_function_2nd_derivatives (const InputVector                         &fe_func
       for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
        if (fe->is_primitive(shape_func))
          {
-           Tensor<2,dim> tmp(shape_2nd_derivative(shape_func,point));
+           Tensor<2,dim> tmp(shape_hessian(shape_func,point));
            tmp *= dof_values(shape_func);
            second_derivs[fe->system_to_component_index(shape_func).first][point]
              += tmp;
@@ -979,7 +979,7 @@ get_function_2nd_derivatives (const InputVector                         &fe_func
        else
          for (unsigned int c=0; c<n_components; ++c)
            {
-             Tensor<2,dim> tmp = this->shape_2nd_derivative_component(shape_func,point,c);
+             Tensor<2,dim> tmp = this->shape_hessian_component(shape_func,point,c);
              tmp *= dof_values(shape_func);
              second_derivs[c][point] += tmp;
            }
@@ -988,7 +988,7 @@ get_function_2nd_derivatives (const InputVector                         &fe_func
       for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
        if (fe->is_primitive(shape_func))
          {
-           Tensor<2,dim> tmp(shape_2nd_derivative(shape_func,point));
+           Tensor<2,dim> tmp(shape_hessian(shape_func,point));
            tmp *= dof_values(shape_func);
            second_derivs[point][fe->system_to_component_index(shape_func).first]
              += tmp;
@@ -996,7 +996,7 @@ get_function_2nd_derivatives (const InputVector                         &fe_func
        else
          for (unsigned int c=0; c<n_components; ++c)
            {
-             Tensor<2,dim> tmp = this->shape_2nd_derivative_component(shape_func,point,c);
+             Tensor<2,dim> tmp = this->shape_hessian_component(shape_func,point,c);
              tmp *= dof_values(shape_func);
              second_derivs[point][c] += tmp;
            }
@@ -1010,7 +1010,7 @@ FEValuesBase<dim>::memory_consumption () const
 {
   return (MemoryConsumption::memory_consumption (this->shape_values) +
          MemoryConsumption::memory_consumption (this->shape_gradients) +
-         MemoryConsumption::memory_consumption (this->shape_2nd_derivatives) +
+         MemoryConsumption::memory_consumption (this->shape_hessians) +
          MemoryConsumption::memory_consumption (this->JxW_values) +
          MemoryConsumption::memory_consumption (this->quadrature_points) +
          MemoryConsumption::memory_consumption (this->normal_vectors) +
index 1cc5a87cf673f09e43c16647685ae08fca150a01..94f3f684847004be05a433c0b34b16243aaedf8c 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -56,27 +56,27 @@ void FEValuesBase<deal_II_dimension>::get_function_values<IN>
  std::vector<std::vector<float> > &, bool) const;
 
 template
-void FEValuesBase<deal_II_dimension>::get_function_grads<IN>
+void FEValuesBase<deal_II_dimension>::get_function_gradients<IN>
 (const IN&, std::vector<Tensor<1,deal_II_dimension> > &) const;
 template
-void FEValuesBase<deal_II_dimension>::get_function_grads<IN>
+void FEValuesBase<deal_II_dimension>::get_function_gradients<IN>
 (const IN&, const VectorSlice<const std::vector<unsigned int> >&,
  std::vector<Tensor<1,deal_II_dimension> > &) const;
 
 template
-void FEValuesBase<deal_II_dimension>::get_function_grads<IN>
+void FEValuesBase<deal_II_dimension>::get_function_gradients<IN>
 (const IN&, std::vector<std::vector<Tensor<1,deal_II_dimension> > > &) const;
 template
-void FEValuesBase<deal_II_dimension>::get_function_grads<IN>
+void FEValuesBase<deal_II_dimension>::get_function_gradients<IN>
 (const IN&, const VectorSlice<const std::vector<unsigned int> >&,
  std::vector<std::vector<Tensor<1,deal_II_dimension> > > &, bool) const;
 
 template
-void FEValuesBase<deal_II_dimension>::get_function_2nd_derivatives<IN>
+void FEValuesBase<deal_II_dimension>::get_function_hessians<IN>
 (const IN&, std::vector<Tensor<2,deal_II_dimension> > &) const;
 
 template
-void FEValuesBase<deal_II_dimension>::get_function_2nd_derivatives<IN>
+void FEValuesBase<deal_II_dimension>::get_function_hessians<IN>
 (const IN&, std::vector<std::vector<Tensor<2,deal_II_dimension> > > &, bool) const;
 
 DEAL_II_NAMESPACE_CLOSE
index df45dce7f4bd23d3be4fcea179ccc3de6b2d0e4e..bc170f5aa3a74dc33d042dec8576c3f54b4c458e 100644 (file)
@@ -406,14 +406,14 @@ get_projected_derivative (const FEValues<dim>  &fe_values,
   if (fe_values.get_fe().n_components() == 1)
     {
       std::vector<ProjectedDerivative> values (1);
-      fe_values.get_function_2nd_derivatives (solution, values);
+      fe_values.get_function_hessians (solution, values);
       return values[0];
     }
   else
     {
       std::vector<std::vector<ProjectedDerivative> > values
        (1, std::vector<ProjectedDerivative>(fe_values.get_fe().n_components()));
-      fe_values.get_function_2nd_derivatives (solution, values);
+      fe_values.get_function_hessians (solution, values);
       return values[0][component];
     };
 }

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.