|
10 | 10 | from mpas_tools.io import write_netcdf |
11 | 11 | from mpas_tools.logging import LoggingContext, check_call |
12 | 12 | from mpas_tools.mesh.conversion import cull |
| 13 | +from mpas_tools.mesh.creation.sort_mesh import sort_mesh |
13 | 14 | from mpas_tools.mesh.mask import compute_mpas_flood_fill_mask |
14 | 15 | from mpas_tools.ocean import inject_bathymetry |
15 | 16 | from mpas_tools.ocean.coastline_alteration import ( |
|
19 | 20 | ) |
20 | 21 | from mpas_tools.viz.paraview_extractor import extract_vtk |
21 | 22 |
|
| 23 | +from compass.model import make_graph_file |
22 | 24 | from compass.step import Step |
23 | 25 |
|
24 | 26 |
|
@@ -365,11 +367,18 @@ def _cull_mesh_with_logging(logger, with_cavities, with_critical_passages, |
365 | 367 | logger=logger) |
366 | 368 |
|
367 | 369 | # cull the mesh a second time using a flood fill from the seed points |
368 | | - dsCulledMesh = cull(dsCulledMesh, dsInverse=dsSeedMask, |
369 | | - graphInfoFileName='culled_graph.info', logger=logger, |
| 370 | + dsCulledMesh = cull(dsCulledMesh, dsInverse=dsSeedMask, logger=logger, |
370 | 371 | dir='.') |
| 372 | + |
| 373 | + # sort the cell, edge and vertex indices for better performances |
| 374 | + dsCulledMesh = sort_mesh(dsCulledMesh) |
| 375 | + |
371 | 376 | write_netcdf(dsCulledMesh, 'culled_mesh.nc') |
372 | 377 |
|
| 378 | + # we need to make the graph file after sorting |
| 379 | + make_graph_file(mesh_filename='culled_mesh.nc', |
| 380 | + graph_filename='culled_graph.info') |
| 381 | + |
373 | 382 | if critical_passages: |
374 | 383 | # make a new version of the critical passages mask on the culled mesh |
375 | 384 | fcCritPassages.to_geojson('critical_passages.geojson') |
|
0 commit comments