// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2014 - 2023 by the deal.II authors // // This file is part of the deal.II library. // // Part of the source code is dual licensed under Apache-2.0 WITH // LLVM-exception OR LGPL-2.1-or-later. Detailed license information // governing the source code and code contributions can be found in // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. // // ------------------------------------------------------------------------ #ifndef dealii_fe_trace_h #define dealii_fe_trace_h #include #include #include #include #include DEAL_II_NAMESPACE_OPEN /** * A finite element, which is the trace of FE_Q elements, that is a tensor * product of polynomials on the faces, undefined in the interior of the cells * and continuous. The basis functions on the faces are formed by a tensor * product of 1d Lagrange polynomials with equidistant points up to degree 2 * and Gauss-Lobatto points starting from degree 3. * * This finite element is the trace space of FE_Q on the faces. * * @note Since these are only finite elements on faces, only FEFaceValues and * FESubfaceValues will be able to extract reasonable values from any face * polynomial. In order to make the use of FESystem simpler, FEValues objects * will not fail using this finite element space, but all shape function * values extracted will equal to zero. */ template class FE_TraceQ : public FE_PolyFace, dim, spacedim> { public: /** * Constructor for tensor product polynomials of degree p. The * shape functions created using this constructor correspond to Legendre * polynomials in each coordinate direction. */ FE_TraceQ(unsigned int p); /** * Return a string that uniquely identifies a finite element. This class * returns FE_DGQ(degree), with dim and * degree replaced by appropriate values. */ virtual std::string get_name() const override; virtual std::unique_ptr> clone() const override; /** * Implementation of the corresponding function in the FiniteElement * class. Since the current element is interpolatory, the nodal * values are exactly the support point values. Furthermore, since * the current element is scalar, the support point values need to * be vectors of length 1. */ virtual void convert_generalized_support_point_values_to_dof_values( const std::vector> &support_point_values, std::vector &nodal_values) const override; /** * This function returns @p true, if the shape function @p shape_index has * non-zero function values somewhere on the face @p face_index. */ virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override; /** * Return a list of constant modes of the element. For this element, it * simply returns one row with all entries set to true. */ virtual std::pair, std::vector> get_constant_modes() const override; /** * Return whether this element implements its hanging node constraints in * the new way, which has to be used to make elements "hp-compatible". */ virtual bool hp_constraints_are_implemented() const override; /** * Return the matrix interpolating from a face of one element to the face * of the neighboring element. The size of the matrix is then * source.dofs_per_face times this->dofs_per_face. This * element only provides interpolation matrices for elements of the same * type and FE_Nothing. For all other elements, an exception of type * FiniteElement::ExcInterpolationNotImplemented is thrown. */ virtual void get_face_interpolation_matrix(const FiniteElement &source, FullMatrix &matrix, const unsigned int face_no = 0) const override; /** * Return the matrix interpolating from a face of one element to the face * of the neighboring element. The size of the matrix is then * source.dofs_per_face times this->dofs_per_face. This * element only provides interpolation matrices for elements of the same * type and FE_Nothing. For all other elements, an exception of type * FiniteElement::ExcInterpolationNotImplemented is thrown. */ virtual void get_subface_interpolation_matrix( const FiniteElement &source, const unsigned int subface, FullMatrix &matrix, const unsigned int face_no = 0) const override; /** * @copydoc FiniteElement::compare_for_domination() */ virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement &fe_other, const unsigned int codim = 0) const override final; private: /** * Store a copy of FE_Q for delegating the hp-constraints functionality. */ FE_Q fe_q; /** * Return vector with dofs per vertex, line, quad, hex. */ static std::vector get_dpo_vector(const unsigned int deg); }; /** * FE_TraceQ in 1d, i.e., with degrees of freedom on the element vertices. */ template class FE_TraceQ<1, spacedim> : public FE_FaceQ<1, spacedim> { public: /** * Constructor. */ FE_TraceQ(const unsigned int p); /** * Return the name of the element */ std::string get_name() const override; }; DEAL_II_NAMESPACE_CLOSE #endif