]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added Vector::get_function_laplacians_from_local_dof_values
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 10 Aug 2017 22:59:39 +0000 (16:59 -0600)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 12 Aug 2017 17:09:32 +0000 (11:09 -0600)
include/deal.II/fe/fe_values.h
source/fe/fe_values.cc
source/fe/fe_values.inst.in

index 80f6a1739a038bc4051e1f12f70b03fd4f5f9a9c..b23b7de42b4bb58889dd0977e332ba92687d5289 100644 (file)
@@ -1038,6 +1038,13 @@ namespace FEValuesViews
     void get_function_laplacians (const InputVector &fe_function,
                                   std::vector<typename ProductType<value_type,typename InputVector::value_type>::type> &laplacians) const;
 
+    /**
+     * @copydoc FEValuesViews::Vector::get_function_values_from_local_dof_values()
+     */
+    template <class InputVector>
+    void get_function_laplacians_from_local_dof_values (const InputVector &dof_values,
+                                                        std::vector<typename OutputType<typename InputVector::value_type>::laplacian_type> &laplacians) const;
+
     /**
      * Return the third derivatives of the selected scalar component of the
      * finite element function characterized by <tt>fe_function</tt> at the
index 9eb65c5cc8e1b76408b859e051ffdadc8e0af908..908e774288a7a1f9dcd42a8ae7a9eb8d75560d66 100644 (file)
@@ -959,7 +959,7 @@ namespace FEValuesViews
     do_function_laplacians (const ArrayView<Number> &dof_values,
                             const Table<2,dealii::Tensor<2,spacedim> > &shape_hessians,
                             const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
-                            std::vector<typename ProductType<Number,dealii::Tensor<1,spacedim> >::type> &laplacians)
+                            std::vector<typename Vector<dim,spacedim>::template OutputType<Number>::laplacian_type> &laplacians)
     {
       const unsigned int dofs_per_cell = dof_values.size();
       const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
@@ -967,7 +967,7 @@ namespace FEValuesViews
       AssertDimension (laplacians.size(), n_quadrature_points);
 
       std::fill (laplacians.begin(), laplacians.end(),
-                 typename ProductType<Number,dealii::Tensor<1,spacedim> >::type());
+                 typename Vector<dim,spacedim>::template OutputType<Number>::laplacian_type());
 
       for (unsigned int shape_function=0;
            shape_function<dofs_per_cell; ++shape_function)
@@ -1779,6 +1779,29 @@ namespace FEValuesViews
   }
 
 
+
+
+  template <int dim, int spacedim>
+  template <class InputVector>
+  void
+  Vector<dim,spacedim>::
+  get_function_laplacians_from_local_dof_values(const InputVector &dof_values,
+                                                std::vector<typename OutputType<typename InputVector::value_type>::laplacian_type> &laplacians) const
+  {
+    Assert (fe_values->update_flags & update_hessians,
+            (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_hessians")));
+    Assert (laplacians.size() == fe_values->n_quadrature_points,
+            ExcDimensionMismatch(laplacians.size(), fe_values->n_quadrature_points));
+    Assert (fe_values->present_cell.get() != nullptr,
+            ExcMessage ("FEValues object is not reinit'ed to any cell"));
+    AssertDimension (dof_values.size(), fe_values->dofs_per_cell);
+
+    internal::do_function_laplacians<dim,spacedim>
+    (make_array_view(dof_values.begin(), dof_values.end()),
+     fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
+  }
+
+
   template <int dim, int spacedim>
   template <class InputVector>
   void
index 416d30bd6f05a9c48869f2c677d2e57f66e0ebe7..7ed95a20e8c1c4293b010dd68c07e023d469dd00 100644 (file)
@@ -201,6 +201,11 @@ for (VEC : GENERAL_CONTAINER_TYPES;
     void FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>
     ::get_function_hessians_from_local_dof_values<VEC<Number>>
             (const VEC<Number>&, std::vector<typename OutputType<Number>::hessian_type>&) const;
+
+    template
+    void FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>
+    ::get_function_laplacians_from_local_dof_values<VEC<Number>>
+            (const VEC<Number>&, std::vector<typename OutputType<Number>::value_type>&) const;
 #endif
 }
 

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.