Skip to content

List of all functions

Here an overview of all functions:

JustRelax.Geometry Type
julia
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.velocity_grids Method
julia
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.StokesArrays Method
julia
StokesArrays(ni::NTuple{N,Integer}) where {N}

Create the Stokes arrays object in 2D or 3D.

Fields

  • P: Pressure field

  • P0: Previous pressure field

  • ∇V: Velocity gradient

  • V: Velocity fields

  • Q: Volumetric source/sink term e.g. ΔV/V_tot [m³/m³]

  • U: Displacement fields

  • ω: Vorticity field

  • τ: Stress tensors

  • τ_o: Old stress tensors

  • ε: Strain rate tensors

  • ε_pl: Plastic strain rate tensors

  • EII_pl: Second invariant of the accumulated plastic strain

  • viscosity: Viscosity fields

  • R: Residual fields

  • Δε: Strain increment tensor

  • ∇U: Displacement gradient

source
JustRelax.JustRelax2D.WENO_advection! Method
julia
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
julia
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._heatdiffusion_PT! Method
julia
heatdiffusion_PT!(thermal, pt_thermal, rheology, dt, di; iterMax, nout, verbose)

Heat diffusion solver using Pseudo-Transient iterations.

source
JustRelax.JustRelax2D.allzero Method
julia
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
julia
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

compute_P!(P, P0, RP, ∇V, Q, ΔTc, η, rheology::NTuple{N,MaterialParams}, phase_ratio::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).

Arguments

  • P: pressure field

  • RP: residual field

  • ∇V: divergence of the velocity field

  • Q: volumetric source/sink term which should have the properties of dV/V_tot [m³/m³] normalized per cell, default is zero.

  • ΔTc: temperature difference on the cell center, to account for thermal stresses. The thermal expansivity α is computed from the material parameters.

  • η: viscosity field

  • rheology: material parameters

  • phase_ratio: phase field

source
JustRelax.JustRelax2D.compute_buoyancy Method
julia
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_buoyancy Method
julia
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_buoyancy Method
julia
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_buoyancy Method
julia
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_dt Method
julia
compute_dt(S::JustRelax.StokesArrays, args...)

Compute the time step dt for the simulation.

source
JustRelax.JustRelax2D.compute_maxloc! Method
julia
maxloc!(B, A; window)

Compute the maximum value of A in the window = (width_x, width_y, width_z) and store the result in B.

source
JustRelax.JustRelax2D.compute_ρg! Method
julia
compute_ρg!(ρg, rheology, args)

Calculate the buoyance forces ρg for the given GeoParams.jl rheology object and correspondent arguments args.

source
JustRelax.JustRelax2D.compute_ρg! Method
julia
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.continuation_log Method
julia
continuation_log(x_new, x_old, ν)

Do a continuation step exp((1-ν)*log(x_old) + ν*log(x_new)) with damping parameter ν

source
JustRelax.JustRelax2D.flow_bcs! Method
julia
flow_bcs!(stokes, bcs::VelocityBoundaryConditions)

Apply the prescribed flow boundary conditions bc on the stokes

source
JustRelax.JustRelax2D.flow_bcs! Method
julia
flow_bcs!(stokes, bcs::DisplacementBoundaryConditions)

Apply the prescribed flow boundary conditions bc on the stokes

source
JustRelax.JustRelax2D.fn_ratio Method
julia
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
julia
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.isvalid_c Method
julia
isvalid_c::JustRelax.RockRatio, inds...)

Check if ϕ.center[inds...] is a not a nullspace.

Arguments

  • ϕ::JustRelax.RockRatio: The RockRatio object to check against.

  • inds: Cartesian indices to check.

source
JustRelax.JustRelax2D.isvalid_v Method
julia
isvalid_v::JustRelax.RockRatio, inds...)

Check if ϕ.vertex[inds...] is a not a nullspace.

Arguments

  • ϕ::JustRelax.RockRatio: The RockRatio object to check against.

  • inds: Cartesian indices to check.

source
JustRelax.JustRelax2D.isvalid_vx Method
julia
isvalid_vx::JustRelax.RockRatio, inds...)

Check if ϕ.Vx[inds...] is a not a nullspace.

Arguments

  • ϕ::JustRelax.RockRatio: The RockRatio object to check against.

  • inds: Cartesian indices to check.

source
JustRelax.JustRelax2D.isvalid_vz Method
julia
isvalid_vz::JustRelax.RockRatio, inds...)

Check if ϕ.Vz[inds...] is a not a nullspace.

Arguments

  • ϕ::JustRelax.RockRatio: The RockRatio object to check against.

  • inds: Cartesian indices to check.

source
JustRelax.JustRelax2D.take Method
julia
take(fldr::String)

Create folder fldr if it does not exist.

source
JustRelax.JustRelax2D.tensor_invariant! Method
julia
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.thermal_bcs! Method
julia
thermal_bcs!(T, bcs::TemperatureBoundaryConditions)

Apply the prescribed heat boundary conditions bc on the T

source
JustRelax.JustRelax2D.update_rock_ratio! Method
julia
update_rock_ratio!::JustRelax.RockRatio, phase_ratios, air_phase)

Update the rock ratio ϕ based on the provided phase_ratios and air_phase.

Arguments

  • ϕ::JustRelax.RockRatio: The rock ratio object to be updated.

  • phase_ratios: The ratios of different phases present.

  • air_phase: The phase representing air.

source
JustRelax.JustRelax2D.velocity2vertex! Method
julia
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.velocity2vertex Method
julia
velocity2vertex(Vx, Vy, Vz)

Interpolate the velocity field Vx, Vy, Vz from a staggered grid with ghost nodes onto the grid vertices.

source
JustRelax.JustRelax2D.@add Macro
julia
@add(I, args...)

Add I to the scalars in args

source
JustRelax.JustRelax2D.@copy Macro
julia
copy(B, A)

convenience macro to copy data from the array A into array B

source
JustRelax.JustRelax2D.@displacement Macro
julia
@displacement(U)

Unpacks the displacement arrays U from the StokesArrays A.

source
JustRelax.JustRelax2D.@idx Macro
julia
@idx(args...)

Make a linear range from 1 to args[i], with i ∈ [1, ..., n]

source
JustRelax.JustRelax2D.@normal Macro
julia
@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_strain Macro
julia
@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.@qT Macro
julia
@qT(V)

Unpacks the flux arrays qT_i from the ThermalArrays A.

source
JustRelax.JustRelax2D.@qT2 Macro
julia
@qT2(V)

Unpacks the flux arrays qT2_i from the ThermalArrays A.

source
JustRelax.JustRelax2D.@residuals Macro
julia
@residuals(A)

Unpacks the momentum residuals from A.

source
JustRelax.JustRelax2D.@shear Macro
julia
@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.@strain Macro
julia
@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_center Macro
julia
@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.@strain_increment Macro
julia
@strain_increment(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.@stress Macro
julia
@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_center Macro
julia
@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.@tensor Macro
julia
@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_center Macro
julia
@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.JustRelax2D.@velocity Macro
julia
@velocity(V)

Unpacks the velocity arrays V from the StokesArrays A.

source
JustRelax.JustRelax3D.StokesArrays Method
julia
StokesArrays(ni::NTuple{N,Integer}) where {N}

Create the Stokes arrays object in 2D or 3D.

Fields

  • P: Pressure field

  • P0: Previous pressure field

  • ∇V: Velocity gradient

  • V: Velocity fields

  • Q: Volumetric source/sink term e.g. ΔV/V_tot [m³/m³]

  • U: Displacement fields

  • ω: Vorticity field

  • τ: Stress tensors

  • τ_o: Old stress tensors

  • ε: Strain rate tensors

  • ε_pl: Plastic strain rate tensors

  • EII_pl: Second invariant of the accumulated plastic strain

  • viscosity: Viscosity fields

  • R: Residual fields

  • Δε: Strain increment tensor

  • ∇U: Displacement gradient

source
JustRelax.JustRelax3D.WENO_advection! Method
julia
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
julia
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._heatdiffusion_PT! Method
julia
heatdiffusion_PT!(thermal, pt_thermal, rheology, dt, di; iterMax, nout, verbose)

Heat diffusion solver using Pseudo-Transient iterations.

source
JustRelax.JustRelax3D.allzero Method
julia
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
julia
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

compute_P!(P, P0, RP, ∇V, Q, ΔTc, η, rheology::NTuple{N,MaterialParams}, phase_ratio::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).

Arguments

  • P: pressure field

  • RP: residual field

  • ∇V: divergence of the velocity field

  • Q: volumetric source/sink term which should have the properties of dV/V_tot [m³/m³] normalized per cell, default is zero.

  • ΔTc: temperature difference on the cell center, to account for thermal stresses. The thermal expansivity α is computed from the material parameters.

  • η: viscosity field

  • rheology: material parameters

  • phase_ratio: phase field

source
JustRelax.JustRelax3D.compute_buoyancy Method
julia
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_buoyancy Method
julia
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_buoyancy Method
julia
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_buoyancy Method
julia
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_dt Method
julia
compute_dt(S::JustRelax.StokesArrays, args...)

Compute the time step dt for the simulation.

source
JustRelax.JustRelax3D.compute_maxloc! Method
julia
maxloc!(B, A; window)

Compute the maximum value of A in the window = (width_x, width_y, width_z) and store the result in B.

source
JustRelax.JustRelax3D.compute_ρg! Method
julia
compute_ρg!(ρg, rheology, args)

Calculate the buoyance forces ρg for the given GeoParams.jl rheology object and correspondent arguments args.

source
JustRelax.JustRelax3D.compute_ρg! Method
julia
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.continuation_log Method
julia
continuation_log(x_new, x_old, ν)

Do a continuation step exp((1-ν)*log(x_old) + ν*log(x_new)) with damping parameter ν

source
JustRelax.JustRelax3D.flow_bcs! Method
julia
flow_bcs!(stokes, bcs::VelocityBoundaryConditions)

Apply the prescribed flow boundary conditions bc on the stokes

source
JustRelax.JustRelax3D.flow_bcs! Method
julia
flow_bcs!(stokes, bcs::DisplacementBoundaryConditions)

Apply the prescribed flow boundary conditions bc on the stokes

source
JustRelax.JustRelax3D.fn_ratio Method
julia
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
julia
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.isvalid_c Method
julia
isvalid_c::JustRelax.RockRatio, inds...)

Check if ϕ.center[inds...] is a not a nullspace.

Arguments

  • ϕ::JustRelax.RockRatio: The RockRatio object to check against.

  • inds: Cartesian indices to check.

source
JustRelax.JustRelax3D.isvalid_v Method
julia
isvalid_v::JustRelax.RockRatio, inds...)

Check if ϕ.vertex[inds...] is a not a nullspace.

Arguments

  • ϕ::JustRelax.RockRatio: The RockRatio object to check against.

  • inds: Cartesian indices to check.

source
JustRelax.JustRelax3D.isvalid_vx Method
julia
isvalid_vx::JustRelax.RockRatio, inds...)

Check if ϕ.Vx[inds...] is a not a nullspace.

Arguments

  • ϕ::JustRelax.RockRatio: The RockRatio object to check against.

  • inds: Cartesian indices to check.

source
JustRelax.JustRelax3D.isvalid_vz Method
julia
isvalid_vz::JustRelax.RockRatio, inds...)

Check if ϕ.Vz[inds...] is a not a nullspace.

Arguments

  • ϕ::JustRelax.RockRatio: The RockRatio object to check against.

  • inds: Cartesian indices to check.

source
JustRelax.JustRelax3D.take Method
julia
take(fldr::String)

Create folder fldr if it does not exist.

source
JustRelax.JustRelax3D.tensor_invariant! Method
julia
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.thermal_bcs! Method
julia
thermal_bcs!(T, bcs::TemperatureBoundaryConditions)

Apply the prescribed heat boundary conditions bc on the T

source
JustRelax.JustRelax3D.update_rock_ratio! Method
julia
update_rock_ratio!::JustRelax.RockRatio, phase_ratios, air_phase)

Update the rock ratio ϕ based on the provided phase_ratios and air_phase.

Arguments

  • ϕ::JustRelax.RockRatio: The rock ratio object to be updated.

  • phase_ratios: The ratios of different phases present.

  • air_phase: The phase representing air.

source
JustRelax.JustRelax3D.velocity2vertex! Method
julia
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.velocity2vertex Method
julia
velocity2vertex(Vx, Vy, Vz)

Interpolate the velocity field Vx, Vy, Vz from a staggered grid with ghost nodes onto the grid vertices.

