List of all functions

Here an overview of all functions:

JustRelax.GeometryType
struct Geometry{nDim,T}

A struct representing the geometry of a topological object in nDim dimensions.

Arguments

  • nDim: The number of dimensions of the topological object.
  • T: The type of the elements in the topological object.
source
JustRelax.cart2indMethod
cart2ind(A)

Return the linear index of a n-dimensional array corresponding to the cartesian indices I

source
JustRelax.elementMethod
element(A, element_indices..., cell_indices...)

Return a the element with element_indices of the Cell with cell_indices of the CellArray A.

Arguments

  • element_indices::Int|NTuple{N,Int}: the element_indices that designate the field in accordance with A's cell type.
  • cell_indices::Int|NTuple{N,Int}: the cell_indices that designate the cell in accordance with A's cell type.
source
JustRelax.setelement!Method
setelement!(A, x, element_indices..., cell_indices...)

Store the given value x at the given element with element_indices of the cell with the indices cell_indices

Arguments

  • x::Number: value to be stored in the index element_indices of the cell with cell_indices.
  • element_indices::Int|NTuple{N,Int}: the element_indices that designate the field in accordance with A's cell type.
  • cell_indices::Int|NTuple{N,Int}: the cell_indices that designate the cell in accordance with A's cell type.
source
JustRelax.velocity_gridsMethod
velocity_grids(xci, xvi, di::NTuple{N,T}) where {N,T}

Compute the velocity grids for N dimensionional problems.

Arguments

  • xci: The x-coordinate of the cell centers.
  • xvi: The x-coordinate of the cell vertices.
  • di: A tuple containing the cell dimensions.
source
JustRelax.JustRelax2D.WENO5Type
WENO5{T, N, A, M} <: AbstractWENO

The WENO5 is a structure representing the Weighted Essentially Non-Oscillatory (WENO) scheme of order 5 for the solution of hyperbolic partial differential equations.

Fields

  • d0L, d1L, d2L: Upwind constants.
  • d0R, d1R, d2R: Downwind constants.
  • c1, c2: Constants for betas.
  • sc1, sc2, sc3, sc4, sc5: Stencil weights.
  • ϵ: Tolerance.
  • ni: Grid size.
  • ut: Intermediate buffer array.
  • fL, fR, fB, fT: Fluxes.
  • method: Method (1:JS, 2:Z).

Description

The WENO5 structure contains the parameters and temporary variables used in the WENO scheme. These include the upwind and downwind constants, the constants for betas, the stencil candidate weights, the tolerance, the grid size, the fluxes, and the method.

source
JustRelax.JustRelax2D.WENO_advection!Method
WENO_advection!(u, Vxi, weno, di, ni, dt)

Perform the advection step of the Weighted Essentially Non-Oscillatory (WENO) scheme for the solution of hyperbolic partial differential equations.

Arguments

  • u: field to be advected.
  • Vxi: velocity field.
  • weno: structure containing the WENO scheme parameters and temporary variables.
  • di: grid spacing.
  • ni: number of grid points.
  • dt: time step.

Description

The function first calculates the fluxes using the WENO scheme. Then it performs three steps of the WENO scheme. Each step involves calculating the right-hand side of the WENO equation and updating the solution u. The updating of the solution u is done using different combinations of the original solution and the temporary solution weno.ut.

source
JustRelax.JustRelax2D._heatdiffusion_PT!Method
heatdiffusion_PT!(thermal, pt_thermal, K, ρCp, dt, di; iterMax, nout, verbose)

Heat diffusion solver using Pseudo-Transient iterations. Both K and ρCp are n-dimensional arrays.

source
JustRelax.JustRelax2D.allzeroMethod
allzero(x::Vararg{T,N}) where {T,N}

Check if all elements in x are zero.

Arguments

  • x::Vararg{T,N}: The input array.

Returns

  • Bool: true if all elements in x are zero, false otherwise.
source
JustRelax.JustRelax2D.assign!Method
assign!(B::AbstractArray{T,N}, A::AbstractArray{T,N}) where {T,N}

Assigns the values of array A to array B in parallel.

Arguments

  • B::AbstractArray{T,N}: The destination array.
  • A::AbstractArray{T,N}: The source array.
source
JustRelax.JustRelax2D.compute_P!Method

computeP!(P, P0, RP, ∇V, ΔTc, η, rheology::NTuple{N,MaterialParams}, phaseratio::C, dt, r, θ_dτ)

Compute the pressure field P and the residual RP for the compressible case. This function introduces thermal stresses after the implementation of Kiss et al. (2023). The temperature difference ΔTc on the cell center is used to compute this as well as α as the thermal expansivity.

source
JustRelax.JustRelax2D.compute_buoyancyMethod
compute_buoyancy(rheology, args, phase_ratios)

Compute the buoyancy forces based on the given rheology, arguments, and phase ratios.

Arguments

  • rheology: The rheology used to compute the buoyancy forces.
  • args: Additional arguments required by the rheology.
  • phase_ratios: The ratios of the different phases.
source
JustRelax.JustRelax2D.compute_buoyancyMethod
compute_buoyancy(rheology, args)

Compute the buoyancy forces based on the given rheology and arguments.

Arguments

  • rheology: The rheology used to compute the buoyancy forces.
  • args: Additional arguments required for the computation.
source
JustRelax.JustRelax2D.compute_buoyancyMethod
compute_buoyancy(rheology::MaterialParams, args, phase_ratios)

Compute the buoyancy forces for a given set of material parameters, arguments, and phase ratios.

Arguments

  • rheology: The material parameters.
  • args: The arguments.
  • phase_ratios: The phase ratios.
source
JustRelax.JustRelax2D.compute_buoyancyMethod
compute_buoyancy(rheology::MaterialParams, args)

Compute the buoyancy forces based on the given rheology parameters and arguments.

Arguments

  • rheology::MaterialParams: The material parameters for the rheology.
  • args: The arguments for the computation.
source
JustRelax.JustRelax2D.compute_ρg!Method
compute_ρg!(ρg, phase_ratios, rheology, args)

Calculate the buoyance forces ρg for the given GeoParams.jl rheology object and correspondent arguments args. The phase_ratios are used to compute the density of the composite rheology.

source
JustRelax.JustRelax2D.fn_ratioMethod
fn_ratio(fn::F, rheology::NTuple{N, AbstractMaterialParamsStruct}, ratio) where {N, F}

Average the function fn over the material phases in rheology using the phase ratios ratio.

source
JustRelax.JustRelax2D.interp_Vx_on_Vy!Method
interp_Vx_on_Vy!(Vx_on_Vy, Vx)

Interpolates the values of Vx onto the grid points of Vy.

Arguments

  • Vx_on_Vy::AbstractArray: Vx at Vy grid points.
  • Vx::AbstractArray: Vx at its staggered grid points.
source
JustRelax.JustRelax2D.tensor_invariant!Method
tensor_invariant!(A::JustRelax.SymmetricTensor)

Compute the tensor invariant of the given symmetric tensor A.

Arguments

  • A::JustRelax.SymmetricTensor: The input symmetric tensor.
source
JustRelax.JustRelax2D.velocity2vertex!Method
velocity2vertex!(Vx_v, Vy_v, Vz_v, Vx, Vy, Vz)

In-place interpolation of the velocity field Vx, Vy, Vz from a staggered grid with ghost nodes onto the pre-allocated Vx_d, Vy_d, Vz_d 3D arrays located at the grid vertices.

source
JustRelax.JustRelax2D.@normalMacro
@normal(A)

Unpacks the normal components of the symmetric tensor A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax2D.@plastic_strainMacro
@plastic_strain(A)

Unpacks the plastic strain rate tensor ε_pl from the StokesArrays A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax2D.@shearMacro
@shear(A)

Unpacks the shear components of the symmetric tensor A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax2D.@strainMacro
@strain(A)

Unpacks the strain rate tensor ε from the StokesArrays A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax2D.@strain_centerMacro
@strain_center(A)

Unpacks the strain rate tensor ε from the StokesArrays A, where its components are defined in the center of the grid cells. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax2D.@stressMacro
@stress(A)

Unpacks the deviatoric stress tensor τ from the StokesArrays A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax2D.@stress_centerMacro
@stress_center(A)

Unpacks the deviatoric stress tensor τ from the StokesArrays A, where its components are defined in the center of the grid cells. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax2D.@tensorMacro
@tensor(A)

Unpacks the symmetric tensor A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax2D.@tensor_centerMacro
@tensor_center(A)

Unpacks the symmetric tensor A, where its components are defined in the center of the grid cells. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.WENO5Type
WENO5{T, N, A, M} <: AbstractWENO

