fastscapelib.DiffusionADIEroder#
- class fastscapelib.DiffusionADIEroder#
Hillslope erosion using linear diffusion.
It numerically solves the diffusion equation using an Alternating Direction Implicit (ADI) scheme.
The equation is given by:
\[\frac{\partial h}{\partial t} = K \nabla^2 h\]where \(K\) is an erosion coefficient (diffusivity) and \(\nabla^2 h\) is the local curvature of the topographic surface.
This equation implies that the amount of sediment eroded is linearly proportional to the local gradient of the topographic surface.
Notes: only raster grids are supported. This eroder assumes Dirichlet boundary conditions at the border nodes of the raster grid.
- __init__(self, grid: RasterGrid, k_coef: float | numpy.ndarray) None #
DiffusionADIEroder initializer.
- Parameters:
grid (
RasterGrid
) – A raster grid instance.k_coef (
float
ornumpy.ndarray
) – Spatially uniform or variable erosion coefficient (diffusivity) value. For the spatially variable case, the shape of the array must match the shape of the raster grid.
Methods
__init__
(self, grid, k_coef)DiffusionADIEroder initializer.
erode
(elevation, dt)Slove diffusion for one time step.
Attributes
Erosion coefficient (spatially variable or uniform).
- erode(elevation: numpy.ndarray, dt: float) numpy.ndarray #
Slove diffusion for one time step.
- Parameters:
elevation (
numpy.ndarray
) – Surface topography elevation at each grid node (shape must match the shape of the raster grid).dt (
float
) – Duration of the time step.
- Returns:
erosion (
numpy.ndarray
) – Diffusion vertical erosion (> 0) or accumulation (< 0) computed for the time step. Same shape than the inputelevation
array.
- property k_coef#
Erosion coefficient (spatially variable or uniform).