underworldcode / underworld3

https://underworldcode.github.io/underworld3/
Other
20 stars 10 forks source link

Nuking mesh coordinates #238

Open gthyagi opened 2 months ago

gthyagi commented 2 months ago

Hi @lmoresi,

Each time we create a mesh by calling uw.discretisation.Mesh, we execute self.nuke_coords_and_rebuild(), regardless of whether the mesh is deformed or undeformed. Is this necessary? https://github.com/underworldcode/underworld3/blob/3ef67b9871a50d240993334d5dd1beef0f2127bb/src/underworld3/discretisation.py#L340

In my case, I'm simply creating the mesh.msh and mesh.h5 files for the sphere, so I'm wondering why it needs to go through the nuking process.

lmoresi commented 2 months ago

I suppose that if you are just converting a .msh to a .h5, then this is not really necessary. In fact we already do this because we convert any gmsh file into a dmplex and save as h5 before building the mesh.

So if you are just converting files to store, maybe just use that strategy. It's in the _from_gmsh() function in the discretisation.