1#ifndef LF_REFINEMENT_MESH_FUNCTION_TRANSFER_H
2#define LF_REFINEMENT_MESH_FUNCTION_TRANSFER_H
4#include <lf/mesh/utils/utils.h>
5#include <lf/refinement/mesh_hierarchy.h>
17template <mesh::utils::MeshFunction MF>
19 using mf_t = std::remove_cv_t<std::remove_reference_t<MF>>;
22 template <
typename MF_TEST,
23 typename =
decltype(std::declval<MF_TEST>().getMesh())>
25 template <
typename MF_TEST>
28 decltype(has_getMesh_impl<mf_t>(
int{})){};
48 "level_coarse must not point to the finest mesh in the hierarchy");
51 LF_ASSERT_MSG(level_fine > level_coarse,
52 "level_fine must be bigger than level_fine");
55 "level_fine must point to a valid mesh in the mesh hierarchy");
59 LF_ASSERT_MSG(mh.
getMesh(level_coarse) == mf.getMesh(),
60 "Invalid level_coarse provided");
72 const Eigen::MatrixXd &local)
const {
75 auto local_parent = rel_geom->Global(local);
80 local_parent = rel_geom->Global(local_parent);
82 return mf_(*parent, local_parent);
89 [[nodiscard]] std::shared_ptr<const lf::mesh::Mesh>
getMesh()
const {
100template <
typename MF>
Interface class representing a topological entity in a cellular complex
A MeshFunction representing interpolation on a lf::refinement::MeshHierarchy.
static std::false_type has_getMesh_impl(...)
MeshFunctionTransfer(const lf::refinement::MeshHierarchy &mh, const MF &mf, lf::base::size_type level_coarse, lf::base::size_type level_fine)
Constructor.
const lf::refinement::MeshHierarchy & mh_
const lf::base::size_type level_fine_
const lf::base::size_type level_coarse_
std::remove_cv_t< std::remove_reference_t< MF > > mf_t
std::shared_ptr< const lf::mesh::Mesh > getMesh() const
Access the underlying Mesh.
static constexpr bool provides_getMesh
static std::true_type has_getMesh_impl(int)
A hierarchy of nested 2D hybrid meshes created by refinement.
std::shared_ptr< const mesh::Mesh > getMesh(size_type level) const
access the mesh on a particular level
size_type NumLevels() const
number of meshes contained in the hierarchy, 1 for a single mesh
const lf::mesh::Entity * ParentEntity(size_type level, const lf::mesh::Entity &e) const
Retrieve the parent of an entity contained in a mesh of a refinement hierarchy.
const lf::geometry::Geometry * GeometryInParent(size_type level, const lf::mesh::Entity &e) const
shape of child entity in parent's reference coordinates
unsigned int size_type
general type for variables related to size of arrays
tools for regular or local refinement of 2D hybrid meshes
MeshFunctionTransfer(const lf::refinement::MeshHierarchy &, const MF &, lf::base::size_type, lf::base::size_type) -> MeshFunctionTransfer< MF >