From: Jean-Paul Pelteret Date: Thu, 10 Aug 2017 22:52:57 +0000 (-0600) Subject: Added Scalar::get_function_hessians_from_local_dof_values X-Git-Tag: v9.0.0-rc1~1291^2~16 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6050fc5087727cb9c91f9e06ef56cab45ead0c99;p=dealii.git Added Scalar::get_function_hessians_from_local_dof_values --- diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 77a6639005..3b6b591c9a 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -402,6 +402,14 @@ namespace FEValuesViews void get_function_hessians (const InputVector &fe_function, std::vector::type> &hessians) const; + /** + * @copydoc FEValuesViews::Scalar::get_function_values_from_local_dof_values() + */ + template + void get_function_hessians_from_local_dof_values (const InputVector &dof_values, + std::vector::hessian_type> &hessians) const; + + /** * Return the Laplacians of the selected scalar component 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 c890974cf6..496042749c 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -1376,6 +1376,26 @@ namespace FEValuesViews + template + template + void + Scalar:: + get_function_hessians_from_local_dof_values(const InputVector &dof_values, + std::vector::hessian_type> &hessians) const + { + Assert (fe_values->update_flags & update_hessians, + (typename FEValuesBase::ExcAccessToUninitializedField("update_hessians"))); + 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<2,dim,spacedim> + (make_array_view(dof_values.begin(), dof_values.end()), + fe_values->finite_element_output.shape_hessians, shape_function_data, hessians); + } + + + template template void diff --git a/source/fe/fe_values.inst.in b/source/fe/fe_values.inst.in index ae54b4cd4b..cc403b24d4 100644 --- a/source/fe/fe_values.inst.in +++ b/source/fe/fe_values.inst.in @@ -154,6 +154,11 @@ for (VEC : GENERAL_CONTAINER_TYPES; void FEValuesViews::Scalar ::get_function_gradients_from_local_dof_values> (const VEC&, std::vector::gradient_type>&) const; + + template + void FEValuesViews::Scalar + ::get_function_hessians_from_local_dof_values> + (const VEC&, std::vector::hessian_type>&) const; #endif }