10#ifndef INCG4ee2d6e8004446558bc6d2186596e392
11#define INCG4ee2d6e8004446558bc6d2186596e392
15#include "scalar_fe_space.h"
43template <
class SCALAR_FE,
class SCALAR_COEFF>
48 using Scalar =
decltype(SCALAR_FE(0) * SCALAR_COEFF(0));
62 Eigen::Matrix<SCALAR_COEFF, Eigen::Dynamic, 1> coeff_vector)
73 const Eigen::MatrixXd& local)
const {
76 fe_space_->ShapeFunctionLayout(e)->EvalReferenceShapeFunctions(local);
79 Eigen::Matrix<SCALAR_COEFF, 1, Eigen::Dynamic> local_dofs(1,
81 auto global_dofs =
fe_space_->LocGlobMap().GlobalDofIndices(e);
82 for (Eigen::Index i = 0; i < sf_eval.rows(); ++i) {
86 std::vector<Scalar> result(local.cols());
87 Eigen::Map<Eigen::Matrix<Scalar, 1, Eigen::Dynamic>> temp(result.data(), 1,
89 temp = local_dofs * sf_eval;
97 [[nodiscard]] std::shared_ptr<const mesh::Mesh>
getMesh()
const {
107 [[nodiscard]] std::shared_ptr<const ScalarFESpace<SCALAR_FE>>
getFESpace()
113 std::shared_ptr<const ScalarFESpace<SCALAR_FE>>
fe_space_;
118template <
class T,
class SCALAR_COEFF>
120 const Eigen::Matrix<SCALAR_COEFF, Eigen::Dynamic, 1>&)
A MeshFunction representing an element from a ScalarFESpace (e.g. solution of BVP)
std::shared_ptr< const ScalarFESpace< SCALAR_FE > > getFESpace() const
Convenience method to retrieve the finite element space in which the mesh function lives.
Eigen::Matrix< SCALAR_COEFF, Eigen::Dynamic, 1 > dof_vector_
std::shared_ptr< const mesh::Mesh > getMesh() const
Convenience method to retrieve the underlying mesh.
decltype(SCALAR_FE(0) *SCALAR_COEFF(0)) Scalar
MeshFunctionFE(std::shared_ptr< const ScalarFESpace< SCALAR_FE > > fe_space, Eigen::Matrix< SCALAR_COEFF, Eigen::Dynamic, 1 > coeff_vector)
Create a new MeshFunctionFE from a ScalarFESpace and a coefficient vector.
std::shared_ptr< const ScalarFESpace< SCALAR_FE > > fe_space_
std::vector< Scalar > operator()(const lf::mesh::Entity &e, const Eigen::MatrixXd &local) const
Evaluate the mesh function on a MeshEntity.
Space of scalar valued finite element functions on a Mesh.
Interface class representing a topological entity in a cellular complex
Collects data structures and algorithms designed for scalar finite element methods primarily meant fo...
MeshFunctionFE(std::shared_ptr< T >, const Eigen::Matrix< SCALAR_COEFF, Eigen::Dynamic, 1 > &) -> MeshFunctionFE< typename T::Scalar, SCALAR_COEFF >