From: Jean-Paul Pelteret Date: Thu, 10 Aug 2017 22:53:56 +0000 (-0600) Subject: Added Scalar::get_function_laplacians_from_local_dof_values X-Git-Tag: v9.0.0-rc1~1291^2~15 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9af0d540003132185614b1e1c752ce9f106cc22;p=dealii.git Added Scalar::get_function_laplacians_from_local_dof_values --- diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 3b6b591c9a..e17caaf5cc 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -432,6 +432,14 @@ namespace FEValuesViews void get_function_laplacians (const InputVector &fe_function, std::vector::type> &laplacians) const; + /** + * @copydoc FEValuesViews::Scalar::get_function_values_from_local_dof_values() + */ + template + void get_function_laplacians_from_local_dof_values (const InputVector &dof_values, + std::vector::laplacian_type> &laplacians) const; + + /** * Return the third derivatives 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 496042749c..3f67cd9e3d 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -527,14 +527,15 @@ namespace FEValuesViews do_function_laplacians (const ArrayView &dof_values, const Table<2,dealii::Tensor<2,spacedim> > &shape_hessians, const std::vector::ShapeFunctionData> &shape_function_data, - std::vector::type> &laplacians) + std::vector::template OutputType::laplacian_type> &laplacians) { const unsigned int dofs_per_cell = dof_values.size(); const unsigned int n_quadrature_points = dofs_per_cell > 0 ? shape_hessians[0].size() : laplacians.size(); AssertDimension (laplacians.size(), n_quadrature_points); - std::fill (laplacians.begin(), laplacians.end(), typename ProductType::type()); + std::fill (laplacians.begin(), laplacians.end(), + typename Scalar::template OutputType::laplacian_type()); for (unsigned int shape_function=0; shape_function + template + void + Scalar:: + get_function_laplacians_from_local_dof_values(const InputVector &dof_values, + std::vector::laplacian_type> &laplacians) 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_laplacians + (make_array_view(dof_values.begin(), dof_values.end()), + fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians); + } + + + template template void diff --git a/source/fe/fe_values.inst.in b/source/fe/fe_values.inst.in index cc403b24d4..067db65566 100644 --- a/source/fe/fe_values.inst.in +++ b/source/fe/fe_values.inst.in @@ -159,6 +159,11 @@ for (VEC : GENERAL_CONTAINER_TYPES; void FEValuesViews::Scalar ::get_function_hessians_from_local_dof_values> (const VEC&, std::vector::hessian_type>&) const; + + template + void FEValuesViews::Scalar + ::get_function_laplacians_from_local_dof_values> + (const VEC&, std::vector::value_type>&) const; #endif }