From: Peter Munch Date: Wed, 20 Oct 2021 08:34:37 +0000 (+0200) Subject: Implement convert_generalized_support_point_values_to_dof_values for wedges/pyramids X-Git-Tag: v9.4.0-rc1~918^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12853%2Fhead;p=dealii.git Implement convert_generalized_support_point_values_to_dof_values for wedges/pyramids --- diff --git a/include/deal.II/fe/fe_pyramid_p.h b/include/deal.II/fe/fe_pyramid_p.h index b82028744d..243a5c615e 100644 --- a/include/deal.II/fe/fe_pyramid_p.h +++ b/include/deal.II/fe/fe_pyramid_p.h @@ -41,6 +41,14 @@ public: FE_PyramidPoly(const unsigned int degree, const internal::GenericDoFsPerObject & dpos, const typename FiniteElementData::Conformity conformity); + + /** + * @copydoc dealii::FiniteElement::convert_generalized_support_point_values_to_dof_values() + */ + virtual void + convert_generalized_support_point_values_to_dof_values( + const std::vector> &support_point_values, + std::vector & nodal_values) const override; }; /** diff --git a/include/deal.II/fe/fe_wedge_p.h b/include/deal.II/fe/fe_wedge_p.h index 032bba660e..18d3227c19 100644 --- a/include/deal.II/fe/fe_wedge_p.h +++ b/include/deal.II/fe/fe_wedge_p.h @@ -41,6 +41,14 @@ public: FE_WedgePoly(const unsigned int degree, const internal::GenericDoFsPerObject & dpos, const typename FiniteElementData::Conformity conformity); + + /** + * @copydoc dealii::FiniteElement::convert_generalized_support_point_values_to_dof_values() + */ + virtual void + convert_generalized_support_point_values_to_dof_values( + const std::vector> &support_point_values, + std::vector & nodal_values) const override; }; /** diff --git a/source/fe/fe_pyramid_p.cc b/source/fe/fe_pyramid_p.cc index 92d516e0bd..68209cfd1a 100644 --- a/source/fe/fe_pyramid_p.cc +++ b/source/fe/fe_pyramid_p.cc @@ -108,6 +108,28 @@ FE_PyramidPoly::FE_PyramidPoly( +template +void +FE_PyramidPoly:: + convert_generalized_support_point_values_to_dof_values( + const std::vector> &support_point_values, + std::vector & nodal_values) const +{ + AssertDimension(support_point_values.size(), + this->get_unit_support_points().size()); + AssertDimension(support_point_values.size(), nodal_values.size()); + AssertDimension(this->dofs_per_cell, nodal_values.size()); + + for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + { + AssertDimension(support_point_values[i].size(), 1); + + nodal_values[i] = support_point_values[i](0); + } +} + + + template FE_PyramidP::FE_PyramidP(const unsigned int degree) : FE_PyramidPoly(degree, diff --git a/source/fe/fe_wedge_p.cc b/source/fe/fe_wedge_p.cc index 33a6b62aba..184796a866 100644 --- a/source/fe/fe_wedge_p.cc +++ b/source/fe/fe_wedge_p.cc @@ -116,6 +116,28 @@ FE_WedgePoly::FE_WedgePoly( +template +void +FE_WedgePoly:: + convert_generalized_support_point_values_to_dof_values( + const std::vector> &support_point_values, + std::vector & nodal_values) const +{ + AssertDimension(support_point_values.size(), + this->get_unit_support_points().size()); + AssertDimension(support_point_values.size(), nodal_values.size()); + AssertDimension(this->dofs_per_cell, nodal_values.size()); + + for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + { + AssertDimension(support_point_values[i].size(), 1); + + nodal_values[i] = support_point_values[i](0); + } +} + + + template FE_WedgeP::FE_WedgeP(const unsigned int degree) : FE_WedgePoly(degree,