From: Martin Kronbichler Date: Tue, 12 Jul 2016 12:19:01 +0000 (+0200) Subject: Prevent FE_Bernstein from implementing nonsensical interpolation X-Git-Tag: v8.5.0-rc1~881^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6bed8055741f9a00ab245b2a1c72d8286db3d56;p=dealii.git Prevent FE_Bernstein from implementing nonsensical interpolation --- diff --git a/include/deal.II/fe/fe_bernstein.h b/include/deal.II/fe/fe_bernstein.h index f55fd70789..cb90524733 100644 --- a/include/deal.II/fe/fe_bernstein.h +++ b/include/deal.II/fe/fe_bernstein.h @@ -70,6 +70,39 @@ public: */ FE_Bernstein (const unsigned int p); + /** + * FE_Bernstein is not interpolatory in the element interior, which prevents + * this element from defining an interpolation matrix. An exception will be + * thrown. + * + * Overrides the implementation from FE_Q_Base. + */ + virtual void + get_interpolation_matrix (const FiniteElement &source, + FullMatrix &matrix) const; + + /** + * FE_Bernstein is not interpolatory in the element interior, which prevents + * this element from defining a restriction matrix. An exception will be + * thrown. + * + * Overrides the implementation from FE_Q_Base. + */ + virtual const FullMatrix & + get_restriction_matrix (const unsigned int child, + const RefinementCase &refinement_case=RefinementCase::isotropic_refinement) const; + + /** + * FE_Bernstein is not interpolatory in the element interior, which prevents + * this element from defining a prolongation matrix. An exception will be + * thrown. + * + * Overrides the implementation from FE_Q_Base. + */ + virtual const FullMatrix & + get_prolongation_matrix (const unsigned int child, + const RefinementCase &refinement_case=RefinementCase::isotropic_refinement) const; + /** * Return the matrix interpolating from a face of one element to the face of * the neighboring element. The size of the matrix is then diff --git a/source/fe/fe_bernstein.cc b/source/fe/fe_bernstein.cc index 1e828e207a..6fd68ab662 100644 --- a/source/fe/fe_bernstein.cc +++ b/source/fe/fe_bernstein.cc @@ -43,6 +43,51 @@ FE_Bernstein::FE_Bernstein (const unsigned int degree) {} + +template +void +FE_Bernstein:: +get_interpolation_matrix (const FiniteElement &, + FullMatrix &) const +{ + // no interpolation possible. throw exception, as documentation says + typedef FiniteElement FEE; + AssertThrow (false, + typename FEE::ExcInterpolationNotImplemented()); +} + + + +template +const FullMatrix & +FE_Bernstein::get_restriction_matrix (const unsigned int, + const RefinementCase &) const +{ + typedef FiniteElement FEE; + AssertThrow (false, + typename FEE::ExcProjectionVoid()); + // return dummy, nothing will happen because the base class FE_Q_Base + // implements lazy evaluation of those matrices + return this->restriction[0][0]; +} + + + +template +const FullMatrix & +FE_Bernstein::get_prolongation_matrix (const unsigned int, + const RefinementCase &) const +{ + typedef FiniteElement FEE; + AssertThrow (false, + typename FEE::ExcEmbeddingVoid()); + // return dummy, nothing will happen because the base class FE_Q_Base + // implements lazy evaluation of those matrices + return this->prolongation[0][0]; +} + + + template void FE_Bernstein::