hydromt_delft3dfm.DFlowFMModel.setup_mesh2d#

DFlowFMModel.setup_mesh2d(region: dict, res: float | None = None) UgridDataset[source]#

Create a 2D unstructured mesh according UGRID conventions.

Grids are read according to UGRID conventions. A 2D unstructured mesh will be created as 2D rectangular grid from a geometry (geom_fn) or bbox. If an existing 2D mesh is given, then no new mesh will be generated but an extent can be extracted using the bounds argument of region.

# Note that: # (1) Refinement of the mesh is a seperate setup function, however an existing # grid with refinement (mesh_fn) can already be read. # (2) If mesh also has 1D, 1D2Dlinks are created in a separate setup function. # (3) At mesh border, cells that intersect with geometry border will be kept. # (4) Only existing mesh with only 2D grid can be read. So 1D2D network files # are not supported as mesh2d_fn.

Adds/Updates model layers:

  • grid_name mesh topology: add grid_name 2D topology to mesh object

Parameters:
  • region (dict) – Dictionary describing region of interest, bounds can be provided for type ‘mesh’.

  • e.g. (CRS for 'bbox' and 'bounds' should be 4326;) –

    • {‘bbox’: [xmin, ymin, xmax, ymax]}

    • {‘geom’: ‘path/to/polygon_geometry’}

    • {‘mesh’: ‘path/to/2dmesh_file’}

    • {‘mesh’: ‘path/to/2dmesh_file’, ‘bounds’: [xmin, ymin, xmax, ymax]}

  • res (float) – Resolution used to generate 2D mesh [unit of the CRS], required if region is not based on ‘mesh’.

Returns:

mesh2d – Generated mesh2d.

Return type:

xu.UgridDataset