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

Added read_fort14.py #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

liesvyvall
Copy link

to parse fort.14 mesh files, inspired by the methodology used in the OceanMesh2D MATLAB repository

…hodology used in the OceanMesh2D MATLAB repository
oceanmesh/read_fort14.py Outdated Show resolved Hide resolved
oceanmesh/read_fort14.py Show resolved Hide resolved
oceanmesh/read_fort14.py Outdated Show resolved Hide resolved
idx = np.loadtxt(fid, max_rows=N[0], dtype=int)

# Ordenar los datos leídos
EToV = idx[:, 2:5]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be good to check that EToV is converted to zero-based indexing as that's how it's used in Python.

VX = np.full((num_nodes, 2), np.nan)
B = np.full(num_nodes, np.nan)

VX[Val[:, 0].astype(int) - 1, :] = Val[:, 1:3]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be good to check that all vertices are present in the element table.

@krober10nd
Copy link
Collaborator

Should this be part of a reader/writer class instead of a standalone function?

@liesvyvall
Copy link
Author

Maybe we need a reader/writer, a mesh_generator and a plot classes. Or we can put it in a separate class cause this is not related to the main objective of ocean mesh (create mesh)?

@krober10nd
Copy link
Collaborator

Maybe we need a reader/writer, a mesh_generator and a plot classes. Or we can put it in a separate class cause this is not related to the main objective of ocean mesh (create mesh)?

Good suggestion while it's not the purpose of this library it's an essential utility. I'm in favor of creating two additional classes: one dedicating to plotting meshes (similar to msh.plot() in MATLAB) and a reader/writer for fort14 and 2dm format.

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

Successfully merging this pull request may close these issues.

2 participants