This is the julia interface to LaMEM, which does a number of handy things:
It will automatically download a binary installation of LaMEM, along with the correct version of PETSc and mpiexec for your system. You can also use these binaries directly from your terminal, so you are not limited to julia. Gone are the days where you had to first spend hours or days to install PETSc on your system!
We provide a simple function to run LaMEM from julia (also in parallel).
We provide functions to read timesteps back into julia.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 20 July 2023. Using Julia version 1.8.5.
This is the julia interface to LaMEM, which does a number of handy things:
It will automatically download a binary installation of LaMEM, along with the correct version of PETSc and mpiexec for your system. You can also use these binaries directly from your terminal, so you are not limited to julia. Gone are the days where you had to first spend hours or days to install PETSc on your system!
We provide a simple function to run LaMEM from julia (also in parallel).
We provide functions to read timesteps back into julia.
Settings
This document was generated with Documenter.jl version 0.27.25 on Thursday 20 July 2023. Using Julia version 1.8.5.
Mf::Float64: value for dike/magma- accommodated extension, between 0 and 1, in the front of the box, for phase dike
Mc::Float64: [optional] value for dike/magma- accommodate extension, between 0 and 1, for dike phase; M is linearly interpolated between Mf & Mc and Mc & Mb, if not set, Mc default is set to -1 so it is not used
y_Mc::Union{Nothing, Float64}: [optional], location for Mc, must be between front and back boundaries of dike box, if not set, default value to 0.0, but not used
Mb::Union{Nothing, Float64}: value for dike/magma-accommodated extension, between 0 and 1, in the back of the box, for phase dike
PhaseID::Union{Nothing, Int64}: Phase ID
PhaseTransID::Union{Nothing, Int64}: Phase transition ID
Mf::Float64: value for dike/magma- accommodated extension, between 0 and 1, in the front of the box, for phase dike
Mc::Float64: [optional] value for dike/magma- accommodate extension, between 0 and 1, for dike phase; M is linearly interpolated between Mf & Mc and Mc & Mb, if not set, Mc default is set to -1 so it is not used
y_Mc::Union{Nothing, Float64}: [optional], location for Mc, must be between front and back boundaries of dike box, if not set, default value to 0.0, but not used
Mb::Union{Nothing, Float64}: value for dike/magma-accommodated extension, between 0 and 1, in the back of the box, for phase dike
PhaseID::Union{Nothing, Int64}: Phase ID
PhaseTransID::Union{Nothing, Int64}: Phase transition ID
Structure that contains the LaMEM Model Setup and Advection options
msetup::String: Setup type - can be geom (phases are assigned from geometric primitives), files (from julia input), polygons (from geomIO input, which requires poly_file to be specified)
rand_noise::Int64: add random noise to the particle location
rand_noiseGP::Int64: random noise flag, subsequently applied to geometric primitives
bg_phase::Int64: background phase ID
save_mark::Int64: save marker to disk flag
mark_load_file::String: marker input file (extension is .xxxxxxxx.dat), if using msetup=files
mark_save_file::String: marker output file (extension is .xxxxxxxx.dat)
poly_file::String: polygon geometry file (redundant), if using msetup=polygons
temp_file::String: initial temperature file (redundant), if not set on markers
advect::String: advection scheme; options=none (no advection); basic (Euler classical implementation [default]); Euler (Euler explicit in time); rk2 (Runge-Kutta 2nd order in space)
interp::String: velocity interpolation scheme; options = stag (trilinear interpolation from FDSTAG points), minmod ( MINMOD interpolation to nodes, trilinear interpolation to markers + correction), stagp ( STAG_P empirical approach by T. Gerya)
mark_ctrl::String: marker control type; options are subgrid (default; marker control enforced over fine scale grid), none (none), basic (AVD for cells + corner insertion), and avd (pure AVD for all control volumes)
nmark_lim::Vector{Int64}: min/max number per cell (marker control)
BoxVicinity::Union{Nothing, Int64}: 1: only check particles in the vicinity of the box boundaries (2: in all directions)
Parameter_transition::String: [T = Temperature, P = Pressure, Depth = z-coord, X=x-coord, Y=y-coord, APS = accumulated plastic strain, MeltFraction, t = time] parameter that triggers the phase transition
ConstantValue::Union{Nothing, Float64}: Value of the parameter [unit of T,P,z, APS]
number_phases::Union{Nothing, Int64}: The number of involved phases [default=1]
PhaseAbove::Union{Nothing, Vector{Int64}}: Above the chosen value the phase is 1, below it, the value is PhaseBelow
PhaseBelow::Union{Nothing, Vector{Int64}}
PhaseInside::Union{Nothing, Vector{Int64}}: Phase within the box [use -1 if you don't want to change the phase inside the box]
PhaseOutside::Union{Nothing, Vector{Int64}}: Phase outside the box [use -1 if you don't want to change the phase outside the box. If combined with OutsideToInside, all phases that come in are set to PhaseInside]
PhaseDirection::String: [BothWays=default; BelowToAbove; AboveToBelow] Direction in which transition works
ResetParam::String: [APS] Parameter to reset on particles below PT or within box
PTBox_TempType::String: # Temperature condition witin the box [none, constant, linear, halfspace]
PTBox_topTemp::Union{Nothing, Float64}: Temp @ top of box [for linear & halfspace]
PTBox_botTemp::Union{Nothing, Float64}: Temp @ bottom of box [for linear & halfspace]
PTBox_thermalAge::Union{Nothing, Float64}: Thermal age, usually in geo-units [Myrs] [only in case of halfspace]
PTBox_cstTemp::Union{Nothing, Float64}: Temp within box [only for constant T]
v_box::Union{Nothing, Float64}: [optional] only for NotInAirBox, velocity with which box moves in cm/yr
t0_box::Union{Nothing, Float64}: [optional] beginning time of movemen in Myr
t1_box::Union{Nothing, Float64}: [optional] end time of movement in Myr
Adiabatic_Heat::Float64: Adiabatic Heating activation flag and efficiency. 0.0 - 1.0
act_temp_diff::Int64: temperature diffusion activation flag
act_therm_exp::Int64: thermal expansion activation flag
act_steady_temp::Int64: steady-state temperature initial guess activation flag
steady_temp_t::Float64: time for (quasi-)steady-state temperature initial guess
nstep_steady::Int64: number of steps for (quasi-)steady-state temperature initial guess (default = 1)
act_heat_rech::Int64: recharge heat in anomalous bodies after (quasi-)steady-state temperature initial guess (=2: recharge after every diffusion step of initial guess)
init_lith_pres::Int64: sets initial pressure to be the lithostatic pressure (stabilizes compressible setups in the first steps)
init_guess::Int64: create an initial guess step (using constant viscosity eta_ref before starting the simulation
p_litho_visc::Int64: use lithostatic instead of dynamic pressure for creep laws
p_litho_plast::Int64: use lithostatic pressure for plasticity
p_lim_plast::Int64: limit pressure at first iteration for plasticity
p_shift::Int64: add a constant value [MPa] to the total pressure field, before evaluating plasticity (e.g., when the domain is located @ some depth within the crust)
act_p_shift::Int64: pressure shift activation flag (enforce zero pressure on average in the top cell layer); note: this overwrites p_shift above!
eta_min::Float64: viscosity lower bound [Pas]
eta_max::Float64: viscosity upper limit [Pas]
eta_ref::Float64: Reference viscosity (used for the initial guess) [Pas]
T_ref::Float64: Reference temperature [C]
RUGC::Float64: universal gas constant (you need to change this only for non-dimensional setups)
min_cohes::Float64: cohesion lower bound [Pa]
min_fric::Float64: friction lower bound [degree]
tau_ult::Float64: ultimate yield stress [Pa]
rho_fluid::Float64: fluid density for depth-dependent density model
gw_level_type::String: ground water level type for pore pressure computation (see below)
gw_level::Float64: ground water level at the free surface (if defined)
biot::Float64: Biot pressure parameter
get_permea::Float64: effective permeability computation activation flag
rescal::Float64: stencil rescaling flag (for internal constraints, for example while computing permeability)
mfmax::Float64: maximum melt fraction affecting viscosity reduction
lmaxit::Int64: maximum number of local rheology iterations
lrtol::Float64: local rheology iterations relative tolerance
act_dike::Int64: dike activation flag (additonal term in divergence)
useTk::Int64: switch to use T-dependent conductivity, 0: not active
dikeHeat::Int64: switch to use Behn & Ito heat source in the dike
Compute_velocity_gradient::Int64: compute the velocity gradient tensor 1: active, 0: not active. If active, it automatically activates the output in the .pvd file
SolverType::String: solver employed ["direct" or "multigrid"]
DirectSolver::String: mumps/superlu_dist/pastix/umfpack (requires these external PETSc packages to be installed!)
DirectPenalty::Float64: penalty parameter [employed if we use a direct solver]
MGLevels::Int64: number of MG levels [default=3]
MGSweeps::Int64: number of MG smoothening steps per level [default=10]
MGSmoother::String: type of smoothener used [chebyshev or jacobi]
MGJacobiDamp::Float64: Dampening parameter [only employed for Jacobi smoothener; default=0.6]
MGCoarseSolver::String: coarse grid solver if using multigrid ["direct" / "mumps" / "superlu_dist" or "redundant" - more options specifiable through the command-line options -crs_ksp_type & -crs_pc_type]
MGRedundantNum::Int64: How many times do we copy the coarse grid? [only employed for redundant solver; default is 4]
MGRedundantSolver::String: The coarse grid solver for each of the redundant solves [only employed for redundant; options are "mumps"/"superlu_dist" with default "superlu_dist"]
PETSc_options::Vector{String}: List with (optional) PETSc options
Structure that contains the LaMEM Model Setup and Advection options
msetup::String: Setup type - can be geom (phases are assigned from geometric primitives), files (from julia input), polygons (from geomIO input, which requires poly_file to be specified)
rand_noise::Int64: add random noise to the particle location
rand_noiseGP::Int64: random noise flag, subsequently applied to geometric primitives
bg_phase::Int64: background phase ID
save_mark::Int64: save marker to disk flag
mark_load_file::String: marker input file (extension is .xxxxxxxx.dat), if using msetup=files
mark_save_file::String: marker output file (extension is .xxxxxxxx.dat)
poly_file::String: polygon geometry file (redundant), if using msetup=polygons
temp_file::String: initial temperature file (redundant), if not set on markers
advect::String: advection scheme; options=none (no advection); basic (Euler classical implementation [default]); Euler (Euler explicit in time); rk2 (Runge-Kutta 2nd order in space)
interp::String: velocity interpolation scheme; options = stag (trilinear interpolation from FDSTAG points), minmod ( MINMOD interpolation to nodes, trilinear interpolation to markers + correction), stagp ( STAG_P empirical approach by T. Gerya)
mark_ctrl::String: marker control type; options are subgrid (default; marker control enforced over fine scale grid), none (none), basic (AVD for cells + corner insertion), and avd (pure AVD for all control volumes)
nmark_lim::Vector{Int64}: min/max number per cell (marker control)
BoxVicinity::Union{Nothing, Int64}: 1: only check particles in the vicinity of the box boundaries (2: in all directions)
Parameter_transition::String: [T = Temperature, P = Pressure, Depth = z-coord, X=x-coord, Y=y-coord, APS = accumulated plastic strain, MeltFraction, t = time] parameter that triggers the phase transition
ConstantValue::Union{Nothing, Float64}: Value of the parameter [unit of T,P,z, APS]
number_phases::Union{Nothing, Int64}: The number of involved phases [default=1]
PhaseAbove::Union{Nothing, Vector{Int64}}: Above the chosen value the phase is 1, below it, the value is PhaseBelow
PhaseBelow::Union{Nothing, Vector{Int64}}
PhaseInside::Union{Nothing, Vector{Int64}}: Phase within the box [use -1 if you don't want to change the phase inside the box]
PhaseOutside::Union{Nothing, Vector{Int64}}: Phase outside the box [use -1 if you don't want to change the phase outside the box. If combined with OutsideToInside, all phases that come in are set to PhaseInside]
PhaseDirection::String: [BothWays=default; BelowToAbove; AboveToBelow] Direction in which transition works
ResetParam::String: [APS] Parameter to reset on particles below PT or within box
PTBox_TempType::String: # Temperature condition witin the box [none, constant, linear, halfspace]
PTBox_topTemp::Union{Nothing, Float64}: Temp @ top of box [for linear & halfspace]
PTBox_botTemp::Union{Nothing, Float64}: Temp @ bottom of box [for linear & halfspace]
PTBox_thermalAge::Union{Nothing, Float64}: Thermal age, usually in geo-units [Myrs] [only in case of halfspace]
PTBox_cstTemp::Union{Nothing, Float64}: Temp within box [only for constant T]
v_box::Union{Nothing, Float64}: [optional] only for NotInAirBox, velocity with which box moves in cm/yr
t0_box::Union{Nothing, Float64}: [optional] beginning time of movemen in Myr
t1_box::Union{Nothing, Float64}: [optional] end time of movement in Myr
Adiabatic_Heat::Float64: Adiabatic Heating activation flag and efficiency. 0.0 - 1.0
act_temp_diff::Int64: temperature diffusion activation flag
act_therm_exp::Int64: thermal expansion activation flag
act_steady_temp::Int64: steady-state temperature initial guess activation flag
steady_temp_t::Float64: time for (quasi-)steady-state temperature initial guess
nstep_steady::Int64: number of steps for (quasi-)steady-state temperature initial guess (default = 1)
act_heat_rech::Int64: recharge heat in anomalous bodies after (quasi-)steady-state temperature initial guess (=2: recharge after every diffusion step of initial guess)
init_lith_pres::Int64: sets initial pressure to be the lithostatic pressure (stabilizes compressible setups in the first steps)
init_guess::Int64: create an initial guess step (using constant viscosity eta_ref before starting the simulation
p_litho_visc::Int64: use lithostatic instead of dynamic pressure for creep laws
p_litho_plast::Int64: use lithostatic pressure for plasticity
p_lim_plast::Int64: limit pressure at first iteration for plasticity
p_shift::Int64: add a constant value [MPa] to the total pressure field, before evaluating plasticity (e.g., when the domain is located @ some depth within the crust)
act_p_shift::Int64: pressure shift activation flag (enforce zero pressure on average in the top cell layer); note: this overwrites p_shift above!
eta_min::Float64: viscosity lower bound [Pas]
eta_max::Float64: viscosity upper limit [Pas]
eta_ref::Float64: Reference viscosity (used for the initial guess) [Pas]
T_ref::Float64: Reference temperature [C]
RUGC::Float64: universal gas constant (you need to change this only for non-dimensional setups)
min_cohes::Float64: cohesion lower bound [Pa]
min_fric::Float64: friction lower bound [degree]
tau_ult::Float64: ultimate yield stress [Pa]
rho_fluid::Float64: fluid density for depth-dependent density model
gw_level_type::String: ground water level type for pore pressure computation (see below)
gw_level::Float64: ground water level at the free surface (if defined)
biot::Float64: Biot pressure parameter
get_permea::Float64: effective permeability computation activation flag
rescal::Float64: stencil rescaling flag (for internal constraints, for example while computing permeability)
mfmax::Float64: maximum melt fraction affecting viscosity reduction
lmaxit::Int64: maximum number of local rheology iterations
lrtol::Float64: local rheology iterations relative tolerance
act_dike::Int64: dike activation flag (additonal term in divergence)
useTk::Int64: switch to use T-dependent conductivity, 0: not active
dikeHeat::Int64: switch to use Behn & Ito heat source in the dike
Compute_velocity_gradient::Int64: compute the velocity gradient tensor 1: active, 0: not active. If active, it automatically activates the output in the .pvd file
SolverType::String: solver employed ["direct" or "multigrid"]
DirectSolver::String: mumps/superlu_dist/pastix/umfpack (requires these external PETSc packages to be installed!)
DirectPenalty::Float64: penalty parameter [employed if we use a direct solver]
MGLevels::Int64: number of MG levels [default=3]
MGSweeps::Int64: number of MG smoothening steps per level [default=10]
MGSmoother::String: type of smoothener used [chebyshev or jacobi]
MGJacobiDamp::Float64: Dampening parameter [only employed for Jacobi smoothener; default=0.6]
MGCoarseSolver::String: coarse grid solver if using multigrid ["direct" / "mumps" / "superlu_dist" or "redundant" - more options specifiable through the command-line options -crs_ksp_type & -crs_pc_type]
MGRedundantNum::Int64: How many times do we copy the coarse grid? [only employed for redundant solver; default is 4]
MGRedundantSolver::String: The coarse grid solver for each of the redundant solves [only employed for redundant; options are "mumps"/"superlu_dist" with default "superlu_dist"]
PETSc_options::Vector{String}: List with (optional) PETSc options
Adds a box with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models See the documentation of the GMG routine
Adds a box with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models See the documentation of the GMG routine
AddCylinder!(model::Model; # required input
base=Tuple{3}, cap=Tuple{3}, radius=Tuple{1}, # center and radius of the sphere
phase = ConstantPhase(1), # Sets the phase number(s) in the sphere
- T=nothing ) # Sets the thermal structure (various fucntions are available)
AddEllipsoid!(model::Model; # required input
cen=Tuple{3}, axes=Tuple{3}, # center and semi-axes of the ellpsoid
Origin=nothing, StrikeAngle=0, DipAngle=0, # origin & dip/strike
phase = ConstantPhase(1), # Sets the phase number(s) in the box
- T=nothing )
This replaces a phase within a LaMEM Model Setup model with phase_new either based on its Name or ID. Note that it is expected that only one such phase is present in the current setup.
This replaces a phase within a LaMEM Model Setup model with phase_new either based on its Name or ID. Note that it is expected that only one such phase is present in the current setup.
This starts a LaMEM simulation, for using the parameter file ParamFile on cores number of cores. Optional additional command-line parameters can be specified with args.
Example:
You can call LaMEM with:
julia> using LaMEM
+pkg>add LaMEM
which will download the binaries along with PETSc and mpiexec for your system.
This starts a LaMEM simulation, for using the parameter file ParamFile on cores number of cores. Optional additional command-line parameters can be specified with args.
Example:
You can call LaMEM with:
julia> using LaMEM
julia> ParamFile="../../input_models/BuildInSetups/FallingBlock_Multigrid.dat";
julia> run_lamem(ParamFile)
Do the same on 2 cores with a command-line argument as:
If you, for some reason, do not want to run LaMEM through julia but instead directly from the terminal or powershell, you will have to add the required dynamic libraries and executables. Do this with:
The downloaded LaMEM binaries can also be called from outside julia (directly from the terminal). In that case, you will need to set load correct dynamic libraries (such as PETSc) and call the correct binaries.
If you, for some reason, do not want to run LaMEM through julia but instead directly from the terminal or powershell, you will have to add the required dynamic libraries and executables. Do this with:
The downloaded LaMEM binaries can also be called from outside julia (directly from the terminal). In that case, you will need to set load correct dynamic libraries (such as PETSc) and call the correct binaries.