Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping of meshes #202

Open
hiptmair opened this issue May 2, 2021 · 3 comments
Open

Mapping of meshes #202

hiptmair opened this issue May 2, 2021 · 3 comments
Assignees
Labels
Enhancement New feature or request

Comments

@hiptmair
Copy link
Collaborator

hiptmair commented May 2, 2021

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 hiptmair added the Enhancement New feature or request label May 2, 2021
@craffael
Copy link
Owner

craffael commented May 2, 2021

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

?

@hiptmair
Copy link
Collaborator Author

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

@craffael
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants