Model

This class generates the options for pTatin3d model using the format of the PETSc library. It requires to have generated

class genepy.Model(model_ics: InitialConditions, model_regions: ModelRegions, model_bcs: ModelBCs, model_name: str = 'model_GENE3D', **kwargs)
class Model(model_ics: InitialConditions, model_regions: ModelRegions, model_bcs: ModelBCs, model_name: str = 'model_GENE3D', **kwargs)

Class to define the options for pTatin3d model.

Parameters:
  • model_ics (InitialConditions) – Initial conditions of the model.

  • model_regions (ModelRegions) – Material parameters of the model.

  • model_bcs (ModelBCs) – Boundary conditions of the model.

  • model_name (str) – Name of the model. Default is "model_GENE3D".

  • kwargs – Additional arguments for the model.

Keyword arguments (optional)

Parameters:
  • output_frequency (int) – Frequency of results output. Default is 25.

  • output_path (str) – Path of the output directory. Default is "output".

  • output_fields (list[str]) – Fields to output. Default is ["region","viscosity","density","plastic_strain"].

  • checkpoint_ncpumins (int) – Checkpoint every n cpu minutes. Default is 230.

  • checkpoint_frequency (int) – Checkpoint every n time step. Default is 25.

  • length_bar (float) – Length scaling. Default is 1.0e5 m.

  • viscosity_bar (float) – Viscosity scaling. Default is \(10^{22}\) Pa.s.

  • velocity_bar (float) – Velocity scaling. Default is \(10^{-10}\) m.s-1.

  • nsteps (int) – Max number of time steps. Default is 100000.

  • dtmin (float) – Min time step. Default is 1.0e-6.

  • dtmax (float) – Max time step. Default is 0.5.

  • isostatic_density (float) – Density reference for initial isostatic topography. Default is 3300 kg.m-3.

  • isostatic_depth (float) – Depth of compensation for initial isostatic topography. Default is -40 km.

  • max_surface_displacement (float) – Max surface displacement per time step. Default is 500 m.

  • markers (MarkersManagement) – Markers layout and population control options.

  • viscosity_min (float) – Minimum viscosity value. Default is \(10^{19}\) Pa.s.

  • viscosity_max (float) – Maximum viscosity value. Default is \(10^{25}\) Pa.s.

  • spm (SPMDiffusion) – Surface processes SPMDiffusion class instance.

  • pswarm (Pswarm) – Passive tracers class instance.

  • mpi_ranks (int) – Number of MPI ranks, it is used to define the solver options. For now, there are 4 possible values: 1, 64, 512 and 1024. Any value other value will set the solver options for 1 MPI rank. These options were defined for some meshes but may require some modification depending on users needs and computational resources. Default is 1.

Attributes

name: str

Name of the model. Default is "model_GENE3D".

regions: ModelRegions

Material parameters of the model.

bcs: ModelBCs

Boundary conditions of the model.

ics: InitialConditions

Initial conditions of the model.

options: str

Options for the model.

Example

Markers management

class genepy.MarkersManagement(layout: tuple[int, int, int] = (5, 5, 5), popctrl_faces: tuple[int, ...] = (0, 1, 4, 5), popctrl_np_lower: int = 8, popctrl_np_upper: int = 128, popctrl_layout: tuple[int, int, int] = (2, 2, 2))
class MarkersManagement(layout: tuple[int, int, int] = (5, 5, 5), popctrl_faces: tuple[int, ...] = (0, 1, 4, 5), popctrl_np_lower: int = 8, popctrl_np_upper: int = 128, popctrl_layout: tuple[int, int, int] = (2, 2, 2))

Class to manage the lagrangian markers in pTatin3d model.

Parameters:
  • layout (tuple[int,int,int]) – Number of markers per element in each direction. Default is (5,5,5).

  • popctrl_faces (tuple[int,...]) –

    Faces where markers are injected and not cleaned as long as they belong to an element connected to the face. Default is (0,1,4,5). Faces numbering is as follow:

    • 0: east = xmax = imax = Pxi

    • 1: west = xmin = imin = Nxi

    • 2: north = ymax = jmax = Peta

    • 3: south = ymin = jmin = Neta

    • 4: front = zmax = kmax = Pzeta

    • 5: back = zmin = kmin = Nzeta

  • popctrl_np_lower (int) – Minimum number of markers per element. Default is 8.

  • popctrl_np_upper (int) – Maximum number of markers per element. Default is 128.

  • popctrl_layout (tuple[int,int,int]) – Number of markers injected in each direction. Default is (2,2,2).

Passive tracers

Pswarm

