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

Is it possible to allow pathlib.Path to be passed as argument to Mesh()? #3424

Open
p479h opened this issue Feb 26, 2024 · 1 comment
Open

Comments

@p479h
Copy link

p479h commented Feb 26, 2024

As of right now, you must provide the file path to your .msh mesh using a python string. Since many users utilize python's built in pathlib.Path objects for indicating the mesh directory it would be nice to be able to pass them as arguments. I believe the solution could be added to firedrake/mesh.py _from_gmsh(filename, comm=None) as follows:

if isinstance(filename, Path):
    filename = filename.as_posix()

Or something similar.

@connorjward
Copy link
Contributor

This seems like a sensible thing to support. Probably the best place to put this would be inside Mesh as your suggestion is specific to gmsh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants