1#ifndef PROJECTS_DPG_TRACE_SCALAR_REFERENCE_FINITE_ELEMENT
2#define PROJECTS_DPG_TRACE_SCALAR_REFERENCE_FINITE_ELEMENT
14#include <lf/uscalfe/uscalfe.h>
41template <
typename SCALAR>
77 [[nodiscard]]
unsigned Degree()
const override {
79 return cfe_->Degree();
84 return cfe_->NumRefShapeFunctions() -
cfe_->NumRefShapeFunctions(0);
89 return (codim == 0) ? 0 :
cfe_->NumRefShapeFunctions(codim);
95 return (codim == 0) ? 0 :
cfe_->NumRefShapeFunctions(codim, subidx);
98 [[nodiscard]] Eigen::Matrix<SCALAR, Eigen::Dynamic, Eigen::Dynamic>
101 return cfe_->EvalReferenceShapeFunctions(local).topRows(
105 [[nodiscard]] Eigen::Matrix<SCALAR, Eigen::Dynamic, Eigen::Dynamic>
107 const Eigen::MatrixXd& local)
const override {
109 return cfe_->GradientsReferenceShapeFunctions(local).topRows(
120 return cfe_->NumEvaluationNodes() -
cfe_->NumRefShapeFunctions(0);
124 const Eigen::Matrix<SCALAR, 1, Eigen::Dynamic>& nodvals)
const override {
132 Eigen::Matrix<SCALAR, 1, Eigen::Dynamic> extendedNodvals(
133 cfe_->NumEvaluationNodes());
134 Eigen::Matrix<SCALAR, 1, Eigen::Dynamic> zeros(
cfe_->NumEvaluationNodes() -
137 extendedNodvals << nodvals, zeros;
138 return cfe_->NodalValuesToDofs(extendedNodvals)
147 std::shared_ptr<const lf::fe::ScalarReferenceFiniteElement<SCALAR>>
cfe_;
Represents a reference element with all its properties.
Interface class for parametric scalar valued finite elements.
ScalarReferenceFiniteElement()=default
Decorator class around a ScalarReferenceFiniteElement to represent traces on the cell boundary.
size_type NumRefShapeFunctions(dim_t codim) const override
The number of interior reference shape functions for sub-entities of a particular co-dimension.
TraceScalarReferenceFiniteElement()=default
Default constructor, does not initialize this class (invalid state).
lf::base::RefEl RefEl() const override
Tells the type of reference cell underlying the parametric finite element.
lf::fe::size_type NumEvaluationNodes() const override
Tell the number of evaluation (interpolation) nodes.
size_type NumRefShapeFunctions() const override
Total number of reference shape functions associated with the reference cell.
TraceScalarReferenceFiniteElement(TraceScalarReferenceFiniteElement &&) noexcept=default
~TraceScalarReferenceFiniteElement() override=default
Eigen::Matrix< SCALAR, 1, Eigen::Dynamic > NodalValuesToDofs(const Eigen::Matrix< SCALAR, 1, Eigen::Dynamic > &nodvals) const override
Computes the linear combination of reference shape functions matching function values at evaluation n...
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > GradientsReferenceShapeFunctions(const Eigen::MatrixXd &local) const override
Computation of the gradients of all reference shape functions in a number of points.
bool isInitialized() const
Report the initialization status of the object.
unsigned Degree() const override
Request the maximal polynomial degree of the basis functions in this finite element.
TraceScalarReferenceFiniteElement(const TraceScalarReferenceFiniteElement &)=delete
Eigen::MatrixXd EvaluationNodes() const override
Returns reference coordinates of "evaluation nodes" for evaluation of parametric degrees of freedom,...
std::shared_ptr< const lf::fe::ScalarReferenceFiniteElement< SCALAR > > cfe_
size_type NumRefShapeFunctions(dim_t codim, sub_idx_t subidx) const override
The number of interior reference shape functions for every sub-entity.
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > EvalReferenceShapeFunctions(const Eigen::MatrixXd &local) const override
Evaluation of all reference shape functions in a number of points.
lf::assemble::size_type size_type
Contains functionality for the implementation of DPG methods.
lf::uscalfe::sub_idx_t sub_idx_t
Type for indexing of sub-entities.
lf::uscalfe::dim_t dim_t
Tpe for (co)-dimensions.
lf::uscalfe::size_type size_type
Type for vector length/matrix sizes.