class genepy.Pswarm(layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')
class Pswarm(layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')

Class to define passive swarms of markers in pTatin3d. It is the parent class of the different types of passive marker layout:

Parameters:
  • layout (tuple[int,int,int]) – Number of markers per element in each direction. Default is (2,2,2).

  • pressure (bool) – Activate pressure tracking. Default is False.

  • temperature (bool) – Activate temperature tracking. Default is False.

  • model_name (str) – Name of the model. Default is “model_GENE3D”.

Fill entire domain

class genepy.PswarmFillDomain(layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')
class PswarmFillDomain(layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')

Class to define passive swarms of markers in pTatin3d. Generates options for a passive swarm that fills the entire physical domain.

Parameters:
  • layout (tuple[int,int,int]) – Number of markers per element in each direction. Default is (2,2,2).

  • pressure (bool) – Activate pressure tracking. Default is False.

  • temperature (bool) – Activate temperature tracking. Default is False.

  • model_name (str) – Name of the model. Default is “model_GENE3D”.

Fill domain within a bounding box

class genepy.PswarmFillDomainWithinBoundingBox(minCoord: tuple[float, float, float], maxCoord: tuple[float, float, float], layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')
class PswamFillDomainWithinBoundingBox(minCoord: tuple[float, float, float], maxCoord: tuple[float, float, float], layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')

Class to define passive swarms of markers in pTatin3d. Generates options for a passive swarm that fills the physical domain within a given bounding box.

Parameters:
  • minCoord (tuple[float,float,float]) – Minimum coordinates of the bounding box.

  • maxCoord (tuple[float,float,float]) – Maximum coordinates of the bounding box.

  • layout (tuple[int,int,int]) – Number of markers per element in each direction. Default is (2,2,2).

  • pressure (bool) – Activate pressure tracking. Default is False.

  • temperature (bool) – Activate temperature tracking. Default is False.

  • model_name (str) – Name of the model. Default is “model_GENE3D”.

Fill domain within a bounding box with a given number of particles

class genepy.PswarmFillBox(minCoord: tuple[float, float, float], maxCoord: tuple[float, float, float], layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')
class PswarmFillBox(minCoord: tuple[float, float, float], maxCoord: tuple[float, float, float], layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')

Class to define passive swarms of markers in pTatin3d. Generates options for a passive swarm that fills a given bounding box with a specified marker resolution.

Warning

Opposed to the other classes, the layout is not the number of markers per element in each direction but the total number of markers in each direction.

Parameters:
  • minCoord (tuple[float,float,float]) – Minimum coordinates of the bounding box.

  • maxCoord (tuple[float,float,float]) – Maximum coordinates of the bounding box.

  • layout (tuple[int,int,int]) – Number of markers in each direction. Default is (2,2,2).

  • pressure (bool) – Activate pressure tracking. Default is False.

  • temperature (bool) – Activate temperature tracking. Default is False.

  • model_name (str) – Name of the model. Default is “model_GENE3D”.

Place only selected tracers

class genepy.PswarmFromUserList(markers_coor: ndarray, pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')
class PswarmFromUserList(markers_coor: np.ndarray, layout: tuple[int, int, int] = (2, 2, 2), pressure: bool = False, temperature: bool = False, model_name: str = 'model_GENE3D')

Class to define passive swarms of markers in pTatin3d. Generates options for a list of passive tracers.

Note

This layout should be used only when a small number of tracers are required and that their initial coordinates are known.

Parameters:
  • markers_coor (np.ndarray) – Coordinates of the markers.

  • pressure (bool) – Activate pressure tracking. Default is False.

  • temperature (bool) – Activate temperature tracking. Default is False.

  • model_name (str) – Name of the model. Default is “model_GENE3D”.

Surface processes

class genepy.SPMDiffusion(dirichlet_faces: list[str], diffusivity: float = 1e-06, model_name: str = 'model_GENE3D')
class SPMDiffusion(dirichlet_faces: list[str], diffusivity: float = 1.0e-6, model_name: str = 'model_GENE3D')

Class to generate the options for surface processes diffusion in pTatin3d. Surface processes are handled by solving the following diffusion equation:

\[\nabla \cdot (k \nabla h) = 0\]

with \(k\) the diffusivity and \(h\) the height.

Parameters:
  • dirichlet_faces (list[str]) – List of faces where Dirichlet boundary conditions are applied. Possible values are: "xmin", "xmax", "zmin", "zmax". At least one is required to ensure uniqueness of the solution.

  • diffusivity (float) – Diffusivity value in m2.s-1. Default is \(10^{-6}\).

  • model_name (str) – Model name.

Raises:

ValueError – If an unrecognized face is passed.

class genepy.SPMDiffusionBaselvl(dirichlet_faces: list[str], diffusivity: list[float] = [1e-10, 1e-06], baselevel: float = 0.0, model_name: str = 'model_GENE3D')
class SPMDiffusionBaselvl(dirichlet_faces: list[str], diffusivity: list[float] = [1.0e-10, 1.0e-6], baselevel: float = 0.0, model_name: str = 'model_GENE3D')

Class to generate the options for surface processes diffusion in pTatin3d with a base level. The equation solved is the same than in SPMDiffusion.

Parameters:
  • dirichlet_faces (list[str]) – List of faces where Dirichlet boundary conditions are applied. Possible values are: "xmin", "xmax", "zmin", "zmax". At least one is required to ensure uniqueness of the solution.

  • diffusivity (list[float]) – Diffusivity values in m2.s-1. A list of two values is expected, diffusivity[0] is the value below the base level, diffusivity[1] is the value above the base level. Default is \(10^{-10}\) m2.s-1 and \(10^{-6}\) m2.s-1.

  • baselevel – Base level in m. Default is 0.0.

  • model_name (str) – Model name.

Raises:

ValueError – If an unrecognized face is passed.