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

index c6fe38f0d0fb91b83510f402756c2237e1fd1ddf..724df6475274d06f5a26fbee40d121a184a4ce3a 100644 (file)
@@ -887,6 +887,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::Vector::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 symmetrized gradients of the selected vector components of
      * the finite element function characterized by <tt>fe_function</tt> at
index 3dc2a33af160f27f994f8620e58648d4119a263f..dcd5a1086ce1e098c2944c621480763a8dfc193e 100644 (file)
@@ -1553,6 +1553,26 @@ namespace FEValuesViews
 
 
 
+  template <int dim, int spacedim>
+  template <class InputVector>
+  void
+  Vector<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 f0b789a19ce84dd3888f38427b96029737057ec0..99b74e3bc170280a19da30d692652e7faed43d49 100644 (file)
@@ -176,6 +176,11 @@ for (VEC : GENERAL_CONTAINER_TYPES;
     void FEValuesViews::Vector<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::Vector<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.