From 6b3809fac38f20ce15658fee1bc47620b7d68a0a Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Wed, 1 Nov 2023 19:29:10 +0000 Subject: [PATCH] build based on 3282b33 --- dev/index.html | 2 +- dev/man/LaMEM_ModelFunctions/index.html | 18 +++++++++--------- dev/man/installation/index.html | 4 ++-- dev/man/installation_HPC/index.html | 2 +- dev/man/juliasetup_LaPalma/index.html | 2 +- dev/man/juliasetup_TMSubduction/index.html | 4 +++- dev/man/juliasetup_example_sphere/index.html | 2 +- dev/man/juliasetup_pluto/index.html | 2 +- dev/man/juliasetups/index.html | 2 +- dev/man/listfunctions/index.html | 6 +++--- dev/man/readtimesteps/index.html | 2 +- dev/man/runlamem/index.html | 2 +- dev/search/index.html | 2 +- dev/search_index.js | 2 +- 14 files changed, 27 insertions(+), 25 deletions(-) diff --git a/dev/index.html b/dev/index.html index 094d439..cd795b6 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · LaMEM.jl

LaMEM.jl

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.
+Home · LaMEM.jl

LaMEM.jl

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.
diff --git a/dev/man/LaMEM_ModelFunctions/index.html b/dev/man/LaMEM_ModelFunctions/index.html index 5f023e7..925350e 100644 --- a/dev/man/LaMEM_ModelFunctions/index.html +++ b/dev/man/LaMEM_ModelFunctions/index.html @@ -1,5 +1,5 @@ -Available functions · LaMEM.jl

List functions

These are all the functions that are provided for the LaMEM Julia Setup interface

LaMEM.LaMEM_Model.BoundaryConditionsType
Structure that contains the LaMEM boundary conditions information.
  • noslip::Vector{Int64}: No-slip boundary flag mask (left right front back bottom top)

  • open_top_bound::Int64: Stress-free (free surface/infinitely fast erosion) top boundary flag

  • temp_top::Float64: Constant temperature on the top boundary

  • temp_bot::Float64: Constant temperature on the bottom boundary

  • exx_num_periods::Int64: number intervals of constant background strain rate (x-axis)

  • exx_time_delims::Vector{Float64}: time delimiters (one less than number of intervals, not required for one interval)

  • exx_strain_rates::Vector{Float64}: strain rates for each interval

  • eyy_num_periods::Int64: eyynumperiods

  • eyy_time_delims::Vector{Float64}: eyytimedelims

  • eyy_strain_rates::Vector{Float64}: eyystrainrates

  • exy_num_periods::Int64: exynumperiods

  • exy_time_delims::Vector{Float64}: exytimedelims

  • exy_strain_rates::Vector{Float64}: exystrainrates

  • exz_num_periods::Int64: exznumperiods

  • exz_time_delims::Vector{Float64}: exztimedelims

  • exz_strain_rates::Vector{Float64}: exzstrainrates

  • eyz_num_periods::Int64: eyznumperiods

  • eyz_time_delims::Vector{Float64}: eyztimedelims

  • eyz_strain_rates::Vector{Float64}: eyzstrainrates

  • bg_ref_point::Vector{Float64}: background strain rate reference point (fixed)

source
LaMEM.LaMEM_Model.DikeType
Defines the properties related to inserting dikes
  • ID::Int64: Material phase 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

source
LaMEM.LaMEM_Model.FreeSurfaceType
Structure that contains the LaMEM free surface information.
  • surf_use::Int64: Free surface activation flag

  • surf_corr_phase::Int64: air phase ratio correction flag (phases in an element that contains are modified based on the surface position)

  • surf_level::Union{Nothing, Float64}: initial level of the free surface

  • surf_air_phase::Union{Nothing, Int64}: phase ID of sticky air layer

  • surf_max_angle::Float64: maximum angle with horizon (smoothed if larger)

  • surf_topo_file::String: initial topography file (redundant)

  • erosion_model::Int64: erosion model [0-none (default), 1-infinitely fast, 2-prescribed rate with given level]

  • er_num_phases::Int64: number of erosion phases

  • er_time_delims::Vector{Float64}: erosion time delimiters (one less than number)

  • er_rates::Vector{Float64}: constant erosion rates in different time periods

  • er_levels::Vector{Int64}: levels above which we apply constant erosion rates in different time periods

  • sediment_model::Int64: sedimentation model [0-none (dafault), 1-prescribed rate with given level, 2-cont. margin]

  • sed_num_layers::Int64: number of sediment layers

  • sed_time_delims::Vector{Float64}: sediment layers time delimiters (one less than number)

  • sed_rates::Vector{Float64}: sediment rates in different time periods

  • sed_levels::Vector{Float64}: levels below which we apply constant sediment rates in different time periods

  • sed_phases::Vector{Int64}: sediment layers phase numbers in different time periods

  • marginO::Vector{Float64}: lateral coordinates of continental margin - origin

  • marginE::Vector{Float64}: lateral coordinates of continental margin - 2nd point

  • hUp::Float64: up dip thickness of sediment cover (onshore)

  • hDown::Float64: down dip thickness of sediment cover (off shore)

  • dTrans::Float64: half of transition zone

  • Topography::Union{Nothing, GeophysicalModelGenerator.CartData}: Topography grid

source
LaMEM.LaMEM_Model.GridType
Structure that contains the LaMEM grid information
  • nmark_x::Int64: number of markers/element in x-direction

  • nmark_y::Int64: number of markers/element in y-direction

  • nmark_z::Int64: number of markers/element in x-direction

  • nel_x::Vector{Int64}: number of elements in x-direction

  • nel_y::Vector{Int64}: number of elements in y-direction

  • nel_z::Vector{Int64}: number of elements in z-direction

  • coord_x::Vector{Float64}: coordinates in x-direction

  • coord_y::Vector{Float64}: coordinates in y-direction

  • coord_z::Vector{Float64}: coordinates in z-direction

  • nseg_x::Int64: number of segments in x-direction (if we employ variable grid spacing in x-direction)

  • nseg_y::Int64: number of segments in y-direction (if we employ variable grid spacing in y-direction)

  • nseg_z::Int64: number of segments in z-direction (if we employ variable grid spacing in z-direction)

  • bias_x::Vector{Float64}: bias in x-direction (if we employ variable grid spacing in x-direction)

  • bias_y::Vector{Float64}: bias in y-direction (if we employ variable grid spacing in y-direction)

  • bias_z::Vector{Float64}: bias in z-direction (if we employ variable grid spacing in z-direction)

  • Grid::GeophysicalModelGenerator.LaMEM_grid: Contains the LaMEM Grid object

  • Phases::Array{Int32}: Phases; 3D phase information

  • Temp::Array{Float64}: Temp; 3D phase information

Example 1

julia> d=LaMEM.Grid(coord_x=[0.0, 0.7, 0.8, 1.0], bias_x=[0.3,1.0,3.0], nel_x=[10,4,2])
+Available functions · LaMEM.jl

List functions

These are all the functions that are provided for the LaMEM Julia Setup interface

LaMEM.LaMEM_Model.BoundaryConditionsType
Structure that contains the LaMEM boundary conditions information.
  • noslip::Vector{Int64}: No-slip boundary flag mask (left right front back bottom top)

  • open_top_bound::Int64: Stress-free (free surface/infinitely fast erosion) top boundary flag

  • temp_top::Float64: Constant temperature on the top boundary

  • temp_bot::Float64: Constant temperature on the bottom boundary

  • exx_num_periods::Int64: number intervals of constant background strain rate (x-axis)

  • exx_time_delims::Vector{Float64}: time delimiters (one less than number of intervals, not required for one interval)

  • exx_strain_rates::Vector{Float64}: strain rates for each interval

  • eyy_num_periods::Int64: eyynumperiods

  • eyy_time_delims::Vector{Float64}: eyytimedelims

  • eyy_strain_rates::Vector{Float64}: eyystrainrates

  • exy_num_periods::Int64: exynumperiods

  • exy_time_delims::Vector{Float64}: exytimedelims

  • exy_strain_rates::Vector{Float64}: exystrainrates

  • exz_num_periods::Int64: exznumperiods

  • exz_time_delims::Vector{Float64}: exztimedelims

  • exz_strain_rates::Vector{Float64}: exzstrainrates

  • eyz_num_periods::Int64: eyznumperiods

  • eyz_time_delims::Vector{Float64}: eyztimedelims

  • eyz_strain_rates::Vector{Float64}: eyzstrainrates

  • bg_ref_point::Vector{Float64}: background strain rate reference point (fixed)

source
LaMEM.LaMEM_Model.DikeType
Defines the properties related to inserting dikes
  • ID::Int64: Material phase 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

source
LaMEM.LaMEM_Model.FreeSurfaceType
Structure that contains the LaMEM free surface information.
  • surf_use::Int64: Free surface activation flag

  • surf_corr_phase::Int64: air phase ratio correction flag (phases in an element that contains are modified based on the surface position)

  • surf_level::Union{Nothing, Float64}: initial level of the free surface

  • surf_air_phase::Union{Nothing, Int64}: phase ID of sticky air layer

  • surf_max_angle::Float64: maximum angle with horizon (smoothed if larger)

  • surf_topo_file::String: initial topography file (redundant)

  • erosion_model::Int64: erosion model [0-none (default), 1-infinitely fast, 2-prescribed rate with given level]

  • er_num_phases::Int64: number of erosion phases

  • er_time_delims::Vector{Float64}: erosion time delimiters (one less than number)

  • er_rates::Vector{Float64}: constant erosion rates in different time periods

  • er_levels::Vector{Int64}: levels above which we apply constant erosion rates in different time periods

  • sediment_model::Int64: sedimentation model [0-none (dafault), 1-prescribed rate with given level, 2-cont. margin]

  • sed_num_layers::Int64: number of sediment layers

  • sed_time_delims::Vector{Float64}: sediment layers time delimiters (one less than number)

  • sed_rates::Vector{Float64}: sediment rates in different time periods

  • sed_levels::Vector{Float64}: levels below which we apply constant sediment rates in different time periods

  • sed_phases::Vector{Int64}: sediment layers phase numbers in different time periods

  • marginO::Vector{Float64}: lateral coordinates of continental margin - origin

  • marginE::Vector{Float64}: lateral coordinates of continental margin - 2nd point

  • hUp::Float64: up dip thickness of sediment cover (onshore)

  • hDown::Float64: down dip thickness of sediment cover (off shore)

  • dTrans::Float64: half of transition zone

  • Topography::Union{Nothing, GeophysicalModelGenerator.CartData}: Topography grid

source
LaMEM.LaMEM_Model.GridType
Structure that contains the LaMEM grid information
  • nmark_x::Int64: number of markers/element in x-direction

  • nmark_y::Int64: number of markers/element in y-direction

  • nmark_z::Int64: number of markers/element in x-direction

  • nel_x::Vector{Int64}: number of elements in x-direction

  • nel_y::Vector{Int64}: number of elements in y-direction

  • nel_z::Vector{Int64}: number of elements in z-direction

  • coord_x::Vector{Float64}: coordinates in x-direction

  • coord_y::Vector{Float64}: coordinates in y-direction

  • coord_z::Vector{Float64}: coordinates in z-direction

  • nseg_x::Int64: number of segments in x-direction (if we employ variable grid spacing in x-direction)

  • nseg_y::Int64: number of segments in y-direction (if we employ variable grid spacing in y-direction)

  • nseg_z::Int64: number of segments in z-direction (if we employ variable grid spacing in z-direction)

  • bias_x::Vector{Float64}: bias in x-direction (if we employ variable grid spacing in x-direction)

  • bias_y::Vector{Float64}: bias in y-direction (if we employ variable grid spacing in y-direction)

  • bias_z::Vector{Float64}: bias in z-direction (if we employ variable grid spacing in z-direction)

  • Grid::GeophysicalModelGenerator.LaMEM_grid: Contains the LaMEM Grid object

  • Phases::Array{Int32}: Phases; 3D phase information

  • Temp::Array{Float64}: Temp; 3D phase information

Example 1

julia> d=LaMEM.Grid(coord_x=[0.0, 0.7, 0.8, 1.0], bias_x=[0.3,1.0,3.0], nel_x=[10,4,2])
 LaMEM grid with 1D refinement: 
   nel         : ([10, 4, 2], [16], [16])
   marker/cell : (3, 3, 3)
@@ -11,7 +11,7 @@
   marker/cell : (3, 3, 3)
   x           ϵ [-10.0 : 10.0]
   y           ϵ [-10.0 : 0.0]
-  z           ϵ [-10.0 : 0.0]
source
LaMEM.LaMEM_Model.MaterialsType
Structure that contains the material properties in the current simulation
  • Phases::Vector{Phase}: Different Materials implemented

  • SofteningLaws::Vector{Softening}: Softening laws implemented

  • PhaseTransitions::Vector{PhaseTransition}: Internal Phase Transitions (that change the ID of markers) implemented

  • Dikes::Vector{Dike}: Dikes implemented (mostly for MOR simulations)

source
LaMEM.LaMEM_Model.ModelType

; Model

Structure that holds all the information to create a LaMEM input file

  • Scaling::Scaling: Scaling parameters

  • Grid::Grid: LaMEM Grid

  • Time::Any: Time options

  • FreeSurface::Any: Free surface options

  • BoundaryConditions::Any: Boundary conditions

  • SolutionParams::Any: Global solution parameters

  • Solver::Any: Solver options and optional PETSc options

  • ModelSetup::Any: Model setup

  • Output::Any: Output options

  • Materials::Any: Material parameters for each of the phases

source
LaMEM.LaMEM_Model.ModelMethod
Model(args...)

Allow to define a model setup by specifying some of the basic objects

Example

julia> d = Model(Grid(nel=(10,1,20)), Scaling(NO_units()))
+  z           ϵ [-10.0 : 0.0]
source
LaMEM.LaMEM_Model.MaterialsType
Structure that contains the material properties in the current simulation
  • Phases::Vector{Phase}: Different Materials implemented

  • SofteningLaws::Vector{Softening}: Softening laws implemented

  • PhaseTransitions::Vector{PhaseTransition}: Internal Phase Transitions (that change the ID of markers) implemented

  • Dikes::Vector{Dike}: Dikes implemented (mostly for MOR simulations)

source
LaMEM.LaMEM_Model.ModelType

; Model

Structure that holds all the information to create a LaMEM input file

  • Scaling::Scaling: Scaling parameters

  • Grid::Grid: LaMEM Grid

  • Time::Any: Time options

  • FreeSurface::Any: Free surface options

  • BoundaryConditions::Any: Boundary conditions

  • SolutionParams::Any: Global solution parameters

  • Solver::Any: Solver options and optional PETSc options

  • ModelSetup::Any: Model setup

  • Output::Any: Output options

  • Materials::Any: Material parameters for each of the phases

source
LaMEM.LaMEM_Model.ModelMethod
Model(args...)

Allow to define a model setup by specifying some of the basic objects

Example

julia> d = Model(Grid(nel=(10,1,20)), Scaling(NO_units()))
 LaMEM Model setup
 |
 |-- Scaling             :  GeoParams.Units.GeoUnits{GeoParams.Units.NONE}
@@ -23,7 +23,7 @@
 |-- Model setup options :  Type=geom; 
 |-- Output options      :  filename=output; pvd=1; avd=0; surf=0
 |-- Materials           :  1 phases;  
-
source
LaMEM.LaMEM_Model.ModelMethod
Model(;
     Scaling=Scaling(GEO_units()),
     Grid=Grid(), 
     Time=Time(),
@@ -34,18 +34,18 @@
     ModelSetup=ModelSetup(),
     Output=Output(),
     Materials=Materials()
-    )

Creates a LaMEM Model setup.

  • Scaling::Scaling

  • Grid::Grid

  • Time::Any

  • FreeSurface::Any

  • BoundaryConditions::Any

  • SolutionParams::Any

  • Solver::Any

  • ModelSetup::Any

  • Output::Any

  • Materials::Any

source
LaMEM.LaMEM_Model.ModelSetupType
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)

  • stagp_a::Float64: STAG_P velocity interpolation parameter

  • 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)

  • nmark_avd::Vector{Int64}: x-y-z AVD refinement factors (avd marker control)

  • nmark_sub::Int64: max number of same phase markers per subcell (subgrid marker control)

  • geom_primitives::Vector: Different geometric primitives that can be selected if we msetup=geom; seegeom_Sphere`

source
LaMEM.LaMEM_Model.OutputType
Structure that contains the LaMEM output options
  • out_file_name::Any: output file name

  • out_dir::Any: output directory

  • param_file_name::Any: parameter filename

  • write_VTK_setup::Any: write VTK initial model setup

  • out_pvd::Any: activate writing .pvd file

  • out_phase::Any: dominant phase

  • out_density::Any: density

  • out_visc_total::Any: total (viscoelastoplastic) viscosity

  • out_visc_creep::Any: creep viscosity

  • out_velocity::Any: velocity

  • out_pressure::Any: (dynamic) pressure

  • out_tot_press::Any: total pressure

  • out_eff_press::Any: effective pressure

  • out_over_press::Any: outoverpress

  • out_litho_press::Any: lithospheric pressure

  • out_pore_press::Any: pore pressure

  • out_temperature::Any: temperature

  • out_dev_stress::Any: deviatoric strain rate tensor

  • out_j2_dev_stress::Any: second invariant of deviatoric stress tensor

  • out_strain_rate::Any: deviatoric strain rate tensor

  • out_j2_strain_rate::Any: second invariant of strain rate tensor

  • out_shmax::Any: sh max

  • out_ehmax::Any: eh max

  • out_yield::Any: yield stress

  • out_rel_dif_rate::Any: relative proportion of diffusion creep strainrate

  • out_rel_dis_rate::Any: relative proportion of dislocation creep strainrate

  • out_rel_prl_rate::Any: relative proportion of peierls creep strainrate

  • out_rel_pl_rate::Any: relative proportion of plastic strainrate

  • out_plast_strain::Any: accumulated plastic strain

  • out_plast_dissip::Any: plastic dissipation

  • out_tot_displ::Any: total displacement

  • out_moment_res::Any: momentum residual

  • out_cont_res::Any: continuity residual

  • out_energ_res::Any: energy residual

  • out_melt_fraction::Any: Melt fraction

  • out_fluid_density::Any: fluid density

  • out_conductivity::Any: conductivity

  • out_vel_gr_tensor::Any: velocity gradient tensor

  • out_surf::Any: activate surface output

  • out_surf_pvd::Any: activate writing .pvd file

  • out_surf_velocity::Any: surface velocity

  • out_surf_topography::Any: surface topography

  • out_surf_amplitude::Any: amplitude of topography (=topo-average(topo))

  • out_mark::Any: activate marker output

  • out_mark_pvd::Any: activate writing .pvd file

  • out_avd::Any: activate AVD phase output

  • out_avd_pvd::Any: activate writing .pvd file

  • out_avd_ref::Any: AVD grid refinement factor

  • out_ptr::Any: activate

  • out_ptr_ID::Any: ID of the passive tracers

  • out_ptr_phase::Any: phase of the passive tracers

  • out_ptr_Pressure::Any: interpolated pressure

  • out_ptr_Temperature::Any: temperature

  • out_ptr_MeltFraction::Any: melt fraction computed using P-T of the marker

  • out_ptr_Active::Any: option that highlight the marker that are currently active

  • out_ptr_Grid_Mf::Any: option that allow to store the melt fraction seen within the cell

source
LaMEM.LaMEM_Model.PhaseType
Defines the material properties for each of the phases
  • ID::Union{Nothing, Int64}: Material phase ID

  • Name::Union{Nothing, String}: Description of the phase

  • rho::Union{Nothing, Float64}: Density [kg/m^3]

  • eta::Union{Nothing, Float64}: Linear viscosity [Pas]

  • visID::Union{Nothing, Int64}: material ID for phase visualization (default is ID)

  • diff_prof::Union{Nothing, String}: DIFFUSION creep profile; example: "DryOlivinediffcreep-HirthKohlstedt_2003"

  • disl_prof::Union{Nothing, String}: DISLOCATION creep profile; example: "Granite-Tireletal_2008"

  • peir_prof::Union{Nothing, String}: PEIERLS creep profile; example: "OlivinePeierls-Kameyama1999"

  • rho_n::Union{Nothing, Float64}: depth-dependent density model parameter

  • rho_c::Union{Nothing, Float64}: depth-dependent density model parameter

  • beta::Union{Nothing, Float64}: pressure-dependent density model parameter

  • G::Union{Nothing, Float64}: shear modulus

  • Kb::Union{Nothing, Float64}: bulk modulus

  • E::Union{Nothing, Float64}: Young's modulus

  • nu::Union{Nothing, Float64}: Poisson's ratio

  • Kp::Union{Nothing, Float64}: pressure dependence parameter

  • Bd::Union{Nothing, Float64}: DIFFUSION creep pre-exponential constant

  • Ed::Union{Nothing, Float64}: activation energy

  • Vd::Union{Nothing, Float64}: activation volume

  • eta0::Union{Nothing, Float64}: POWER LAW reference viscosity

  • e0::Union{Nothing, Float64}: reference strain rate

  • Bn::Union{Nothing, Float64}: DISLOCATION creep pre-exponential constant

  • En::Union{Nothing, Float64}: activation energy

  • Vn::Union{Nothing, Float64}: activation volume

  • n::Union{Nothing, Float64}: power law exponent

  • Bp::Union{Nothing, Float64}: PEIERLS creep pre-exponential constant

  • Ep::Union{Nothing, Float64}: activation energy

  • Vp::Union{Nothing, Float64}: activation volume

  • taup::Union{Nothing, Float64}: scaling stress

  • gamma::Union{Nothing, Float64}: approximation parameter

  • q::Union{Nothing, Float64}: stress-dependence parameter

  • eta_fk::Union{Nothing, Float64}: reference viscosity for Frank-Kamenetzky viscosity

  • gamma_fk::Union{Nothing, Float64}: gamma parameter for Frank-Kamenetzky viscosity

  • TRef_fk::Union{Nothing, Float64}: reference Temperature for Frank-Kamenetzky viscosity (if not set it is 0°C)

  • ch::Union{Nothing, Float64}: cohesion

  • fr::Union{Nothing, Float64}: friction angle

  • eta_st::Union{Nothing, Float64}: stabilization viscosity (default is eta_min)

  • rp::Union{Nothing, Float64}: pore-pressure ratio

  • chSoftID::Union{Nothing, Int64}: friction softening law ID

  • frSoftID::Union{Nothing, Int64}: cohesion softening law ID

  • healID::Union{Nothing, Int64}: healing ID, points to healTau in Softening

  • alpha::Union{Nothing, Float64}: thermal expansivity

  • Cp::Union{Nothing, Float64}: specific heat (capacity), J⋅K−1⋅kg−1

  • k::Union{Nothing, Float64}: thermal conductivity

  • A::Union{Nothing, Float64}: radiogenic heat production

  • T::Union{Nothing, Float64}: optional temperature to set within the phase

  • Latent_hx::Union{Nothing, Float64}: optional, used for dike heating, J/kg

  • T_liq::Union{Nothing, Float64}: optional, used for dike heating, liquidus temperature of material, celsius

  • T_sol::Union{Nothing, Float64}: optional, used for dike heating, solidus temperature of material, celsius

  • T_Nu::Union{Nothing, Float64}: default value for thermal conductivity boundary

  • nu_k::Union{Nothing, Float64}: optional parameter, Nusselt number for use with conductivity

  • rho_ph::Union{Nothing, String}: name of the phase diagram you want to use (still needs rho to be defined for the initial guess of pressure)

  • rho_ph_dir::Union{Nothing, String}: in case the phase diagram has a different path provide the path (without the name of the actual PD) here

  • mfc::Union{Nothing, Float64}: melt fraction viscosity correction factor (positive scalar)

source
LaMEM.LaMEM_Model.PhaseTransitionType
Defines phase transitions on markers (that change the Phase ID of a marker depending on some conditions)
  • ID::Int64: Phase_transition law ID

  • Type::String: [Constant, Clapeyron, Box]: Constant - the phase transition occurs only at a fixed value of the parameter; Clapeyron - clapeyron slope

  • Name_Clapeyron::Union{Nothing, Int64}: Type of predefined Clapeyron slope, such as MantleTransition660km

  • PTBox_Bounds::Union{Nothing, Vector{Float64}}: box bound coordinates: [left, right, front, back, bottom, top]

  • 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

source
LaMEM.LaMEM_Model.ScalingType
Scaling{T} is a structure that contains the scaling info, employed in the current simulation
  • Scaling::Any: Scaling object (as in GeoParams), which can be GEO_units(), NO_units(), or SI_units()
source
LaMEM.LaMEM_Model.SofteningType
Defines strain softening parameters
  • ID::Int64: softening law ID

  • APS1::Float64: Begin of softening, in units of accumulated plastic strain (APS)

  • APS2::Float64: End of softening, in units of accumulated plastic strain (APS)

  • A::Float64: Reduction ratio

  • Lm::Float64: Material length scale (in selected units, e.g. km in geo)

  • APSheal2::Union{Nothing, Float64}: APS when healTau2 activates

  • healTau::Union{Nothing, Float64}: healing timescale parameter [Myr]

  • healTau2::Union{Nothing, Float64}: healing timescale parameter [Myr] starting at APS=APSheal2

source
LaMEM.LaMEM_Model.SolutionParamsType
Structure that contains the LaMEM global solution parameters.
  • gravity::Vector{Float64}: gravitational acceleration vector

  • FSSA::Float64: free surface stabilization parameter [0 - 1]; The value has to be between 0 and 1

  • shear_heat_eff::Float64: shear heating efficiency parameter [0 - 1]

  • 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

source
LaMEM.LaMEM_Model.SolverType
Structure that contains the LaMEM solver options
  • 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

source
LaMEM.LaMEM_Model.TimeType
Structure that contains the LaMEM timestepping information. An explanation of the paramneters is given in the struct `Time_info`
  • time_end::Float64: simulation end time

  • dt::Float64: initial time step

  • dt_min::Float64: minimum time step (declare divergence if lower value is attempted)

  • dt_max::Float64: maximum time step

  • dt_out::Float64: output step (output at least at fixed time intervals)

  • inc_dt::Float64: time step increment per time step (fraction of unit)

  • CFL::Float64: CFL (Courant-Friedrichs-Lewy) criterion

  • CFLMAX::Float64: CFL criterion for elasticity

  • nstep_max::Int64: maximum allowed number of steps (lower bound: timeend/dtmax)

  • nstep_out::Int64: save output every n steps; Set this to -1 to deactivate saving output

  • nstep_rdb::Int64: save restart database every n steps

  • num_dt_periods::Int64: number of time stepping periods

  • time_dt_periods::Vector{Int64}: timestamps where timestep should be fixed (first entry has to 0)

  • step_dt_periods::Vector{Float64}: target timesteps ar timestamps above

  • nstep_ini::Int64: save output for n initial steps

  • time_tol::Float64: relative tolerance for time comparisons

source
LaMEM.LaMEM_Model.geom_SphereType
LaMEM geometric primitive `sphere` object
  • phase::Int64: phase

  • radius::Float64: radius of sphere

  • center::Vector{Float64}: center of sphere

  • Temperature::Union{Nothing, String}: optional: Temperature of the sphere. possibilities: [constant, or nothing]

  • cstTemp::Union{Nothing, Float64}: required in case of [constant]: temperature value [in Celcius in case of GEO units]

source
GeophysicalModelGenerator.AddBox!Method
AddBox!(model::Model; xlim=Tuple{2}, [ylim=Tuple{2}], zlim=Tuple{2},
+    )

Creates a LaMEM Model setup.

  • Scaling::Scaling

  • Grid::Grid

  • Time::Any

  • FreeSurface::Any

  • BoundaryConditions::Any

  • SolutionParams::Any

  • Solver::Any

  • ModelSetup::Any

  • Output::Any

  • Materials::Any

source
LaMEM.LaMEM_Model.ModelSetupType
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)

  • stagp_a::Float64: STAG_P velocity interpolation parameter

  • 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)

  • nmark_avd::Vector{Int64}: x-y-z AVD refinement factors (avd marker control)

  • nmark_sub::Int64: max number of same phase markers per subcell (subgrid marker control)

  • geom_primitives::Vector: Different geometric primitives that can be selected if we msetup=geom; seegeom_Sphere`

source
LaMEM.LaMEM_Model.OutputType
Structure that contains the LaMEM output options
  • out_file_name::Any: output file name

  • out_dir::Any: output directory

  • param_file_name::Any: parameter filename

  • write_VTK_setup::Any: write VTK initial model setup

  • out_pvd::Any: activate writing .pvd file

  • out_phase::Any: dominant phase

  • out_density::Any: density

  • out_visc_total::Any: total (viscoelastoplastic) viscosity

  • out_visc_creep::Any: creep viscosity

  • out_velocity::Any: velocity

  • out_pressure::Any: (dynamic) pressure

  • out_tot_press::Any: total pressure

  • out_eff_press::Any: effective pressure

  • out_over_press::Any: outoverpress

  • out_litho_press::Any: lithospheric pressure

  • out_pore_press::Any: pore pressure

  • out_temperature::Any: temperature

  • out_dev_stress::Any: deviatoric strain rate tensor

  • out_j2_dev_stress::Any: second invariant of deviatoric stress tensor

  • out_strain_rate::Any: deviatoric strain rate tensor

  • out_j2_strain_rate::Any: second invariant of strain rate tensor

  • out_shmax::Any: sh max

  • out_ehmax::Any: eh max

  • out_yield::Any: yield stress

  • out_rel_dif_rate::Any: relative proportion of diffusion creep strainrate

  • out_rel_dis_rate::Any: relative proportion of dislocation creep strainrate

  • out_rel_prl_rate::Any: relative proportion of peierls creep strainrate

  • out_rel_pl_rate::Any: relative proportion of plastic strainrate

  • out_plast_strain::Any: accumulated plastic strain

  • out_plast_dissip::Any: plastic dissipation

  • out_tot_displ::Any: total displacement

  • out_moment_res::Any: momentum residual

  • out_cont_res::Any: continuity residual

  • out_energ_res::Any: energy residual

  • out_melt_fraction::Any: Melt fraction

  • out_fluid_density::Any: fluid density

  • out_conductivity::Any: conductivity

  • out_vel_gr_tensor::Any: velocity gradient tensor

  • out_surf::Any: activate surface output

  • out_surf_pvd::Any: activate writing .pvd file

  • out_surf_velocity::Any: surface velocity

  • out_surf_topography::Any: surface topography

  • out_surf_amplitude::Any: amplitude of topography (=topo-average(topo))

  • out_mark::Any: activate marker output

  • out_mark_pvd::Any: activate writing .pvd file

  • out_avd::Any: activate AVD phase output

  • out_avd_pvd::Any: activate writing .pvd file

  • out_avd_ref::Any: AVD grid refinement factor

  • out_ptr::Any: activate

  • out_ptr_ID::Any: ID of the passive tracers

  • out_ptr_phase::Any: phase of the passive tracers

  • out_ptr_Pressure::Any: interpolated pressure

  • out_ptr_Temperature::Any: temperature

  • out_ptr_MeltFraction::Any: melt fraction computed using P-T of the marker

  • out_ptr_Active::Any: option that highlight the marker that are currently active

  • out_ptr_Grid_Mf::Any: option that allow to store the melt fraction seen within the cell

source
LaMEM.LaMEM_Model.PhaseType
Defines the material properties for each of the phases
  • ID::Union{Nothing, Int64}: Material phase ID

  • Name::Union{Nothing, String}: Description of the phase

  • rho::Union{Nothing, Float64}: Density [kg/m^3]

  • eta::Union{Nothing, Float64}: Linear viscosity [Pas]

  • visID::Union{Nothing, Int64}: material ID for phase visualization (default is ID)

  • diff_prof::Union{Nothing, String}: DIFFUSION creep profile; example: "DryOlivinediffcreep-HirthKohlstedt_2003"

  • disl_prof::Union{Nothing, String}: DISLOCATION creep profile; example: "Granite-Tireletal_2008"

  • peir_prof::Union{Nothing, String}: PEIERLS creep profile; example: "OlivinePeierls-Kameyama1999"

  • rho_n::Union{Nothing, Float64}: depth-dependent density model parameter

  • rho_c::Union{Nothing, Float64}: depth-dependent density model parameter

  • beta::Union{Nothing, Float64}: pressure-dependent density model parameter

  • G::Union{Nothing, Float64}: shear modulus

  • Kb::Union{Nothing, Float64}: bulk modulus

  • E::Union{Nothing, Float64}: Young's modulus

  • nu::Union{Nothing, Float64}: Poisson's ratio

  • Kp::Union{Nothing, Float64}: pressure dependence parameter

  • Bd::Union{Nothing, Float64}: DIFFUSION creep pre-exponential constant

  • Ed::Union{Nothing, Float64}: activation energy

  • Vd::Union{Nothing, Float64}: activation volume

  • eta0::Union{Nothing, Float64}: POWER LAW reference viscosity

  • e0::Union{Nothing, Float64}: reference strain rate

  • Bn::Union{Nothing, Float64}: DISLOCATION creep pre-exponential constant

  • En::Union{Nothing, Float64}: activation energy

  • Vn::Union{Nothing, Float64}: activation volume

  • n::Union{Nothing, Float64}: power law exponent

  • Bp::Union{Nothing, Float64}: PEIERLS creep pre-exponential constant

  • Ep::Union{Nothing, Float64}: activation energy

  • Vp::Union{Nothing, Float64}: activation volume

  • taup::Union{Nothing, Float64}: scaling stress

  • gamma::Union{Nothing, Float64}: approximation parameter

  • q::Union{Nothing, Float64}: stress-dependence parameter

  • eta_fk::Union{Nothing, Float64}: reference viscosity for Frank-Kamenetzky viscosity

  • gamma_fk::Union{Nothing, Float64}: gamma parameter for Frank-Kamenetzky viscosity

  • TRef_fk::Union{Nothing, Float64}: reference Temperature for Frank-Kamenetzky viscosity (if not set it is 0°C)

  • ch::Union{Nothing, Float64}: cohesion

  • fr::Union{Nothing, Float64}: friction angle

  • eta_st::Union{Nothing, Float64}: stabilization viscosity (default is eta_min)

  • rp::Union{Nothing, Float64}: pore-pressure ratio

  • chSoftID::Union{Nothing, Int64}: friction softening law ID

  • frSoftID::Union{Nothing, Int64}: cohesion softening law ID

  • healID::Union{Nothing, Int64}: healing ID, points to healTau in Softening

  • alpha::Union{Nothing, Float64}: thermal expansivity

  • Cp::Union{Nothing, Float64}: specific heat (capacity), J⋅K−1⋅kg−1

  • k::Union{Nothing, Float64}: thermal conductivity

  • A::Union{Nothing, Float64}: radiogenic heat production

  • T::Union{Nothing, Float64}: optional temperature to set within the phase

  • Latent_hx::Union{Nothing, Float64}: optional, used for dike heating, J/kg

  • T_liq::Union{Nothing, Float64}: optional, used for dike heating, liquidus temperature of material, celsius

  • T_sol::Union{Nothing, Float64}: optional, used for dike heating, solidus temperature of material, celsius

  • T_Nu::Union{Nothing, Float64}: default value for thermal conductivity boundary

  • nu_k::Union{Nothing, Float64}: optional parameter, Nusselt number for use with conductivity

  • rho_ph::Union{Nothing, String}: name of the phase diagram you want to use (still needs rho to be defined for the initial guess of pressure)

  • rho_ph_dir::Union{Nothing, String}: in case the phase diagram has a different path provide the path (without the name of the actual PD) here

  • mfc::Union{Nothing, Float64}: melt fraction viscosity correction factor (positive scalar)

source
LaMEM.LaMEM_Model.PhaseTransitionType
Defines phase transitions on markers (that change the Phase ID of a marker depending on some conditions)
  • ID::Int64: Phase_transition law ID

  • Type::String: [Constant, Clapeyron, Box]: Constant - the phase transition occurs only at a fixed value of the parameter; Clapeyron - clapeyron slope

  • Name_Clapeyron::Union{Nothing, Int64}: Type of predefined Clapeyron slope, such as MantleTransition660km

  • PTBox_Bounds::Union{Nothing, Vector{Float64}}: box bound coordinates: [left, right, front, back, bottom, top]

  • 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

source
LaMEM.LaMEM_Model.ScalingType
Scaling{T} is a structure that contains the scaling info, employed in the current simulation
  • Scaling::Any: Scaling object (as in GeoParams), which can be GEO_units(), NO_units(), or SI_units()
source
LaMEM.LaMEM_Model.SofteningType
Defines strain softening parameters
  • ID::Int64: softening law ID

  • APS1::Float64: Begin of softening, in units of accumulated plastic strain (APS)

  • APS2::Float64: End of softening, in units of accumulated plastic strain (APS)

  • A::Float64: Reduction ratio

  • Lm::Float64: Material length scale (in selected units, e.g. km in geo)

  • APSheal2::Union{Nothing, Float64}: APS when healTau2 activates

  • healTau::Union{Nothing, Float64}: healing timescale parameter [Myr]

  • healTau2::Union{Nothing, Float64}: healing timescale parameter [Myr] starting at APS=APSheal2

source
LaMEM.LaMEM_Model.SolutionParamsType
Structure that contains the LaMEM global solution parameters.
  • gravity::Vector{Float64}: gravitational acceleration vector

  • FSSA::Float64: free surface stabilization parameter [0 - 1]; The value has to be between 0 and 1

  • shear_heat_eff::Float64: shear heating efficiency parameter [0 - 1]

  • 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

source
LaMEM.LaMEM_Model.SolverType
Structure that contains the LaMEM solver options
  • 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

source
LaMEM.LaMEM_Model.TimeType
Structure that contains the LaMEM timestepping information. An explanation of the paramneters is given in the struct `Time_info`
  • time_end::Float64: simulation end time

  • dt::Float64: initial time step

  • dt_min::Float64: minimum time step (declare divergence if lower value is attempted)

  • dt_max::Float64: maximum time step

  • dt_out::Float64: output step (output at least at fixed time intervals)

  • inc_dt::Float64: time step increment per time step (fraction of unit)

  • CFL::Float64: CFL (Courant-Friedrichs-Lewy) criterion

  • CFLMAX::Float64: CFL criterion for elasticity

  • nstep_max::Int64: maximum allowed number of steps (lower bound: timeend/dtmax)

  • nstep_out::Int64: save output every n steps; Set this to -1 to deactivate saving output

  • nstep_rdb::Int64: save restart database every n steps

  • num_dt_periods::Int64: number of time stepping periods

  • time_dt_periods::Vector{Int64}: timestamps where timestep should be fixed (first entry has to 0)

  • step_dt_periods::Vector{Float64}: target timesteps ar timestamps above

  • nstep_ini::Int64: save output for n initial steps

  • time_tol::Float64: relative tolerance for time comparisons

source
LaMEM.LaMEM_Model.geom_SphereType
LaMEM geometric primitive `sphere` object
  • phase::Int64: phase

  • radius::Float64: radius of sphere

  • center::Vector{Float64}: center of sphere

  • Temperature::Union{Nothing, String}: optional: Temperature of the sphere. possibilities: [constant, or nothing]

  • cstTemp::Union{Nothing, Float64}: required in case of [constant]: temperature value [in Celcius in case of GEO units]

source
GeophysicalModelGenerator.AddBox!Method
AddBox!(model::Model; xlim=Tuple{2}, [ylim=Tuple{2}], zlim=Tuple{2},
         Origin=nothing, StrikeAngle=0, DipAngle=0,
         phase = ConstantPhase(1),
-        T=nothing )

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

source
GeophysicalModelGenerator.AddCylinder!Method
AddCylinder!(model::Model;                                      # required input
+        T=nothing )

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

source
GeophysicalModelGenerator.AddCylinder!Method
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)

See the documentation of the GMG routine

source
GeophysicalModelGenerator.AddEllipsoid!Method
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 )

See the documentation of the GMG routine

source
LaMEM.IO_functions.Read_LaMEM_simulationMethod
Timestep, FileNames, Time = Read_LaMEM_simulation(model::Model; phase=false, surf=false, passive_tracers=false)

Reads a LaMEM simulation as specified in model and returns the timesteps, times and filenames of that simulation once it is finished.

source
LaMEM.IO_functions.Read_LaMEM_timestepFunction
data, time = Read_LaMEM_timestep(model::Model, TimeStep::Int64=0; fields=nothing, phase=false, surf=false, last=true)

Reads a specific Timestep from a simulation specified in model

source
LaMEM.LaMEM_Model.AboveSurface!Method
AboveSurface!(model::Model, DataSurface_Cart::CartData; phase::Int64=nothing, T::Number=nothing)

Sets the Temp or Phases above the surface DataSurface_Cart to a constant value.

source
LaMEM.LaMEM_Model.BelowSurface!Method
BelowSurface!(model::Model, DataSurface_Cart::CartData; phase::Union{Int64,Nothing}=nothing, T::Union{Number,Nothing}=nothing)

Sets the Temp or Phases below the surface DataSurface_Cart to a constant value.

source
LaMEM.LaMEM_Model.Write_LaMEM_InputFileMethod
Write_LaMEM_InputFile(io, d::Grid)

This writes grid info to a LaMEM input file

Example

julia> d=LaMEM.Grid(coord_x=[0.0, 0.7, 0.8, 1.0], bias_x=[0.3,1.0,3.0], nel_x=[10,4,2])
+                T=nothing )

See the documentation of the GMG routine

source
LaMEM.IO_functions.Read_LaMEM_simulationMethod
Timestep, FileNames, Time = Read_LaMEM_simulation(model::Model; phase=false, surf=false, passive_tracers=false)

Reads a LaMEM simulation as specified in model and returns the timesteps, times and filenames of that simulation once it is finished.

source
LaMEM.IO_functions.Read_LaMEM_timestepFunction
data, time = Read_LaMEM_timestep(model::Model, TimeStep::Int64=0; fields=nothing, phase=false, surf=false, last=true)

Reads a specific Timestep from a simulation specified in model

source
LaMEM.LaMEM_Model.AboveSurface!Method
AboveSurface!(model::Model, DataSurface_Cart::CartData; phase::Int64=nothing, T::Number=nothing)

Sets the Temp or Phases above the surface DataSurface_Cart to a constant value.

source
LaMEM.LaMEM_Model.BelowSurface!Method
BelowSurface!(model::Model, DataSurface_Cart::CartData; phase::Union{Int64,Nothing}=nothing, T::Union{Number,Nothing}=nothing)

Sets the Temp or Phases below the surface DataSurface_Cart to a constant value.

source
LaMEM.LaMEM_Model.Write_LaMEM_InputFileMethod
Write_LaMEM_InputFile(io, d::Grid)

This writes grid info to a LaMEM input file

Example

julia> d=LaMEM.Grid(coord_x=[0.0, 0.7, 0.8, 1.0], bias_x=[0.3,1.0,3.0], nel_x=[10,4,2])
 julia> io = open("test.dat","w")
 julia> LaMEM.Write_LaMEM_InputFile(io, d)
-julia> close(io)
source
LaMEM.LaMEM_Model.add_geom!Method
add_geom!(model::Model, geom_object)

This adds an internal geometric primitive object geom_object to the LaMEM Model Setup model.

Currently available primitive geom objects are:

  • geom_Sphere
source
LaMEM.LaMEM_Model.add_petsc!Method
add_petsc!(model::Model, option::String)

Adds one or more PETSc options to the model

Example

julia> d = Model()
-julia> add_petsc!(d,"-snes_npicard 3")
source
LaMEM.LaMEM_Model.add_topography!Method
add_topography!(model::Model, topography::CartData; surf_air_phase=0, surf_topo_file="topography.txt", open_top_bound=1,  surf_level=0.0)

Adds the topography surface to the model

source
LaMEM.LaMEM_Model.create_initialsetupFunction
create_initialsetup(model::Model, cores::Int64=1, args::String="")

Creates the initial model setup of LaMEM from model, which includes:

  • Writing the LaMEM (*.dat) input file
  • Write the VTK file (if requested when model.Output.write_VTK_setup=true)
  • Write the marker files to disk (if model.ModelSetup.msetup="files")
source
LaMEM.LaMEM_Model.cross_sectionFunction
data_tuple, axes_str = cross_section(model::LaMEM.Model, field=:phases; x=nothing, y=nothing, z=nothing)

This creates a cross-section through the initial model setup & returns a 2D array

source
LaMEM.LaMEM_Model.cross_sectionFunction
Cross = cross_section(cart::CartData, field::Symbol =:phase; x=nothing, y=nothing, z=nothing)

Creates a cross-section through the data and returns x,z coordinates

source
LaMEM.LaMEM_Model.replace_phase!Method
replace_phase!(model::Model, phase_new::Phase; ID::Int64=nothing, Name::String=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.

source
LaMEM.LaMEM_Model.set_airMethod
set_air(; Name="air", ID=0, rho=1, alpha=nothing, eta=1e17, G=nothing, nu=nothing, fr=nothing, ch=nothing, k=30,Cp=1000)

Sets an air phase, with high conductivity

source
LaMEM.Run.run_lamemFunction
run_lamem(model::Model, cores::Int64=1, args:String=""; wait=true)

Performs a LaMEM run for the parameters that are specified in model

source
+julia> close(io)
source
LaMEM.LaMEM_Model.add_geom!Method
add_geom!(model::Model, geom_object)

This adds an internal geometric primitive object geom_object to the LaMEM Model Setup model.

Currently available primitive geom objects are:

  • geom_Sphere
source
LaMEM.LaMEM_Model.add_petsc!Method
add_petsc!(model::Model, option::String)

Adds one or more PETSc options to the model

Example

julia> d = Model()
+julia> add_petsc!(d,"-snes_npicard 3")
source
LaMEM.LaMEM_Model.add_topography!Method
add_topography!(model::Model, topography::CartData; surf_air_phase=0, surf_topo_file="topography.txt", open_top_bound=1,  surf_level=0.0)

Adds the topography surface to the model

source
LaMEM.LaMEM_Model.create_initialsetupFunction
create_initialsetup(model::Model, cores::Int64=1, args::String="")

Creates the initial model setup of LaMEM from model, which includes:

  • Writing the LaMEM (*.dat) input file
  • Write the VTK file (if requested when model.Output.write_VTK_setup=true)
  • Write the marker files to disk (if model.ModelSetup.msetup="files")
source
LaMEM.LaMEM_Model.cross_sectionFunction
data_tuple, axes_str = cross_section(model::LaMEM.Model, field=:phases; x=nothing, y=nothing, z=nothing)

This creates a cross-section through the initial model setup & returns a 2D array

source
LaMEM.LaMEM_Model.cross_sectionFunction
Cross = cross_section(cart::CartData, field::Symbol =:phase; x=nothing, y=nothing, z=nothing)

Creates a cross-section through the data and returns x,z coordinates

source
LaMEM.LaMEM_Model.replace_phase!Method
replace_phase!(model::Model, phase_new::Phase; ID::Int64=nothing, Name::String=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.

source
LaMEM.LaMEM_Model.set_airMethod
set_air(; Name="air", ID=0, rho=1, alpha=nothing, eta=1e17, G=nothing, nu=nothing, fr=nothing, ch=nothing, k=30,Cp=1000)

Sets an air phase, with high conductivity

source
LaMEM.Run.run_lamemFunction
run_lamem(model::Model, cores::Int64=1, args:String=""; wait=true)

Performs a LaMEM run for the parameters that are specified in model

source
diff --git a/dev/man/installation/index.html b/dev/man/installation/index.html index e9880a3..c6805c3 100644 --- a/dev/man/installation/index.html +++ b/dev/man/installation/index.html @@ -1,6 +1,6 @@ General instructions · LaMEM.jl

Installation

Installing LaMEM can simply be done through the package manager:

julia>]
-pkg>add LaMEM

which will download the binaries along with PETSc and mpiexec for your system.

You can test if it works on your machine with

pkg> test LaMEM

Running LaMEM from the julia REPL

Running LaMEM from within julia can be done with the run_lamem function:

LaMEM.Run.run_lamemFunction
run_lamem(ParamFile::String, cores::Int64=1, args:String=""; wait=true, deactivate_multithreads=true)

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.

You can test if it works on your machine with

pkg> test LaMEM

Running LaMEM from the julia REPL

Running LaMEM from within julia can be done with the run_lamem function:

LaMEM.Run.run_lamemFunction
run_lamem(model::Model, cores::Int64=1, args:String=""; wait=true)

Performs a LaMEM run for the parameters that are specified in model

source
run_lamem(ParamFile::String, cores::Int64=1, args:String=""; wait=true, deactivate_multithreads=true)

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:

julia> ParamFile="../../input_models/BuildInSetups/FallingBlock_Multigrid.dat";
-julia> run_lamem(ParamFile, 2, "-nstep_max = 1")
source
run_lamem(model::Model, cores::Int64=1, args:String=""; wait=true)

Performs a LaMEM run for the parameters that are specified in model

source

Running LaMEM from outside julia

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:

LaMEM.Run.show_paths_LaMEMFunction
show_paths_LaMEM()

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.

This function shows this for your system.

source
+julia> run_lamem(ParamFile, 2, "-nstep_max = 1")source

Running LaMEM from outside julia

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:

LaMEM.Run.show_paths_LaMEMFunction
show_paths_LaMEM()

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.

This function shows this for your system.

source
diff --git a/dev/man/installation_HPC/index.html b/dev/man/installation_HPC/index.html index e07d91e..9b86bac 100644 --- a/dev/man/installation_HPC/index.html +++ b/dev/man/installation_HPC/index.html @@ -10,4 +10,4 @@ julia> MPI.Get_library_version() "MPIwrapper 2.10.3, using MPIABI 2.9.0, wrapping:\nOpen MPI v4.1.4, package: Open MPI boris@Pluton Distribution, ident: 4.1.4, repo rev: v4.1.4, May 26, 2022"

After this, restart julia (this only needs to be done once, next time all is fine).

julia> using MPI,LaMEM
 julia> LaMEM.LaMEM_jll.host_platform
-Linux x86_64 {cxxstring_abi=cxx11, julia_version=1.8.1, libc=glibc, libgfortran_version=5.0.0, mpi=mpitrampoline}

At this stage the precompiled version of LaMEM should be useable on that system.

+Linux x86_64 {cxxstring_abi=cxx11, julia_version=1.8.1, libc=glibc, libgfortran_version=5.0.0, mpi=mpitrampoline}

At this stage the precompiled version of LaMEM should be useable on that system.

diff --git a/dev/man/juliasetup_LaPalma/index.html b/dev/man/juliasetup_LaPalma/index.html index e074c03..c87a19a 100644 --- a/dev/man/juliasetup_LaPalma/index.html +++ b/dev/man/juliasetup_LaPalma/index.html @@ -99,4 +99,4 @@ Length : 1000. [m] Viscosity : 1e+20 [Pa*s] Stress : 1e+09 [Pa] --------------------------------------------------------------------------- +-------------------------------------------------------------------------- diff --git a/dev/man/juliasetup_TMSubduction/index.html b/dev/man/juliasetup_TMSubduction/index.html index 7f390ab..2838bc1 100644 --- a/dev/man/juliasetup_TMSubduction/index.html +++ b/dev/man/juliasetup_TMSubduction/index.html @@ -105,6 +105,8 @@ out_surf = 1, out_surf_pvd = 1, out_surf_topography = 1, + out_j2_dev_stress = 1, + out_pressure = 1, out_temperature = 1, )
Set some background properties, later overwritten

The model geometry in LaMEM is defined by two arrays: model.Grid.Temp and model.Grid.Phase which sets the initial temperature and phase at every point. These are 3D arrays that can be modified; in the usual case temperatures are assumed to be in Celcius, and the phases are integers (0-5 here).

Lets specify a few helpful parameters, such as the adiabatic temperature throughout the model (0.4°C/km) and the mantle potential temperature at the surface 1280°C:

Tair            = 20.0;
 Tmantle         = 1280.0;
 Adiabat         = 0.4

Next, we set the temperature everwhere to (will be overwrittem later) and all phases to 0 with

model.Grid.Temp     .= Tmantle .+ 1.0;      # set mantle temperature (without adiabat at first)
@@ -192,4 +194,4 @@
 

model.Solver = Solver( SolverType = "multigrid", MGLevels = 3, MGCoarseSolver = "superludist", PETScoptions = [ "-sneskspew", "-sneskspewrtolmax 1e-4", "-snesrtol 5e-3", "-snesatol 1e-4", "-snesmaxit 200", "-snesPicardSwitchToNewtonrtol 1e-3", "-snesNewtonSwitchToPicardit 20", "-jsksptype fgmres", "-jskspmaxit 20", "-jskspatol 1e-8", "-jsksprtol 1e-4", "-sneslinesearchtype l2", "-sneslinesearchmaxstep 10", "-darefiney 1" ] )


 #### 4. Perform the simulation
 Here we riun LaMEM on 8 cores (if you have them; use less otherwise):
-

julia julia> run_lamem(model, 8) Saved file: Model3D.vts (Nprocx, Nprocy, Nprocz, xc, yc, zc, nNodeX, nNodeY, nNodeZ) = (4, 1, 2, [-2000.0, -1000.0, 0.0, 1000.0, 2000.0], [-8.0, 8.0], [-660.0, -310.0, 40.0], 513, 2, 129) Writing LaMEM marker file -> ./markers/mdb.00000000.dat Writing LaMEM marker file -> ./markers/mdb.00000001.dat Writing LaMEM marker file -> ./markers/mdb.00000002.dat Writing LaMEM marker file -> ./markers/mdb.00000003.dat Writing LaMEM marker file -> ./markers/mdb.00000004.dat Writing LaMEM marker file -> ./markers/mdb.00000005.dat Writing LaMEM marker file -> ./markers/mdb.00000006.dat Writing LaMEM marker file -> ./markers/mdb.00000007.dat ––––––––––––––––––––––––––––––––––––– Lithosphere and Mantle Evolution Model Compiled: Date: Apr 7 2023 - Time: 22:11:23 Version : 1.2.4 ––––––––––––––––––––––––––––––––––––– STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION ––––––––––––––––––––––––––––––––––––– Parsing input file : output.dat Finished parsing input file : output.dat ––––––––––––––––––––––––––––––––––––– Scaling parameters: Temperature : 1000. [C/K] Length : 1000. [m] Viscosity : 1e+20 [Pa*s] Stress : 1e+09 [Pa] ```

The results will be saved in the directory where you performed the simulation and can be visualized in Paraview by opening the file output.pvd: 2D thermomechanical subduction

+

julia julia> run_lamem(model, 8) Saved file: Model3D.vts (Nprocx, Nprocy, Nprocz, xc, yc, zc, nNodeX, nNodeY, nNodeZ) = (4, 1, 2, [-2000.0, -1000.0, 0.0, 1000.0, 2000.0], [-8.0, 8.0], [-660.0, -310.0, 40.0], 513, 2, 129) Writing LaMEM marker file -> ./markers/mdb.00000000.dat Writing LaMEM marker file -> ./markers/mdb.00000001.dat Writing LaMEM marker file -> ./markers/mdb.00000002.dat Writing LaMEM marker file -> ./markers/mdb.00000003.dat Writing LaMEM marker file -> ./markers/mdb.00000004.dat Writing LaMEM marker file -> ./markers/mdb.00000005.dat Writing LaMEM marker file -> ./markers/mdb.00000006.dat Writing LaMEM marker file -> ./markers/mdb.00000007.dat ––––––––––––––––––––––––––––––––––––– Lithosphere and Mantle Evolution Model Compiled: Date: Apr 7 2023 - Time: 22:11:23 Version : 1.2.4 ––––––––––––––––––––––––––––––––––––– STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION ––––––––––––––––––––––––––––––––––––– Parsing input file : output.dat Finished parsing input file : output.dat ––––––––––––––––––––––––––––––––––––– Scaling parameters: Temperature : 1000. [C/K] Length : 1000. [m] Viscosity : 1e+20 [Pa*s] Stress : 1e+09 [Pa] ```

The results will be saved in the directory where you performed the simulation and can be visualized in Paraview by opening the file output.pvd: 2D thermomechanical subduction

diff --git a/dev/man/juliasetup_example_sphere/index.html b/dev/man/juliasetup_example_sphere/index.html index b8ef81b..58fadc2 100644 --- a/dev/man/juliasetup_example_sphere/index.html +++ b/dev/man/juliasetup_example_sphere/index.html @@ -92,4 +92,4 @@ "markers" "output.dat" "output.pvd"

And you can open output.pvd with paraview. If your system recogizes that *.pvd files should be opened with paraview, you can do that with

julia> ;
-shell> open output.pvd

Otherwise, start paraview manually and open the file.

+shell> open output.pvd

Otherwise, start paraview manually and open the file.

diff --git a/dev/man/juliasetup_pluto/index.html b/dev/man/juliasetup_pluto/index.html index c1e6273..1636428 100644 --- a/dev/man/juliasetup_pluto/index.html +++ b/dev/man/juliasetup_pluto/index.html @@ -1,4 +1,4 @@ Notebooks · LaMEM.jl

Using Pluto or Jupyter notebooks

Pluto

You can also run LaMEM directly using Pluto notebooks:

julia> using Pluto
 julia> Pluto.run()

we have provided examples in the notebooks directory of the LaMEM.jl package.

Jupyter

And for the ones of you that are more used to Jupyter notebooks, we also provide an example. Note that this will require you to install the required packages in julia first and use the IJulia package:

julia> using IJulia
-julia> notebook()
+julia> notebook() diff --git a/dev/man/juliasetups/index.html b/dev/man/juliasetups/index.html index d56b646..a116ece 100644 --- a/dev/man/juliasetups/index.html +++ b/dev/man/juliasetups/index.html @@ -77,4 +77,4 @@ y ϵ [-10.0 : 0.0] z ϵ [-10.0 : 0.0] Phases : range ϵ [0 - 1] - Temp : range ϵ [0.0 - 0.0]

Running a model is very simple:

julia> run_lamem(model,1)

More examples

More examples can be found on the left hand side menu.

+ Temp : range ϵ [0.0 - 0.0]

Running a model is very simple:

julia> run_lamem(model,1)

More examples

More examples can be found on the left hand side menu.

diff --git a/dev/man/listfunctions/index.html b/dev/man/listfunctions/index.html index 517cea8..4ec2908 100644 --- a/dev/man/listfunctions/index.html +++ b/dev/man/listfunctions/index.html @@ -1,7 +1,7 @@ -List of functions · LaMEM.jl

List of all functions

These are all functions that are available in the package, which can roughly be divided into two groups (running & reading LaMEM)

Running LaMEM

LaMEM.Run.remove_popup_messages_macMethod
remove_popup_messages_mac()

On a Mac with firewall enabled, running LaMEM will result in a popup window that says: "Accept incoming connections" which you should Allow or Deny. This is a bit annoying, so this julia script fixes that. Note that you must have administrator rights on your machine as we need to run "sudo"

Run this script from the terminal with

julia> remove_popup_messages_mac()

You need to do this once (every time a new version is installed)

source
LaMEM.Run.run_lamemFunction
run_lamem(ParamFile::String, cores::Int64=1, args:String=""; wait=true, deactivate_multithreads=true)

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
+List of functions · LaMEM.jl

List of all functions

These are all functions that are available in the package, which can roughly be divided into two groups (running & reading LaMEM)

Running LaMEM

LaMEM.Run.remove_popup_messages_macMethod
remove_popup_messages_mac()

On a Mac with firewall enabled, running LaMEM will result in a popup window that says: "Accept incoming connections" which you should Allow or Deny. This is a bit annoying, so this julia script fixes that. Note that you must have administrator rights on your machine as we need to run "sudo"

Run this script from the terminal with

julia> remove_popup_messages_mac()

You need to do this once (every time a new version is installed)

source
LaMEM.Run.run_lamemFunction
run_lamem(ParamFile::String, cores::Int64=1, args:String=""; wait=true, deactivate_multithreads=true)

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:

julia> ParamFile="../../input_models/BuildInSetups/FallingBlock_Multigrid.dat";
-julia> run_lamem(ParamFile, 2, "-nstep_max = 1")
source
LaMEM.Run.run_lamem_save_gridFunction
ProcessorPartFile = run_lamem_save_grid(ParamFile::String, cores::Int64=1; verbose=true)

This calls LaMEM simulation, for using the parameter file ParamFile and creates processor partitioning file "ProcessorPartitioningcorescpuX.Y.Z.bin" for cores number of cores.

Example:

julia> using LaMEM
+julia> run_lamem(ParamFile, 2, "-nstep_max = 1")
source
LaMEM.Run.run_lamem_save_gridFunction
ProcessorPartFile = run_lamem_save_grid(ParamFile::String, cores::Int64=1; verbose=true)

This calls LaMEM simulation, for using the parameter file ParamFile and creates processor partitioning file "ProcessorPartitioningcorescpuX.Y.Z.bin" for cores number of cores.

Example:

julia> using LaMEM
 julia> ParamFile="../../input_models/BuildInSetups/FallingBlock_Multigrid.dat";
-julia> ProcessorPartFile = run_lamem_save_grid(ParamFile, 2)
source
LaMEM.Run.show_paths_LaMEMMethod
show_paths_LaMEM()

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.

This function shows this for your system.

source

Reading LaMEM output back into julia

```@autodocs Modules = [LaMEM.IO_functions]

+julia> ProcessorPartFile = run_lamem_save_grid(ParamFile, 2)
source
LaMEM.Run.show_paths_LaMEMMethod
show_paths_LaMEM()

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.

This function shows this for your system.

source

Reading LaMEM output back into julia

```@autodocs Modules = [LaMEM.IO_functions]

diff --git a/dev/man/readtimesteps/index.html b/dev/man/readtimesteps/index.html index 5494e67..3d1077b 100644 --- a/dev/man/readtimesteps/index.html +++ b/dev/man/readtimesteps/index.html @@ -27,4 +27,4 @@ z ϵ [ 0.0 : 1.0] fields : (:phase, :visc_total, :velocity) attributes: ["note"] -, [6.729703]) +, [6.729703]) diff --git a/dev/man/runlamem/index.html b/dev/man/runlamem/index.html index 1d4157b..ffb8a8d 100644 --- a/dev/man/runlamem/index.html +++ b/dev/man/runlamem/index.html @@ -27,4 +27,4 @@ Output every [n] steps : 1 Output [n] initial steps : 1 --------------------------------------------------------------------------

The last parameter are optional PETSc command-line options. By default it runs on one processor.

Please note that you will have to be in the correct directory or indicate where that directory is. If you are in a different directory, the easiest way to change to the correct one is by using the changefolder function (on Windows and Mac):

julia> changefolder()

Alternatively, you can use the build-in terminal/shell in julia, which you can access with:

julia>;
-shell>cd ~/LaMEM/input_models/BuildInSetups/

use the Backspace key to return to the julia REPL.

Once you have performed a simulation, you can look at the results by opening the *.pvd files with Paraview. In this example, that would be FB_multigrid.pvd and FB_multigrid_phase.pvd.

+shell>cd ~/LaMEM/input_models/BuildInSetups/

use the Backspace key to return to the julia REPL.

Once you have performed a simulation, you can look at the results by opening the *.pvd files with Paraview. In this example, that would be FB_multigrid.pvd and FB_multigrid_phase.pvd.

diff --git a/dev/search/index.html b/dev/search/index.html index 112566d..b84f737 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · LaMEM.jl

