-
Notifications
You must be signed in to change notification settings - Fork 65
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
Inconsistency in vertices and edges #585
Comments
@changliao1025, the indexing is 1-based (Fortran) indexing. Are you sure that is what you are using? I think such fundamental issues would have broken our workflows long ago if they were caused by MPAS-Tools. |
If you'd like us to take a closer look, you're going to need to point to the mesh somewhere so we can have a look. |
Here is the workflow that @changliao1025 shared with me: def _land_mask_from_geojson( mesh_filename=sFilename_base_mesh,
geojson_filename=sFilename_land_coverage,
mask_filename=sFilename_land_mask):
dsLandMask = xr.open_dataset(sFilename_land_mask)
sFilename_culled_mesh = os.path.join(sWorkspace_jigsaw_out, "out", "culled_graph.info")
dsCulledMesh = cull(
dsBaseMesh, dsMask=dsLandMask,
graphInfoFileName=sFilename_culled_mesh)
sFilename_invert_mesh = os.path.join(sWorkspace_jigsaw_out, "out", "invert_graph.info")
dsInvertMesh = cull(
dsBaseMesh, dsInverse=dsLandMask,
graphInfoFileName= sFilename_invert_mesh)
sFilename_culled_mesh = os.path.join(sWorkspace_jigsaw_out, "out", "culled_mesh.nc")
write_netcdf(
dsCulledMesh, sFilename_culled_mesh, netcdfFormat)
sFilename_invert_mesh = os.path.join(sWorkspace_jigsaw_out, "out", "invert_mesh.nc")
write_netcdf(
dsInvertMesh, sFilename_invert_mesh, netcdfFormat) Here is my suggested fix, calling def _land_mask_from_geojson( mesh_filename=sFilename_base_mesh,
geojson_filename=sFilename_land_coverage,
mask_filename=sFilename_land_mask):
dsLandMask = xr.open_dataset(sFilename_land_mask)
sFilename_culled_mesh = os.path.join(sWorkspace_jigsaw_out, "out", "culled_graph.info")
dsCulledMesh = cull(
dsBaseMesh, dsMask=dsLandMask)
dsCulledMesh = convert(
dsCulledMesh, graphInfoFileName=sFilename_culled_mesh)
sFilename_invert_mesh = os.path.join(sWorkspace_jigsaw_out, "out", "invert_graph.info")
dsInvertMesh = cull(
dsBaseMesh, dsInverse=dsLandMask)
dsInvertMesh = convert(
dsInvertMesh, graphInfoFileName=sFilename_invert_mesh)
sFilename_culled_mesh = os.path.join(sWorkspace_jigsaw_out, "out", "culled_mesh.nc")
write_netcdf(
dsCulledMesh, sFilename_culled_mesh, netcdfFormat)
sFilename_invert_mesh = os.path.join(sWorkspace_jigsaw_out, "out", "invert_mesh.nc")
write_netcdf(
dsInvertMesh, sFilename_invert_mesh, netcdfFormat) |
I was able to visualize the original dataset ( |
I ran a mesh generation simulation successfully. But a script crashed when I tried to convert the invert_mesh.nc to a different format. I debugged and found something unexpected:
It appears cell 60469 has six vertices but only five edges.
The text was updated successfully, but these errors were encountered: