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

index 3e747687d22725bf89279e4dcf654fa401d008da..77a6639005f9d3d9cfe84dbb8570a624ff69b365 100644 (file)
@@ -374,6 +374,13 @@ namespace FEValuesViews
     void get_function_gradients (const InputVector &fe_function,
                                  std::vector<typename ProductType<gradient_type,typename InputVector::value_type>::type> &gradients) const;
 
+    /**
+     * @copydoc FEValuesViews::Scalar::get_function_values_from_local_dof_values()
+     */
+    template <class InputVector>
+    void get_function_gradients_from_local_dof_values (const InputVector &dof_values,
+                                                       std::vector<typename OutputType<typename InputVector::value_type>::gradient_type> &gradients) const;
+
     /**
      * Return the Hessians of the selected scalar component of the finite
      * element function characterized by <tt>fe_function</tt> at the
index 039a7cec749a726a6c5d03437ad76c837b5fb219..c890974cf6e5d4c49b28305d30c1c4878cb73c17 100644 (file)
@@ -1332,6 +1332,26 @@ namespace FEValuesViews
 
 
 
+  template <int dim, int spacedim>
+  template <class InputVector>
+  void
+  Scalar<dim,spacedim>::
+  get_function_gradients_from_local_dof_values(const InputVector &dof_values,
+                                               std::vector<typename OutputType<typename InputVector::value_type>::gradient_type> &gradients) const
+  {
+    Assert (fe_values->update_flags & update_gradients,
+            (typename FEValuesBase<dim,spacedim>::ExcAccessToUninitializedField("update_gradients")));
+    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_derivatives<1,dim,spacedim>
+    (make_array_view(dof_values.begin(), dof_values.end()),
+     fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
+  }
+
+
+
   template <int dim, int spacedim>
   template <class InputVector>
   void
index 90f24d926af6000f93c1cee67a197cf6a2ef9649..ae54b4cd4b85c8cae9cadae28b21f2b201b4b2a1 100644 (file)
@@ -149,6 +149,11 @@ for (VEC : GENERAL_CONTAINER_TYPES;
     void FEValuesViews::Scalar<deal_II_dimension, deal_II_space_dimension>
     ::get_function_values_from_local_dof_values<VEC<Number>>
             (const VEC<Number>&, std::vector<typename OutputType<Number>::value_type>&) const;
+
+    template
+    void FEValuesViews::Scalar<deal_II_dimension, deal_II_space_dimension>
+    ::get_function_gradients_from_local_dof_values<VEC<Number>>
+            (const VEC<Number>&, std::vector<typename OutputType<Number>::gradient_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.