From: Jean-Paul Pelteret Date: Thu, 10 Aug 2017 22:59:39 +0000 (-0600) Subject: Added Vector::get_function_laplacians_from_local_dof_values X-Git-Tag: v9.0.0-rc1~1291^2~7 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=226fd24cf77863d22f69b46161fa09ce87eb9ec0;p=dealii.git Added Vector::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 80f6a1739a..b23b7de42b 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -1038,6 +1038,13 @@ namespace FEValuesViews void get_function_laplacians (const InputVector &fe_function, std::vector::type> &laplacians) const; + /** + * @copydoc FEValuesViews::Vector::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 9eb65c5cc8..908e774288 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -959,7 +959,7 @@ 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 ? @@ -967,7 +967,7 @@ namespace FEValuesViews AssertDimension (laplacians.size(), n_quadrature_points); std::fill (laplacians.begin(), laplacians.end(), - typename ProductType >::type()); + typename Vector::template OutputType::laplacian_type()); for (unsigned int shape_function=0; shape_function + template + void + Vector:: + 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 (laplacians.size() == fe_values->n_quadrature_points, + ExcDimensionMismatch(laplacians.size(), fe_values->n_quadrature_points)); + 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 416d30bd6f..7ed95a20e8 100644 --- a/source/fe/fe_values.inst.in +++ b/source/fe/fe_values.inst.in @@ -201,6 +201,11 @@ for (VEC : GENERAL_CONTAINER_TYPES; void FEValuesViews::Vector ::get_function_hessians_from_local_dof_values> (const VEC&, std::vector::hessian_type>&) const; + + template + void FEValuesViews::Vector + ::get_function_laplacians_from_local_dof_values> + (const VEC&, std::vector::value_type>&) const; #endif }