Loading search...

    +Search · LaMEM.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index 0221e4d..0c23c61 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"man/readtimesteps/#Read-timesteps-back-into-LaMEM","page":"Reading timesteps","title":"Read timesteps back into LaMEM","text":"","category":"section"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"If you want to quantitatively do something with the results, there is an easy way to read the output of a LaMEM timestep back into julia. All routines related to that are part of the LaMEM.IO module.","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> using LaMEM","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"You can first read the *.pvd file in the directory to see which timesteps are available:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> FileName=\"FB_multigrid\"\njulia> DirName =\"test\"\njulia> Timestep, Filenames, Time = Read_LaMEM_simulation(FileName, DirName)\n([0, 1], [\"Timestep_00000000_0.00000000e+00/FB_multigrid.pvtr\", \"Timestep_00000001_6.72970343e+00/FB_multigrid.pvtr\"], [0.0, 6.729703])","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"We can read a particular timestep (say 1) with:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> data, time = Read_LaMEM_timestep(FileName, 1, DirName)\n(CartData \n size : (33, 33, 33)\n x ϵ [ 0.0 : 1.0]\n y ϵ [ 0.0 : 1.0]\n z ϵ [ 0.0 : 1.0]\n fields : (:phase, :visc_total, :visc_creep, :velocity, :pressure, :strain_rate, :j2_dev_stress, :j2_strain_rate)\n attributes: [\"note\"]\n, [6.729703])","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"The output is in a CartData structure (as defined in GeophysicalModelGenerator).","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"If you do not indicate a directory name (DirName) it'll look in your current directory. The default above will load the main LaMEM simulation output. Alternatively, you can also load the phase information by specify the optional keyword phase=true:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> data, time = Read_LaMEM_timestep(FileName, 1, DirName, phase=true)\n(CartData \n size : (96, 96, 96)\n x ϵ [ 0.0052083334885537624 : 0.9947916269302368]\n y ϵ [ 0.0052083334885537624 : 0.9947916269302368]\n z ϵ [ 0.0052083334885537624 : 0.9947916269302368]\n fields : (:phase,)\n attributes: [\"note\"]\n, [6.729703])","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"In the same way, you can load the internal free surface with surf=true (if that was saved), or passive tracers (passive_tracers=true). If you don't want to load all the fields in the file back to julia, you can check which fields are available:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> Read_LaMEM_fieldnames(FileName, DirName)\n(\"phase [ ]\", \"visc_total [ ]\", \"visc_creep [ ]\", \"velocity [ ]\", \"pressure [ ]\", \"strain_rate [ ]\", \"j2_dev_stress [ ]\", \"j2_strain_rate [ ]\")","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"and load only part of those:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> data, time = Read_LaMEM_timestep(FileName, 1, DirName, fields=(\"phase [ ]\", \"visc_total [ ]\",\"velocity [ ]\"))\n(CartData \n size : (33, 33, 33)\n x ϵ [ 0.0 : 1.0]\n y ϵ [ 0.0 : 1.0]\n z ϵ [ 0.0 : 1.0]\n fields : (:phase, :visc_total, :velocity)\n attributes: [\"note\"]\n, [6.729703])","category":"page"},{"location":"man/juliasetup_pluto/#Using-Pluto-or-Jupyter-notebooks","page":"Notebooks","title":"Using Pluto or Jupyter notebooks","text":"","category":"section"},{"location":"man/juliasetup_pluto/#Pluto","page":"Notebooks","title":"Pluto","text":"","category":"section"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"You can also run LaMEM directly using Pluto notebooks:","category":"page"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"julia> using Pluto\njulia> Pluto.run()","category":"page"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"we have provided examples in the notebooks directory of the LaMEM.jl package.","category":"page"},{"location":"man/juliasetup_pluto/#Jupyter","page":"Notebooks","title":"Jupyter","text":"","category":"section"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"And for the ones of you that are more used to Jupyter notebooks, we also provide an example. Note that this will require you to install the required packages in julia first and use the IJulia package:","category":"page"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"julia> using IJulia\njulia> notebook()","category":"page"},{"location":"man/listfunctions/#List-of-all-functions","page":"List of functions","title":"List of all functions","text":"","category":"section"},{"location":"man/listfunctions/","page":"List of functions","title":"List of functions","text":"These are all functions that are available in the package, which can roughly be divided into two groups (running & reading LaMEM)","category":"page"},{"location":"man/listfunctions/#Running-LaMEM","page":"List of functions","title":"Running LaMEM","text":"","category":"section"},{"location":"man/listfunctions/","page":"List of functions","title":"List of functions","text":"Modules = [LaMEM.Run]\n","category":"page"},{"location":"man/listfunctions/#LaMEM.Run.deactivate_multithreading-Tuple{Cmd}","page":"List of functions","title":"LaMEM.Run.deactivate_multithreading","text":"deactivate_multithreading(cmd)\n\nThis deactivates multithreading\n\n\n\n\n\n","category":"method"},{"location":"man/listfunctions/#LaMEM.Run.remove_popup_messages_mac-Tuple{}","page":"List of functions","title":"LaMEM.Run.remove_popup_messages_mac","text":"remove_popup_messages_mac()\n\nOn a Mac with firewall enabled, running LaMEM will result in a popup window that says: \"Accept incoming connections\" which you should Allow or Deny. This is a bit annoying, so this julia script fixes that. Note that you must have administrator rights on your machine as we need to run \"sudo\"\n\nRun this script from the terminal with\n\njulia> remove_popup_messages_mac()\n\nYou need to do this once (every time a new version is installed)\n\n\n\n\n\n","category":"method"},{"location":"man/listfunctions/#LaMEM.Run.run_lamem","page":"List of functions","title":"LaMEM.Run.run_lamem","text":"run_lamem(ParamFile::String, cores::Int64=1, args:String=\"\"; wait=true, deactivate_multithreads=true)\n\nThis 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.\n\nExample:\n\nYou can call LaMEM with:\n\njulia> using LaMEM\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile)\n\nDo the same on 2 cores with a command-line argument as:\n\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile, 2, \"-nstep_max = 1\")\n\n\n\n\n\n","category":"function"},{"location":"man/listfunctions/#LaMEM.Run.run_lamem_save_grid","page":"List of functions","title":"LaMEM.Run.run_lamem_save_grid","text":"ProcessorPartFile = run_lamem_save_grid(ParamFile::String, cores::Int64=1; verbose=true)\n\nThis calls LaMEM simulation, for using the parameter file ParamFile and creates processor partitioning file \"ProcessorPartitioningcorescpuX.Y.Z.bin\" for cores number of cores. \n\nExample:\n\njulia> using LaMEM\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> ProcessorPartFile = run_lamem_save_grid(ParamFile, 2)\n\n\n\n\n\n","category":"function"},{"location":"man/listfunctions/#LaMEM.Run.show_paths_LaMEM-Tuple{}","page":"List of functions","title":"LaMEM.Run.show_paths_LaMEM","text":"show_paths_LaMEM()\n\nThe 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.\n\nThis function shows this for your system. \n\n\n\n\n\n","category":"method"},{"location":"man/listfunctions/#Reading-LaMEM-output-back-into-julia","page":"List of functions","title":"Reading LaMEM output back into julia","text":"","category":"section"},{"location":"man/listfunctions/","page":"List of functions","title":"List of functions","text":"```@autodocs Modules = [LaMEM.IO_functions]","category":"page"},{"location":"man/juliasetup_LaPalma/#La-Palma-Volcano-setup","page":"Example 2: Volcano","title":"La Palma Volcano setup","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"In this example, we will show how to create a 3D model setup for the 2020 La Palma eruption. We mainly focus on the LaMEM part; see the GeophysicalModelGenerator package for more details on how to plot earthquake data etc.","category":"page"},{"location":"man/juliasetup_LaPalma/#.-Load-packages-and-topography","page":"Example 2: Volcano","title":"1. Load packages & topography","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Let's start with what we need:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> using LaMEM, GeophysicalModelGenerator, GMT, Plots\nLoading GMT routines within GMG\nWARNING: using GMT.meshgrid in module GeophysicalModelGenerator conflicts with an existing identifier.\nadding Plots.jl plotting extensions for LaMEM","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Load the topography, choose a projection point & project the topography to cartesian coordinates:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> Topo = ImportTopo(lon = [-18.7, -17.1], lat=[28.0, 29.2], file=\"@earth_relief_03s.grd\");\njulia> proj = ProjectionPoint(Lon=-17.84, Lat=28.56);\njulia> Topo_cart = Convert2CartData(Topo, proj)\nCartData \n size : (1921, 1441, 1)\n x ϵ [ -86.09445705828863 : 73.67229892155609]\n y ϵ [ -63.5531883197492 : 73.28446155584604]\n z ϵ [ -4.38352685546875 : 2.414]\n fields : (:Topography,)\n attributes: [\"note\"]","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"This shows the dimensions of our domain in kilometers. The issue is that this projected topography is not an orthogonal grid, but (slightly) distorted. In any case, we see the approximate dimensions of the grid (in horizontal directions), so we can create an orthogonal grid on which to project this:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> Topo_LaMEM = CartData(XYZGrid(-70:.2:70,-60:.2:70,0));\njulia> Topo_LaMEM = ProjectCartData(Topo_LaMEM, Topo, proj)","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We can plot it with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> plot_topo(Topo_LaMEM, clim=(-4,4))","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"(Image: LaPalma_topo)","category":"page"},{"location":"man/juliasetup_LaPalma/#.-LaMEM-Model-setup","page":"Example 2: Volcano","title":"2. LaMEM Model setup","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Next, we generate a model setup for LaMEM with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model = Model(Grid(x=[-50.,50.], y=[-40.,40.], z=[-80,15] , nel=(64,64,32)),\n BoundaryConditions(temp_bot=1350, open_top_bound=1),\n Scaling(GEO_units(stress=1e9Pa, length=1km)),\n Time(nstep_max=20) )\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(64, 64, 32); xϵ(-50.0, 50.0), yϵ(-40.0, 40.0), zϵ(-80.0, 15.0) \n|-- Time : nstep_max=20; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases; ","category":"page"},{"location":"man/juliasetup_LaPalma/#Set-geotherm-and-phases","page":"Example 2: Volcano","title":"Set geotherm and phases","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We can set an initial constant, linear, geotherm with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> Z = model.Grid.Grid.Z;\njulia> Geotherm=30\njulia> model.Grid.Temp = -Z.*Geotherm;","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We will cutoff extreme values with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model.Grid.Temp[model.Grid.Temp.<20] .= 20;\njulia> model.Grid.Temp[model.Grid.Temp.>1350] .= 1350;\njulia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([64], [64], [32])\n marker/cell : (3, 3, 3)\n x ϵ [-50.0 : 50.0]\n y ϵ [-40.0 : 40.0]\n z ϵ [-80.0 : 15.0]\n Phases : range ϵ [0 - 0]\n Temp : range ϵ [20.0 - 1350.0]","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Set Phases to two everywhere:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model.Grid.Phases .= 2;","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Now set points above the topography to zero (will be air later), the ones above the topography but below zero to 'water` and below 40 km to mantle (if we had a Moho surface we could use that):","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":" julia> AboveSurface!(model, Topo_LaMEM, phase=0, T=0)\n julia> model.Grid.Phases[Z.<-0 .&& model.Grid.Phases .== 0] .= 1;\n julia> model.Grid.Phases[Z.<-40] .= 3;","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Finally, we define some magma chambers:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> AddSphere!(model, cen=(0,0,-35), radius=5, phase=ConstantPhase(5), T=ConstantTemp(1200));\njulia> AddEllipsoid!(model, cen=(-1,0,-11), axes=(3,3,8), StrikeAngle=225, DipAngle=45, phase=ConstantPhase(5), T=ConstantTemp(1200));\njulia> AddEllipsoid!(model, cen=(-0,0,-23), axes=(8,8,2), StrikeAngle=0, DipAngle=0, phase=ConstantPhase(5), T=ConstantTemp(1200));","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We can plot a cross-section through the model:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":" julia> plot_cross_section(model, x=0, field=:phase)","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"(Image: LaPalma_CrossSection)","category":"page"},{"location":"man/juliasetup_LaPalma/#Set-material-properties","page":"Example 2: Volcano","title":"Set material properties","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"First, we set air and water properties:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> air = set_air(alpha=3e-5, G=1e10, nu=0.2, ch=10e6, fr=30)\nPhase 0 (air): \n rho = 100.0 \n eta = 1.0e17 \n G = 1.0e10 \n nu = 0.2 \n ch = 1.0e7 \n fr = 30.0 \n alpha = 3.0e-5 \n Cp = 1000.0 \n k = 30.0 \njulia> water=deepcopy(air); water.Name=\"water\"; water.ID=1","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Next, we set the crust:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> crust = Phase(Name=\"Crust\", ID=2, rho=2900, alpha=3e-5, disl_prof=\"Mafic_Granulite-Ranalli_1995\",\n G=3e10, nu=0.2, k=3, Cp=1000, ch=10e6, fr=30)\nPhase 2 (Crust): \n rho = 2900.0 \n disl_prof = Mafic_Granulite-Ranalli_1995 \n G = 3.0e10 \n nu = 0.2 \n ch = 1.0e7 \n fr = 30.0 \n alpha = 3.0e-5 \n Cp = 1000.0 \n k = 3.0 ","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"The mantle is done as a copy of that, while changing a few parameters:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":" julia> mantle = copy_phase(crust, Name=\"Mantle\", ID=3, rho=3320.0, disl_prof=\"Dry_Olivine-Ranalli_1995\", G=6.5e10, k=3.3);","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"And we define two different types of magma:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> andesite = Phase(Name=\"andesitic_magma\",ID=4,rho=2700, alpha=3e-5, eta=1e18, G=1.5e10, nu=0.2, k=3, Cp=1000, T=980, ch=1e7, fr=30);\njulia> dacite = copy_phase(andesite,Name=\"dacite_magma\", ID=5, rho=2575.0, eta=1e19, T=800.0)","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Now we add all of this to the model:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> rm_phase!(model)\njulia> add_phase!(model, air, water, crust, mantle, andesite, dacite)","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"And check that we indeed have 6 phases:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(64, 64, 32); xϵ(-50.0, 50.0), yϵ(-40.0, 40.0), zϵ(-80.0, 15.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases; ","category":"page"},{"location":"man/juliasetup_LaPalma/#Add-topography-to-model","page":"Example 2: Volcano","title":"Add topography to model","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We can add the topography grid that we created earlier to the model with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> add_topography!(model, Topo_LaMEM)","category":"page"},{"location":"man/juliasetup_LaPalma/#Set-solver-options","page":"Example 2: Volcano","title":"Set solver options","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"You will want to use a multigrid solver in this case:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model.Solver = Solver(SolverType=\"multigrid\", MGLevels=4)","category":"page"},{"location":"man/juliasetup_LaPalma/#.-Run-LaMEM","page":"Example 2: Volcano","title":"3. Run LaMEM","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Running LaMEM is simple; here on 4 processors:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> run_lamem(model, 4)\nSaved file: Model3D.vts\nWritten LaMEM topography file: topography.txt\nWriting LaMEM marker file -> ./markers/mdb.00000000.dat\nWriting LaMEM marker file -> ./markers/mdb.00000001.dat\nWriting LaMEM marker file -> ./markers/mdb.00000002.dat\nWriting LaMEM marker file -> ./markers/mdb.00000003.dat\n-------------------------------------------------------------------------- \n Lithosphere and Mantle Evolution Model \n Compiled: Date: Apr 7 2023 - Time: 22:11:23 \n Version : 1.2.4 \n-------------------------------------------------------------------------- \n STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION \n-------------------------------------------------------------------------- \nParsing input file : output.dat \nFinished parsing input file : output.dat \n--------------------------------------------------------------------------\nScaling parameters:\n Temperature : 1000. [C/K] \n Length : 1000. [m] \n Viscosity : 1e+20 [Pa*s] \n Stress : 1e+09 [Pa] \n--------------------------------------------------------------------------","category":"page"},{"location":"man/LaMEM_ModelFunctions/#List-functions","page":"Available functions","title":"List functions","text":"","category":"section"},{"location":"man/LaMEM_ModelFunctions/","page":"Available functions","title":"Available functions","text":"These are all the functions that are provided for the LaMEM Julia Setup interface ","category":"page"},{"location":"man/LaMEM_ModelFunctions/","page":"Available functions","title":"Available functions","text":"Modules = [LaMEM.LaMEM_Model]","category":"page"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.BoundaryConditions","page":"Available functions","title":"LaMEM.LaMEM_Model.BoundaryConditions","text":"Structure that contains the LaMEM boundary conditions information.\n\nnoslip::Vector{Int64}: No-slip boundary flag mask (left right front back bottom top)\nopen_top_bound::Int64: Stress-free (free surface/infinitely fast erosion) top boundary flag\ntemp_top::Float64: Constant temperature on the top boundary\ntemp_bot::Float64: Constant temperature on the bottom boundary\nexx_num_periods::Int64: number intervals of constant background strain rate (x-axis)\nexx_time_delims::Vector{Float64}: time delimiters (one less than number of intervals, not required for one interval)\nexx_strain_rates::Vector{Float64}: strain rates for each interval\neyy_num_periods::Int64: eyynumperiods\neyy_time_delims::Vector{Float64}: eyytimedelims\neyy_strain_rates::Vector{Float64}: eyystrainrates\nexy_num_periods::Int64: exynumperiods\nexy_time_delims::Vector{Float64}: exytimedelims\nexy_strain_rates::Vector{Float64}: exystrainrates\nexz_num_periods::Int64: exznumperiods\nexz_time_delims::Vector{Float64}: exztimedelims\nexz_strain_rates::Vector{Float64}: exzstrainrates\neyz_num_periods::Int64: eyznumperiods\neyz_time_delims::Vector{Float64}: eyztimedelims\neyz_strain_rates::Vector{Float64}: eyzstrainrates\nbg_ref_point::Vector{Float64}: background strain rate reference point (fixed)\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Dike","page":"Available functions","title":"LaMEM.LaMEM_Model.Dike","text":"Defines the properties related to inserting dikes\n\nID::Int64: Material phase ID\nMf::Float64: value for dike/magma- accommodated extension, between 0 and 1, in the front of the box, for phase dike\nMc::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\ny_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\nMb::Union{Nothing, Float64}: value for dike/magma-accommodated extension, between 0 and 1, in the back of the box, for phase dike\nPhaseID::Union{Nothing, Int64}: Phase ID\nPhaseTransID::Union{Nothing, Int64}: Phase transition ID\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.FreeSurface","page":"Available functions","title":"LaMEM.LaMEM_Model.FreeSurface","text":"Structure that contains the LaMEM free surface information.\n\nsurf_use::Int64: Free surface activation flag\nsurf_corr_phase::Int64: air phase ratio correction flag (phases in an element that contains are modified based on the surface position)\nsurf_level::Union{Nothing, Float64}: initial level of the free surface\nsurf_air_phase::Union{Nothing, Int64}: phase ID of sticky air layer\nsurf_max_angle::Float64: maximum angle with horizon (smoothed if larger)\nsurf_topo_file::String: initial topography file (redundant)\nerosion_model::Int64: erosion model [0-none (default), 1-infinitely fast, 2-prescribed rate with given level]\ner_num_phases::Int64: number of erosion phases\ner_time_delims::Vector{Float64}: erosion time delimiters (one less than number)\ner_rates::Vector{Float64}: constant erosion rates in different time periods\ner_levels::Vector{Int64}: levels above which we apply constant erosion rates in different time periods\nsediment_model::Int64: sedimentation model [0-none (dafault), 1-prescribed rate with given level, 2-cont. margin]\nsed_num_layers::Int64: number of sediment layers\nsed_time_delims::Vector{Float64}: sediment layers time delimiters (one less than number)\nsed_rates::Vector{Float64}: sediment rates in different time periods\nsed_levels::Vector{Float64}: levels below which we apply constant sediment rates in different time periods\nsed_phases::Vector{Int64}: sediment layers phase numbers in different time periods\nmarginO::Vector{Float64}: lateral coordinates of continental margin - origin\nmarginE::Vector{Float64}: lateral coordinates of continental margin - 2nd point\nhUp::Float64: up dip thickness of sediment cover (onshore)\nhDown::Float64: down dip thickness of sediment cover (off shore)\ndTrans::Float64: half of transition zone\nTopography::Union{Nothing, GeophysicalModelGenerator.CartData}: Topography grid\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Grid","page":"Available functions","title":"LaMEM.LaMEM_Model.Grid","text":"Structure that contains the LaMEM grid information\n\nnmark_x::Int64: number of markers/element in x-direction\nnmark_y::Int64: number of markers/element in y-direction\nnmark_z::Int64: number of markers/element in x-direction\nnel_x::Vector{Int64}: number of elements in x-direction\nnel_y::Vector{Int64}: number of elements in y-direction\nnel_z::Vector{Int64}: number of elements in z-direction\ncoord_x::Vector{Float64}: coordinates in x-direction\ncoord_y::Vector{Float64}: coordinates in y-direction\ncoord_z::Vector{Float64}: coordinates in z-direction\nnseg_x::Int64: number of segments in x-direction (if we employ variable grid spacing in x-direction)\nnseg_y::Int64: number of segments in y-direction (if we employ variable grid spacing in y-direction)\nnseg_z::Int64: number of segments in z-direction (if we employ variable grid spacing in z-direction)\nbias_x::Vector{Float64}: bias in x-direction (if we employ variable grid spacing in x-direction)\nbias_y::Vector{Float64}: bias in y-direction (if we employ variable grid spacing in y-direction)\nbias_z::Vector{Float64}: bias in z-direction (if we employ variable grid spacing in z-direction)\nGrid::GeophysicalModelGenerator.LaMEM_grid: Contains the LaMEM Grid object\nPhases::Array{Int32}: Phases; 3D phase information\nTemp::Array{Float64}: Temp; 3D phase information\n\nExample 1\n\njulia> d=LaMEM.Grid(coord_x=[0.0, 0.7, 0.8, 1.0], bias_x=[0.3,1.0,3.0], nel_x=[10,4,2])\nLaMEM grid with 1D refinement: \n nel : ([10, 4, 2], [16], [16])\n marker/cell : (3, 3, 3)\n x ϵ [0.0, 0.7, 0.8, 1.0], bias=[0.3, 1.0, 3.0], nseg=3, Δmin=0.025000000000000022, Δmax=0.1499999999999999\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n\nExample 2\n\njulia> d=LaMEM.Grid(nel=(10,20))\nLaMEM grid with constant Δ: \n nel : ([10], [1], [20])\n marker/cell : (3, 3, 3)\n x ϵ [-10.0 : 10.0]\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Materials","page":"Available functions","title":"LaMEM.LaMEM_Model.Materials","text":"Structure that contains the material properties in the current simulation\n\nPhases::Vector{Phase}: Different Materials implemented\nSofteningLaws::Vector{Softening}: Softening laws implemented\nPhaseTransitions::Vector{PhaseTransition}: Internal Phase Transitions (that change the ID of markers) implemented\nDikes::Vector{Dike}: Dikes implemented (mostly for MOR simulations)\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Model","page":"Available functions","title":"LaMEM.LaMEM_Model.Model","text":"; Model\n\nStructure that holds all the information to create a LaMEM input file\n\nScaling::Scaling: Scaling parameters\nGrid::Grid: LaMEM Grid\nTime::Any: Time options\nFreeSurface::Any: Free surface options\nBoundaryConditions::Any: Boundary conditions\nSolutionParams::Any: Global solution parameters\nSolver::Any: Solver options and optional PETSc options\nModelSetup::Any: Model setup\nOutput::Any: Output options\nMaterials::Any: Material parameters for each of the phases\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Model-Tuple","page":"Available functions","title":"LaMEM.LaMEM_Model.Model","text":"Model(args...)\n\nAllow to define a model setup by specifying some of the basic objects\n\nExample\n\njulia> d = Model(Grid(nel=(10,1,20)), Scaling(NO_units()))\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GeoParams.Units.NONE}\n|-- Grid : nel=(10, 1, 20); xϵ(-10.0, 10.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : \n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=geom; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 1 phases; \n\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Model-Tuple{}","page":"Available functions","title":"LaMEM.LaMEM_Model.Model","text":"Model(;\n Scaling=Scaling(GEO_units()),\n Grid=Grid(), \n Time=Time(),\n FreeSurface=FreeSurface(),\n BoundaryConditions=BoundaryConditions(),\n SolutionParams=SolutionParams(),\n Solver=Solver(),\n ModelSetup=ModelSetup(),\n Output=Output(),\n Materials=Materials()\n )\n\nCreates a LaMEM Model setup.\n\nScaling::Scaling\nGrid::Grid\nTime::Any\nFreeSurface::Any\nBoundaryConditions::Any\nSolutionParams::Any\nSolver::Any\nModelSetup::Any\nOutput::Any\nMaterials::Any\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.ModelSetup","page":"Available functions","title":"LaMEM.LaMEM_Model.ModelSetup","text":"Structure that contains the LaMEM Model Setup and Advection options\n\nmsetup::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)\nrand_noise::Int64: add random noise to the particle location\nrand_noiseGP::Int64: random noise flag, subsequently applied to geometric primitives\nbg_phase::Int64: background phase ID\nsave_mark::Int64: save marker to disk flag\nmark_load_file::String: marker input file (extension is .xxxxxxxx.dat), if using msetup=files\nmark_save_file::String: marker output file (extension is .xxxxxxxx.dat)\npoly_file::String: polygon geometry file (redundant), if using msetup=polygons\ntemp_file::String: initial temperature file (redundant), if not set on markers\nadvect::String: advection scheme; options=none (no advection); basic (Euler classical implementation [default]); Euler (Euler explicit in time); rk2 (Runge-Kutta 2nd order in space)\ninterp::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)\nstagp_a::Float64: STAG_P velocity interpolation parameter\nmark_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)\nnmark_lim::Vector{Int64}: min/max number per cell (marker control)\nnmark_avd::Vector{Int64}: x-y-z AVD refinement factors (avd marker control)\nnmark_sub::Int64: max number of same phase markers per subcell (subgrid marker control)\ngeom_primitives::Vector: Different geometric primitives that can be selected if we msetup=geom; seegeom_Sphere`\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Output","page":"Available functions","title":"LaMEM.LaMEM_Model.Output","text":"Structure that contains the LaMEM output options\n\nout_file_name::Any: output file name\nout_dir::Any: output directory\nparam_file_name::Any: parameter filename\nwrite_VTK_setup::Any: write VTK initial model setup\nout_pvd::Any: activate writing .pvd file\nout_phase::Any: dominant phase\nout_density::Any: density\nout_visc_total::Any: total (viscoelastoplastic) viscosity\nout_visc_creep::Any: creep viscosity\nout_velocity::Any: velocity\nout_pressure::Any: (dynamic) pressure\nout_tot_press::Any: total pressure\nout_eff_press::Any: effective pressure\nout_over_press::Any: outoverpress\nout_litho_press::Any: lithospheric pressure\nout_pore_press::Any: pore pressure\nout_temperature::Any: temperature\nout_dev_stress::Any: deviatoric strain rate tensor\nout_j2_dev_stress::Any: second invariant of deviatoric stress tensor\nout_strain_rate::Any: deviatoric strain rate tensor\nout_j2_strain_rate::Any: second invariant of strain rate tensor\nout_shmax::Any: sh max\nout_ehmax::Any: eh max\nout_yield::Any: yield stress\nout_rel_dif_rate::Any: relative proportion of diffusion creep strainrate\nout_rel_dis_rate::Any: relative proportion of dislocation creep strainrate\nout_rel_prl_rate::Any: relative proportion of peierls creep strainrate\nout_rel_pl_rate::Any: relative proportion of plastic strainrate\nout_plast_strain::Any: accumulated plastic strain\nout_plast_dissip::Any: plastic dissipation\nout_tot_displ::Any: total displacement\nout_moment_res::Any: momentum residual\nout_cont_res::Any: continuity residual\nout_energ_res::Any: energy residual\nout_melt_fraction::Any: Melt fraction\nout_fluid_density::Any: fluid density\nout_conductivity::Any: conductivity\nout_vel_gr_tensor::Any: velocity gradient tensor\nout_surf::Any: activate surface output\nout_surf_pvd::Any: activate writing .pvd file\nout_surf_velocity::Any: surface velocity\nout_surf_topography::Any: surface topography\nout_surf_amplitude::Any: amplitude of topography (=topo-average(topo))\nout_mark::Any: activate marker output\nout_mark_pvd::Any: activate writing .pvd file\nout_avd::Any: activate AVD phase output\nout_avd_pvd::Any: activate writing .pvd file\nout_avd_ref::Any: AVD grid refinement factor\nout_ptr::Any: activate\nout_ptr_ID::Any: ID of the passive tracers\nout_ptr_phase::Any: phase of the passive tracers\nout_ptr_Pressure::Any: interpolated pressure\nout_ptr_Temperature::Any: temperature\nout_ptr_MeltFraction::Any: melt fraction computed using P-T of the marker\nout_ptr_Active::Any: option that highlight the marker that are currently active\nout_ptr_Grid_Mf::Any: option that allow to store the melt fraction seen within the cell\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Phase","page":"Available functions","title":"LaMEM.LaMEM_Model.Phase","text":"Defines the material properties for each of the phases\n\nID::Union{Nothing, Int64}: Material phase ID\nName::Union{Nothing, String}: Description of the phase\nrho::Union{Nothing, Float64}: Density [kg/m^3]\neta::Union{Nothing, Float64}: Linear viscosity [Pas]\nvisID::Union{Nothing, Int64}: material ID for phase visualization (default is ID)\ndiff_prof::Union{Nothing, String}: DIFFUSION creep profile; example: \"DryOlivinediffcreep-HirthKohlstedt_2003\"\ndisl_prof::Union{Nothing, String}: DISLOCATION creep profile; example: \"Granite-Tireletal_2008\"\npeir_prof::Union{Nothing, String}: PEIERLS creep profile; example: \"OlivinePeierls-Kameyama1999\"\nrho_n::Union{Nothing, Float64}: depth-dependent density model parameter\nrho_c::Union{Nothing, Float64}: depth-dependent density model parameter\nbeta::Union{Nothing, Float64}: pressure-dependent density model parameter\nG::Union{Nothing, Float64}: shear modulus\nKb::Union{Nothing, Float64}: bulk modulus\nE::Union{Nothing, Float64}: Young's modulus\nnu::Union{Nothing, Float64}: Poisson's ratio\nKp::Union{Nothing, Float64}: pressure dependence parameter\nBd::Union{Nothing, Float64}: DIFFUSION creep pre-exponential constant\nEd::Union{Nothing, Float64}: activation energy\nVd::Union{Nothing, Float64}: activation volume\neta0::Union{Nothing, Float64}: POWER LAW reference viscosity\ne0::Union{Nothing, Float64}: reference strain rate\nBn::Union{Nothing, Float64}: DISLOCATION creep pre-exponential constant\nEn::Union{Nothing, Float64}: activation energy\nVn::Union{Nothing, Float64}: activation volume\nn::Union{Nothing, Float64}: power law exponent\nBp::Union{Nothing, Float64}: PEIERLS creep pre-exponential constant\nEp::Union{Nothing, Float64}: activation energy\nVp::Union{Nothing, Float64}: activation volume\ntaup::Union{Nothing, Float64}: scaling stress\ngamma::Union{Nothing, Float64}: approximation parameter\nq::Union{Nothing, Float64}: stress-dependence parameter\neta_fk::Union{Nothing, Float64}: reference viscosity for Frank-Kamenetzky viscosity\ngamma_fk::Union{Nothing, Float64}: gamma parameter for Frank-Kamenetzky viscosity\nTRef_fk::Union{Nothing, Float64}: reference Temperature for Frank-Kamenetzky viscosity (if not set it is 0°C)\nch::Union{Nothing, Float64}: cohesion\nfr::Union{Nothing, Float64}: friction angle\neta_st::Union{Nothing, Float64}: stabilization viscosity (default is eta_min)\nrp::Union{Nothing, Float64}: pore-pressure ratio\nchSoftID::Union{Nothing, Int64}: friction softening law ID\nfrSoftID::Union{Nothing, Int64}: cohesion softening law ID\nhealID::Union{Nothing, Int64}: healing ID, points to healTau in Softening\nalpha::Union{Nothing, Float64}: thermal expansivity\nCp::Union{Nothing, Float64}: specific heat (capacity), J⋅K−1⋅kg−1\nk::Union{Nothing, Float64}: thermal conductivity\nA::Union{Nothing, Float64}: radiogenic heat production\nT::Union{Nothing, Float64}: optional temperature to set within the phase\nLatent_hx::Union{Nothing, Float64}: optional, used for dike heating, J/kg\nT_liq::Union{Nothing, Float64}: optional, used for dike heating, liquidus temperature of material, celsius\nT_sol::Union{Nothing, Float64}: optional, used for dike heating, solidus temperature of material, celsius\nT_Nu::Union{Nothing, Float64}: default value for thermal conductivity boundary\nnu_k::Union{Nothing, Float64}: optional parameter, Nusselt number for use with conductivity\nrho_ph::Union{Nothing, String}: name of the phase diagram you want to use (still needs rho to be defined for the initial guess of pressure)\nrho_ph_dir::Union{Nothing, String}: in case the phase diagram has a different path provide the path (without the name of the actual PD) here\nmfc::Union{Nothing, Float64}: melt fraction viscosity correction factor (positive scalar)\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.PhaseTransition","page":"Available functions","title":"LaMEM.LaMEM_Model.PhaseTransition","text":"Defines phase transitions on markers (that change the Phase ID of a marker depending on some conditions)\n\nID::Int64: Phase_transition law ID\nType::String: [Constant, Clapeyron, Box]: Constant - the phase transition occurs only at a fixed value of the parameter; Clapeyron - clapeyron slope\nName_Clapeyron::Union{Nothing, Int64}: Type of predefined Clapeyron slope, such as MantleTransition660km\nPTBox_Bounds::Union{Nothing, Vector{Float64}}: box bound coordinates: [left, right, front, back, bottom, top]\nBoxVicinity::Union{Nothing, Int64}: 1: only check particles in the vicinity of the box boundaries (2: in all directions)\nParameter_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\nConstantValue::Union{Nothing, Float64}: Value of the parameter [unit of T,P,z, APS]\nnumber_phases::Union{Nothing, Int64}: The number of involved phases [default=1]\nPhaseAbove::Union{Nothing, Vector{Int64}}: Above the chosen value the phase is 1, below it, the value is PhaseBelow\nPhaseBelow::Union{Nothing, Vector{Int64}}\nPhaseInside::Union{Nothing, Vector{Int64}}: Phase within the box [use -1 if you don't want to change the phase inside the box]\nPhaseOutside::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]\nPhaseDirection::String: [BothWays=default; BelowToAbove; AboveToBelow] Direction in which transition works\nResetParam::String: [APS] Parameter to reset on particles below PT or within box\nPTBox_TempType::String: # Temperature condition witin the box [none, constant, linear, halfspace]\nPTBox_topTemp::Union{Nothing, Float64}: Temp @ top of box [for linear & halfspace]\nPTBox_botTemp::Union{Nothing, Float64}: Temp @ bottom of box [for linear & halfspace]\nPTBox_thermalAge::Union{Nothing, Float64}: Thermal age, usually in geo-units [Myrs] [only in case of halfspace]\nPTBox_cstTemp::Union{Nothing, Float64}: Temp within box [only for constant T]\nv_box::Union{Nothing, Float64}: [optional] only for NotInAirBox, velocity with which box moves in cm/yr\nt0_box::Union{Nothing, Float64}: [optional] beginning time of movemen in Myr\nt1_box::Union{Nothing, Float64}: [optional] end time of movement in Myr\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Scaling","page":"Available functions","title":"LaMEM.LaMEM_Model.Scaling","text":"Scaling{T} is a structure that contains the scaling info, employed in the current simulation\n\nScaling::Any: Scaling object (as in GeoParams), which can be GEO_units(), NO_units(), or SI_units()\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Softening","page":"Available functions","title":"LaMEM.LaMEM_Model.Softening","text":"Defines strain softening parameters\n\nID::Int64: softening law ID\nAPS1::Float64: Begin of softening, in units of accumulated plastic strain (APS)\nAPS2::Float64: End of softening, in units of accumulated plastic strain (APS)\nA::Float64: Reduction ratio\nLm::Float64: Material length scale (in selected units, e.g. km in geo)\nAPSheal2::Union{Nothing, Float64}: APS when healTau2 activates\nhealTau::Union{Nothing, Float64}: healing timescale parameter [Myr]\nhealTau2::Union{Nothing, Float64}: healing timescale parameter [Myr] starting at APS=APSheal2\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.SolutionParams","page":"Available functions","title":"LaMEM.LaMEM_Model.SolutionParams","text":"Structure that contains the LaMEM global solution parameters.\n\ngravity::Vector{Float64}: gravitational acceleration vector\nFSSA::Float64: free surface stabilization parameter [0 - 1]; The value has to be between 0 and 1\n\nshear_heat_eff::Float64: shear heating efficiency parameter [0 - 1]\nAdiabatic_Heat::Float64: Adiabatic Heating activation flag and efficiency. 0.0 - 1.0\nact_temp_diff::Int64: temperature diffusion activation flag\nact_therm_exp::Int64: thermal expansion activation flag\nact_steady_temp::Int64: steady-state temperature initial guess activation flag\nsteady_temp_t::Float64: time for (quasi-)steady-state temperature initial guess\nnstep_steady::Int64: number of steps for (quasi-)steady-state temperature initial guess (default = 1)\nact_heat_rech::Int64: recharge heat in anomalous bodies after (quasi-)steady-state temperature initial guess (=2: recharge after every diffusion step of initial guess)\ninit_lith_pres::Int64: sets initial pressure to be the lithostatic pressure (stabilizes compressible setups in the first steps)\ninit_guess::Int64: create an initial guess step (using constant viscosity eta_ref before starting the simulation\np_litho_visc::Int64: use lithostatic instead of dynamic pressure for creep laws\np_litho_plast::Int64: use lithostatic pressure for plasticity\np_lim_plast::Int64: limit pressure at first iteration for plasticity\np_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)\nact_p_shift::Int64: pressure shift activation flag (enforce zero pressure on average in the top cell layer); note: this overwrites p_shift above!\neta_min::Float64: viscosity lower bound [Pas]\neta_max::Float64: viscosity upper limit [Pas]\neta_ref::Float64: Reference viscosity (used for the initial guess) [Pas]\nT_ref::Float64: Reference temperature [C]\nRUGC::Float64: universal gas constant (you need to change this only for non-dimensional setups)\nmin_cohes::Float64: cohesion lower bound [Pa]\nmin_fric::Float64: friction lower bound [degree]\ntau_ult::Float64: ultimate yield stress [Pa]\nrho_fluid::Float64: fluid density for depth-dependent density model\ngw_level_type::String: ground water level type for pore pressure computation (see below)\ngw_level::Float64: ground water level at the free surface (if defined)\nbiot::Float64: Biot pressure parameter\nget_permea::Float64: effective permeability computation activation flag\nrescal::Float64: stencil rescaling flag (for internal constraints, for example while computing permeability)\nmfmax::Float64: maximum melt fraction affecting viscosity reduction\nlmaxit::Int64: maximum number of local rheology iterations\nlrtol::Float64: local rheology iterations relative tolerance\nact_dike::Int64: dike activation flag (additonal term in divergence)\nuseTk::Int64: switch to use T-dependent conductivity, 0: not active\ndikeHeat::Int64: switch to use Behn & Ito heat source in the dike\nCompute_velocity_gradient::Int64: compute the velocity gradient tensor 1: active, 0: not active. If active, it automatically activates the output in the .pvd file\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Solver","page":"Available functions","title":"LaMEM.LaMEM_Model.Solver","text":"Structure that contains the LaMEM solver options\n\nSolverType::String: solver employed [\"direct\" or \"multigrid\"]\nDirectSolver::String: mumps/superlu_dist/pastix/umfpack (requires these external PETSc packages to be installed!)\nDirectPenalty::Float64: penalty parameter [employed if we use a direct solver]\nMGLevels::Int64: number of MG levels [default=3]\nMGSweeps::Int64: number of MG smoothening steps per level [default=10]\nMGSmoother::String: type of smoothener used [chebyshev or jacobi]\nMGJacobiDamp::Float64: Dampening parameter [only employed for Jacobi smoothener; default=0.6]\nMGCoarseSolver::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]\nMGRedundantNum::Int64: How many times do we copy the coarse grid? [only employed for redundant solver; default is 4]\nMGRedundantSolver::String: The coarse grid solver for each of the redundant solves [only employed for redundant; options are \"mumps\"/\"superlu_dist\" with default \"superlu_dist\"]\nPETSc_options::Vector{String}: List with (optional) PETSc options\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Time","page":"Available functions","title":"LaMEM.LaMEM_Model.Time","text":"Structure that contains the LaMEM timestepping information. An explanation of the paramneters is given in the struct `Time_info`\n\ntime_end::Float64: simulation end time\ndt::Float64: initial time step\ndt_min::Float64: minimum time step (declare divergence if lower value is attempted)\ndt_max::Float64: maximum time step\ndt_out::Float64: output step (output at least at fixed time intervals)\ninc_dt::Float64: time step increment per time step (fraction of unit)\nCFL::Float64: CFL (Courant-Friedrichs-Lewy) criterion\nCFLMAX::Float64: CFL criterion for elasticity\nnstep_max::Int64: maximum allowed number of steps (lower bound: timeend/dtmax)\nnstep_out::Int64: save output every n steps; Set this to -1 to deactivate saving output\nnstep_rdb::Int64: save restart database every n steps\nnum_dt_periods::Int64: number of time stepping periods\ntime_dt_periods::Vector{Int64}: timestamps where timestep should be fixed (first entry has to 0)\nstep_dt_periods::Vector{Float64}: target timesteps ar timestamps above\nnstep_ini::Int64: save output for n initial steps\ntime_tol::Float64: relative tolerance for time comparisons\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.geom_Sphere","page":"Available functions","title":"LaMEM.LaMEM_Model.geom_Sphere","text":"LaMEM geometric primitive `sphere` object\n\nphase::Int64: phase\nradius::Float64: radius of sphere\ncenter::Vector{Float64}: center of sphere\nTemperature::Union{Nothing, String}: optional: Temperature of the sphere. possibilities: [constant, or nothing]\ncstTemp::Union{Nothing, Float64}: required in case of [constant]: temperature value [in Celcius in case of GEO units]\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AboveSurface-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"GeophysicalModelGenerator.AboveSurface","text":"AboveSurface(model::Model, DataSurface_Cart::CartData)\n\nReturns a boolean grid that is true if the Phases/Temp grid are above the surface\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AddBox!-Tuple{Model}","page":"Available functions","title":"GeophysicalModelGenerator.AddBox!","text":"AddBox!(model::Model; xlim=Tuple{2}, [ylim=Tuple{2}], zlim=Tuple{2},\n Origin=nothing, StrikeAngle=0, DipAngle=0,\n phase = ConstantPhase(1),\n T=nothing )\n\nAdds 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\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AddCylinder!-Tuple{Model}","page":"Available functions","title":"GeophysicalModelGenerator.AddCylinder!","text":"AddCylinder!(model::Model; # required input\n base=Tuple{3}, cap=Tuple{3}, radius=Tuple{1}, # center and radius of the sphere\n phase = ConstantPhase(1), # Sets the phase number(s) in the sphere\n T=nothing ) # Sets the thermal structure (various fucntions are available)\n\nSee the documentation of the GMG routine\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AddEllipsoid!-Tuple{Model}","page":"Available functions","title":"GeophysicalModelGenerator.AddEllipsoid!","text":"AddEllipsoid!(model::Model; # required input\n cen=Tuple{3}, axes=Tuple{3}, # center and semi-axes of the ellpsoid\n Origin=nothing, StrikeAngle=0, DipAngle=0, # origin & dip/strike\n phase = ConstantPhase(1), # Sets the phase number(s) in the box\n T=nothing )\n\nSee the documentation of the GMG routine\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AddSphere!-Tuple{Model}","page":"Available functions","title":"GeophysicalModelGenerator.AddSphere!","text":"AddSphere!(model::Model; cen=Tuple{3}, radius=Tuple{1}, phase = ConstantPhase(1), T=nothing)\n\nSee the documentation of the GMG routine\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.BelowSurface-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"GeophysicalModelGenerator.BelowSurface","text":"BelowSurface(model::Model, DataSurface_Cart::CartData)\n\nReturns a boolean grid that is true if the Phases/Temp grid are below the surface\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.IO_functions.Read_LaMEM_simulation-Tuple{Model}","page":"Available functions","title":"LaMEM.IO_functions.Read_LaMEM_simulation","text":"Timestep, FileNames, Time = Read_LaMEM_simulation(model::Model; phase=false, surf=false, passive_tracers=false)\n\nReads a LaMEM simulation as specified in model and returns the timesteps, times and filenames of that simulation once it is finished.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.IO_functions.Read_LaMEM_timestep","page":"Available functions","title":"LaMEM.IO_functions.Read_LaMEM_timestep","text":"data, time = Read_LaMEM_timestep(model::Model, TimeStep::Int64=0; fields=nothing, phase=false, surf=false, last=true)\n\nReads a specific Timestep from a simulation specified in model\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.AboveSurface!-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.AboveSurface!","text":"AboveSurface!(model::Model, DataSurface_Cart::CartData; phase::Int64=nothing, T::Number=nothing)\n\nSets the Temp or Phases above the surface DataSurface_Cart to a constant value.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.BelowSurface!-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.BelowSurface!","text":"BelowSurface!(model::Model, DataSurface_Cart::CartData; phase::Union{Int64,Nothing}=nothing, T::Union{Number,Nothing}=nothing)\n\nSets the Temp or Phases below the surface DataSurface_Cart to a constant value.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Check_LaMEM_Model-Tuple{Model}","page":"Available functions","title":"LaMEM.LaMEM_Model.Check_LaMEM_Model","text":"Check_LaMEM_Model(m::Model)\n\nChecks the LaMEM Setup Model m for errors\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Create_Grid-NTuple{15, Any}","page":"Available functions","title":"LaMEM.LaMEM_Model.Create_Grid","text":"This creates a LaMEM grid\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(d::Model,fname::String; dir=pwd())\n\nWrites a LaMEM input file based on the data stored in Model\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, BoundaryConditions}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::BoundaryConditions)\n\nWrites the boundary conditions related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, FreeSurface}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::FreeSurface)\n\nWrites the free surface related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Grid}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::Grid)\n\nThis writes grid info to a LaMEM input file\n\nExample\n\njulia> d=LaMEM.Grid(coord_x=[0.0, 0.7, 0.8, 1.0], bias_x=[0.3,1.0,3.0], nel_x=[10,4,2])\njulia> io = open(\"test.dat\",\"w\")\njulia> LaMEM.Write_LaMEM_InputFile(io, d)\njulia> close(io)\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Materials}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::Output)\n\nWrites the free surface related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, ModelSetup}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::ModelSetup)\n\nWrites options related to the Model Setup to disk\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Output}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::Output)\n\nWrites the free surface related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, SolutionParams}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::SolutionParams)\n\nWrites the boundary conditions related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Solver}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::Solver)\n\nWrites the free surface related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Time}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Writes the Time related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, geom_Sphere}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::geom_Sphere)\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile_PETSc-Tuple{Any, Solver}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile_PETSc","text":"Write_LaMEM_InputFile_PETSc(io, d::Solver)\n\nWrites the (optional) PETSc options to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_dike!-Tuple{Model, Dike}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_dike!","text":"add_dike!(model::Model, dike::Dike)\n\nThis adds a phase transition phase_trans to model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_geom!-Tuple{Model, Any}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_geom!","text":"add_geom!(model::Model, geom_object)\n\nThis adds an internal geometric primitive object geom_object to the LaMEM Model Setup model.\n\nCurrently available primitive geom objects are:\n\ngeom_Sphere\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_petsc!-Tuple{Model, Vararg{Any}}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_petsc!","text":"add_petsc!(model::Model, option::String)\n\nAdds one or more PETSc options to the model \n\nExample\n\njulia> d = Model()\njulia> add_petsc!(d,\"-snes_npicard 3\")\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_phase!-Tuple{Model, Phase}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_phase!","text":"add_phase!(model::Model, phase::Phase)\n\nThis adds a phase (with material properties) to model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_phase!-Tuple{Model, Vararg{Any}}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_phase!","text":"add_phase!(model::Model, phases...)\n\nAdd several phases @ once.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_phasetransition!-Tuple{Model, PhaseTransition}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_phasetransition!","text":"add_phasetransition!(model::Model, phase_trans::PhaseTransition)\n\nThis adds a phase transition phase_trans to model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_softening!-Tuple{Model, Softening}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_softening!","text":"add_softening!(model::Model, soft::Softening)\n\nThis adds a plastic softening law soft to model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_topography!-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_topography!","text":"add_topography!(model::Model, topography::CartData; surf_air_phase=0, surf_topo_file=\"topography.txt\", open_top_bound=1, surf_level=0.0)\n\nAdds the topography surface to the model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.copy_phase-Tuple{Phase}","page":"Available functions","title":"LaMEM.LaMEM_Model.copy_phase","text":"copy_phase(phase::Phase; kwargs...)\n\nThis copies a phase with material properties, while allowing to change some parameters\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.create_initialsetup","page":"Available functions","title":"LaMEM.LaMEM_Model.create_initialsetup","text":"create_initialsetup(model::Model, cores::Int64=1, args::String=\"\")\n\nCreates the initial model setup of LaMEM from model, which includes:\n\nWriting the LaMEM (*.dat) input file\nWrite the VTK file (if requested when model.Output.write_VTK_setup=true)\nWrite the marker files to disk (if model.ModelSetup.msetup=\"files\")\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.cross_section","page":"Available functions","title":"LaMEM.LaMEM_Model.cross_section","text":"data_tuple, axes_str = cross_section(model::LaMEM.Model, field=:phases; x=nothing, y=nothing, z=nothing)\n\nThis creates a cross-section through the initial model setup & returns a 2D array\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.cross_section-2","page":"Available functions","title":"LaMEM.LaMEM_Model.cross_section","text":"Cross = cross_section(cart::CartData, field::Symbol =:phase; x=nothing, y=nothing, z=nothing)\n\nCreates a cross-section through the data and returns x,z coordinates\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.flatten-Tuple{GeophysicalModelGenerator.CartData, Symbol, Any, Any, Any}","page":"Available functions","title":"LaMEM.LaMEM_Model.flatten","text":"Creates a 2D array out of a cross-section and a specified data field\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.is_rectilinear-Tuple{GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.is_rectilinear","text":"is_rectilinear(topography::CartData)\n\nChecks whether topography is rectilinear\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.replace_phase!-Tuple{Model, Phase}","page":"Available functions","title":"LaMEM.LaMEM_Model.replace_phase!","text":"replace_phase!(model::Model, phase_new::Phase; ID::Int64=nothing, Name::String=nothing)\n\nThis 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.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.rm_last_phase!-Tuple{Model}","page":"Available functions","title":"LaMEM.LaMEM_Model.rm_last_phase!","text":"rm_last_phase!(model::Model, phase::Phase)\n\nThis removes the last added phase from model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.rm_phase!-Tuple{Model, Int64}","page":"Available functions","title":"LaMEM.LaMEM_Model.rm_phase!","text":"rm_phase!(model::Model, ID::Int64)\n\nThis removes a phase with ID from model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.rm_phase!-Tuple{Model}","page":"Available functions","title":"LaMEM.LaMEM_Model.rm_phase!","text":"rm_phase!(model::Model)\n\nThis removes all existing phases from model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.set_air-Tuple{}","page":"Available functions","title":"LaMEM.LaMEM_Model.set_air","text":"set_air(; Name=\"air\", ID=0, rho=1, alpha=nothing, eta=1e17, G=nothing, nu=nothing, fr=nothing, ch=nothing, k=30,Cp=1000)\n\nSets an air phase, with high conductivity \n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.set_geom!-Tuple{Model, geom_Sphere}","page":"Available functions","title":"LaMEM.LaMEM_Model.set_geom!","text":"This sets the geometry \n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.within_bounds-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.within_bounds","text":"within_bounds(model::Model, topography::CartData)\n\nVerifies that the bounds of the topography grid are larger than that of the model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.Run.run_lamem","page":"Available functions","title":"LaMEM.Run.run_lamem","text":"run_lamem(model::Model, cores::Int64=1, args:String=\"\"; wait=true)\n\nPerforms a LaMEM run for the parameters that are specified in model\n\n\n\n\n\n","category":"function"},{"location":"man/installation_HPC/#Installation-on-HPC-systems","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"","category":"section"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Installing LaMEM on high performance computer (HPC) systems can be complicated, because you will have to compile PETSc with the correct dependencies for that system. The reason is that HPC systems use MPI versions that are specifically tailored/compiled for that system. ","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Luckily there is a solution thanks to the great work of @eschnett and colleagues, who developed MPITrampoline which is an intermediate layer between the HPC-system-specific MPI libraries and the precompiled LaMEM binaries. ","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"It essentially consists of two steps: 1) compile a small package (MPIwrapper) 2) make sure that you download the version of MAGEMin that was compiled versus MPItrampoline.","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Here step-by-step instructions (for Linux, as that is what essentially all HPC systems use):","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Download MPIwrapper: ","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"$git clone https://github.com/eschnett/MPIwrapper.git \n$cd MPIwrapper","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Install it after making sure that mpiexec points to the one you want (you may have to load some modules, depending on your system):","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"$cmake -S . -B build -DMPIEXEC_EXECUTABLE=mpiexec -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/mpiwrapper\n$cmake --build build\n$cmake --install build","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"At this stage, MPItrampoline is installed in $HOME/mpiwrapper","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Set the correct wrapper:","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"$export MPITRAMPOLINE_LIB=$HOME/mpiwrapper/lib64/libmpiwrapper.so","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Depending on the system it may be called lib instead of lib64 (check!).","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Start julia and install the MPI and MPIPreferences packages:","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"$julia\njulia> ]\npkg>add MPI, MPIPreferences","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Set the preference to use MPItrampoline","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"julia> using MPIPreferences; MPIPreferences.use_jll_binary(\"MPItrampoline_jll\")\n┌ Info: MPIPreferences unchanged\n└ binary = \"MPItrampoline_jll\"","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Load MPI and verify it is the correct one","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"julia> using MPI\njulia> MPI.Get_library_version()\n\"MPIwrapper 2.10.3, using MPIABI 2.9.0, wrapping:\\nOpen MPI v4.1.4, package: Open MPI boris@Pluton Distribution, ident: 4.1.4, repo rev: v4.1.4, May 26, 2022\"","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"After this, restart julia (this only needs to be done once, next time all is fine).","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Now load LaMEM and check that it uses the mpitrampoline version:","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"julia> using MPI,LaMEM\njulia> LaMEM.LaMEM_jll.host_platform\nLinux x86_64 {cxxstring_abi=cxx11, julia_version=1.8.1, libc=glibc, libgfortran_version=5.0.0, mpi=mpitrampoline}","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"At this stage the precompiled version of LaMEM should be useable on that system.","category":"page"},{"location":"man/installation/#Installation","page":"General instructions","title":"Installation","text":"","category":"section"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"Installing LaMEM can simply be done through the package manager:","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"julia>]\npkg>add LaMEM","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"which will download the binaries along with PETSc and mpiexec for your system.","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"You can test if it works on your machine with","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"pkg> test LaMEM","category":"page"},{"location":"man/installation/#Running-LaMEM-from-the-julia-REPL","page":"General instructions","title":"Running LaMEM from the julia REPL","text":"","category":"section"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"Running LaMEM from within julia can be done with the run_lamem function:","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"LaMEM.run_lamem","category":"page"},{"location":"man/installation/#LaMEM.Run.run_lamem","page":"General instructions","title":"LaMEM.Run.run_lamem","text":"run_lamem(ParamFile::String, cores::Int64=1, args:String=\"\"; wait=true, deactivate_multithreads=true)\n\nThis 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.\n\nExample:\n\nYou can call LaMEM with:\n\njulia> using LaMEM\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile)\n\nDo the same on 2 cores with a command-line argument as:\n\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile, 2, \"-nstep_max = 1\")\n\n\n\n\n\nrun_lamem(model::Model, cores::Int64=1, args:String=\"\"; wait=true)\n\nPerforms a LaMEM run for the parameters that are specified in model\n\n\n\n\n\n","category":"function"},{"location":"man/installation/#Running-LaMEM-from-outside-julia","page":"General instructions","title":"Running LaMEM from outside julia","text":"","category":"section"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"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:","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"LaMEM.show_paths_LaMEM","category":"page"},{"location":"man/installation/#LaMEM.Run.show_paths_LaMEM","page":"General instructions","title":"LaMEM.Run.show_paths_LaMEM","text":"show_paths_LaMEM()\n\nThe 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.\n\nThis function shows this for your system. \n\n\n\n\n\n","category":"function"},{"location":"man/juliasetup_example_sphere/#.-Example-1:-Falling-sphere","page":"Example 1: Sphere","title":"1. Example 1: Falling sphere","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"This is a first example that illustrates how to build a setup using the LaMEM.jl package, run it and visualize the results, all without leaving julia.","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"We start with loading the packages we need:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> using LaMEM, GeophysicalModelGenerator, Plots","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"The GeophysicalModelGenerator package can be used to generate model setups and Plots for plotting.","category":"page"},{"location":"man/juliasetup_example_sphere/#.1-Define-model-setup","page":"Example 1: Sphere","title":"1.1 Define model setup","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Next, we define a general model setup, in which we specify the units with which we work (for most cases, you'll want to use the default GEO units), the size of the computational box and various timestepping parameters. In this case, we use a multigrid solver.","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> model = Model(Grid(nel=(16,16,16), x=[-1,1], y=[-1,1], z=[-1,1]), \n Time(nstep_max=20, dt_min=1e-3, dt=1, dt_max=10, time_end=100), \n Solver(SolverType=\"multigrid\", MGLevels=2),\n Output(out_dir=\"example_1\"))\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(16, 16, 16); xϵ(-1.0, 1.0), yϵ(-1.0, 1.0), zϵ(-1.0, 1.0) \n|-- Time : nstep_max=20; nstep_out=1; time_end=100.0; dt=1.0\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : multigrid solver; coarse grid solver=direct; 2 levels\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases; ","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Note that each of the fields within Model has many additional and adjustable parameters. You can view that by typing:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> model.Time\nLaMEM Timestepping parameters: \n time_end = 100.0 \n dt = 1.0 \n dt_min = 0.001 \n dt_max = 10.0 \n dt_out = 0.2 \n inc_dt = 0.1 \n CFL = 0.5 \n CFLMAX = 0.8 \n nstep_max = 20 \n nstep_out = 1 \n nstep_rdb = 100 \n nstep_ini = 1 \n time_tol = 1.0e-8 ","category":"page"},{"location":"man/juliasetup_example_sphere/#.2-Specify-material-properties","page":"Example 1: Sphere","title":"1.2 Specify material properties","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Once this is specified, we need to set material properties for each of the Phases we will consider in the simulation. This can be done with the Phase structure. First, we define two phases","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> rm_phase!(model)\njulia> matrix = Phase(ID=0,Name=\"matrix\",eta=1e20,rho=3000)\nPhase 0 (matrix): \n rho = 3000.0 \n eta = 1.0e20 \njulia> sphere = Phase(ID=1,Name=\"sphere\",eta=1e23,rho=3200)\nPhase 1 (sphere): \n rho = 3200.0 \n eta = 1.0e23 ","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"and add them to the model with:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> add_phase!(model, sphere, matrix)","category":"page"},{"location":"man/juliasetup_example_sphere/#.3-Set-initial-model-geometry","page":"Example 1: Sphere","title":"1.3 Set initial model geometry","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"We also need to specify an initial model geometry. The julia package GeophysicalModelGenerator has a number of functions for that, which can be used here. For the current setup, we just add a sphere: ","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> AddSphere!(model,cen=(0.0,0.0,0.0), radius=(0.5, ))","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"It is often useful to plot the initial model setup. You can do this with the heatmap function from the Plots.jl package, for which we provide a LaMEM plugin that allows you to specify a cross-section through a 3D LaMEM setup:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> plot_cross_section(model, field=:phase, y=0)","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"(Image: InitialSetupSphere)","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"In the initial setup we define two fields: :phase which defines the rocktypes and :temperature which has the initial temperature. They are stored as 3D arrays in model.Grid.Phases and model.Grid.Temp:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([16], [16], [16])\n marker/cell : (3, 3, 3)\n x ϵ [-1.0 : 1.0]\n y ϵ [-1.0 : 1.0]\n z ϵ [-1.0 : 1.0]\n Phases : range ϵ [0 - 1]\n Temp : range ϵ [0.0 - 0.0]","category":"page"},{"location":"man/juliasetup_example_sphere/#.4-Run-LaMEM","page":"Example 1: Sphere","title":"1.4 Run LaMEM","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"At this stage we are ready to run a LaMEM simulation which can simply be done with the run_lamem command. By default, it will run on one processor. If you want to run this in parallel, you can specify the number of cores you want to use. Please note that running things in parallel is only worth the effort for large resolutions; for smaller setups it will be faster on one processor:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> run_lamem(model,1)\nSaved file: Model3D.vts\nWriting LaMEM marker file -> ./markers/mdb.00000000.dat\n-------------------------------------------------------------------------- \n Lithosphere and Mantle Evolution Model \n Compiled: Date: Apr 7 2023 - Time: 22:11:23 \n Version : 1.2.4 \n-------------------------------------------------------------------------- \n STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION \n-------------------------------------------------------------------------- \nParsing input file : output.dat \nFinished parsing input file : output.dat \n--------------------------------------------------------------------------\nScaling parameters:\n Temperature : 1000. [C/K] \n Length : 1e+06 [m] \n Viscosity : 1e+20 [Pa*s] \n Stress : 10. [Pa] \n--------------------------------------------------------------------------\nTime stepping parameters:\n Simulation end time : 100. [Myr] \n Maximum number of steps : 20 \n Time step : 1. [Myr] \n Minimum time step : 0.001 [Myr] \n Maximum time step : 10. [Myr] \n Time step increase factor : 0.1 \n CFL criterion : 0.5 \n CFLMAX (fixed time steps) : 0.8 \n Output every [n] steps : 1 \n Output [n] initial steps : 1 \n--------------------------------------------------------------------------\n--------------------------------------------------------------------------","category":"page"},{"location":"man/juliasetup_example_sphere/#.5-Visualize-results","page":"Example 1: Sphere","title":"1.5 Visualize results","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Once the simulation is done, you can look at the results using the same heatmap function, but by specifying a timestep, which will read that timestep and plot a cross-section though it:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> plot_cross_section(model, y=0, timestep=20, field=:phase)\t","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"(Image: FallingSphere_t20)","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Alternatively, you can visualize the results with Paraview. Change to the directory where you did the simulation:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> cd(model.Output.out_dir)\njulia> julia> readdir()\n25-element Vector{String}:\n \"Model3D.vts\"\n \"Timestep_00000000_0.00000000e+00\"\n \"Timestep_00000001_1.10000000e+00\"\n \"Timestep_00000002_2.31000000e+00\"\n \"Timestep_00000003_3.64100000e+00\"\n \"Timestep_00000004_5.10510000e+00\"\n \"Timestep_00000005_6.71561000e+00\"\n ⋮\n \"Timestep_00000017_4.45991731e+01\"\n \"Timestep_00000018_5.01590904e+01\"\n \"Timestep_00000019_5.62749995e+01\"\n \"Timestep_00000020_6.30024994e+01\"\n \"markers\"\n \"output.dat\"\n \"output.pvd\"","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"And you can open output.pvd with paraview. If your system recogizes that *.pvd files should be opened with paraview, you can do that with","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> ;\nshell> open output.pvd","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Otherwise, start paraview manually and open the file.","category":"page"},{"location":"man/juliasetup_TMSubduction/#D-Thermomechanical-subduction-model","page":"Example 3: Subduction","title":"2D Thermomechanical subduction model","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"In this example, we will show how to create a 2D thermomechanical model of subduction. Here the setup is saved into a julia script. First create a textfile called TM_Subduction_example.jl in your current directory. The easiest is to use Visual Studio Code for this, but you can in principle use any text editor.","category":"page"},{"location":"man/juliasetup_TMSubduction/#.-Load-necessary-packages","page":"Example 3: Subduction","title":"1. Load necessary packages","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Next start julia in the directory where you saved TM_Subduction_example.jl, or go to correct directory within julia ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Note that you can do the following steps directy from the julia REPL (command prompt), or you can write them in TM_Subduction_example.jl and run that file by typing","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> include(\"TM_Subduction_example.jl\")","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"We get started by loading the required packages:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"using LaMEM, GeophysicalModelGenerator, Plots","category":"page"},{"location":"man/juliasetup_TMSubduction/#.-LaMEM-model-setup","page":"Example 3: Subduction","title":"2. LaMEM model setup","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"The setup will include 6 different materials with the following ID's:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"# material id's\n# 0: asthenosphere\n# 1: oceanic crust\n# 2: oceanic lithosphere\n# 3: continental crust\n# 4: continental lithosphere\n# 5: air layer","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model = Model(Grid( x = [-2000.,2000.],\n y = [-2.5,2.5], # <- model is 2D, size in y-direction is choosen to be close to a cube shape for the cell\n z = [-660,40] ,\n nel = (512,1,128) ),\n\n BoundaryConditions( temp_bot = 1565.0,\n temp_top = 20.0,\n open_top_bound = 1),\n Scaling(GEO_units( temperature = 1000,\n stress = 1e9Pa,\n length = 1km,\n viscosity = 1e20Pa*s) ),\n Time(nstep_max=20) ) ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"This initializes the initial LaMEM model setup with a number of default options. On the REPL it will show the following info","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"LaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(512, 1, 128); xϵ(-2000.0, 2000.0), yϵ(-8.0, 8.0), zϵ(-660.0, 40.0) \n|-- Time : nstep_max=20; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases; ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"In this case we assume that we have dimensions in kilometers and times in million years (the default).","category":"page"},{"location":"man/juliasetup_TMSubduction/#Inspecting/modifying-parameters","page":"Example 3: Subduction","title":"Inspecting/modifying parameters","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Each of the parameters in this model setup can be modified. The easiest way to see what is available is by using the REPL. If you type ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"and now use your TAB button, you will see all the fields within the model structure:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.\nBoundaryConditions FreeSurface Grid Materials ModelSetup Output Scaling SolutionParams\nSolver Time","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"If you want to see which timestepping parameters are set, you type:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.Time\nLaMEM Timestepping parameters: \n time_end = 1.0 \n dt = 0.05 \n dt_min = 0.01 \n dt_max = 0.2 \n dt_out = 0.2 \n inc_dt = 0.1 \n CFL = 0.5 \n CFLMAX = 0.8 \n nstep_max = 20 \n nstep_out = 1 \n nstep_rdb = 100 \n nstep_ini = 1 \n time_tol = 1.0e-8 ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"The parameters that are changed from the default settings are highlighted in blue (not visible on this markdown document, but visible in the REPL). ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"If you want to see what each of these parameters mean, you can get some basic help with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"help?> Time\nsearch: Time time Timer time_ns timedwait mtime ctime @time @timev @timed @time_imports @showtime optimize_ticks optimize_datetime_ticks Read_LaMEM_timestep\n\n Structure that contains the LaMEM timestepping information. An explanation of the paramneters is given in the struct `Time_info`\n • time_end::Float64: simulation end time\n • dt::Float64: initial time step\n • dt_min::Float64: minimum time step (declare divergence if lower value is attempted)\n • dt_max::Float64: maximum time step\n • dt_out::Float64: output step (output at least at fixed time intervals)\n • inc_dt::Float64: time step increment per time step (fraction of unit)\n • CFL::Float64: CFL (Courant-Friedrichs-Lewy) criterion\n • CFLMAX::Float64: CFL criterion for elasticity\n • nstep_max::Int64: maximum allowed number of steps (lower bound: timeend/dtmax)\n • nstep_out::Int64: save output every n steps; Set this to -1 to deactivate saving output\n • nstep_rdb::Int64: save restart database every n steps\n • num_dt_periods::Int64: number of time stepping periods\n • time_dt_periods::Vector{Int64}: timestamps where timestep should be fixed (first entry has to 0)\n • step_dt_periods::Vector{Float64}: target timesteps ar timestamps above\n • nstep_ini::Int64: save output for n initial steps\n • time_tol::Float64: relative tolerance for time comparisons","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"If you want to change one of the parameters, say the maximum number of timesteps, you can do that with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.Time.nstep_max=100\n100","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"You can verify that this has been changed with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.Time\nLaMEM Timestepping parameters: \n time_end = 1.0 \n dt = 0.05 \n dt_min = 0.01 \n dt_max = 0.2 \n dt_out = 0.2 \n inc_dt = 0.1 \n CFL = 0.5 \n CFLMAX = 0.8 \n nstep_max = 100 \n nstep_out = 1 \n nstep_rdb = 100 \n nstep_ini = 1 \n time_tol = 1.0e-8 ","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-timestepping-parameters","page":"Example 3: Subduction","title":"Set timestepping parameters","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Ok, lets change a few parameters at the same time. Here the maximum time (time_end) is set to a large value (2000 Myrs) as we want to limit the simulation using nstep_max = 400, which implies that we will perform 400 timesteps","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Time = Time( time_end = 2000.0,\n dt = 0.001,\n dt_min = 0.000001,\n dt_max = 0.1,\n nstep_max = 400,\n nstep_out = 10\n )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Note that you can achieve the same results with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Time.time_end = 2000.0\nmodel.Time.dt = 0.001\nmodel.Time.dt_min = 0.000001\nmodel.Time.dt_max = 0.1\nmodel.Time.nstep_max = 400\nmodel.Time.nstep_out = 10","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-solution-parameters","page":"Example 3: Subduction","title":"Set solution parameters","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"We activate shear heating and adiabatic heating, as well as thermal diffusion, and set the minimum and maximum viscosities of the model as:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.SolutionParams = SolutionParams( shear_heat_eff = 1.0,\n Adiabatic_Heat = 1.0,\n act_temp_diff = 1,\n eta_min = 5e18,\n eta_ref = 1e21,\n eta_max = 1e25,\n min_cohes = 1e3\n )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-surface-topography","page":"Example 3: Subduction","title":"Set surface topography","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"In our simulation, we want to take a free surface into account. In LaMEM that is done with a sticky air layer (phase 5 here), combined with a mesh that tracks the location of the free surface. You need to activate the free surface, tell LaMEM which phase is the sticky air phase and what the initial free surface level is at the beginning of the simulation (0 km). Do that with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.FreeSurface = FreeSurface( surf_use = 1, # free surface activation flag\n surf_corr_phase = 1, # air phase ratio correction flag (due to surface position)\n surf_level = 0.0, # initial level\n surf_air_phase = 5, # phase ID of sticky air layer\n surf_max_angle = 40.0 # maximum angle with horizon (smoothed if larger))\n )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-model-output","page":"Example 3: Subduction","title":"Set model output","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"We update the list of fields saved as output:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Output = Output( out_density = 1,\n out_j2_strain_rate = 1,\n out_surf = 1, \t\n out_surf_pvd = 1,\n out_surf_topography = 1,\n out_temperature = 1, )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-some-background-properties,-later-overwritten","page":"Example 3: Subduction","title":"Set some background properties, later overwritten","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"The model geometry in LaMEM is defined by two arrays: model.Grid.Temp and model.Grid.Phase which sets the initial temperature and phase at every point. These are 3D arrays that can be modified; in the usual case temperatures are assumed to be in Celcius, and the phases are integers (0-5 here). ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Lets specify a few helpful parameters, such as the adiabatic temperature throughout the model (0.4°C/km) and the mantle potential temperature at the surface 1280°C:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Tair = 20.0;\nTmantle = 1280.0;\nAdiabat = 0.4","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Next, we set the temperature everwhere to (will be overwrittem later) and all phases to 0 with","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Grid.Temp .= Tmantle .+ 1.0; # set mantle temperature (without adiabat at first)\nmodel.Grid.Phases .= 0; # Set Phases to 0 everywhere (0 is/will be asthenosphere in this setup):","category":"page"},{"location":"man/juliasetup_TMSubduction/#Setup-temperature-of-the-air-to-be-20C","page":"Example 3: Subduction","title":"Setup temperature of the air to be 20°C","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Next we set all \"air\" particles to Tair: ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Grid.Temp[model.Grid.Grid.Z .> 0] .= Tair;","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"We can quickly verify that this has been done on the REPL with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia>julia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([512], [1], [128])\n marker/cell : (3, 3, 3)\n x ϵ [-2000.0 : 2000.0]\n y ϵ [-8.0 : 8.0]\n z ϵ [-660.0 : 40.0]\n Phases : range ϵ [0 - 0]\n Temp : range ϵ [20.0 - 1281.0]","category":"page"},{"location":"man/juliasetup_TMSubduction/#Setup-the-air-layer-(id-5)-if-Z-0.0","page":"Example 3: Subduction","title":"Setup the air layer (id = 5) if Z > 0.0","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Set the air particles to 5:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Grid.Phases[model.Grid.Grid.Z .> 0.0 ] .= 5;","category":"page"},{"location":"man/juliasetup_TMSubduction/#Add-left-oceanic-plate","page":"Example 3: Subduction","title":"Add left oceanic plate","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"An oceanic plate can be added using the AddBox!() function of the GeophysicalModelGenerator package (see ?GeophysicalModelGenerator.AddBox! for more information, or check out the online help of the package). The lithosphere to asthenosphere temperature is set to 1250°C. If temperature of the plate is > 1250°C then the material is turned to asthenosphere. The temperature profile of the plate is set using a half space cooling temperature and a spreading rate velocity of 0.5 cm/yr with the ridge prescribed to be at the \"left\" of the box.","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (-2000.0, 0.0), \n ylim = (model.Grid.coord_y...,), \n zlim = (-660.0, 0.0),\n Origin = nothing, StrikeAngle=0, DipAngle=0,\n phase = LithosphericPhases(Layers=[20 80], Phases=[1 2 0] ),\n T = SpreadingRateTemp( Tsurface = Tair,\n Tmantle = Tmantle,\n MORside = \"left\",\n SpreadingVel= 0.5,\n AgeRidge = 0.01;\n maxAge = 80.0 ) )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Add-right-oceanic-plate","page":"Example 3: Subduction","title":"Add right oceanic plate","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Same for the plate on the right:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (1500, 2000), \n ylim = (model.Grid.coord_y..., ), \n zlim = (-660.0, 0.0),\n Origin = nothing, StrikeAngle=0, DipAngle=0,\n phase = LithosphericPhases(Layers=[20 80], Phases=[1 2 0] ),\n T = SpreadingRateTemp( Tsurface = Tair,\n Tmantle = Tmantle,\n MORside = \"right\",\n SpreadingVel= 0.5,\n AgeRidge = 0.01;\n maxAge = 80.0 ) )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Add-overriding-plate-margin","page":"Example 3: Subduction","title":"Add overriding plate margin","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"For the overriding plate margin the age is fixed to 90 Ma using HalfspaceCoolingTemp().","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (0.0, 400.0), \n ylim = (model.Grid.coord_y[1], model.Grid.coord_y[2]), \n zlim = (-660.0, 0.0),\n Origin = nothing, StrikeAngle=0, DipAngle=0,\n phase = LithosphericPhases(Layers=[25 90], Phases=[3 4 0] ),\n T = HalfspaceCoolingTemp( Tsurface = Tair,\n Tmantle = Tmantle,\n Age = 80 ) )\n ``` \n\n##### Add overriding plate craton\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (400.0, 1500.0), ylim = (model.Grid.coord_y...,), zlim = (-660.0, 0.0), Origin = nothing, StrikeAngle=0, DipAngle=0, phase = LithosphericPhases(Layers=[35 100], Phases=[3 4 0] ), T = HalfspaceCoolingTemp( Tsurface = Tair, Tmantle = Tmantle, Age = 120 ) )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Add pre-subducted slab\nHere we change the dip angle of the box to 30° to initiates subduction:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (0.0, 300), ylim = (model.Grid.coord_y...,), zlim = (-660.0, 0.0), Origin = nothing, StrikeAngle=0, DipAngle=30, phase = LithosphericPhases(Layers=[30 80], Phases=[1 2 0], Tlab=1250 ), T = HalfspaceCoolingTemp( Tsurface = Tair, Tmantle = Tmantle, Age = 80 ) )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":" \n##### Impose approximate adiabat\nWe can add a mantle adiabatic temperature to the model with\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia model.Grid.Temp = model.Grid.Temp - model.Grid.Grid.Z.*Adiabat;","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Plot preview of the setup\nCross-sections of the model setup showing the temperature and the phase fields can be visualized as follows:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia plotcrosssection(model, y=0, field=:temperature) plotcrosssection(model, y=0, field=:phase)","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":" ![Subduction_CrossSection](sub_field.png)\n ![Subduction_CrossSection](sub_temp.png)\n\n#### 3. Define material parameters\n\nAt this stage, we defined the geometry and thermal structures of the model, but we did yet assign material properties to each of the rocktypes.\n\n##### Softening law\nWe assume that rocks weaken/soften when they becomes damaged, which can be defined by a softening law. Post-softening strength is defined as 0.05 the initial strength\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia softening = Softening( ID = 0, \t\t\t# softening law ID APS1 = 0.1, \t\t\t# begin of softening APS APS2 = 0.5, \t\t\t# end of softening APS A = 0.95, \t\t # reduction ratio )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Material thermal and rheological properties\n*Mantle*\nFor the mantle, we use a dry olivine rheology:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia dryPeridotite = Phase( Name = \"dryPeridotite\", ID = 0, # phase id [-] rho = 3300.0, # density [kg/m3] alpha = 3e-5, # coeff. of thermal expansion [1/K] dislprof = \"DryOlivinedislcreep-HirthKohlstedt2003\", Vn = 14.5e-6, diffprof = \"DryOlivinediffcreep-HirthKohlstedt2003\", Vd = 14.5e-6, G = 5e10, # elastic shear module [MPa] k = 3, # conductivity Cp = 1000.0, # heat capacity ch = 30e6, # cohesion [Pa] fr = 20.0, # friction angle\t A = 6.6667e-12, # radiogenic heat production [W/kg] chSoftID = 0, \t # cohesion softening law ID frSoftID = 0, \t # friction softening law ID )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n*Oceanic crust*\nFor the oceanic crust we use a low cohesion and a frictional angle equal to 0. The goal is to make the oceanic crust weak enough to lubricate the interface with the overriding plate and allow for self-sustained subduction. Moreover, as density is not pressure and temperature dependent, it is set to be the same as the mantle (3300) in order to be neutrally buoyant with respect to the rest of the lithosphere.\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia oceanicCrust = Phase( Name = \"oceanCrust\", ID = 1, # phase id [-] rho = 3300.0, # density [kg/m3] alpha = 3e-5, # coeff. of thermal expansion [1/K] dislprof = \"PlagioclaseAn75-Ranalli_1995\", G = 5e10, # elastic shear module [MPa] k = 3, # conductivity Cp = 1000.0, # heat capacity ch = 5e6, # cohesion [Pa] fr = 0.0, # friction angle\t A = 2.333e-10, # radiogenic heat production [W/kg] )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n*Oceanic mantle lithosphere*\nThe oceanic mantle lithosphere has the same properties as the mantle but a different name and different phase. To simplify your life, you can use the `copy_phase` function for that:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia oceanicLithosphere = copy_phase( dryPeridotite, Name = \"oceanicLithosphere\", ID = 2 )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"*Continental crust*\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"continentalCrust = copyphase( oceanicCrust, Name = \"continentalCrust\", ID = 3, dislprof = \"Quarzite-Ranalli_1995\", rho = 2700.0, ch = 30e6, fr = 20.0, A \t = 5.3571e-10, chSoftID \t = 0, \t frSoftID \t = 0, \t )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"*Continental lithosphere*\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"continentalLithosphere = copy_phase( dryPeridotite, Name = \"continentalLithosphere\", ID = 4 )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n*Sticky air*\nFinally, the \"air\" in our model is a layer with low density and low viscosity, such that it essentially gives very low stresses compared to those within the lithosphere. We cannot give it the viscosity of real air, as this results in a too large viscosity jump at the surface (geodynamic codes cannot handle that). We therefore also often call this \"sticky air\". Note that we also give it a very high thermal conductivity to ensure that the temperature within the air layer remains more or less constant throughout a simulation (and equal to the temperature at the upper boundary of the model):\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia air = Phase( Name = \"air\", ID = 5, # phase id [-] rho = 50.0, # density [kg/m3] # coeff. of thermal expansion [1/K] eta = 1e19, G = 5e10, # elastic shear module [MPa] k = 100, # conductivity Cp = 1e6, # heat capacity ch = 10e6, # cohesion [MPa] fr = 0.0, # friction angle\t )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Add phases to the model\nFinally, we can add all these phases to the model with:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia rmphase!(model) addphase!( model, dryPeridotite, oceanicCrust, oceanicLithosphere, continentalCrust, continentalLithosphere, air )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Add softening law\nSame with the softening law:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia add_softening!( model, softening )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Set solver options\nThe PETSc command ```-da_refine_y 1``` allow to run the model as 2D\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Solver = Solver( SolverType = \"multigrid\", MGLevels = 3, MGCoarseSolver \t= \"superludist\", PETScoptions = [ \"-sneskspew\", \"-sneskspewrtolmax 1e-4\", \"-snesrtol 5e-3\",\t\t\t \"-snesatol 1e-4\", \"-snesmaxit 200\", \"-snesPicardSwitchToNewtonrtol 1e-3\", \"-snesNewtonSwitchToPicardit 20\", \"-jsksptype fgmres\", \"-jskspmaxit 20\", \"-jskspatol 1e-8\", \"-jsksprtol 1e-4\", \"-sneslinesearchtype l2\", \"-sneslinesearchmaxstep 10\", \"-darefiney 1\" ] )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n#### 4. Perform the simulation\nHere we riun LaMEM on 8 cores (if you have them; use less otherwise):\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia julia> run_lamem(model, 8) Saved file: Model3D.vts (Nprocx, Nprocy, Nprocz, xc, yc, zc, nNodeX, nNodeY, nNodeZ) = (4, 1, 2, [-2000.0, -1000.0, 0.0, 1000.0, 2000.0], [-8.0, 8.0], [-660.0, -310.0, 40.0], 513, 2, 129) Writing LaMEM marker file -> ./markers/mdb.00000000.dat Writing LaMEM marker file -> ./markers/mdb.00000001.dat Writing LaMEM marker file -> ./markers/mdb.00000002.dat Writing LaMEM marker file -> ./markers/mdb.00000003.dat Writing LaMEM marker file -> ./markers/mdb.00000004.dat Writing LaMEM marker file -> ./markers/mdb.00000005.dat Writing LaMEM marker file -> ./markers/mdb.00000006.dat Writing LaMEM marker file -> ./markers/mdb.00000007.dat ––––––––––––––––––––––––––––––––––––– Lithosphere and Mantle Evolution Model Compiled: Date: Apr 7 2023 - Time: 22:11:23 Version : 1.2.4 ––––––––––––––––––––––––––––––––––––– STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION ––––––––––––––––––––––––––––––––––––– Parsing input file : output.dat Finished parsing input file : output.dat ––––––––––––––––––––––––––––––––––––– Scaling parameters: Temperature : 1000. [C/K] Length : 1000. [m] Viscosity : 1e+20 [Pa*s] Stress : 1e+09 [Pa] ```","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"The results will be saved in the directory where you performed the simulation and can be visualized in Paraview by opening the file output.pvd: (Image: 2D thermomechanical subduction)","category":"page"},{"location":"man/juliasetups/#Create-and-run-setups-from-julia","page":"Overview","title":"Create & run setups from julia","text":"","category":"section"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"It is also possible to construct a LaMEM setup directly in julia & run that. You can do the same from within a Pluto notebook. The advantage is that it is easier to use, has build-in plotting functions and extensive documentation. ","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"The main routine to do this is: ","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> using LaMEM\njulia> model = Model()\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(16, 16, 16); xϵ(-10.0, 10.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases;","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"Model is a structure that contains all the information about the LaMEM simulation and consists of the following sub-structures that can all be adjusted.","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"BoundaryConditions FreeSurface Grid \nMaterials ModelSetup Output \nScaling SolutionParams Solver \nTime","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"You can, for example, look at the current Grid:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([16], [16], [16])\n marker/cell : (3, 3, 3)\n x ϵ [-10.0 : 10.0]\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n Phases : range ϵ [0 - 0]\n Temp : range ϵ [0.0 - 0.0]","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"and change the dimensions and number of grid-cells with:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model.Grid = Grid(nel=[32,32,32], x=[-20,20])\nLaMEM grid with constant Δ: \n nel : ([32], [32], [32])\n marker/cell : (3, 3, 3)\n x ϵ [-20.0 : 20.0]\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n Phases : range ϵ [0 - 0]\n Temp : range ϵ [0.0 - 0.0]","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"or do it by directly accessing the respectyive data field:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model.Grid.nel_x = [32]\n1-element Vector{Int64}:\n 32","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"Every LaMEM model setup needs to specify material properties for the different materials. By default it has nothing:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model.Materials\nLaMEM Material Properties: \n Softening = \n PhaseTransition =","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"yet, we can specify different materials using the Phase structure:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> sphere = Phase(Name=\"Sphere\", ID=1, eta=1e20, rho=2800)\nPhase 1 (Sphere): \n rho = 2800.0 \n eta = 1.0e20 ","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"and add that to the model with:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> add_phase!(model, sphere)\njulia> model\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(32, 32, 32); xϵ(-20.0, 20.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 1 phases; ","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"Note that the model now has 1 phase.","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"In order to run a simulation, we need to define at least 1 phase and heterogeneities in either the initial temperature field (model.Grid.Temp) or the Phases field (model.Grid.Phases). The easiest way to do that is to use routines from the GeophyicalModelGenerator package, for which we created simple interfaces to many of the relevant routines:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> using GeophysicalModelGenerator\njulia> AddSphere!(model,cen=(0.0,0.0,0.0), radius=(0.5, ))","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"For the sake of this example, lets add another phase:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> matrix = Phase(ID=0,Name=\"matrix\",eta=1e20,rho=3000)\nPhase 0 (matrix): \n rho = 3000.0 \n eta = 1.0e20 \njulia> add_phase!(model, matrix)","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"At this stage you have a model setup with 2 phases and heterogeneities in the Phases field, which you can check with:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(32, 32, 32); xϵ(-20.0, 20.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 2 phases; \n\n\njulia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([32], [32], [32])\n marker/cell : (3, 3, 3)\n x ϵ [-20.0 : 20.0]\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n Phases : range ϵ [0 - 1]\n Temp : range ϵ [0.0 - 0.0]","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"Running a model is very simple:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> run_lamem(model,1)","category":"page"},{"location":"man/juliasetups/#More-examples","page":"Overview","title":"More examples","text":"","category":"section"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"More examples can be found on the left hand side menu.","category":"page"},{"location":"man/runlamem/#Run-LaMEM","page":"Run LaMEM","title":"Run LaMEM","text":"","category":"section"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"Go to the package manager & install it with:","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"julia>]\npkg>add LaMEM","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"It will automatically download a binary version of LaMEM which runs in parallel (along with the correct PETSc version). This will work on linux, mac and windows.","category":"page"},{"location":"man/runlamem/#Starting-a-simulation","page":"Run LaMEM","title":"Starting a simulation","text":"","category":"section"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"If you have a LaMEM (*.dat) input file, you can run in parallel (here on 4 cores) with:","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"julia> ParamFile=\"input_files/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile, 4,\"-time_end 1\")\n-------------------------------------------------------------------------- \n Lithosphere and Mantle Evolution Model \n Compiled: Date: Sep 10 2022 - Time: 06:21:30 \n-------------------------------------------------------------------------- \n STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION \n-------------------------------------------------------------------------- \nParsing input file : input_files/FallingBlock_Multigrid.dat \n Adding PETSc option: -snes_type ksponly\n Adding PETSc option: -js_ksp_monitor\n Adding PETSc option: -crs_pc_type bjacobi\nFinished parsing input file : input_files/FallingBlock_Multigrid.dat \n--------------------------------------------------------------------------\nTime stepping parameters:\n Simulation end time : 1. [ ] \n Maximum number of steps : 10 \n Time step : 10. [ ] \n Minimum time step : 1e-05 [ ] \n Maximum time step : 100. [ ] \n Time step increase factor : 0.1 \n CFL criterion : 0.5 \n CFLMAX (fixed time steps) : 0.5 \n Output time step : 0.2 [ ] \n Output every [n] steps : 1 \n Output [n] initial steps : 1 \n--------------------------------------------------------------------------","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"The last parameter are optional PETSc command-line options. By default it runs on one processor.","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"Please note that you will have to be in the correct directory or indicate where that directory is. If you are in a different directory, the easiest way to change to the correct one is by using the changefolder function (on Windows and Mac):","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"julia> changefolder()","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"Alternatively, you can use the build-in terminal/shell in julia, which you can access with:","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"julia>;\nshell>cd ~/LaMEM/input_models/BuildInSetups/","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"use the Backspace key to return to the julia REPL.","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"Once you have performed a simulation, you can look at the results by opening the *.pvd files with Paraview. In this example, that would be FB_multigrid.pvd and FB_multigrid_phase.pvd.","category":"page"},{"location":"#LaMEM.jl","page":"Home","title":"LaMEM.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This is the julia interface to LaMEM, which does a number of handy things:","category":"page"},{"location":"","page":"Home","title":"Home","text":"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!\nWe provide a simple function to run LaMEM from julia (also in parallel).\nWe provide functions to read timesteps back into julia. ","category":"page"}] +[{"location":"man/readtimesteps/#Read-timesteps-back-into-LaMEM","page":"Reading timesteps","title":"Read timesteps back into LaMEM","text":"","category":"section"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"If you want to quantitatively do something with the results, there is an easy way to read the output of a LaMEM timestep back into julia. All routines related to that are part of the LaMEM.IO module.","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> using LaMEM","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"You can first read the *.pvd file in the directory to see which timesteps are available:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> FileName=\"FB_multigrid\"\njulia> DirName =\"test\"\njulia> Timestep, Filenames, Time = Read_LaMEM_simulation(FileName, DirName)\n([0, 1], [\"Timestep_00000000_0.00000000e+00/FB_multigrid.pvtr\", \"Timestep_00000001_6.72970343e+00/FB_multigrid.pvtr\"], [0.0, 6.729703])","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"We can read a particular timestep (say 1) with:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> data, time = Read_LaMEM_timestep(FileName, 1, DirName)\n(CartData \n size : (33, 33, 33)\n x ϵ [ 0.0 : 1.0]\n y ϵ [ 0.0 : 1.0]\n z ϵ [ 0.0 : 1.0]\n fields : (:phase, :visc_total, :visc_creep, :velocity, :pressure, :strain_rate, :j2_dev_stress, :j2_strain_rate)\n attributes: [\"note\"]\n, [6.729703])","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"The output is in a CartData structure (as defined in GeophysicalModelGenerator).","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"If you do not indicate a directory name (DirName) it'll look in your current directory. The default above will load the main LaMEM simulation output. Alternatively, you can also load the phase information by specify the optional keyword phase=true:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> data, time = Read_LaMEM_timestep(FileName, 1, DirName, phase=true)\n(CartData \n size : (96, 96, 96)\n x ϵ [ 0.0052083334885537624 : 0.9947916269302368]\n y ϵ [ 0.0052083334885537624 : 0.9947916269302368]\n z ϵ [ 0.0052083334885537624 : 0.9947916269302368]\n fields : (:phase,)\n attributes: [\"note\"]\n, [6.729703])","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"In the same way, you can load the internal free surface with surf=true (if that was saved), or passive tracers (passive_tracers=true). If you don't want to load all the fields in the file back to julia, you can check which fields are available:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> Read_LaMEM_fieldnames(FileName, DirName)\n(\"phase [ ]\", \"visc_total [ ]\", \"visc_creep [ ]\", \"velocity [ ]\", \"pressure [ ]\", \"strain_rate [ ]\", \"j2_dev_stress [ ]\", \"j2_strain_rate [ ]\")","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"and load only part of those:","category":"page"},{"location":"man/readtimesteps/","page":"Reading timesteps","title":"Reading timesteps","text":"julia> data, time = Read_LaMEM_timestep(FileName, 1, DirName, fields=(\"phase [ ]\", \"visc_total [ ]\",\"velocity [ ]\"))\n(CartData \n size : (33, 33, 33)\n x ϵ [ 0.0 : 1.0]\n y ϵ [ 0.0 : 1.0]\n z ϵ [ 0.0 : 1.0]\n fields : (:phase, :visc_total, :velocity)\n attributes: [\"note\"]\n, [6.729703])","category":"page"},{"location":"man/juliasetup_pluto/#Using-Pluto-or-Jupyter-notebooks","page":"Notebooks","title":"Using Pluto or Jupyter notebooks","text":"","category":"section"},{"location":"man/juliasetup_pluto/#Pluto","page":"Notebooks","title":"Pluto","text":"","category":"section"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"You can also run LaMEM directly using Pluto notebooks:","category":"page"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"julia> using Pluto\njulia> Pluto.run()","category":"page"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"we have provided examples in the notebooks directory of the LaMEM.jl package.","category":"page"},{"location":"man/juliasetup_pluto/#Jupyter","page":"Notebooks","title":"Jupyter","text":"","category":"section"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"And for the ones of you that are more used to Jupyter notebooks, we also provide an example. Note that this will require you to install the required packages in julia first and use the IJulia package:","category":"page"},{"location":"man/juliasetup_pluto/","page":"Notebooks","title":"Notebooks","text":"julia> using IJulia\njulia> notebook()","category":"page"},{"location":"man/listfunctions/#List-of-all-functions","page":"List of functions","title":"List of all functions","text":"","category":"section"},{"location":"man/listfunctions/","page":"List of functions","title":"List of functions","text":"These are all functions that are available in the package, which can roughly be divided into two groups (running & reading LaMEM)","category":"page"},{"location":"man/listfunctions/#Running-LaMEM","page":"List of functions","title":"Running LaMEM","text":"","category":"section"},{"location":"man/listfunctions/","page":"List of functions","title":"List of functions","text":"Modules = [LaMEM.Run]\n","category":"page"},{"location":"man/listfunctions/#LaMEM.Run.deactivate_multithreading-Tuple{Cmd}","page":"List of functions","title":"LaMEM.Run.deactivate_multithreading","text":"deactivate_multithreading(cmd)\n\nThis deactivates multithreading\n\n\n\n\n\n","category":"method"},{"location":"man/listfunctions/#LaMEM.Run.remove_popup_messages_mac-Tuple{}","page":"List of functions","title":"LaMEM.Run.remove_popup_messages_mac","text":"remove_popup_messages_mac()\n\nOn a Mac with firewall enabled, running LaMEM will result in a popup window that says: \"Accept incoming connections\" which you should Allow or Deny. This is a bit annoying, so this julia script fixes that. Note that you must have administrator rights on your machine as we need to run \"sudo\"\n\nRun this script from the terminal with\n\njulia> remove_popup_messages_mac()\n\nYou need to do this once (every time a new version is installed)\n\n\n\n\n\n","category":"method"},{"location":"man/listfunctions/#LaMEM.Run.run_lamem","page":"List of functions","title":"LaMEM.Run.run_lamem","text":"run_lamem(ParamFile::String, cores::Int64=1, args:String=\"\"; wait=true, deactivate_multithreads=true)\n\nThis 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.\n\nExample:\n\nYou can call LaMEM with:\n\njulia> using LaMEM\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile)\n\nDo the same on 2 cores with a command-line argument as:\n\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile, 2, \"-nstep_max = 1\")\n\n\n\n\n\n","category":"function"},{"location":"man/listfunctions/#LaMEM.Run.run_lamem_save_grid","page":"List of functions","title":"LaMEM.Run.run_lamem_save_grid","text":"ProcessorPartFile = run_lamem_save_grid(ParamFile::String, cores::Int64=1; verbose=true)\n\nThis calls LaMEM simulation, for using the parameter file ParamFile and creates processor partitioning file \"ProcessorPartitioningcorescpuX.Y.Z.bin\" for cores number of cores. \n\nExample:\n\njulia> using LaMEM\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> ProcessorPartFile = run_lamem_save_grid(ParamFile, 2)\n\n\n\n\n\n","category":"function"},{"location":"man/listfunctions/#LaMEM.Run.show_paths_LaMEM-Tuple{}","page":"List of functions","title":"LaMEM.Run.show_paths_LaMEM","text":"show_paths_LaMEM()\n\nThe 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.\n\nThis function shows this for your system. \n\n\n\n\n\n","category":"method"},{"location":"man/listfunctions/#Reading-LaMEM-output-back-into-julia","page":"List of functions","title":"Reading LaMEM output back into julia","text":"","category":"section"},{"location":"man/listfunctions/","page":"List of functions","title":"List of functions","text":"```@autodocs Modules = [LaMEM.IO_functions]","category":"page"},{"location":"man/juliasetup_LaPalma/#La-Palma-Volcano-setup","page":"Example 2: Volcano","title":"La Palma Volcano setup","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"In this example, we will show how to create a 3D model setup for the 2020 La Palma eruption. We mainly focus on the LaMEM part; see the GeophysicalModelGenerator package for more details on how to plot earthquake data etc.","category":"page"},{"location":"man/juliasetup_LaPalma/#.-Load-packages-and-topography","page":"Example 2: Volcano","title":"1. Load packages & topography","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Let's start with what we need:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> using LaMEM, GeophysicalModelGenerator, GMT, Plots\nLoading GMT routines within GMG\nWARNING: using GMT.meshgrid in module GeophysicalModelGenerator conflicts with an existing identifier.\nadding Plots.jl plotting extensions for LaMEM","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Load the topography, choose a projection point & project the topography to cartesian coordinates:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> Topo = ImportTopo(lon = [-18.7, -17.1], lat=[28.0, 29.2], file=\"@earth_relief_03s.grd\");\njulia> proj = ProjectionPoint(Lon=-17.84, Lat=28.56);\njulia> Topo_cart = Convert2CartData(Topo, proj)\nCartData \n size : (1921, 1441, 1)\n x ϵ [ -86.09445705828863 : 73.67229892155609]\n y ϵ [ -63.5531883197492 : 73.28446155584604]\n z ϵ [ -4.38352685546875 : 2.414]\n fields : (:Topography,)\n attributes: [\"note\"]","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"This shows the dimensions of our domain in kilometers. The issue is that this projected topography is not an orthogonal grid, but (slightly) distorted. In any case, we see the approximate dimensions of the grid (in horizontal directions), so we can create an orthogonal grid on which to project this:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> Topo_LaMEM = CartData(XYZGrid(-70:.2:70,-60:.2:70,0));\njulia> Topo_LaMEM = ProjectCartData(Topo_LaMEM, Topo, proj)","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We can plot it with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> plot_topo(Topo_LaMEM, clim=(-4,4))","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"(Image: LaPalma_topo)","category":"page"},{"location":"man/juliasetup_LaPalma/#.-LaMEM-Model-setup","page":"Example 2: Volcano","title":"2. LaMEM Model setup","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Next, we generate a model setup for LaMEM with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model = Model(Grid(x=[-50.,50.], y=[-40.,40.], z=[-80,15] , nel=(64,64,32)),\n BoundaryConditions(temp_bot=1350, open_top_bound=1),\n Scaling(GEO_units(stress=1e9Pa, length=1km)),\n Time(nstep_max=20) )\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(64, 64, 32); xϵ(-50.0, 50.0), yϵ(-40.0, 40.0), zϵ(-80.0, 15.0) \n|-- Time : nstep_max=20; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases; ","category":"page"},{"location":"man/juliasetup_LaPalma/#Set-geotherm-and-phases","page":"Example 2: Volcano","title":"Set geotherm and phases","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We can set an initial constant, linear, geotherm with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> Z = model.Grid.Grid.Z;\njulia> Geotherm=30\njulia> model.Grid.Temp = -Z.*Geotherm;","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We will cutoff extreme values with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model.Grid.Temp[model.Grid.Temp.<20] .= 20;\njulia> model.Grid.Temp[model.Grid.Temp.>1350] .= 1350;\njulia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([64], [64], [32])\n marker/cell : (3, 3, 3)\n x ϵ [-50.0 : 50.0]\n y ϵ [-40.0 : 40.0]\n z ϵ [-80.0 : 15.0]\n Phases : range ϵ [0 - 0]\n Temp : range ϵ [20.0 - 1350.0]","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Set Phases to two everywhere:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model.Grid.Phases .= 2;","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Now set points above the topography to zero (will be air later), the ones above the topography but below zero to 'water` and below 40 km to mantle (if we had a Moho surface we could use that):","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":" julia> AboveSurface!(model, Topo_LaMEM, phase=0, T=0)\n julia> model.Grid.Phases[Z.<-0 .&& model.Grid.Phases .== 0] .= 1;\n julia> model.Grid.Phases[Z.<-40] .= 3;","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Finally, we define some magma chambers:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> AddSphere!(model, cen=(0,0,-35), radius=5, phase=ConstantPhase(5), T=ConstantTemp(1200));\njulia> AddEllipsoid!(model, cen=(-1,0,-11), axes=(3,3,8), StrikeAngle=225, DipAngle=45, phase=ConstantPhase(5), T=ConstantTemp(1200));\njulia> AddEllipsoid!(model, cen=(-0,0,-23), axes=(8,8,2), StrikeAngle=0, DipAngle=0, phase=ConstantPhase(5), T=ConstantTemp(1200));","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We can plot a cross-section through the model:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":" julia> plot_cross_section(model, x=0, field=:phase)","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"(Image: LaPalma_CrossSection)","category":"page"},{"location":"man/juliasetup_LaPalma/#Set-material-properties","page":"Example 2: Volcano","title":"Set material properties","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"First, we set air and water properties:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> air = set_air(alpha=3e-5, G=1e10, nu=0.2, ch=10e6, fr=30)\nPhase 0 (air): \n rho = 100.0 \n eta = 1.0e17 \n G = 1.0e10 \n nu = 0.2 \n ch = 1.0e7 \n fr = 30.0 \n alpha = 3.0e-5 \n Cp = 1000.0 \n k = 30.0 \njulia> water=deepcopy(air); water.Name=\"water\"; water.ID=1","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Next, we set the crust:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> crust = Phase(Name=\"Crust\", ID=2, rho=2900, alpha=3e-5, disl_prof=\"Mafic_Granulite-Ranalli_1995\",\n G=3e10, nu=0.2, k=3, Cp=1000, ch=10e6, fr=30)\nPhase 2 (Crust): \n rho = 2900.0 \n disl_prof = Mafic_Granulite-Ranalli_1995 \n G = 3.0e10 \n nu = 0.2 \n ch = 1.0e7 \n fr = 30.0 \n alpha = 3.0e-5 \n Cp = 1000.0 \n k = 3.0 ","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"The mantle is done as a copy of that, while changing a few parameters:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":" julia> mantle = copy_phase(crust, Name=\"Mantle\", ID=3, rho=3320.0, disl_prof=\"Dry_Olivine-Ranalli_1995\", G=6.5e10, k=3.3);","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"And we define two different types of magma:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> andesite = Phase(Name=\"andesitic_magma\",ID=4,rho=2700, alpha=3e-5, eta=1e18, G=1.5e10, nu=0.2, k=3, Cp=1000, T=980, ch=1e7, fr=30);\njulia> dacite = copy_phase(andesite,Name=\"dacite_magma\", ID=5, rho=2575.0, eta=1e19, T=800.0)","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Now we add all of this to the model:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> rm_phase!(model)\njulia> add_phase!(model, air, water, crust, mantle, andesite, dacite)","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"And check that we indeed have 6 phases:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(64, 64, 32); xϵ(-50.0, 50.0), yϵ(-40.0, 40.0), zϵ(-80.0, 15.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases; ","category":"page"},{"location":"man/juliasetup_LaPalma/#Add-topography-to-model","page":"Example 2: Volcano","title":"Add topography to model","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"We can add the topography grid that we created earlier to the model with:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> add_topography!(model, Topo_LaMEM)","category":"page"},{"location":"man/juliasetup_LaPalma/#Set-solver-options","page":"Example 2: Volcano","title":"Set solver options","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"You will want to use a multigrid solver in this case:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> model.Solver = Solver(SolverType=\"multigrid\", MGLevels=4)","category":"page"},{"location":"man/juliasetup_LaPalma/#.-Run-LaMEM","page":"Example 2: Volcano","title":"3. Run LaMEM","text":"","category":"section"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"Running LaMEM is simple; here on 4 processors:","category":"page"},{"location":"man/juliasetup_LaPalma/","page":"Example 2: Volcano","title":"Example 2: Volcano","text":"julia> run_lamem(model, 4)\nSaved file: Model3D.vts\nWritten LaMEM topography file: topography.txt\nWriting LaMEM marker file -> ./markers/mdb.00000000.dat\nWriting LaMEM marker file -> ./markers/mdb.00000001.dat\nWriting LaMEM marker file -> ./markers/mdb.00000002.dat\nWriting LaMEM marker file -> ./markers/mdb.00000003.dat\n-------------------------------------------------------------------------- \n Lithosphere and Mantle Evolution Model \n Compiled: Date: Apr 7 2023 - Time: 22:11:23 \n Version : 1.2.4 \n-------------------------------------------------------------------------- \n STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION \n-------------------------------------------------------------------------- \nParsing input file : output.dat \nFinished parsing input file : output.dat \n--------------------------------------------------------------------------\nScaling parameters:\n Temperature : 1000. [C/K] \n Length : 1000. [m] \n Viscosity : 1e+20 [Pa*s] \n Stress : 1e+09 [Pa] \n--------------------------------------------------------------------------","category":"page"},{"location":"man/LaMEM_ModelFunctions/#List-functions","page":"Available functions","title":"List functions","text":"","category":"section"},{"location":"man/LaMEM_ModelFunctions/","page":"Available functions","title":"Available functions","text":"These are all the functions that are provided for the LaMEM Julia Setup interface ","category":"page"},{"location":"man/LaMEM_ModelFunctions/","page":"Available functions","title":"Available functions","text":"Modules = [LaMEM.LaMEM_Model]","category":"page"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.BoundaryConditions","page":"Available functions","title":"LaMEM.LaMEM_Model.BoundaryConditions","text":"Structure that contains the LaMEM boundary conditions information.\n\nnoslip::Vector{Int64}: No-slip boundary flag mask (left right front back bottom top)\nopen_top_bound::Int64: Stress-free (free surface/infinitely fast erosion) top boundary flag\ntemp_top::Float64: Constant temperature on the top boundary\ntemp_bot::Float64: Constant temperature on the bottom boundary\nexx_num_periods::Int64: number intervals of constant background strain rate (x-axis)\nexx_time_delims::Vector{Float64}: time delimiters (one less than number of intervals, not required for one interval)\nexx_strain_rates::Vector{Float64}: strain rates for each interval\neyy_num_periods::Int64: eyynumperiods\neyy_time_delims::Vector{Float64}: eyytimedelims\neyy_strain_rates::Vector{Float64}: eyystrainrates\nexy_num_periods::Int64: exynumperiods\nexy_time_delims::Vector{Float64}: exytimedelims\nexy_strain_rates::Vector{Float64}: exystrainrates\nexz_num_periods::Int64: exznumperiods\nexz_time_delims::Vector{Float64}: exztimedelims\nexz_strain_rates::Vector{Float64}: exzstrainrates\neyz_num_periods::Int64: eyznumperiods\neyz_time_delims::Vector{Float64}: eyztimedelims\neyz_strain_rates::Vector{Float64}: eyzstrainrates\nbg_ref_point::Vector{Float64}: background strain rate reference point (fixed)\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Dike","page":"Available functions","title":"LaMEM.LaMEM_Model.Dike","text":"Defines the properties related to inserting dikes\n\nID::Int64: Material phase ID\nMf::Float64: value for dike/magma- accommodated extension, between 0 and 1, in the front of the box, for phase dike\nMc::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\ny_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\nMb::Union{Nothing, Float64}: value for dike/magma-accommodated extension, between 0 and 1, in the back of the box, for phase dike\nPhaseID::Union{Nothing, Int64}: Phase ID\nPhaseTransID::Union{Nothing, Int64}: Phase transition ID\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.FreeSurface","page":"Available functions","title":"LaMEM.LaMEM_Model.FreeSurface","text":"Structure that contains the LaMEM free surface information.\n\nsurf_use::Int64: Free surface activation flag\nsurf_corr_phase::Int64: air phase ratio correction flag (phases in an element that contains are modified based on the surface position)\nsurf_level::Union{Nothing, Float64}: initial level of the free surface\nsurf_air_phase::Union{Nothing, Int64}: phase ID of sticky air layer\nsurf_max_angle::Float64: maximum angle with horizon (smoothed if larger)\nsurf_topo_file::String: initial topography file (redundant)\nerosion_model::Int64: erosion model [0-none (default), 1-infinitely fast, 2-prescribed rate with given level]\ner_num_phases::Int64: number of erosion phases\ner_time_delims::Vector{Float64}: erosion time delimiters (one less than number)\ner_rates::Vector{Float64}: constant erosion rates in different time periods\ner_levels::Vector{Int64}: levels above which we apply constant erosion rates in different time periods\nsediment_model::Int64: sedimentation model [0-none (dafault), 1-prescribed rate with given level, 2-cont. margin]\nsed_num_layers::Int64: number of sediment layers\nsed_time_delims::Vector{Float64}: sediment layers time delimiters (one less than number)\nsed_rates::Vector{Float64}: sediment rates in different time periods\nsed_levels::Vector{Float64}: levels below which we apply constant sediment rates in different time periods\nsed_phases::Vector{Int64}: sediment layers phase numbers in different time periods\nmarginO::Vector{Float64}: lateral coordinates of continental margin - origin\nmarginE::Vector{Float64}: lateral coordinates of continental margin - 2nd point\nhUp::Float64: up dip thickness of sediment cover (onshore)\nhDown::Float64: down dip thickness of sediment cover (off shore)\ndTrans::Float64: half of transition zone\nTopography::Union{Nothing, GeophysicalModelGenerator.CartData}: Topography grid\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Grid","page":"Available functions","title":"LaMEM.LaMEM_Model.Grid","text":"Structure that contains the LaMEM grid information\n\nnmark_x::Int64: number of markers/element in x-direction\nnmark_y::Int64: number of markers/element in y-direction\nnmark_z::Int64: number of markers/element in x-direction\nnel_x::Vector{Int64}: number of elements in x-direction\nnel_y::Vector{Int64}: number of elements in y-direction\nnel_z::Vector{Int64}: number of elements in z-direction\ncoord_x::Vector{Float64}: coordinates in x-direction\ncoord_y::Vector{Float64}: coordinates in y-direction\ncoord_z::Vector{Float64}: coordinates in z-direction\nnseg_x::Int64: number of segments in x-direction (if we employ variable grid spacing in x-direction)\nnseg_y::Int64: number of segments in y-direction (if we employ variable grid spacing in y-direction)\nnseg_z::Int64: number of segments in z-direction (if we employ variable grid spacing in z-direction)\nbias_x::Vector{Float64}: bias in x-direction (if we employ variable grid spacing in x-direction)\nbias_y::Vector{Float64}: bias in y-direction (if we employ variable grid spacing in y-direction)\nbias_z::Vector{Float64}: bias in z-direction (if we employ variable grid spacing in z-direction)\nGrid::GeophysicalModelGenerator.LaMEM_grid: Contains the LaMEM Grid object\nPhases::Array{Int32}: Phases; 3D phase information\nTemp::Array{Float64}: Temp; 3D phase information\n\nExample 1\n\njulia> d=LaMEM.Grid(coord_x=[0.0, 0.7, 0.8, 1.0], bias_x=[0.3,1.0,3.0], nel_x=[10,4,2])\nLaMEM grid with 1D refinement: \n nel : ([10, 4, 2], [16], [16])\n marker/cell : (3, 3, 3)\n x ϵ [0.0, 0.7, 0.8, 1.0], bias=[0.3, 1.0, 3.0], nseg=3, Δmin=0.025000000000000022, Δmax=0.1499999999999999\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n\nExample 2\n\njulia> d=LaMEM.Grid(nel=(10,20))\nLaMEM grid with constant Δ: \n nel : ([10], [1], [20])\n marker/cell : (3, 3, 3)\n x ϵ [-10.0 : 10.0]\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Materials","page":"Available functions","title":"LaMEM.LaMEM_Model.Materials","text":"Structure that contains the material properties in the current simulation\n\nPhases::Vector{Phase}: Different Materials implemented\nSofteningLaws::Vector{Softening}: Softening laws implemented\nPhaseTransitions::Vector{PhaseTransition}: Internal Phase Transitions (that change the ID of markers) implemented\nDikes::Vector{Dike}: Dikes implemented (mostly for MOR simulations)\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Model","page":"Available functions","title":"LaMEM.LaMEM_Model.Model","text":"; Model\n\nStructure that holds all the information to create a LaMEM input file\n\nScaling::Scaling: Scaling parameters\nGrid::Grid: LaMEM Grid\nTime::Any: Time options\nFreeSurface::Any: Free surface options\nBoundaryConditions::Any: Boundary conditions\nSolutionParams::Any: Global solution parameters\nSolver::Any: Solver options and optional PETSc options\nModelSetup::Any: Model setup\nOutput::Any: Output options\nMaterials::Any: Material parameters for each of the phases\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Model-Tuple","page":"Available functions","title":"LaMEM.LaMEM_Model.Model","text":"Model(args...)\n\nAllow to define a model setup by specifying some of the basic objects\n\nExample\n\njulia> d = Model(Grid(nel=(10,1,20)), Scaling(NO_units()))\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GeoParams.Units.NONE}\n|-- Grid : nel=(10, 1, 20); xϵ(-10.0, 10.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : \n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=geom; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 1 phases; \n\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Model-Tuple{}","page":"Available functions","title":"LaMEM.LaMEM_Model.Model","text":"Model(;\n Scaling=Scaling(GEO_units()),\n Grid=Grid(), \n Time=Time(),\n FreeSurface=FreeSurface(),\n BoundaryConditions=BoundaryConditions(),\n SolutionParams=SolutionParams(),\n Solver=Solver(),\n ModelSetup=ModelSetup(),\n Output=Output(),\n Materials=Materials()\n )\n\nCreates a LaMEM Model setup.\n\nScaling::Scaling\nGrid::Grid\nTime::Any\nFreeSurface::Any\nBoundaryConditions::Any\nSolutionParams::Any\nSolver::Any\nModelSetup::Any\nOutput::Any\nMaterials::Any\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.ModelSetup","page":"Available functions","title":"LaMEM.LaMEM_Model.ModelSetup","text":"Structure that contains the LaMEM Model Setup and Advection options\n\nmsetup::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)\nrand_noise::Int64: add random noise to the particle location\nrand_noiseGP::Int64: random noise flag, subsequently applied to geometric primitives\nbg_phase::Int64: background phase ID\nsave_mark::Int64: save marker to disk flag\nmark_load_file::String: marker input file (extension is .xxxxxxxx.dat), if using msetup=files\nmark_save_file::String: marker output file (extension is .xxxxxxxx.dat)\npoly_file::String: polygon geometry file (redundant), if using msetup=polygons\ntemp_file::String: initial temperature file (redundant), if not set on markers\nadvect::String: advection scheme; options=none (no advection); basic (Euler classical implementation [default]); Euler (Euler explicit in time); rk2 (Runge-Kutta 2nd order in space)\ninterp::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)\nstagp_a::Float64: STAG_P velocity interpolation parameter\nmark_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)\nnmark_lim::Vector{Int64}: min/max number per cell (marker control)\nnmark_avd::Vector{Int64}: x-y-z AVD refinement factors (avd marker control)\nnmark_sub::Int64: max number of same phase markers per subcell (subgrid marker control)\ngeom_primitives::Vector: Different geometric primitives that can be selected if we msetup=geom; seegeom_Sphere`\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Output","page":"Available functions","title":"LaMEM.LaMEM_Model.Output","text":"Structure that contains the LaMEM output options\n\nout_file_name::Any: output file name\nout_dir::Any: output directory\nparam_file_name::Any: parameter filename\nwrite_VTK_setup::Any: write VTK initial model setup\nout_pvd::Any: activate writing .pvd file\nout_phase::Any: dominant phase\nout_density::Any: density\nout_visc_total::Any: total (viscoelastoplastic) viscosity\nout_visc_creep::Any: creep viscosity\nout_velocity::Any: velocity\nout_pressure::Any: (dynamic) pressure\nout_tot_press::Any: total pressure\nout_eff_press::Any: effective pressure\nout_over_press::Any: outoverpress\nout_litho_press::Any: lithospheric pressure\nout_pore_press::Any: pore pressure\nout_temperature::Any: temperature\nout_dev_stress::Any: deviatoric strain rate tensor\nout_j2_dev_stress::Any: second invariant of deviatoric stress tensor\nout_strain_rate::Any: deviatoric strain rate tensor\nout_j2_strain_rate::Any: second invariant of strain rate tensor\nout_shmax::Any: sh max\nout_ehmax::Any: eh max\nout_yield::Any: yield stress\nout_rel_dif_rate::Any: relative proportion of diffusion creep strainrate\nout_rel_dis_rate::Any: relative proportion of dislocation creep strainrate\nout_rel_prl_rate::Any: relative proportion of peierls creep strainrate\nout_rel_pl_rate::Any: relative proportion of plastic strainrate\nout_plast_strain::Any: accumulated plastic strain\nout_plast_dissip::Any: plastic dissipation\nout_tot_displ::Any: total displacement\nout_moment_res::Any: momentum residual\nout_cont_res::Any: continuity residual\nout_energ_res::Any: energy residual\nout_melt_fraction::Any: Melt fraction\nout_fluid_density::Any: fluid density\nout_conductivity::Any: conductivity\nout_vel_gr_tensor::Any: velocity gradient tensor\nout_surf::Any: activate surface output\nout_surf_pvd::Any: activate writing .pvd file\nout_surf_velocity::Any: surface velocity\nout_surf_topography::Any: surface topography\nout_surf_amplitude::Any: amplitude of topography (=topo-average(topo))\nout_mark::Any: activate marker output\nout_mark_pvd::Any: activate writing .pvd file\nout_avd::Any: activate AVD phase output\nout_avd_pvd::Any: activate writing .pvd file\nout_avd_ref::Any: AVD grid refinement factor\nout_ptr::Any: activate\nout_ptr_ID::Any: ID of the passive tracers\nout_ptr_phase::Any: phase of the passive tracers\nout_ptr_Pressure::Any: interpolated pressure\nout_ptr_Temperature::Any: temperature\nout_ptr_MeltFraction::Any: melt fraction computed using P-T of the marker\nout_ptr_Active::Any: option that highlight the marker that are currently active\nout_ptr_Grid_Mf::Any: option that allow to store the melt fraction seen within the cell\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Phase","page":"Available functions","title":"LaMEM.LaMEM_Model.Phase","text":"Defines the material properties for each of the phases\n\nID::Union{Nothing, Int64}: Material phase ID\nName::Union{Nothing, String}: Description of the phase\nrho::Union{Nothing, Float64}: Density [kg/m^3]\neta::Union{Nothing, Float64}: Linear viscosity [Pas]\nvisID::Union{Nothing, Int64}: material ID for phase visualization (default is ID)\ndiff_prof::Union{Nothing, String}: DIFFUSION creep profile; example: \"DryOlivinediffcreep-HirthKohlstedt_2003\"\ndisl_prof::Union{Nothing, String}: DISLOCATION creep profile; example: \"Granite-Tireletal_2008\"\npeir_prof::Union{Nothing, String}: PEIERLS creep profile; example: \"OlivinePeierls-Kameyama1999\"\nrho_n::Union{Nothing, Float64}: depth-dependent density model parameter\nrho_c::Union{Nothing, Float64}: depth-dependent density model parameter\nbeta::Union{Nothing, Float64}: pressure-dependent density model parameter\nG::Union{Nothing, Float64}: shear modulus\nKb::Union{Nothing, Float64}: bulk modulus\nE::Union{Nothing, Float64}: Young's modulus\nnu::Union{Nothing, Float64}: Poisson's ratio\nKp::Union{Nothing, Float64}: pressure dependence parameter\nBd::Union{Nothing, Float64}: DIFFUSION creep pre-exponential constant\nEd::Union{Nothing, Float64}: activation energy\nVd::Union{Nothing, Float64}: activation volume\neta0::Union{Nothing, Float64}: POWER LAW reference viscosity\ne0::Union{Nothing, Float64}: reference strain rate\nBn::Union{Nothing, Float64}: DISLOCATION creep pre-exponential constant\nEn::Union{Nothing, Float64}: activation energy\nVn::Union{Nothing, Float64}: activation volume\nn::Union{Nothing, Float64}: power law exponent\nBp::Union{Nothing, Float64}: PEIERLS creep pre-exponential constant\nEp::Union{Nothing, Float64}: activation energy\nVp::Union{Nothing, Float64}: activation volume\ntaup::Union{Nothing, Float64}: scaling stress\ngamma::Union{Nothing, Float64}: approximation parameter\nq::Union{Nothing, Float64}: stress-dependence parameter\neta_fk::Union{Nothing, Float64}: reference viscosity for Frank-Kamenetzky viscosity\ngamma_fk::Union{Nothing, Float64}: gamma parameter for Frank-Kamenetzky viscosity\nTRef_fk::Union{Nothing, Float64}: reference Temperature for Frank-Kamenetzky viscosity (if not set it is 0°C)\nch::Union{Nothing, Float64}: cohesion\nfr::Union{Nothing, Float64}: friction angle\neta_st::Union{Nothing, Float64}: stabilization viscosity (default is eta_min)\nrp::Union{Nothing, Float64}: pore-pressure ratio\nchSoftID::Union{Nothing, Int64}: friction softening law ID\nfrSoftID::Union{Nothing, Int64}: cohesion softening law ID\nhealID::Union{Nothing, Int64}: healing ID, points to healTau in Softening\nalpha::Union{Nothing, Float64}: thermal expansivity\nCp::Union{Nothing, Float64}: specific heat (capacity), J⋅K−1⋅kg−1\nk::Union{Nothing, Float64}: thermal conductivity\nA::Union{Nothing, Float64}: radiogenic heat production\nT::Union{Nothing, Float64}: optional temperature to set within the phase\nLatent_hx::Union{Nothing, Float64}: optional, used for dike heating, J/kg\nT_liq::Union{Nothing, Float64}: optional, used for dike heating, liquidus temperature of material, celsius\nT_sol::Union{Nothing, Float64}: optional, used for dike heating, solidus temperature of material, celsius\nT_Nu::Union{Nothing, Float64}: default value for thermal conductivity boundary\nnu_k::Union{Nothing, Float64}: optional parameter, Nusselt number for use with conductivity\nrho_ph::Union{Nothing, String}: name of the phase diagram you want to use (still needs rho to be defined for the initial guess of pressure)\nrho_ph_dir::Union{Nothing, String}: in case the phase diagram has a different path provide the path (without the name of the actual PD) here\nmfc::Union{Nothing, Float64}: melt fraction viscosity correction factor (positive scalar)\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.PhaseTransition","page":"Available functions","title":"LaMEM.LaMEM_Model.PhaseTransition","text":"Defines phase transitions on markers (that change the Phase ID of a marker depending on some conditions)\n\nID::Int64: Phase_transition law ID\nType::String: [Constant, Clapeyron, Box]: Constant - the phase transition occurs only at a fixed value of the parameter; Clapeyron - clapeyron slope\nName_Clapeyron::Union{Nothing, Int64}: Type of predefined Clapeyron slope, such as MantleTransition660km\nPTBox_Bounds::Union{Nothing, Vector{Float64}}: box bound coordinates: [left, right, front, back, bottom, top]\nBoxVicinity::Union{Nothing, Int64}: 1: only check particles in the vicinity of the box boundaries (2: in all directions)\nParameter_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\nConstantValue::Union{Nothing, Float64}: Value of the parameter [unit of T,P,z, APS]\nnumber_phases::Union{Nothing, Int64}: The number of involved phases [default=1]\nPhaseAbove::Union{Nothing, Vector{Int64}}: Above the chosen value the phase is 1, below it, the value is PhaseBelow\nPhaseBelow::Union{Nothing, Vector{Int64}}\nPhaseInside::Union{Nothing, Vector{Int64}}: Phase within the box [use -1 if you don't want to change the phase inside the box]\nPhaseOutside::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]\nPhaseDirection::String: [BothWays=default; BelowToAbove; AboveToBelow] Direction in which transition works\nResetParam::String: [APS] Parameter to reset on particles below PT or within box\nPTBox_TempType::String: # Temperature condition witin the box [none, constant, linear, halfspace]\nPTBox_topTemp::Union{Nothing, Float64}: Temp @ top of box [for linear & halfspace]\nPTBox_botTemp::Union{Nothing, Float64}: Temp @ bottom of box [for linear & halfspace]\nPTBox_thermalAge::Union{Nothing, Float64}: Thermal age, usually in geo-units [Myrs] [only in case of halfspace]\nPTBox_cstTemp::Union{Nothing, Float64}: Temp within box [only for constant T]\nv_box::Union{Nothing, Float64}: [optional] only for NotInAirBox, velocity with which box moves in cm/yr\nt0_box::Union{Nothing, Float64}: [optional] beginning time of movemen in Myr\nt1_box::Union{Nothing, Float64}: [optional] end time of movement in Myr\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Scaling","page":"Available functions","title":"LaMEM.LaMEM_Model.Scaling","text":"Scaling{T} is a structure that contains the scaling info, employed in the current simulation\n\nScaling::Any: Scaling object (as in GeoParams), which can be GEO_units(), NO_units(), or SI_units()\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Softening","page":"Available functions","title":"LaMEM.LaMEM_Model.Softening","text":"Defines strain softening parameters\n\nID::Int64: softening law ID\nAPS1::Float64: Begin of softening, in units of accumulated plastic strain (APS)\nAPS2::Float64: End of softening, in units of accumulated plastic strain (APS)\nA::Float64: Reduction ratio\nLm::Float64: Material length scale (in selected units, e.g. km in geo)\nAPSheal2::Union{Nothing, Float64}: APS when healTau2 activates\nhealTau::Union{Nothing, Float64}: healing timescale parameter [Myr]\nhealTau2::Union{Nothing, Float64}: healing timescale parameter [Myr] starting at APS=APSheal2\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.SolutionParams","page":"Available functions","title":"LaMEM.LaMEM_Model.SolutionParams","text":"Structure that contains the LaMEM global solution parameters.\n\ngravity::Vector{Float64}: gravitational acceleration vector\nFSSA::Float64: free surface stabilization parameter [0 - 1]; The value has to be between 0 and 1\n\nshear_heat_eff::Float64: shear heating efficiency parameter [0 - 1]\nAdiabatic_Heat::Float64: Adiabatic Heating activation flag and efficiency. 0.0 - 1.0\nact_temp_diff::Int64: temperature diffusion activation flag\nact_therm_exp::Int64: thermal expansion activation flag\nact_steady_temp::Int64: steady-state temperature initial guess activation flag\nsteady_temp_t::Float64: time for (quasi-)steady-state temperature initial guess\nnstep_steady::Int64: number of steps for (quasi-)steady-state temperature initial guess (default = 1)\nact_heat_rech::Int64: recharge heat in anomalous bodies after (quasi-)steady-state temperature initial guess (=2: recharge after every diffusion step of initial guess)\ninit_lith_pres::Int64: sets initial pressure to be the lithostatic pressure (stabilizes compressible setups in the first steps)\ninit_guess::Int64: create an initial guess step (using constant viscosity eta_ref before starting the simulation\np_litho_visc::Int64: use lithostatic instead of dynamic pressure for creep laws\np_litho_plast::Int64: use lithostatic pressure for plasticity\np_lim_plast::Int64: limit pressure at first iteration for plasticity\np_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)\nact_p_shift::Int64: pressure shift activation flag (enforce zero pressure on average in the top cell layer); note: this overwrites p_shift above!\neta_min::Float64: viscosity lower bound [Pas]\neta_max::Float64: viscosity upper limit [Pas]\neta_ref::Float64: Reference viscosity (used for the initial guess) [Pas]\nT_ref::Float64: Reference temperature [C]\nRUGC::Float64: universal gas constant (you need to change this only for non-dimensional setups)\nmin_cohes::Float64: cohesion lower bound [Pa]\nmin_fric::Float64: friction lower bound [degree]\ntau_ult::Float64: ultimate yield stress [Pa]\nrho_fluid::Float64: fluid density for depth-dependent density model\ngw_level_type::String: ground water level type for pore pressure computation (see below)\ngw_level::Float64: ground water level at the free surface (if defined)\nbiot::Float64: Biot pressure parameter\nget_permea::Float64: effective permeability computation activation flag\nrescal::Float64: stencil rescaling flag (for internal constraints, for example while computing permeability)\nmfmax::Float64: maximum melt fraction affecting viscosity reduction\nlmaxit::Int64: maximum number of local rheology iterations\nlrtol::Float64: local rheology iterations relative tolerance\nact_dike::Int64: dike activation flag (additonal term in divergence)\nuseTk::Int64: switch to use T-dependent conductivity, 0: not active\ndikeHeat::Int64: switch to use Behn & Ito heat source in the dike\nCompute_velocity_gradient::Int64: compute the velocity gradient tensor 1: active, 0: not active. If active, it automatically activates the output in the .pvd file\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Solver","page":"Available functions","title":"LaMEM.LaMEM_Model.Solver","text":"Structure that contains the LaMEM solver options\n\nSolverType::String: solver employed [\"direct\" or \"multigrid\"]\nDirectSolver::String: mumps/superlu_dist/pastix/umfpack (requires these external PETSc packages to be installed!)\nDirectPenalty::Float64: penalty parameter [employed if we use a direct solver]\nMGLevels::Int64: number of MG levels [default=3]\nMGSweeps::Int64: number of MG smoothening steps per level [default=10]\nMGSmoother::String: type of smoothener used [chebyshev or jacobi]\nMGJacobiDamp::Float64: Dampening parameter [only employed for Jacobi smoothener; default=0.6]\nMGCoarseSolver::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]\nMGRedundantNum::Int64: How many times do we copy the coarse grid? [only employed for redundant solver; default is 4]\nMGRedundantSolver::String: The coarse grid solver for each of the redundant solves [only employed for redundant; options are \"mumps\"/\"superlu_dist\" with default \"superlu_dist\"]\nPETSc_options::Vector{String}: List with (optional) PETSc options\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Time","page":"Available functions","title":"LaMEM.LaMEM_Model.Time","text":"Structure that contains the LaMEM timestepping information. An explanation of the paramneters is given in the struct `Time_info`\n\ntime_end::Float64: simulation end time\ndt::Float64: initial time step\ndt_min::Float64: minimum time step (declare divergence if lower value is attempted)\ndt_max::Float64: maximum time step\ndt_out::Float64: output step (output at least at fixed time intervals)\ninc_dt::Float64: time step increment per time step (fraction of unit)\nCFL::Float64: CFL (Courant-Friedrichs-Lewy) criterion\nCFLMAX::Float64: CFL criterion for elasticity\nnstep_max::Int64: maximum allowed number of steps (lower bound: timeend/dtmax)\nnstep_out::Int64: save output every n steps; Set this to -1 to deactivate saving output\nnstep_rdb::Int64: save restart database every n steps\nnum_dt_periods::Int64: number of time stepping periods\ntime_dt_periods::Vector{Int64}: timestamps where timestep should be fixed (first entry has to 0)\nstep_dt_periods::Vector{Float64}: target timesteps ar timestamps above\nnstep_ini::Int64: save output for n initial steps\ntime_tol::Float64: relative tolerance for time comparisons\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.geom_Sphere","page":"Available functions","title":"LaMEM.LaMEM_Model.geom_Sphere","text":"LaMEM geometric primitive `sphere` object\n\nphase::Int64: phase\nradius::Float64: radius of sphere\ncenter::Vector{Float64}: center of sphere\nTemperature::Union{Nothing, String}: optional: Temperature of the sphere. possibilities: [constant, or nothing]\ncstTemp::Union{Nothing, Float64}: required in case of [constant]: temperature value [in Celcius in case of GEO units]\n\n\n\n\n\n","category":"type"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AboveSurface-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"GeophysicalModelGenerator.AboveSurface","text":"AboveSurface(model::Model, DataSurface_Cart::CartData)\n\nReturns a boolean grid that is true if the Phases/Temp grid are above the surface\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AddBox!-Tuple{Model}","page":"Available functions","title":"GeophysicalModelGenerator.AddBox!","text":"AddBox!(model::Model; xlim=Tuple{2}, [ylim=Tuple{2}], zlim=Tuple{2},\n Origin=nothing, StrikeAngle=0, DipAngle=0,\n phase = ConstantPhase(1),\n T=nothing )\n\nAdds 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\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AddCylinder!-Tuple{Model}","page":"Available functions","title":"GeophysicalModelGenerator.AddCylinder!","text":"AddCylinder!(model::Model; # required input\n base=Tuple{3}, cap=Tuple{3}, radius=Tuple{1}, # center and radius of the sphere\n phase = ConstantPhase(1), # Sets the phase number(s) in the sphere\n T=nothing ) # Sets the thermal structure (various fucntions are available)\n\nSee the documentation of the GMG routine\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AddEllipsoid!-Tuple{Model}","page":"Available functions","title":"GeophysicalModelGenerator.AddEllipsoid!","text":"AddEllipsoid!(model::Model; # required input\n cen=Tuple{3}, axes=Tuple{3}, # center and semi-axes of the ellpsoid\n Origin=nothing, StrikeAngle=0, DipAngle=0, # origin & dip/strike\n phase = ConstantPhase(1), # Sets the phase number(s) in the box\n T=nothing )\n\nSee the documentation of the GMG routine\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.AddSphere!-Tuple{Model}","page":"Available functions","title":"GeophysicalModelGenerator.AddSphere!","text":"AddSphere!(model::Model; cen=Tuple{3}, radius=Tuple{1}, phase = ConstantPhase(1), T=nothing)\n\nSee the documentation of the GMG routine\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#GeophysicalModelGenerator.BelowSurface-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"GeophysicalModelGenerator.BelowSurface","text":"BelowSurface(model::Model, DataSurface_Cart::CartData)\n\nReturns a boolean grid that is true if the Phases/Temp grid are below the surface\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.IO_functions.Read_LaMEM_simulation-Tuple{Model}","page":"Available functions","title":"LaMEM.IO_functions.Read_LaMEM_simulation","text":"Timestep, FileNames, Time = Read_LaMEM_simulation(model::Model; phase=false, surf=false, passive_tracers=false)\n\nReads a LaMEM simulation as specified in model and returns the timesteps, times and filenames of that simulation once it is finished.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.IO_functions.Read_LaMEM_timestep","page":"Available functions","title":"LaMEM.IO_functions.Read_LaMEM_timestep","text":"data, time = Read_LaMEM_timestep(model::Model, TimeStep::Int64=0; fields=nothing, phase=false, surf=false, last=true)\n\nReads a specific Timestep from a simulation specified in model\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.AboveSurface!-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.AboveSurface!","text":"AboveSurface!(model::Model, DataSurface_Cart::CartData; phase::Int64=nothing, T::Number=nothing)\n\nSets the Temp or Phases above the surface DataSurface_Cart to a constant value.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.BelowSurface!-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.BelowSurface!","text":"BelowSurface!(model::Model, DataSurface_Cart::CartData; phase::Union{Int64,Nothing}=nothing, T::Union{Number,Nothing}=nothing)\n\nSets the Temp or Phases below the surface DataSurface_Cart to a constant value.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Check_LaMEM_Model-Tuple{Model}","page":"Available functions","title":"LaMEM.LaMEM_Model.Check_LaMEM_Model","text":"Check_LaMEM_Model(m::Model)\n\nChecks the LaMEM Setup Model m for errors\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Create_Grid-NTuple{15, Any}","page":"Available functions","title":"LaMEM.LaMEM_Model.Create_Grid","text":"This creates a LaMEM grid\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(d::Model,fname::String; dir=pwd())\n\nWrites a LaMEM input file based on the data stored in Model\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, BoundaryConditions}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::BoundaryConditions)\n\nWrites the boundary conditions related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, FreeSurface}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::FreeSurface)\n\nWrites the free surface related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Grid}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::Grid)\n\nThis writes grid info to a LaMEM input file\n\nExample\n\njulia> d=LaMEM.Grid(coord_x=[0.0, 0.7, 0.8, 1.0], bias_x=[0.3,1.0,3.0], nel_x=[10,4,2])\njulia> io = open(\"test.dat\",\"w\")\njulia> LaMEM.Write_LaMEM_InputFile(io, d)\njulia> close(io)\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Materials}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::Output)\n\nWrites the free surface related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, ModelSetup}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::ModelSetup)\n\nWrites options related to the Model Setup to disk\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Output}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::Output)\n\nWrites the free surface related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, SolutionParams}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::SolutionParams)\n\nWrites the boundary conditions related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Solver}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::Solver)\n\nWrites the free surface related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, Time}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Writes the Time related parameters to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile-Tuple{Any, geom_Sphere}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile","text":"Write_LaMEM_InputFile(io, d::geom_Sphere)\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.Write_LaMEM_InputFile_PETSc-Tuple{Any, Solver}","page":"Available functions","title":"LaMEM.LaMEM_Model.Write_LaMEM_InputFile_PETSc","text":"Write_LaMEM_InputFile_PETSc(io, d::Solver)\n\nWrites the (optional) PETSc options to file\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_dike!-Tuple{Model, Dike}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_dike!","text":"add_dike!(model::Model, dike::Dike)\n\nThis adds a phase transition phase_trans to model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_geom!-Tuple{Model, Any}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_geom!","text":"add_geom!(model::Model, geom_object)\n\nThis adds an internal geometric primitive object geom_object to the LaMEM Model Setup model.\n\nCurrently available primitive geom objects are:\n\ngeom_Sphere\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_petsc!-Tuple{Model, Vararg{Any}}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_petsc!","text":"add_petsc!(model::Model, option::String)\n\nAdds one or more PETSc options to the model \n\nExample\n\njulia> d = Model()\njulia> add_petsc!(d,\"-snes_npicard 3\")\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_phase!-Tuple{Model, Phase}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_phase!","text":"add_phase!(model::Model, phase::Phase)\n\nThis adds a phase (with material properties) to model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_phase!-Tuple{Model, Vararg{Any}}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_phase!","text":"add_phase!(model::Model, phases...)\n\nAdd several phases @ once.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_phasetransition!-Tuple{Model, PhaseTransition}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_phasetransition!","text":"add_phasetransition!(model::Model, phase_trans::PhaseTransition)\n\nThis adds a phase transition phase_trans to model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_softening!-Tuple{Model, Softening}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_softening!","text":"add_softening!(model::Model, soft::Softening)\n\nThis adds a plastic softening law soft to model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.add_topography!-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.add_topography!","text":"add_topography!(model::Model, topography::CartData; surf_air_phase=0, surf_topo_file=\"topography.txt\", open_top_bound=1, surf_level=0.0)\n\nAdds the topography surface to the model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.copy_phase-Tuple{Phase}","page":"Available functions","title":"LaMEM.LaMEM_Model.copy_phase","text":"copy_phase(phase::Phase; kwargs...)\n\nThis copies a phase with material properties, while allowing to change some parameters\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.create_initialsetup","page":"Available functions","title":"LaMEM.LaMEM_Model.create_initialsetup","text":"create_initialsetup(model::Model, cores::Int64=1, args::String=\"\")\n\nCreates the initial model setup of LaMEM from model, which includes:\n\nWriting the LaMEM (*.dat) input file\nWrite the VTK file (if requested when model.Output.write_VTK_setup=true)\nWrite the marker files to disk (if model.ModelSetup.msetup=\"files\")\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.cross_section","page":"Available functions","title":"LaMEM.LaMEM_Model.cross_section","text":"data_tuple, axes_str = cross_section(model::LaMEM.Model, field=:phases; x=nothing, y=nothing, z=nothing)\n\nThis creates a cross-section through the initial model setup & returns a 2D array\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.cross_section-2","page":"Available functions","title":"LaMEM.LaMEM_Model.cross_section","text":"Cross = cross_section(cart::CartData, field::Symbol =:phase; x=nothing, y=nothing, z=nothing)\n\nCreates a cross-section through the data and returns x,z coordinates\n\n\n\n\n\n","category":"function"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.flatten-Tuple{GeophysicalModelGenerator.CartData, Symbol, Any, Any, Any}","page":"Available functions","title":"LaMEM.LaMEM_Model.flatten","text":"Creates a 2D array out of a cross-section and a specified data field\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.is_rectilinear-Tuple{GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.is_rectilinear","text":"is_rectilinear(topography::CartData)\n\nChecks whether topography is rectilinear\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.replace_phase!-Tuple{Model, Phase}","page":"Available functions","title":"LaMEM.LaMEM_Model.replace_phase!","text":"replace_phase!(model::Model, phase_new::Phase; ID::Int64=nothing, Name::String=nothing)\n\nThis 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.\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.rm_last_phase!-Tuple{Model}","page":"Available functions","title":"LaMEM.LaMEM_Model.rm_last_phase!","text":"rm_last_phase!(model::Model, phase::Phase)\n\nThis removes the last added phase from model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.rm_phase!-Tuple{Model, Int64}","page":"Available functions","title":"LaMEM.LaMEM_Model.rm_phase!","text":"rm_phase!(model::Model, ID::Int64)\n\nThis removes a phase with ID from model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.rm_phase!-Tuple{Model}","page":"Available functions","title":"LaMEM.LaMEM_Model.rm_phase!","text":"rm_phase!(model::Model)\n\nThis removes all existing phases from model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.set_air-Tuple{}","page":"Available functions","title":"LaMEM.LaMEM_Model.set_air","text":"set_air(; Name=\"air\", ID=0, rho=1, alpha=nothing, eta=1e17, G=nothing, nu=nothing, fr=nothing, ch=nothing, k=30,Cp=1000)\n\nSets an air phase, with high conductivity \n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.set_geom!-Tuple{Model, geom_Sphere}","page":"Available functions","title":"LaMEM.LaMEM_Model.set_geom!","text":"This sets the geometry \n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.LaMEM_Model.within_bounds-Tuple{Model, GeophysicalModelGenerator.CartData}","page":"Available functions","title":"LaMEM.LaMEM_Model.within_bounds","text":"within_bounds(model::Model, topography::CartData)\n\nVerifies that the bounds of the topography grid are larger than that of the model\n\n\n\n\n\n","category":"method"},{"location":"man/LaMEM_ModelFunctions/#LaMEM.Run.run_lamem","page":"Available functions","title":"LaMEM.Run.run_lamem","text":"run_lamem(model::Model, cores::Int64=1, args:String=\"\"; wait=true)\n\nPerforms a LaMEM run for the parameters that are specified in model\n\n\n\n\n\n","category":"function"},{"location":"man/installation_HPC/#Installation-on-HPC-systems","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"","category":"section"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Installing LaMEM on high performance computer (HPC) systems can be complicated, because you will have to compile PETSc with the correct dependencies for that system. The reason is that HPC systems use MPI versions that are specifically tailored/compiled for that system. ","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Luckily there is a solution thanks to the great work of @eschnett and colleagues, who developed MPITrampoline which is an intermediate layer between the HPC-system-specific MPI libraries and the precompiled LaMEM binaries. ","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"It essentially consists of two steps: 1) compile a small package (MPIwrapper) 2) make sure that you download the version of MAGEMin that was compiled versus MPItrampoline.","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Here step-by-step instructions (for Linux, as that is what essentially all HPC systems use):","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Download MPIwrapper: ","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"$git clone https://github.com/eschnett/MPIwrapper.git \n$cd MPIwrapper","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Install it after making sure that mpiexec points to the one you want (you may have to load some modules, depending on your system):","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"$cmake -S . -B build -DMPIEXEC_EXECUTABLE=mpiexec -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/mpiwrapper\n$cmake --build build\n$cmake --install build","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"At this stage, MPItrampoline is installed in $HOME/mpiwrapper","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Set the correct wrapper:","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"$export MPITRAMPOLINE_LIB=$HOME/mpiwrapper/lib64/libmpiwrapper.so","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Depending on the system it may be called lib instead of lib64 (check!).","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Start julia and install the MPI and MPIPreferences packages:","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"$julia\njulia> ]\npkg>add MPI, MPIPreferences","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Set the preference to use MPItrampoline","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"julia> using MPIPreferences; MPIPreferences.use_jll_binary(\"MPItrampoline_jll\")\n┌ Info: MPIPreferences unchanged\n└ binary = \"MPItrampoline_jll\"","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Load MPI and verify it is the correct one","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"julia> using MPI\njulia> MPI.Get_library_version()\n\"MPIwrapper 2.10.3, using MPIABI 2.9.0, wrapping:\\nOpen MPI v4.1.4, package: Open MPI boris@Pluton Distribution, ident: 4.1.4, repo rev: v4.1.4, May 26, 2022\"","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"After this, restart julia (this only needs to be done once, next time all is fine).","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"Now load LaMEM and check that it uses the mpitrampoline version:","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"julia> using MPI,LaMEM\njulia> LaMEM.LaMEM_jll.host_platform\nLinux x86_64 {cxxstring_abi=cxx11, julia_version=1.8.1, libc=glibc, libgfortran_version=5.0.0, mpi=mpitrampoline}","category":"page"},{"location":"man/installation_HPC/","page":"Installation on HPC systems","title":"Installation on HPC systems","text":"At this stage the precompiled version of LaMEM should be useable on that system.","category":"page"},{"location":"man/installation/#Installation","page":"General instructions","title":"Installation","text":"","category":"section"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"Installing LaMEM can simply be done through the package manager:","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"julia>]\npkg>add LaMEM","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"which will download the binaries along with PETSc and mpiexec for your system.","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"You can test if it works on your machine with","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"pkg> test LaMEM","category":"page"},{"location":"man/installation/#Running-LaMEM-from-the-julia-REPL","page":"General instructions","title":"Running LaMEM from the julia REPL","text":"","category":"section"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"Running LaMEM from within julia can be done with the run_lamem function:","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"LaMEM.run_lamem","category":"page"},{"location":"man/installation/#LaMEM.Run.run_lamem","page":"General instructions","title":"LaMEM.Run.run_lamem","text":"run_lamem(model::Model, cores::Int64=1, args:String=\"\"; wait=true)\n\nPerforms a LaMEM run for the parameters that are specified in model\n\n\n\n\n\nrun_lamem(ParamFile::String, cores::Int64=1, args:String=\"\"; wait=true, deactivate_multithreads=true)\n\nThis 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.\n\nExample:\n\nYou can call LaMEM with:\n\njulia> using LaMEM\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile)\n\nDo the same on 2 cores with a command-line argument as:\n\njulia> ParamFile=\"../../input_models/BuildInSetups/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile, 2, \"-nstep_max = 1\")\n\n\n\n\n\n","category":"function"},{"location":"man/installation/#Running-LaMEM-from-outside-julia","page":"General instructions","title":"Running LaMEM from outside julia","text":"","category":"section"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"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:","category":"page"},{"location":"man/installation/","page":"General instructions","title":"General instructions","text":"LaMEM.show_paths_LaMEM","category":"page"},{"location":"man/installation/#LaMEM.Run.show_paths_LaMEM","page":"General instructions","title":"LaMEM.Run.show_paths_LaMEM","text":"show_paths_LaMEM()\n\nThe 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.\n\nThis function shows this for your system. \n\n\n\n\n\n","category":"function"},{"location":"man/juliasetup_example_sphere/#.-Example-1:-Falling-sphere","page":"Example 1: Sphere","title":"1. Example 1: Falling sphere","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"This is a first example that illustrates how to build a setup using the LaMEM.jl package, run it and visualize the results, all without leaving julia.","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"We start with loading the packages we need:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> using LaMEM, GeophysicalModelGenerator, Plots","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"The GeophysicalModelGenerator package can be used to generate model setups and Plots for plotting.","category":"page"},{"location":"man/juliasetup_example_sphere/#.1-Define-model-setup","page":"Example 1: Sphere","title":"1.1 Define model setup","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Next, we define a general model setup, in which we specify the units with which we work (for most cases, you'll want to use the default GEO units), the size of the computational box and various timestepping parameters. In this case, we use a multigrid solver.","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> model = Model(Grid(nel=(16,16,16), x=[-1,1], y=[-1,1], z=[-1,1]), \n Time(nstep_max=20, dt_min=1e-3, dt=1, dt_max=10, time_end=100), \n Solver(SolverType=\"multigrid\", MGLevels=2),\n Output(out_dir=\"example_1\"))\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(16, 16, 16); xϵ(-1.0, 1.0), yϵ(-1.0, 1.0), zϵ(-1.0, 1.0) \n|-- Time : nstep_max=20; nstep_out=1; time_end=100.0; dt=1.0\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : multigrid solver; coarse grid solver=direct; 2 levels\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases; ","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Note that each of the fields within Model has many additional and adjustable parameters. You can view that by typing:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> model.Time\nLaMEM Timestepping parameters: \n time_end = 100.0 \n dt = 1.0 \n dt_min = 0.001 \n dt_max = 10.0 \n dt_out = 0.2 \n inc_dt = 0.1 \n CFL = 0.5 \n CFLMAX = 0.8 \n nstep_max = 20 \n nstep_out = 1 \n nstep_rdb = 100 \n nstep_ini = 1 \n time_tol = 1.0e-8 ","category":"page"},{"location":"man/juliasetup_example_sphere/#.2-Specify-material-properties","page":"Example 1: Sphere","title":"1.2 Specify material properties","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Once this is specified, we need to set material properties for each of the Phases we will consider in the simulation. This can be done with the Phase structure. First, we define two phases","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> rm_phase!(model)\njulia> matrix = Phase(ID=0,Name=\"matrix\",eta=1e20,rho=3000)\nPhase 0 (matrix): \n rho = 3000.0 \n eta = 1.0e20 \njulia> sphere = Phase(ID=1,Name=\"sphere\",eta=1e23,rho=3200)\nPhase 1 (sphere): \n rho = 3200.0 \n eta = 1.0e23 ","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"and add them to the model with:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> add_phase!(model, sphere, matrix)","category":"page"},{"location":"man/juliasetup_example_sphere/#.3-Set-initial-model-geometry","page":"Example 1: Sphere","title":"1.3 Set initial model geometry","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"We also need to specify an initial model geometry. The julia package GeophysicalModelGenerator has a number of functions for that, which can be used here. For the current setup, we just add a sphere: ","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> AddSphere!(model,cen=(0.0,0.0,0.0), radius=(0.5, ))","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"It is often useful to plot the initial model setup. You can do this with the heatmap function from the Plots.jl package, for which we provide a LaMEM plugin that allows you to specify a cross-section through a 3D LaMEM setup:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> plot_cross_section(model, field=:phase, y=0)","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"(Image: InitialSetupSphere)","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"In the initial setup we define two fields: :phase which defines the rocktypes and :temperature which has the initial temperature. They are stored as 3D arrays in model.Grid.Phases and model.Grid.Temp:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([16], [16], [16])\n marker/cell : (3, 3, 3)\n x ϵ [-1.0 : 1.0]\n y ϵ [-1.0 : 1.0]\n z ϵ [-1.0 : 1.0]\n Phases : range ϵ [0 - 1]\n Temp : range ϵ [0.0 - 0.0]","category":"page"},{"location":"man/juliasetup_example_sphere/#.4-Run-LaMEM","page":"Example 1: Sphere","title":"1.4 Run LaMEM","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"At this stage we are ready to run a LaMEM simulation which can simply be done with the run_lamem command. By default, it will run on one processor. If you want to run this in parallel, you can specify the number of cores you want to use. Please note that running things in parallel is only worth the effort for large resolutions; for smaller setups it will be faster on one processor:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> run_lamem(model,1)\nSaved file: Model3D.vts\nWriting LaMEM marker file -> ./markers/mdb.00000000.dat\n-------------------------------------------------------------------------- \n Lithosphere and Mantle Evolution Model \n Compiled: Date: Apr 7 2023 - Time: 22:11:23 \n Version : 1.2.4 \n-------------------------------------------------------------------------- \n STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION \n-------------------------------------------------------------------------- \nParsing input file : output.dat \nFinished parsing input file : output.dat \n--------------------------------------------------------------------------\nScaling parameters:\n Temperature : 1000. [C/K] \n Length : 1e+06 [m] \n Viscosity : 1e+20 [Pa*s] \n Stress : 10. [Pa] \n--------------------------------------------------------------------------\nTime stepping parameters:\n Simulation end time : 100. [Myr] \n Maximum number of steps : 20 \n Time step : 1. [Myr] \n Minimum time step : 0.001 [Myr] \n Maximum time step : 10. [Myr] \n Time step increase factor : 0.1 \n CFL criterion : 0.5 \n CFLMAX (fixed time steps) : 0.8 \n Output every [n] steps : 1 \n Output [n] initial steps : 1 \n--------------------------------------------------------------------------\n--------------------------------------------------------------------------","category":"page"},{"location":"man/juliasetup_example_sphere/#.5-Visualize-results","page":"Example 1: Sphere","title":"1.5 Visualize results","text":"","category":"section"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Once the simulation is done, you can look at the results using the same heatmap function, but by specifying a timestep, which will read that timestep and plot a cross-section though it:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> plot_cross_section(model, y=0, timestep=20, field=:phase)\t","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"(Image: FallingSphere_t20)","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Alternatively, you can visualize the results with Paraview. Change to the directory where you did the simulation:","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> cd(model.Output.out_dir)\njulia> julia> readdir()\n25-element Vector{String}:\n \"Model3D.vts\"\n \"Timestep_00000000_0.00000000e+00\"\n \"Timestep_00000001_1.10000000e+00\"\n \"Timestep_00000002_2.31000000e+00\"\n \"Timestep_00000003_3.64100000e+00\"\n \"Timestep_00000004_5.10510000e+00\"\n \"Timestep_00000005_6.71561000e+00\"\n ⋮\n \"Timestep_00000017_4.45991731e+01\"\n \"Timestep_00000018_5.01590904e+01\"\n \"Timestep_00000019_5.62749995e+01\"\n \"Timestep_00000020_6.30024994e+01\"\n \"markers\"\n \"output.dat\"\n \"output.pvd\"","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"And you can open output.pvd with paraview. If your system recogizes that *.pvd files should be opened with paraview, you can do that with","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"julia> ;\nshell> open output.pvd","category":"page"},{"location":"man/juliasetup_example_sphere/","page":"Example 1: Sphere","title":"Example 1: Sphere","text":"Otherwise, start paraview manually and open the file.","category":"page"},{"location":"man/juliasetup_TMSubduction/#D-Thermomechanical-subduction-model","page":"Example 3: Subduction","title":"2D Thermomechanical subduction model","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"In this example, we will show how to create a 2D thermomechanical model of subduction. Here the setup is saved into a julia script. First create a textfile called TM_Subduction_example.jl in your current directory. The easiest is to use Visual Studio Code for this, but you can in principle use any text editor.","category":"page"},{"location":"man/juliasetup_TMSubduction/#.-Load-necessary-packages","page":"Example 3: Subduction","title":"1. Load necessary packages","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Next start julia in the directory where you saved TM_Subduction_example.jl, or go to correct directory within julia ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Note that you can do the following steps directy from the julia REPL (command prompt), or you can write them in TM_Subduction_example.jl and run that file by typing","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> include(\"TM_Subduction_example.jl\")","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"We get started by loading the required packages:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"using LaMEM, GeophysicalModelGenerator, Plots","category":"page"},{"location":"man/juliasetup_TMSubduction/#.-LaMEM-model-setup","page":"Example 3: Subduction","title":"2. LaMEM model setup","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"The setup will include 6 different materials with the following ID's:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"# material id's\n# 0: asthenosphere\n# 1: oceanic crust\n# 2: oceanic lithosphere\n# 3: continental crust\n# 4: continental lithosphere\n# 5: air layer","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model = Model(Grid( x = [-2000.,2000.],\n y = [-2.5,2.5], # <- model is 2D, size in y-direction is choosen to be close to a cube shape for the cell\n z = [-660,40] ,\n nel = (512,1,128) ),\n\n BoundaryConditions( temp_bot = 1565.0,\n temp_top = 20.0,\n open_top_bound = 1),\n Scaling(GEO_units( temperature = 1000,\n stress = 1e9Pa,\n length = 1km,\n viscosity = 1e20Pa*s) ),\n Time(nstep_max=20) ) ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"This initializes the initial LaMEM model setup with a number of default options. On the REPL it will show the following info","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"LaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(512, 1, 128); xϵ(-2000.0, 2000.0), yϵ(-8.0, 8.0), zϵ(-660.0, 40.0) \n|-- Time : nstep_max=20; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases; ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"In this case we assume that we have dimensions in kilometers and times in million years (the default).","category":"page"},{"location":"man/juliasetup_TMSubduction/#Inspecting/modifying-parameters","page":"Example 3: Subduction","title":"Inspecting/modifying parameters","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Each of the parameters in this model setup can be modified. The easiest way to see what is available is by using the REPL. If you type ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"and now use your TAB button, you will see all the fields within the model structure:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.\nBoundaryConditions FreeSurface Grid Materials ModelSetup Output Scaling SolutionParams\nSolver Time","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"If you want to see which timestepping parameters are set, you type:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.Time\nLaMEM Timestepping parameters: \n time_end = 1.0 \n dt = 0.05 \n dt_min = 0.01 \n dt_max = 0.2 \n dt_out = 0.2 \n inc_dt = 0.1 \n CFL = 0.5 \n CFLMAX = 0.8 \n nstep_max = 20 \n nstep_out = 1 \n nstep_rdb = 100 \n nstep_ini = 1 \n time_tol = 1.0e-8 ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"The parameters that are changed from the default settings are highlighted in blue (not visible on this markdown document, but visible in the REPL). ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"If you want to see what each of these parameters mean, you can get some basic help with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"help?> Time\nsearch: Time time Timer time_ns timedwait mtime ctime @time @timev @timed @time_imports @showtime optimize_ticks optimize_datetime_ticks Read_LaMEM_timestep\n\n Structure that contains the LaMEM timestepping information. An explanation of the paramneters is given in the struct `Time_info`\n • time_end::Float64: simulation end time\n • dt::Float64: initial time step\n • dt_min::Float64: minimum time step (declare divergence if lower value is attempted)\n • dt_max::Float64: maximum time step\n • dt_out::Float64: output step (output at least at fixed time intervals)\n • inc_dt::Float64: time step increment per time step (fraction of unit)\n • CFL::Float64: CFL (Courant-Friedrichs-Lewy) criterion\n • CFLMAX::Float64: CFL criterion for elasticity\n • nstep_max::Int64: maximum allowed number of steps (lower bound: timeend/dtmax)\n • nstep_out::Int64: save output every n steps; Set this to -1 to deactivate saving output\n • nstep_rdb::Int64: save restart database every n steps\n • num_dt_periods::Int64: number of time stepping periods\n • time_dt_periods::Vector{Int64}: timestamps where timestep should be fixed (first entry has to 0)\n • step_dt_periods::Vector{Float64}: target timesteps ar timestamps above\n • nstep_ini::Int64: save output for n initial steps\n • time_tol::Float64: relative tolerance for time comparisons","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"If you want to change one of the parameters, say the maximum number of timesteps, you can do that with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.Time.nstep_max=100\n100","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"You can verify that this has been changed with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia> model.Time\nLaMEM Timestepping parameters: \n time_end = 1.0 \n dt = 0.05 \n dt_min = 0.01 \n dt_max = 0.2 \n dt_out = 0.2 \n inc_dt = 0.1 \n CFL = 0.5 \n CFLMAX = 0.8 \n nstep_max = 100 \n nstep_out = 1 \n nstep_rdb = 100 \n nstep_ini = 1 \n time_tol = 1.0e-8 ","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-timestepping-parameters","page":"Example 3: Subduction","title":"Set timestepping parameters","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Ok, lets change a few parameters at the same time. Here the maximum time (time_end) is set to a large value (2000 Myrs) as we want to limit the simulation using nstep_max = 400, which implies that we will perform 400 timesteps","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Time = Time( time_end = 2000.0,\n dt = 0.001,\n dt_min = 0.000001,\n dt_max = 0.1,\n nstep_max = 400,\n nstep_out = 10\n )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Note that you can achieve the same results with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Time.time_end = 2000.0\nmodel.Time.dt = 0.001\nmodel.Time.dt_min = 0.000001\nmodel.Time.dt_max = 0.1\nmodel.Time.nstep_max = 400\nmodel.Time.nstep_out = 10","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-solution-parameters","page":"Example 3: Subduction","title":"Set solution parameters","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"We activate shear heating and adiabatic heating, as well as thermal diffusion, and set the minimum and maximum viscosities of the model as:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.SolutionParams = SolutionParams( shear_heat_eff = 1.0,\n Adiabatic_Heat = 1.0,\n act_temp_diff = 1,\n eta_min = 5e18,\n eta_ref = 1e21,\n eta_max = 1e25,\n min_cohes = 1e3\n )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-surface-topography","page":"Example 3: Subduction","title":"Set surface topography","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"In our simulation, we want to take a free surface into account. In LaMEM that is done with a sticky air layer (phase 5 here), combined with a mesh that tracks the location of the free surface. You need to activate the free surface, tell LaMEM which phase is the sticky air phase and what the initial free surface level is at the beginning of the simulation (0 km). Do that with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.FreeSurface = FreeSurface( surf_use = 1, # free surface activation flag\n surf_corr_phase = 1, # air phase ratio correction flag (due to surface position)\n surf_level = 0.0, # initial level\n surf_air_phase = 5, # phase ID of sticky air layer\n surf_max_angle = 40.0 # maximum angle with horizon (smoothed if larger))\n )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-model-output","page":"Example 3: Subduction","title":"Set model output","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"We update the list of fields saved as output:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Output = Output( out_density = 1,\n out_j2_strain_rate = 1,\n out_surf = 1, \t\n out_surf_pvd = 1,\n out_surf_topography = 1,\n out_j2_dev_stress = 1,\n out_pressure = 1,\n out_temperature = 1, )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Set-some-background-properties,-later-overwritten","page":"Example 3: Subduction","title":"Set some background properties, later overwritten","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"The model geometry in LaMEM is defined by two arrays: model.Grid.Temp and model.Grid.Phase which sets the initial temperature and phase at every point. These are 3D arrays that can be modified; in the usual case temperatures are assumed to be in Celcius, and the phases are integers (0-5 here). ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Lets specify a few helpful parameters, such as the adiabatic temperature throughout the model (0.4°C/km) and the mantle potential temperature at the surface 1280°C:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Tair = 20.0;\nTmantle = 1280.0;\nAdiabat = 0.4","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Next, we set the temperature everwhere to (will be overwrittem later) and all phases to 0 with","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Grid.Temp .= Tmantle .+ 1.0; # set mantle temperature (without adiabat at first)\nmodel.Grid.Phases .= 0; # Set Phases to 0 everywhere (0 is/will be asthenosphere in this setup):","category":"page"},{"location":"man/juliasetup_TMSubduction/#Setup-temperature-of-the-air-to-be-20C","page":"Example 3: Subduction","title":"Setup temperature of the air to be 20°C","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Next we set all \"air\" particles to Tair: ","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Grid.Temp[model.Grid.Grid.Z .> 0] .= Tair;","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"We can quickly verify that this has been done on the REPL with:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia>julia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([512], [1], [128])\n marker/cell : (3, 3, 3)\n x ϵ [-2000.0 : 2000.0]\n y ϵ [-8.0 : 8.0]\n z ϵ [-660.0 : 40.0]\n Phases : range ϵ [0 - 0]\n Temp : range ϵ [20.0 - 1281.0]","category":"page"},{"location":"man/juliasetup_TMSubduction/#Setup-the-air-layer-(id-5)-if-Z-0.0","page":"Example 3: Subduction","title":"Setup the air layer (id = 5) if Z > 0.0","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Set the air particles to 5:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Grid.Phases[model.Grid.Grid.Z .> 0.0 ] .= 5;","category":"page"},{"location":"man/juliasetup_TMSubduction/#Add-left-oceanic-plate","page":"Example 3: Subduction","title":"Add left oceanic plate","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"An oceanic plate can be added using the AddBox!() function of the GeophysicalModelGenerator package (see ?GeophysicalModelGenerator.AddBox! for more information, or check out the online help of the package). The lithosphere to asthenosphere temperature is set to 1250°C. If temperature of the plate is > 1250°C then the material is turned to asthenosphere. The temperature profile of the plate is set using a half space cooling temperature and a spreading rate velocity of 0.5 cm/yr with the ridge prescribed to be at the \"left\" of the box.","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (-2000.0, 0.0), \n ylim = (model.Grid.coord_y...,), \n zlim = (-660.0, 0.0),\n Origin = nothing, StrikeAngle=0, DipAngle=0,\n phase = LithosphericPhases(Layers=[20 80], Phases=[1 2 0] ),\n T = SpreadingRateTemp( Tsurface = Tair,\n Tmantle = Tmantle,\n MORside = \"left\",\n SpreadingVel= 0.5,\n AgeRidge = 0.01;\n maxAge = 80.0 ) )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Add-right-oceanic-plate","page":"Example 3: Subduction","title":"Add right oceanic plate","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"Same for the plate on the right:","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (1500, 2000), \n ylim = (model.Grid.coord_y..., ), \n zlim = (-660.0, 0.0),\n Origin = nothing, StrikeAngle=0, DipAngle=0,\n phase = LithosphericPhases(Layers=[20 80], Phases=[1 2 0] ),\n T = SpreadingRateTemp( Tsurface = Tair,\n Tmantle = Tmantle,\n MORside = \"right\",\n SpreadingVel= 0.5,\n AgeRidge = 0.01;\n maxAge = 80.0 ) )","category":"page"},{"location":"man/juliasetup_TMSubduction/#Add-overriding-plate-margin","page":"Example 3: Subduction","title":"Add overriding plate margin","text":"","category":"section"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"For the overriding plate margin the age is fixed to 90 Ma using HalfspaceCoolingTemp().","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (0.0, 400.0), \n ylim = (model.Grid.coord_y[1], model.Grid.coord_y[2]), \n zlim = (-660.0, 0.0),\n Origin = nothing, StrikeAngle=0, DipAngle=0,\n phase = LithosphericPhases(Layers=[25 90], Phases=[3 4 0] ),\n T = HalfspaceCoolingTemp( Tsurface = Tair,\n Tmantle = Tmantle,\n Age = 80 ) )\n ``` \n\n##### Add overriding plate craton\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (400.0, 1500.0), ylim = (model.Grid.coord_y...,), zlim = (-660.0, 0.0), Origin = nothing, StrikeAngle=0, DipAngle=0, phase = LithosphericPhases(Layers=[35 100], Phases=[3 4 0] ), T = HalfspaceCoolingTemp( Tsurface = Tair, Tmantle = Tmantle, Age = 120 ) )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Add pre-subducted slab\nHere we change the dip angle of the box to 30° to initiates subduction:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"AddBox!(model; xlim = (0.0, 300), ylim = (model.Grid.coord_y...,), zlim = (-660.0, 0.0), Origin = nothing, StrikeAngle=0, DipAngle=30, phase = LithosphericPhases(Layers=[30 80], Phases=[1 2 0], Tlab=1250 ), T = HalfspaceCoolingTemp( Tsurface = Tair, Tmantle = Tmantle, Age = 80 ) )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":" \n##### Impose approximate adiabat\nWe can add a mantle adiabatic temperature to the model with\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia model.Grid.Temp = model.Grid.Temp - model.Grid.Grid.Z.*Adiabat;","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Plot preview of the setup\nCross-sections of the model setup showing the temperature and the phase fields can be visualized as follows:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia plotcrosssection(model, y=0, field=:temperature) plotcrosssection(model, y=0, field=:phase)","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":" ![Subduction_CrossSection](sub_field.png)\n ![Subduction_CrossSection](sub_temp.png)\n\n#### 3. Define material parameters\n\nAt this stage, we defined the geometry and thermal structures of the model, but we did yet assign material properties to each of the rocktypes.\n\n##### Softening law\nWe assume that rocks weaken/soften when they becomes damaged, which can be defined by a softening law. Post-softening strength is defined as 0.05 the initial strength\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia softening = Softening( ID = 0, \t\t\t# softening law ID APS1 = 0.1, \t\t\t# begin of softening APS APS2 = 0.5, \t\t\t# end of softening APS A = 0.95, \t\t # reduction ratio )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Material thermal and rheological properties\n*Mantle*\nFor the mantle, we use a dry olivine rheology:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia dryPeridotite = Phase( Name = \"dryPeridotite\", ID = 0, # phase id [-] rho = 3300.0, # density [kg/m3] alpha = 3e-5, # coeff. of thermal expansion [1/K] dislprof = \"DryOlivinedislcreep-HirthKohlstedt2003\", Vn = 14.5e-6, diffprof = \"DryOlivinediffcreep-HirthKohlstedt2003\", Vd = 14.5e-6, G = 5e10, # elastic shear module [MPa] k = 3, # conductivity Cp = 1000.0, # heat capacity ch = 30e6, # cohesion [Pa] fr = 20.0, # friction angle\t A = 6.6667e-12, # radiogenic heat production [W/kg] chSoftID = 0, \t # cohesion softening law ID frSoftID = 0, \t # friction softening law ID )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n*Oceanic crust*\nFor the oceanic crust we use a low cohesion and a frictional angle equal to 0. The goal is to make the oceanic crust weak enough to lubricate the interface with the overriding plate and allow for self-sustained subduction. Moreover, as density is not pressure and temperature dependent, it is set to be the same as the mantle (3300) in order to be neutrally buoyant with respect to the rest of the lithosphere.\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia oceanicCrust = Phase( Name = \"oceanCrust\", ID = 1, # phase id [-] rho = 3300.0, # density [kg/m3] alpha = 3e-5, # coeff. of thermal expansion [1/K] dislprof = \"PlagioclaseAn75-Ranalli_1995\", G = 5e10, # elastic shear module [MPa] k = 3, # conductivity Cp = 1000.0, # heat capacity ch = 5e6, # cohesion [Pa] fr = 0.0, # friction angle\t A = 2.333e-10, # radiogenic heat production [W/kg] )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n*Oceanic mantle lithosphere*\nThe oceanic mantle lithosphere has the same properties as the mantle but a different name and different phase. To simplify your life, you can use the `copy_phase` function for that:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia oceanicLithosphere = copy_phase( dryPeridotite, Name = \"oceanicLithosphere\", ID = 2 )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"*Continental crust*\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"continentalCrust = copyphase( oceanicCrust, Name = \"continentalCrust\", ID = 3, dislprof = \"Quarzite-Ranalli_1995\", rho = 2700.0, ch = 30e6, fr = 20.0, A \t = 5.3571e-10, chSoftID \t = 0, \t frSoftID \t = 0, \t )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"*Continental lithosphere*\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"continentalLithosphere = copy_phase( dryPeridotite, Name = \"continentalLithosphere\", ID = 4 )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n*Sticky air*\nFinally, the \"air\" in our model is a layer with low density and low viscosity, such that it essentially gives very low stresses compared to those within the lithosphere. We cannot give it the viscosity of real air, as this results in a too large viscosity jump at the surface (geodynamic codes cannot handle that). We therefore also often call this \"sticky air\". Note that we also give it a very high thermal conductivity to ensure that the temperature within the air layer remains more or less constant throughout a simulation (and equal to the temperature at the upper boundary of the model):\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia air = Phase( Name = \"air\", ID = 5, # phase id [-] rho = 50.0, # density [kg/m3] # coeff. of thermal expansion [1/K] eta = 1e19, G = 5e10, # elastic shear module [MPa] k = 100, # conductivity Cp = 1e6, # heat capacity ch = 10e6, # cohesion [MPa] fr = 0.0, # friction angle\t )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Add phases to the model\nFinally, we can add all these phases to the model with:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia rmphase!(model) addphase!( model, dryPeridotite, oceanicCrust, oceanicLithosphere, continentalCrust, continentalLithosphere, air )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Add softening law\nSame with the softening law:\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia add_softening!( model, softening )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n##### Set solver options\nThe PETSc command ```-da_refine_y 1``` allow to run the model as 2D\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"model.Solver = Solver( SolverType = \"multigrid\", MGLevels = 3, MGCoarseSolver \t= \"superludist\", PETScoptions = [ \"-sneskspew\", \"-sneskspewrtolmax 1e-4\", \"-snesrtol 5e-3\",\t\t\t \"-snesatol 1e-4\", \"-snesmaxit 200\", \"-snesPicardSwitchToNewtonrtol 1e-3\", \"-snesNewtonSwitchToPicardit 20\", \"-jsksptype fgmres\", \"-jskspmaxit 20\", \"-jskspatol 1e-8\", \"-jsksprtol 1e-4\", \"-sneslinesearchtype l2\", \"-sneslinesearchmaxstep 10\", \"-darefiney 1\" ] )","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"\n#### 4. Perform the simulation\nHere we riun LaMEM on 8 cores (if you have them; use less otherwise):\n","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"julia julia> run_lamem(model, 8) Saved file: Model3D.vts (Nprocx, Nprocy, Nprocz, xc, yc, zc, nNodeX, nNodeY, nNodeZ) = (4, 1, 2, [-2000.0, -1000.0, 0.0, 1000.0, 2000.0], [-8.0, 8.0], [-660.0, -310.0, 40.0], 513, 2, 129) Writing LaMEM marker file -> ./markers/mdb.00000000.dat Writing LaMEM marker file -> ./markers/mdb.00000001.dat Writing LaMEM marker file -> ./markers/mdb.00000002.dat Writing LaMEM marker file -> ./markers/mdb.00000003.dat Writing LaMEM marker file -> ./markers/mdb.00000004.dat Writing LaMEM marker file -> ./markers/mdb.00000005.dat Writing LaMEM marker file -> ./markers/mdb.00000006.dat Writing LaMEM marker file -> ./markers/mdb.00000007.dat ––––––––––––––––––––––––––––––––––––– Lithosphere and Mantle Evolution Model Compiled: Date: Apr 7 2023 - Time: 22:11:23 Version : 1.2.4 ––––––––––––––––––––––––––––––––––––– STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION ––––––––––––––––––––––––––––––––––––– Parsing input file : output.dat Finished parsing input file : output.dat ––––––––––––––––––––––––––––––––––––– Scaling parameters: Temperature : 1000. [C/K] Length : 1000. [m] Viscosity : 1e+20 [Pa*s] Stress : 1e+09 [Pa] ```","category":"page"},{"location":"man/juliasetup_TMSubduction/","page":"Example 3: Subduction","title":"Example 3: Subduction","text":"The results will be saved in the directory where you performed the simulation and can be visualized in Paraview by opening the file output.pvd: (Image: 2D thermomechanical subduction)","category":"page"},{"location":"man/juliasetups/#Create-and-run-setups-from-julia","page":"Overview","title":"Create & run setups from julia","text":"","category":"section"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"It is also possible to construct a LaMEM setup directly in julia & run that. You can do the same from within a Pluto notebook. The advantage is that it is easier to use, has build-in plotting functions and extensive documentation. ","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"The main routine to do this is: ","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> using LaMEM\njulia> model = Model()\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(16, 16, 16); xϵ(-10.0, 10.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 0 phases;","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"Model is a structure that contains all the information about the LaMEM simulation and consists of the following sub-structures that can all be adjusted.","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"BoundaryConditions FreeSurface Grid \nMaterials ModelSetup Output \nScaling SolutionParams Solver \nTime","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"You can, for example, look at the current Grid:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([16], [16], [16])\n marker/cell : (3, 3, 3)\n x ϵ [-10.0 : 10.0]\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n Phases : range ϵ [0 - 0]\n Temp : range ϵ [0.0 - 0.0]","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"and change the dimensions and number of grid-cells with:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model.Grid = Grid(nel=[32,32,32], x=[-20,20])\nLaMEM grid with constant Δ: \n nel : ([32], [32], [32])\n marker/cell : (3, 3, 3)\n x ϵ [-20.0 : 20.0]\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n Phases : range ϵ [0 - 0]\n Temp : range ϵ [0.0 - 0.0]","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"or do it by directly accessing the respectyive data field:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model.Grid.nel_x = [32]\n1-element Vector{Int64}:\n 32","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"Every LaMEM model setup needs to specify material properties for the different materials. By default it has nothing:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model.Materials\nLaMEM Material Properties: \n Softening = \n PhaseTransition =","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"yet, we can specify different materials using the Phase structure:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> sphere = Phase(Name=\"Sphere\", ID=1, eta=1e20, rho=2800)\nPhase 1 (Sphere): \n rho = 2800.0 \n eta = 1.0e20 ","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"and add that to the model with:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> add_phase!(model, sphere)\njulia> model\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(32, 32, 32); xϵ(-20.0, 20.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 1 phases; ","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"Note that the model now has 1 phase.","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"In order to run a simulation, we need to define at least 1 phase and heterogeneities in either the initial temperature field (model.Grid.Temp) or the Phases field (model.Grid.Phases). The easiest way to do that is to use routines from the GeophyicalModelGenerator package, for which we created simple interfaces to many of the relevant routines:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> using GeophysicalModelGenerator\njulia> AddSphere!(model,cen=(0.0,0.0,0.0), radius=(0.5, ))","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"For the sake of this example, lets add another phase:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> matrix = Phase(ID=0,Name=\"matrix\",eta=1e20,rho=3000)\nPhase 0 (matrix): \n rho = 3000.0 \n eta = 1.0e20 \njulia> add_phase!(model, matrix)","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"At this stage you have a model setup with 2 phases and heterogeneities in the Phases field, which you can check with:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> model\nLaMEM Model setup\n|\n|-- Scaling : GeoParams.Units.GeoUnits{GEO}\n|-- Grid : nel=(32, 32, 32); xϵ(-20.0, 20.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0) \n|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05\n|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]\n|-- Solution parameters : eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0\n|-- Solver options : direct solver; superlu_dist; penalty term=10000.0\n|-- Model setup options : Type=files; \n|-- Output options : filename=output; pvd=1; avd=0; surf=0\n|-- Materials : 2 phases; \n\n\njulia> model.Grid\nLaMEM grid with constant Δ: \n nel : ([32], [32], [32])\n marker/cell : (3, 3, 3)\n x ϵ [-20.0 : 20.0]\n y ϵ [-10.0 : 0.0]\n z ϵ [-10.0 : 0.0]\n Phases : range ϵ [0 - 1]\n Temp : range ϵ [0.0 - 0.0]","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"Running a model is very simple:","category":"page"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"julia> run_lamem(model,1)","category":"page"},{"location":"man/juliasetups/#More-examples","page":"Overview","title":"More examples","text":"","category":"section"},{"location":"man/juliasetups/","page":"Overview","title":"Overview","text":"More examples can be found on the left hand side menu.","category":"page"},{"location":"man/runlamem/#Run-LaMEM","page":"Run LaMEM","title":"Run LaMEM","text":"","category":"section"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"Go to the package manager & install it with:","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"julia>]\npkg>add LaMEM","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"It will automatically download a binary version of LaMEM which runs in parallel (along with the correct PETSc version). This will work on linux, mac and windows.","category":"page"},{"location":"man/runlamem/#Starting-a-simulation","page":"Run LaMEM","title":"Starting a simulation","text":"","category":"section"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"If you have a LaMEM (*.dat) input file, you can run in parallel (here on 4 cores) with:","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"julia> ParamFile=\"input_files/FallingBlock_Multigrid.dat\";\njulia> run_lamem(ParamFile, 4,\"-time_end 1\")\n-------------------------------------------------------------------------- \n Lithosphere and Mantle Evolution Model \n Compiled: Date: Sep 10 2022 - Time: 06:21:30 \n-------------------------------------------------------------------------- \n STAGGERED-GRID FINITE DIFFERENCE CANONICAL IMPLEMENTATION \n-------------------------------------------------------------------------- \nParsing input file : input_files/FallingBlock_Multigrid.dat \n Adding PETSc option: -snes_type ksponly\n Adding PETSc option: -js_ksp_monitor\n Adding PETSc option: -crs_pc_type bjacobi\nFinished parsing input file : input_files/FallingBlock_Multigrid.dat \n--------------------------------------------------------------------------\nTime stepping parameters:\n Simulation end time : 1. [ ] \n Maximum number of steps : 10 \n Time step : 10. [ ] \n Minimum time step : 1e-05 [ ] \n Maximum time step : 100. [ ] \n Time step increase factor : 0.1 \n CFL criterion : 0.5 \n CFLMAX (fixed time steps) : 0.5 \n Output time step : 0.2 [ ] \n Output every [n] steps : 1 \n Output [n] initial steps : 1 \n--------------------------------------------------------------------------","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"The last parameter are optional PETSc command-line options. By default it runs on one processor.","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"Please note that you will have to be in the correct directory or indicate where that directory is. If you are in a different directory, the easiest way to change to the correct one is by using the changefolder function (on Windows and Mac):","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"julia> changefolder()","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"Alternatively, you can use the build-in terminal/shell in julia, which you can access with:","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"julia>;\nshell>cd ~/LaMEM/input_models/BuildInSetups/","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"use the Backspace key to return to the julia REPL.","category":"page"},{"location":"man/runlamem/","page":"Run LaMEM","title":"Run LaMEM","text":"Once you have performed a simulation, you can look at the results by opening the *.pvd files with Paraview. In this example, that would be FB_multigrid.pvd and FB_multigrid_phase.pvd.","category":"page"},{"location":"#LaMEM.jl","page":"Home","title":"LaMEM.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This is the julia interface to LaMEM, which does a number of handy things:","category":"page"},{"location":"","page":"Home","title":"Home","text":"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!\nWe provide a simple function to run LaMEM from julia (also in parallel).\nWe provide functions to read timesteps back into julia. ","category":"page"}] }