hydromt_delft3dfm.DFlowFMModel.setup_mesh2d_refine#

DFlowFMModel.setup_mesh2d_refine(polygon_fn: str | None = None, sample_fn: str | None = None, steps: int | None = 1)[source]#

Refine the 2d mesh.

Refinement are done within the geometry based on polygon polygon_fn or raster samples sample_fn.

The number of refinement is defined by steps if polygon_fn is used.

Note that this function can only be applied on an existing regular rectangle 2d mesh.

# FIXME: how to identify if the mesh is uniform rectangle 2d mesh? regular irregular?

Adds/Updates model layers:

  • 2D mesh geom: By any changes in 2D grid

Parameters:
  • polygon_fn (str Path, optional) – Path to a polygon or MultiPolygon used to refine the 2D mesh

  • sample_fn (str Path, optional) –

    Path to a raster sample file used to refine the 2D mesh. The value of each sample point is the number of steps to refine the mesh. Allow only single values. The resolution of the raster should be the same as the desired end result resolution.

    • Required variable: [‘steps’]

  • steps (int, optional) – Number of steps in the refinement when `polygon_fn’ is used. By default 1, i.e. no refinement is applied.