Skip to content

Conversation

@tomas19
Copy link

@tomas19 tomas19 commented May 29, 2023

I added a new Python script, oceanmesh/subset_mesh.py. It contains 11 functions, but for doing the subset of a mesh (fort.14) you only need to call subsetMesh. This last function calls the rest. I didn't provide a conda yml file, but the versions of the main packages are:

  • Pandas version: 1.4.3
  • Numpy version: 1.24.3
  • Rtree version: 1.0.1
  • Matplotlib version: 3.7.1
  • Geopandas version: 0.13.0
  • Shapely version: 2.0.1

The workflow follows the next steps:

  • Reads the original fort.14 nodes as a dataframe with readNodes
  • Reads the mask shapefile as a geopandas GeoDataFrame with readSubDomain (polygon covering the area we want to remove)
  • Removes the elements with centroid inside the mask and renumber the nodes with subsetMeshGdf
  • Reads the boundary conditions of the original fort.14 file with readOrgBC
  • Renumber the ocean boundary nodes with renumOceanBC
  • Renumber the closed land boundary (islands) nodes with renumClosedBCs
  • Renumber the mainland boundary nodes with renumMainlandBC
  • Writes the new fort.14 with writeFort14

Thanks, Tomas

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.

1 participant