1#ifndef LF_USCALFE_PROLONGATION_H
2#define LF_USCALFE_PROLONGATION_H
4#include <lf/assemble/dofhandler.h>
6#include <lf/mesh/utils/utils.h>
7#include <lf/refinement/mesh_function_transfer.h>
8#include <lf/refinement/mesh_hierarchy.h>
32template <
typename SCALAR_COEFF,
typename FES_COARSE,
typename FES_FINE>
33[[nodiscard]] Eigen::Matrix<SCALAR_COEFF, Eigen::Dynamic, 1>
prolongate(
35 std::shared_ptr<FES_COARSE> fespace_coarse,
36 std::shared_ptr<FES_FINE> fespace_fine,
37 const Eigen::Matrix<SCALAR_COEFF, Eigen::Dynamic, 1> &dofs_coarse,
40 using scalar_fe_coarse_t =
typename FES_COARSE::Scalar;
41 using scalar_fe_fine_t =
typename FES_FINE::Scalar;
43 std::is_convertible_v<FES_COARSE &,
45 "Invalid coarse FE space provided");
46 static_assert(std::is_convertible_v<FES_FINE &,
48 "Invalid fine FE space provided");
56 "level must not point to or beyond the finest mesh in the hierarchy");
58 dofs_coarse.size() >= N_coarse,
59 "Too few basis function coefficients provided for coarse FE space");
64 mh, mf_coarse, level_coarse, level_coarse + 1);
A general (interface) class for DOF handling, see Lecture Document Paragraph 2.7.4....
virtual size_type NumDofs() const =0
total number of dof's handled by the object
A MeshFunction representing an element from a ScalarFESpace (e.g. solution of BVP)
Space of scalar valued finite element functions on a Mesh.
A MeshFunction representing interpolation on a lf::refinement::MeshHierarchy.
A hierarchy of nested 2D hybrid meshes created by refinement.
size_type NumLevels() const
number of meshes contained in the hierarchy, 1 for a single mesh
unsigned int size_type
general type for variables related to size of arrays
Collects data structures and algorithms designed for scalar finite element methods primarily meant fo...
Eigen::Matrix< SCALAR_COEFF, Eigen::Dynamic, 1 > prolongate(const lf::refinement::MeshHierarchy &mh, std::shared_ptr< FES_COARSE > fespace_coarse, std::shared_ptr< FES_FINE > fespace_fine, const Eigen::Matrix< SCALAR_COEFF, Eigen::Dynamic, 1 > &dofs_coarse, lf::base::size_type level_coarse)
Interpolate a vector of DOFs on a finer mesh.
auto NodalProjection(const lf::fe::ScalarFESpace< SCALAR > &fe_space, MF const &u, SELECTOR &&pred=base::PredicateTrue{}) -> Eigen::Vector< decltype(SCALAR{0} *mesh::utils::MeshFunctionReturnType< std::remove_reference_t< MF > >{0}), Eigen::Dynamic >
Computes nodal projection of a mesh function and returns the finite element basis expansion coefficie...