source
JustRelax.JustRelax3D.@add Macro
julia
@add(I, args...)

Add I to the scalars in args

source
JustRelax.JustRelax3D.@copy Macro
julia
copy(B, A)

convenience macro to copy data from the array A into array B

source
JustRelax.JustRelax3D.@displacement Macro
julia
@displacement(U)

Unpacks the displacement arrays U from the StokesArrays A.

source
JustRelax.JustRelax3D.@idx Macro
julia
@idx(args...)

Make a linear range from 1 to args[i], with i ∈ [1, ..., n]

source
JustRelax.JustRelax3D.@normal Macro
julia
@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_strain Macro
julia
@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.@qT Macro
julia
@qT(V)

Unpacks the flux arrays qT_i from the ThermalArrays A.

source
JustRelax.JustRelax3D.@qT2 Macro
julia
@qT2(V)

Unpacks the flux arrays qT2_i from the ThermalArrays A.

source
JustRelax.JustRelax3D.@residuals Macro
julia
@residuals(A)

Unpacks the momentum residuals from A.

source
JustRelax.JustRelax3D.@shear Macro
julia
@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.@strain Macro
julia
@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_center Macro
julia
@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.@strain_increment Macro
julia
@strain_increment(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.@stress Macro
julia
@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_center Macro
julia
@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.@tensor Macro
julia
@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_center Macro
julia
@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.@velocity Macro
julia
@velocity(V)

Unpacks the velocity arrays V from the StokesArrays A.

source
JustRelax.DataIO.checkpoint_name Method
julia
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.checkpointing_hdf5 Method
julia
checkpointing_hdf5(dst, stokes, T, η, time, timestep)

Save necessary data in dst as and HDF5 file to restart the model from the state at time

source
JustRelax.DataIO.load_checkpoint_hdf5 Method
julia
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)``


<Badge type="info" class="source-link" text="source"><a href="https://github.com/PTsolvers/JustRelax.jl/blob/240cba3e020a993e64c64776140c9cd856ceaa0c/src/IO/H5.jl#L47-L74" target="_blank" rel="noreferrer">source</a></Badge>

</details>

<details class='jldocstring custom-block' open>
<summary><a id='JustRelax.DataIO.load_checkpoint_jld2-Tuple{Any}' href='#JustRelax.DataIO.load_checkpoint_jld2-Tuple{Any}'><span class="jlbinding">JustRelax.DataIO.load_checkpoint_jld2</span></a> <Badge type="info" class="jlObjectType jlMethod" text="Method" /></summary>



```julia
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
JustRelax.DataIO.metadata Method
julia
metadata(src, dst, files...)

Copy files..., Manifest.toml, and Project.toml from src to dst

source
JustRelax.DataIO.save_hdf5 Method
julia
function save_hdf5(dst, fname, data)

Save data as the fname.h5 HDF5 file in the folder dst

source
JustRelax.DataIO.save_hdf5 Method
julia
function save_hdf5(fname, data)

Save data as the fname.h5 HDF5 file

source
JustRelax.DataIO.save_marker_chain Method
julia
save_marker_chain(fname::String, chain::MarkerChain)

Save a vector of points as a line in a VTK file.

Arguments

  • fname::String: The name of the VTK file to save. The extension .vtk will be appended to the name.

  • chain::MarkerChain: Marker chain object from JustPIC.jl.

source
JustRelax.DataIO.save_particles Method
julia
save_particles(particles::Particles{B, 2}, pPhases; conversion = 1e3, fname::String = "./particles") where B

Save particle data and their material phase to a VTK file.

Arguments

  • particles::Particles{B, 2}: The particle data, where B is the type of the particle coordinates.

  • pPhases: The phases of the particles.

  • conversion: A conversion factor for the particle coordinates (default is 1e3).

  • fname::String: The name of the VTK file to save (default is "./particles").

source
JustRelax.DataIO.save_particles Method
julia
save_particles(particles::Particles{B, 2}; conversion = 1e3, fname::String = "./particles") where B

Save particle data to a VTK file.

Arguments

  • particles::Particles{B, 2}: The particle data, where B is the type of the particle coordinates.

  • pPhases: The phases of the particles.

  • conversion: A conversion factor for the particle coordinates (default is 1e3).

  • fname::String: The name of the VTK file to save (default is "./particles").

source