List of all functions
Here an overview of all functions:
JustRelax.Geometry Type
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.
JustRelax.velocity_grids Method
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.
JustRelax.JustRelax2D.StokesArrays Method
StokesArrays(ni::NTuple{N,Integer}) where {N}
Create the Stokes arrays object in 2D or 3D.
Fields
P
: Pressure fieldP0
: Previous pressure field∇V
: Velocity gradientV
: Velocity fieldsQ
: 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 tensorsEII_pl
: Second invariant of the accumulated plastic strainviscosity
: Viscosity fieldsR
: Residual fieldsΔε
: Strain increment tensor∇U
: Displacement gradient
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
.
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.
JustRelax.JustRelax2D._heatdiffusion_PT! Method
heatdiffusion_PT!(thermal, pt_thermal, rheology, dt, di; iterMax, nout, verbose)
Heat diffusion solver using Pseudo-Transient iterations.
sourceJustRelax.JustRelax2D.allzero Method
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 inx
are zero,false
otherwise.
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.
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 fieldRP
: residual field∇V
: divergence of the velocity fieldQ
: volumetric source/sink term which should have the properties ofdV/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 fieldrheology
: material parametersphase_ratio
: phase field
JustRelax.JustRelax2D.compute_buoyancy Method
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.
JustRelax.JustRelax2D.compute_buoyancy Method
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.
JustRelax.JustRelax2D.compute_buoyancy Method
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.
JustRelax.JustRelax2D.compute_buoyancy Method
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.
JustRelax.JustRelax2D.compute_dt Method
compute_dt(S::JustRelax.StokesArrays, args...)
Compute the time step dt
for the simulation.
JustRelax.JustRelax2D.compute_maxloc! Method
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
.
JustRelax.JustRelax2D.compute_ρg! Method
compute_ρg!(ρg, rheology, args)
Calculate the buoyance forces ρg
for the given GeoParams.jl rheology
object and correspondent arguments args
.
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.
JustRelax.JustRelax2D.continuation_log Method
continuation_log(x_new, x_old, ν)
Do a continuation step exp((1-ν)*log(x_old) + ν*log(x_new))
with damping parameter ν
JustRelax.JustRelax2D.flow_bcs! Method
flow_bcs!(stokes, bcs::VelocityBoundaryConditions)
Apply the prescribed flow boundary conditions bc
on the stokes
JustRelax.JustRelax2D.flow_bcs! Method
flow_bcs!(stokes, bcs::DisplacementBoundaryConditions)
Apply the prescribed flow boundary conditions bc
on the stokes
JustRelax.JustRelax2D.fn_ratio Method
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
.
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
atVy
grid points.Vx::AbstractArray
:Vx
at its staggered grid points.
JustRelax.JustRelax2D.isvalid_c Method
isvalid_c(ϕ::JustRelax.RockRatio, inds...)
Check if ϕ.center[inds...]
is a not a nullspace.
Arguments
ϕ::JustRelax.RockRatio
: TheRockRatio
object to check against.inds
: Cartesian indices to check.
JustRelax.JustRelax2D.isvalid_v Method
isvalid_v(ϕ::JustRelax.RockRatio, inds...)
Check if ϕ.vertex[inds...]
is a not a nullspace.
Arguments
ϕ::JustRelax.RockRatio
: TheRockRatio
object to check against.inds
: Cartesian indices to check.
JustRelax.JustRelax2D.isvalid_vx Method
isvalid_vx(ϕ::JustRelax.RockRatio, inds...)
Check if ϕ.Vx[inds...]
is a not a nullspace.
Arguments
ϕ::JustRelax.RockRatio
: TheRockRatio
object to check against.inds
: Cartesian indices to check.
JustRelax.JustRelax2D.isvalid_vz Method
isvalid_vz(ϕ::JustRelax.RockRatio, inds...)
Check if ϕ.Vz[inds...]
is a not a nullspace.
Arguments
ϕ::JustRelax.RockRatio
: TheRockRatio
object to check against.inds
: Cartesian indices to check.
JustRelax.JustRelax2D.take Method
take(fldr::String)
Create folder fldr
if it does not exist.
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.
JustRelax.JustRelax2D.thermal_bcs! Method
thermal_bcs!(T, bcs::TemperatureBoundaryConditions)
Apply the prescribed heat boundary conditions bc
on the T
JustRelax.JustRelax2D.update_rock_ratio! Method
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.
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.
JustRelax.JustRelax2D.velocity2vertex Method
velocity2vertex(Vx, Vy, Vz)
Interpolate the velocity field Vx
, Vy
, Vz
from a staggered grid with ghost nodes onto the grid vertices.
JustRelax.JustRelax2D.@copy Macro
copy(B, A)
convenience macro to copy data from the array A
into array B
JustRelax.JustRelax2D.@displacement Macro
@displacement(U)
Unpacks the displacement arrays U
from the StokesArrays A
.
JustRelax.JustRelax2D.@idx Macro
@idx(args...)
Make a linear range from 1
to args[i]
, with i ∈ [1, ..., n]
JustRelax.JustRelax2D.@normal Macro
@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.
JustRelax.JustRelax2D.@plastic_strain Macro
@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.
JustRelax.JustRelax2D.@qT Macro
@qT(V)
Unpacks the flux arrays qT_i
from the ThermalArrays A
.
JustRelax.JustRelax2D.@qT2 Macro
@qT2(V)
Unpacks the flux arrays qT2_i
from the ThermalArrays A
.
JustRelax.JustRelax2D.@residuals Macro
@residuals(A)
Unpacks the momentum residuals from A
.
JustRelax.JustRelax2D.@shear Macro
@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.
JustRelax.JustRelax2D.@strain Macro
@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.
JustRelax.JustRelax2D.@strain_center Macro
@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.
JustRelax.JustRelax2D.@strain_increment Macro
@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.
JustRelax.JustRelax2D.@stress Macro
@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.
JustRelax.JustRelax2D.@stress_center Macro
@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.
JustRelax.JustRelax2D.@tensor Macro
@tensor(A)
Unpacks the symmetric tensor A
, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.
JustRelax.JustRelax2D.@tensor_center Macro
@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.
JustRelax.JustRelax2D.@velocity Macro
@velocity(V)
Unpacks the velocity arrays V
from the StokesArrays A
.
JustRelax.JustRelax3D.StokesArrays Method
StokesArrays(ni::NTuple{N,Integer}) where {N}
Create the Stokes arrays object in 2D or 3D.
Fields
P
: Pressure fieldP0
: Previous pressure field∇V
: Velocity gradientV
: Velocity fieldsQ
: 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 tensorsEII_pl
: Second invariant of the accumulated plastic strainviscosity
: Viscosity fieldsR
: Residual fieldsΔε
: Strain increment tensor∇U
: Displacement gradient
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
.
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.
JustRelax.JustRelax3D._heatdiffusion_PT! Method
heatdiffusion_PT!(thermal, pt_thermal, rheology, dt, di; iterMax, nout, verbose)
Heat diffusion solver using Pseudo-Transient iterations.
sourceJustRelax.JustRelax3D.allzero Method
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 inx
are zero,false
otherwise.
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.
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 fieldRP
: residual field∇V
: divergence of the velocity fieldQ
: volumetric source/sink term which should have the properties ofdV/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 fieldrheology
: material parametersphase_ratio
: phase field
JustRelax.JustRelax3D.compute_buoyancy Method
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.
JustRelax.JustRelax3D.compute_buoyancy Method
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.
JustRelax.JustRelax3D.compute_buoyancy Method
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.
JustRelax.JustRelax3D.compute_buoyancy Method
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.
JustRelax.JustRelax3D.compute_dt Method
compute_dt(S::JustRelax.StokesArrays, args...)
Compute the time step dt
for the simulation.
JustRelax.JustRelax3D.compute_maxloc! Method
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
.
JustRelax.JustRelax3D.compute_ρg! Method
compute_ρg!(ρg, rheology, args)
Calculate the buoyance forces ρg
for the given GeoParams.jl rheology
object and correspondent arguments args
.
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.
JustRelax.JustRelax3D.continuation_log Method
continuation_log(x_new, x_old, ν)
Do a continuation step exp((1-ν)*log(x_old) + ν*log(x_new))
with damping parameter ν
JustRelax.JustRelax3D.flow_bcs! Method
flow_bcs!(stokes, bcs::VelocityBoundaryConditions)
Apply the prescribed flow boundary conditions bc
on the stokes
JustRelax.JustRelax3D.flow_bcs! Method
flow_bcs!(stokes, bcs::DisplacementBoundaryConditions)
Apply the prescribed flow boundary conditions bc
on the stokes
JustRelax.JustRelax3D.fn_ratio Method
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
.
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
atVy
grid points.Vx::AbstractArray
:Vx
at its staggered grid points.
JustRelax.JustRelax3D.isvalid_c Method
isvalid_c(ϕ::JustRelax.RockRatio, inds...)
Check if ϕ.center[inds...]
is a not a nullspace.
Arguments
ϕ::JustRelax.RockRatio
: TheRockRatio
object to check against.inds
: Cartesian indices to check.
JustRelax.JustRelax3D.isvalid_v Method
isvalid_v(ϕ::JustRelax.RockRatio, inds...)
Check if ϕ.vertex[inds...]
is a not a nullspace.
Arguments
ϕ::JustRelax.RockRatio
: TheRockRatio
object to check against.inds
: Cartesian indices to check.
JustRelax.JustRelax3D.isvalid_vx Method
isvalid_vx(ϕ::JustRelax.RockRatio, inds...)
Check if ϕ.Vx[inds...]
is a not a nullspace.
Arguments
ϕ::JustRelax.RockRatio
: TheRockRatio
object to check against.inds
: Cartesian indices to check.
JustRelax.JustRelax3D.isvalid_vz Method
isvalid_vz(ϕ::JustRelax.RockRatio, inds...)
Check if ϕ.Vz[inds...]
is a not a nullspace.
Arguments
ϕ::JustRelax.RockRatio
: TheRockRatio
object to check against.inds
: Cartesian indices to check.
JustRelax.JustRelax3D.take Method
take(fldr::String)
Create folder fldr
if it does not exist.
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.
JustRelax.JustRelax3D.thermal_bcs! Method
thermal_bcs!(T, bcs::TemperatureBoundaryConditions)
Apply the prescribed heat boundary conditions bc
on the T
JustRelax.JustRelax3D.update_rock_ratio! Method
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.
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.
JustRelax.JustRelax3D.velocity2vertex Method
velocity2vertex(Vx, Vy, Vz)
Interpolate the velocity field Vx
, Vy
, Vz
from a staggered grid with ghost nodes onto the grid vertices.
JustRelax.JustRelax3D.@copy Macro
copy(B, A)
convenience macro to copy data from the array A
into array B
JustRelax.JustRelax3D.@displacement Macro
@displacement(U)
Unpacks the displacement arrays U
from the StokesArrays A
.
JustRelax.JustRelax3D.@idx Macro
@idx(args...)
Make a linear range from 1
to args[i]
, with i ∈ [1, ..., n]
JustRelax.JustRelax3D.@normal Macro
@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.
JustRelax.JustRelax3D.@plastic_strain Macro
@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.
JustRelax.JustRelax3D.@qT Macro
@qT(V)
Unpacks the flux arrays qT_i
from the ThermalArrays A
.
JustRelax.JustRelax3D.@qT2 Macro
@qT2(V)
Unpacks the flux arrays qT2_i
from the ThermalArrays A
.
JustRelax.JustRelax3D.@residuals Macro
@residuals(A)
Unpacks the momentum residuals from A
.
JustRelax.JustRelax3D.@shear Macro
@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.
JustRelax.JustRelax3D.@strain Macro
@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.
JustRelax.JustRelax3D.@strain_center Macro
@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.
JustRelax.JustRelax3D.@strain_increment Macro
@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.
JustRelax.JustRelax3D.@stress Macro
@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.
JustRelax.JustRelax3D.@stress_center Macro
@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.
JustRelax.JustRelax3D.@tensor Macro
@tensor(A)
Unpacks the symmetric tensor A
, where its components are defined in the staggered grid. Shear components are unpack following Voigt's notation.
JustRelax.JustRelax3D.@tensor_center Macro
@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.
JustRelax.JustRelax3D.@velocity Macro
@velocity(V)
Unpacks the velocity arrays V
from the StokesArrays A
.
JustRelax.DataIO.checkpoint_name Method
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,
)
```
JustRelax.DataIO.checkpointing_hdf5 Method
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
JustRelax.DataIO.load_checkpoint_hdf5 Method
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
**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.
JustRelax.DataIO.metadata Method
metadata(src, dst, files...)
Copy files...
, Manifest.toml, and Project.toml from src
to dst
JustRelax.DataIO.save_hdf5 Method
function save_hdf5(dst, fname, data)
Save data
as the fname.h5
HDF5 file in the folder dst
JustRelax.DataIO.save_hdf5 Method
function save_hdf5(fname, data)
Save data
as the fname.h5
HDF5 file
JustRelax.DataIO.save_marker_chain Method
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.
JustRelax.DataIO.save_particles Method
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, whereB
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").
JustRelax.DataIO.save_particles Method
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, whereB
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").