lehrfempp icon indicating copy to clipboard operation
lehrfempp copied to clipboard

Mapping of meshes

Open hiptmair opened this issue 3 years ago • 3 comments

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.

hiptmair avatar May 02 '21 14:05 hiptmair

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

?

craffael avatar May 02 '21 19:05 craffael

Thanks for reminding me that templated functions cannot be virtual. I am going to make a plan for this extension.

hiptmair avatar May 10 '21 12:05 hiptmair

Alright, let me know if I can help in any way. this shouldn't be too hard to implement :)

craffael avatar May 10 '21 13:05 craffael