Skip to content

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
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.

@krober10nd
Copy link
Collaborator

Please rebase with the latest master. I think these functions should be integrated into a class called io or something like that.

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