Class SEAMesh¶
- class sed.seaplex.SEAMesh(*args, **kwargs)[source]¶
This class encapsulates all the functions related to sediment transport and deposition in the marine environment for river delivered sediments. gospl has the ability to track three types of clastic sediment size and one type of carbonate (still under development).
Note
All of these functions are ran in parallel using the underlying PETSc library.
For an overview of solution to nonlinear ODE and PDE problems, one might found the online book from Langtangen (2016) relevant.
Initialise
__init__
(*args, **kwargs)The initialisation of SEAMesh class consists in the declaration of several PETSc vectors.
Public Methods
This function is the main entry point to perform marine river-induced deposition.
Private Methods
_diffuseOcean
(dh, stype)For sediment reaching the marine realm, this function computes the related marine deposition diffusion.
_distanceCoasts
(data[, k_neighbors])This function computes for every marine vertices the distance to the closest coastline.
Based on the incoming marine volumes of sediment and maximum clinoforms slope we distribute sediments downslope.
_evalFunction
(ts, t, x, xdot, f)The nonlinear system at each time step is solved iteratively using PETSc time stepping and SNES method and is based on a Newton/GMRES method.
_evalJacobian
(ts, t, x, xdot, a, J, P)The nonlinear system at each time step is solved iteratively using PETSc time stepping and SNES method and is based on a Newton/GMRES method.
_getSeaVol
(hl, stype)Pick the relevant PETSc array for the specified sediment type and distribute incoming river delivered sediment volume in the marine environment.
_globalCoastsTree
(coastXYZ[, k_neighbors])This function takes all local coastline points and computes locally the distance of all marine points to the coastline.
This function builds from neighbouring slopes the downstream directions in the marine environment.
Public functions¶
Private functions¶
- SEAMesh._diffuseOcean(dh, stype)[source]¶
For sediment reaching the marine realm, this function computes the related marine deposition diffusion. The approach is based on a nonlinear diffusion.
\[\frac{\partial h}{\partial t}= \nabla \cdot \left( C_d(h) \nabla h \right)\]It calls the following private functions:
_evalFunction
_evalJacobian
Note
PETSc SNES and time stepping TS approaches are used to solve the nonlinear equation above over the considered time step.
The nonlinear diffusion equation is ran for the coarser sediment first and for the finest ones afterwards. This mimicks the standard behaviour observed in stratigraphic architectures where the fine fraction are generally transported over longer distances.
- Parameters
dh – numpy array of incoming marine depositional thicknesses
stype – sediment type (integer)
- Returns
ndepo (updated deposition numpy arrays)
- SEAMesh._distanceCoasts(data, k_neighbors=1)[source]¶
This function computes for every marine vertices the distance to the closest coastline.
Important
The calculation takes advantage of the vtkContourFilter function from VTK library which is performed on the global VTK mesh. Once the coastlines have been extracted, the distances are obtained by querying a kd-tree (initialised with the coastal nodes) for marine vertices contained within each partition.
- Parameters
data – local elevation numpy array
k_neighbors – number of nodes to use when querying the kd-tree
- SEAMesh._distOcean()[source]¶
Based on the incoming marine volumes of sediment and maximum clinoforms slope we distribute sediments downslope.
- SEAMesh._evalFunction(ts, t, x, xdot, f)[source]¶
The nonlinear system at each time step is solved iteratively using PETSc time stepping and SNES method and is based on a Newton/GMRES method. . Here we define the function for the nonlinear solve.
- SEAMesh._evalJacobian(ts, t, x, xdot, a, J, P)[source]¶
The nonlinear system at each time step is solved iteratively using PETSc time stepping and SNES method and is based on a Newton/GMRES method. Here we define the Jacobian for the nonlinear solve.
- SEAMesh._getSeaVol(hl, stype)[source]¶
Pick the relevant PETSc array for the specified sediment type and distribute incoming river delivered sediment volume in the marine environment.
The function relies on two private functions from the class:
_distOcean
_diffuseOcean
- SEAMesh._globalCoastsTree(coastXYZ, k_neighbors=1)[source]¶
This function takes all local coastline points and computes locally the distance of all marine points to the coastline.
- Parameters
coastXYZ – local coastline coordinates
k_neighbors – number of nodes to use when querying the kd-tree
- SEAMesh._matOcean()[source]¶
This function builds from neighbouring slopes the downstream directions in the marine environment. It calls a fortran subroutine that locally computes for each vertice:
the indices of receivers (downstream) nodes depending on the desired number of flow directions (SFD to MFD).
the distances to the receivers based on mesh resolution.
the associated weights calculated based on the number of receivers and proportional to the slope.
From these downstream directions, a local ocean downstream matrix is computed.