imod.mf6.HorizontalFlowBarrierResistance.snap_to_grid#
- HorizontalFlowBarrierResistance.snap_to_grid(dis: StructuredDiscretization | VerticesDiscretization) UgridDataset #
Snap the barriers to the grid edges of the discretization. This is also done when calling to_mf6_pkg or when calling
imod.mf6.Modflow6Simulation()
, but this method can be used to debug and see how your barriers are snapped to grid edges.- Parameters:
dis (StructuredDiscretization | VerticesDiscretication) – Model discretization package.
- Returns:
Dataset with barriers snapped to grid edges.
- Return type:
xugrid.UgridDataset
Example
See how the barriers are snapped to grid edges. Get the discretization and horizontal flow barrier package from the
imod.mf6.GroundwaterFlowModel
first.>>> dis = gwf_model["dis"] >>> hfb = gwf_model["hfb"] >>> snapped_dataset = hfb.snap_to_grid(dis) >>> snapped_dataset["resistance"].ugrid.plot()