lehrfempp
lehrfempp copied to clipboard
Mapping of meshes
In quite a few settings it would be convenient to be able to subject a mesh read from file or constructed from primitives to a bijective orientation preserving mapping R^2 -> R^2. This could be done by mapping the points defining the geometry of all mesh entities; it would affect only the Geometry objects associated with mesh entities.
What about introducing a method
template <typename Mapping> remap(Mapping &F);
for lf::mesh::Geometry
? Here the type mapping must provide an Eigen::VectorXd operator () (Eigen::VectorXd) const
evaluation operator.
Ah that sounds like a familiar problem.
I like the solution that you proposed, but I think we should make the remap function virtual, i.e. we cannot use templates. So I would propose the following signature:
virtual void remap(std::function<Eigen::VectorXd(const Eigen::VectorXd&)> transform) const
?
Thanks for reminding me that templated functions cannot be virtual. I am going to make a plan for this extension.
Alright, let me know if I can help in any way. this shouldn't be too hard to implement :)