From 3f00c72839ae3d2c0b649550cfbb923ce41730f7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Thu, 10 Aug 2017 16:57:12 -0600 Subject: [PATCH] Added Vector::get_function_symmetric_gradients_from_local_dof_values --- include/deal.II/fe/fe_values.h | 8 ++++++++ source/fe/fe_values.cc | 21 +++++++++++++++++++++ source/fe/fe_values.inst.in | 5 +++++ 3 files changed, 34 insertions(+) diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 724df64752..895543894b 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -922,6 +922,14 @@ namespace FEValuesViews get_function_symmetric_gradients (const InputVector &fe_function, std::vector::type> &symmetric_gradients) const; + /** + * @copydoc FEValuesViews::Vector::get_function_values_from_local_dof_values() + */ + template + void + get_function_symmetric_gradients_from_local_dof_values (const InputVector &dof_values, + std::vector::symmetric_gradient_type> &symmetric_gradients) const; + /** * Return the divergence of the selected vector components of the finite * element function characterized by fe_function at the diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index dcd5a1086c..8a3289b105 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -1598,6 +1598,27 @@ namespace FEValuesViews + template + template + void + Vector:: + get_function_symmetric_gradients_from_local_dof_values(const InputVector &dof_values, + std::vector::symmetric_gradient_type> &symmetric_gradients) const + { + Assert (fe_values->update_flags & update_gradients, + (typename FEValuesBase::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_symmetric_gradients + (make_array_view(dof_values.begin(), dof_values.end()), + fe_values->finite_element_output.shape_gradients, shape_function_data, + symmetric_gradients); + } + + + template template void diff --git a/source/fe/fe_values.inst.in b/source/fe/fe_values.inst.in index 99b74e3bc1..b0b722db57 100644 --- a/source/fe/fe_values.inst.in +++ b/source/fe/fe_values.inst.in @@ -181,6 +181,11 @@ for (VEC : GENERAL_CONTAINER_TYPES; void FEValuesViews::Vector ::get_function_gradients_from_local_dof_values> (const VEC&, std::vector::gradient_type>&) const; + + template + void FEValuesViews::Vector + ::get_function_symmetric_gradients_from_local_dof_values> + (const VEC&, std::vector::symmetric_gradient_type>&) const; #endif } -- 2.39.5