The WENO5 is a structure representing the Weighted Essentially Non-Oscillatory (WENO) scheme of order 5 for the solution of hyperbolic partial differential equations.

Fields

  • d0L, d1L, d2L: Upwind constants.
  • d0R, d1R, d2R: Downwind constants.
  • c1, c2: Constants for betas.
  • sc1, sc2, sc3, sc4, sc5: Stencil weights.
  • ϵ: Tolerance.
  • ni: Grid size.
  • ut: Intermediate buffer array.
  • fL, fR, fB, fT: Fluxes.
  • method: Method (1:JS, 2:Z).

Description

The WENO5 structure contains the parameters and temporary variables used in the WENO scheme. These include the upwind and downwind constants, the constants for betas, the stencil candidate weights, the tolerance, the grid size, the fluxes, and the method.

source
JustRelax.JustRelax3D.WENO_advection!Method
WENO_advection!(u, Vxi, weno, di, ni, dt)

Perform the advection step of the Weighted Essentially Non-Oscillatory (WENO) scheme for the solution of hyperbolic partial differential equations.

Arguments

  • u: field to be advected.
  • Vxi: velocity field.
  • weno: structure containing the WENO scheme parameters and temporary variables.
  • di: grid spacing.
  • ni: number of grid points.
  • dt: time step.

Description

The function first calculates the fluxes using the WENO scheme. Then it performs three steps of the WENO scheme. Each step involves calculating the right-hand side of the WENO equation and updating the solution u. The updating of the solution u is done using different combinations of the original solution and the temporary solution weno.ut.

source
JustRelax.JustRelax3D._heatdiffusion_PT!Method
heatdiffusion_PT!(thermal, pt_thermal, K, ρCp, dt, di; iterMax, nout, verbose)

Heat diffusion solver using Pseudo-Transient iterations. Both K and ρCp are n-dimensional arrays.

source
JustRelax.JustRelax3D.allzeroMethod
allzero(x::Vararg{T,N}) where {T,N}

Check if all elements in x are zero.

Arguments

  • x::Vararg{T,N}: The input array.

Returns

  • Bool: true if all elements in x are zero, false otherwise.
source
JustRelax.JustRelax3D.assign!Method
assign!(B::AbstractArray{T,N}, A::AbstractArray{T,N}) where {T,N}

Assigns the values of array A to array B in parallel.

Arguments

  • B::AbstractArray{T,N}: The destination array.
  • A::AbstractArray{T,N}: The source array.
source
JustRelax.JustRelax3D.compute_P!Method

computeP!(P, P0, RP, ∇V, ΔTc, η, rheology::NTuple{N,MaterialParams}, phaseratio::C, dt, r, θ_dτ)

Compute the pressure field P and the residual RP for the compressible case. This function introduces thermal stresses after the implementation of Kiss et al. (2023). The temperature difference ΔTc on the cell center is used to compute this as well as α as the thermal expansivity.

source
JustRelax.JustRelax3D.compute_buoyancyMethod
compute_buoyancy(rheology, args, phase_ratios)

Compute the buoyancy forces based on the given rheology, arguments, and phase ratios.

Arguments

  • rheology: The rheology used to compute the buoyancy forces.
  • args: Additional arguments required by the rheology.
  • phase_ratios: The ratios of the different phases.
source
JustRelax.JustRelax3D.compute_buoyancyMethod
compute_buoyancy(rheology, args)

Compute the buoyancy forces based on the given rheology and arguments.

Arguments

  • rheology: The rheology used to compute the buoyancy forces.
  • args: Additional arguments required for the computation.
source
JustRelax.JustRelax3D.compute_buoyancyMethod
compute_buoyancy(rheology::MaterialParams, args, phase_ratios)

Compute the buoyancy forces for a given set of material parameters, arguments, and phase ratios.

Arguments

  • rheology: The material parameters.
  • args: The arguments.
  • phase_ratios: The phase ratios.
source
JustRelax.JustRelax3D.compute_buoyancyMethod
compute_buoyancy(rheology::MaterialParams, args)

Compute the buoyancy forces based on the given rheology parameters and arguments.

Arguments

  • rheology::MaterialParams: The material parameters for the rheology.
  • args: The arguments for the computation.
source
JustRelax.JustRelax3D.compute_ρg!Method
compute_ρg!(ρg, phase_ratios, rheology, args)

Calculate the buoyance forces ρg for the given GeoParams.jl rheology object and correspondent arguments args. The phase_ratios are used to compute the density of the composite rheology.

