]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added SymmetricTensor::get_function_divergences_from_local_dof_values
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 10 Aug 2017 23:02:06 +0000 (17:02 -0600)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 12 Aug 2017 17:21:38 +0000 (11:21 -0600)
include/deal.II/fe/fe_values.h
source/fe/fe_values.cc
source/fe/fe_values.inst.in

index 060a02dfa0af94e67cbc3a415870ad2160de7046..91f1df7b7172bc6d4a6d2adbc616499b5c1e1e9b 100644 (file)
@@ -1336,6 +1336,13 @@ namespace FEValuesViews
     void get_function_divergences (const InputVector &fe_function,
                                    std::vector<typename ProductType<divergence_type,typename InputVector::value_type>::type> &divergences) const;
 
+    /**
+     * @copydoc FEValuesViews::SymmetricTensor<2,dim,spacedim>::get_function_values_from_local_dof_values()
+     */
+    template <class InputVector>
+    void get_function_divergences_from_local_dof_values (const InputVector &dof_values,
+                                                         std::vector<typename OutputType<typename InputVector::value_type>::divergence_type> &divergences) const;
+
   private:
     /**
      * A pointer to the FEValuesBase object we operate on.
index 7a074e468f1f37b960c87196aa4049259b5c984a..7ad5950c78c77c9e1007eaf444a55d20bc5cfdef 100644 (file)
@@ -1067,7 +1067,7 @@ namespace FEValuesViews
     do_function_divergences (const ArrayView<Number> &dof_values,
                              const Table<2,dealii::Tensor<1,spacedim> > &shape_gradients,
                              const std::vector<typename SymmetricTensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
-                             std::vector<typename ProductType<Number,dealii::Tensor<1,spacedim> >::type> &divergences)
+                             std::vector<typename SymmetricTensor<2,dim,spacedim>::template OutputType<Number>::divergence_type> &divergences)
     {
       const unsigned int dofs_per_cell = dof_values.size();
       const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
@@ -1075,7 +1075,7 @@ namespace FEValuesViews
       AssertDimension (divergences.size(), n_quadrature_points);
 
       std::fill (divergences.begin(), divergences.end(),
-                 typename ProductType<Number,dealii::Tensor<1,spacedim> >::type());
+                 typename SymmetricTensor<2,dim,spacedim>::template OutputType<Number>::divergence_type());
 
       for (unsigned int shape_function=0;
            shape_function<dofs_per_cell; ++shape_function)
@@ -1913,6 +1913,28 @@ namespace FEValuesViews
      fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
   }
 
+
+
+  template <int dim, int spacedim>
+  template <class InputVector>
+  void
+  SymmetricTensor<2, dim, spacedim>::
+  get_function_divergences_from_local_dof_values(const InputVector &dof_values,
+                                                 std::vector<typename OutputType<typename InputVector::value_type>::divergence_type> &divergences) 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_divergences<dim,spacedim>
+    (make_array_view(dof_values.begin(), dof_values.end()),
+     fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
+  }
+
+
+
   template <int dim, int spacedim>
   template <class InputVector>
   void
index 4d700e47f1603d213cef27c96265f64d73f45a89..514ebd6834c14e6ed84aca813df1a3bb44d5b7c9 100644 (file)
@@ -218,6 +218,11 @@ for (VEC : GENERAL_CONTAINER_TYPES;
     void FEValuesViews::SymmetricTensor<2,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::SymmetricTensor<2,deal_II_dimension, deal_II_space_dimension>
+    ::get_function_divergences_from_local_dof_values<VEC<Number>>
+            (const VEC<Number>&, std::vector<typename OutputType<Number>::divergence_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.