source
JustRelax.JustRelax3D.fn_ratioMethod
fn_ratio(fn::F, rheology::NTuple{N, AbstractMaterialParamsStruct}, ratio) where {N, F}

Average the function fn over the material phases in rheology using the phase ratios ratio.

source
JustRelax.JustRelax3D.interp_Vx_on_Vy!Method
interp_Vx_on_Vy!(Vx_on_Vy, Vx)

Interpolates the values of Vx onto the grid points of Vy.

Arguments

  • Vx_on_Vy::AbstractArray: Vx at Vy grid points.
  • Vx::AbstractArray: Vx at its staggered grid points.
source
JustRelax.JustRelax3D.tensor_invariant!Method
tensor_invariant!(A::JustRelax.SymmetricTensor)

Compute the tensor invariant of the given symmetric tensor A.

Arguments

  • A::JustRelax.SymmetricTensor: The input symmetric tensor.
source
JustRelax.JustRelax3D.velocity2vertex!Method
velocity2vertex!(Vx_v, Vy_v, Vz_v, Vx, Vy, Vz)

In-place interpolation of the velocity field Vx, Vy, Vz from a staggered grid with ghost nodes onto the pre-allocated Vx_d, Vy_d, Vz_d 3D arrays located at the grid vertices.

source
JustRelax.JustRelax3D.@normalMacro
@normal(A)

Unpacks the normal components of the symmetric tensor A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.@plastic_strainMacro
@plastic_strain(A)

Unpacks the plastic strain rate tensor ε_pl from the StokesArrays A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.@shearMacro
@shear(A)

Unpacks the shear components of the symmetric tensor A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.@strainMacro
@strain(A)

Unpacks the strain rate tensor ε from the StokesArrays A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.@strain_centerMacro
@strain_center(A)

Unpacks the strain rate tensor ε from the StokesArrays A, where its components are defined in the center of the grid cells. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.@stressMacro
@stress(A)

Unpacks the deviatoric stress tensor τ from the StokesArrays A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.@stress_centerMacro
@stress_center(A)

Unpacks the deviatoric stress tensor τ from the StokesArrays A, where its components are defined in the center of the grid cells. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.@tensorMacro
@tensor(A)

Unpacks the symmetric tensor A, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.

source
JustRelax.JustRelax3D.@tensor_centerMacro
@tensor_center(A)

Unpacks the symmetric tensor A, where its components are defined in the center of the grid cells. Shear components are unpack following Voigt's notation.

source
JustRelax.DataIO.checkpoint_nameMethod
checkpointing_jld2(dst, stokes, thermal, time, timestep, igg)

Save necessary data in dst as a jld2 file to restart the model from the state at time. If run in parallel, the file will be named after the corresponidng rank e.g. checkpoint0000.jld2 and thus can be loaded by the processor while restarting the simulation. If you want to restart your simulation from the checkpoint you can use load() and specify the MPI rank by providing a dollar sign and the rank number.

Example

```julia
checkpointing_jld2(
    "path/to/dst",
    stokes,
    thermal,
    t,
    igg,
)

```
source
JustRelax.DataIO.load_checkpoint_hdf5Method
load_checkpoint_hdf5(file_path)

Load the state of the simulation from an .h5 file.

Arguments

  • file_path: The path to the .h5 file.

Returns

  • P: The loaded state of the pressure variable.
  • T: The loaded state of the temperature variable.
  • Vx: The loaded state of the x-component of the velocity variable.
  • Vy: The loaded state of the y-component of the velocity variable.
  • Vz: The loaded state of the z-component of the velocity variable.
  • η: The loaded state of the viscosity variable.
  • t: The loaded simulation time.
  • dt: The loaded simulation time.

Example

```julia

Define the path to the .h5 file

file_path = "path/to/your/file.h5"

Use the load_checkpoint function to load the variables from the file

P, T, Vx, Vy, Vz, η, t, dt = load_checkpoint(file_path)`

source
JustRelax.DataIO.load_checkpoint_jld2Method
load_checkpoint_jld2(file_path)

Load the state of the simulation from a .jld2 file.

Arguments

  • file_path: The path to the .jld2 file.

Returns

  • stokes: The loaded state of the stokes variable.
  • thermal: The loaded state of the thermal variable.
  • time: The loaded simulation time.
  • timestep: The loaded time step.
source