Available functions
These are all the functions that are provided for the LaMEM Julia Setup interface.
LaMEM.LaMEM_Model.BCBlock Type
LaMEM boundary condition `BCBlock` objectnpath::Int64: Number of path points of Bezier curve (path-points only!)path_dim::Int64: Path dimension: 2 = x-y plane (default), 3 = full 3D (path then also moves bot/top z-coordinates)theta::Vector{Float64}: # Orientation angles at path points (counter-clockwise positive)time::Vector{Float64}: Times at path pointspath::Vector{Float64}: Path points coordinates (x-y pairs if path_dim=2, x-y-z triplets if path_dim=3)npoly::Int64: Number of polygon verticespoly::Vector{Float64}: Polygon x-y coordinates at initial timebot::Float64: Polygon bottom coordinatetop::Float64: Polygon top coordinate
LaMEM.LaMEM_Model.BoundaryConditions Type
BoundaryConditionsStructure 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 flagtemp_top::Float64: Constant temperature on the top boundarytemp_bot::Float64: Constant temperature on the bottom boundaryexx_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 intervaleyy_num_periods::Int64: number of intervals of constant background strain rate (y-axis)eyy_time_delims::Vector{Float64}: time delimiters for eyy strain rate intervals (one less than number of intervals)eyy_strain_rates::Vector{Float64}: background strain rates in yy-direction for each intervalexy_num_periods::Int64: number of intervals of constant background simple shear strain rate (xy-plane)exy_time_delims::Vector{Float64}: time delimiters for exy strain rate intervalsexy_strain_rates::Vector{Float64}: background simple shear strain rates in xy-direction for each intervalbg_ref_point::Vector{Float64}: background strain rate reference point (fixed)periodic::Int64: periodic grid topology in the x-direction (LaMEM >= 3.0; also activates periodic advection in x)VelocityBoxes::Vector{VelocityBox}: List of added velocity boxesBCBlocks::Vector{BCBlock}: List of added Bezier blocksVelCylinders::Vector{VelCylinder}: List of added velocity cylindersbvel_face::Union{Nothing, String}: Face identifier (Left; Right; Front; Back; CompensatingInflow)bvel_face_out::Union{Nothing, Int64}: Velocity on opposite side: -1 for inverted velocity; 0 for no velocity; 1 for the same direction of velocitybvel_bot::Union{Nothing, Float64}: Bottom coordinate of inflow windowbvel_top::Union{Nothing, Float64}: Top coordinate of inflow windowvelin_num_periods::Union{Nothing, Int64}: Number of periods when velocity changes (Optional)velin_time_delims::Union{Nothing, Vector}: Change velocity at 2 and 5 Myrs (one less than number of intervals, not required for one interval) (Optional)bvel_velin::Union{Nothing, Vector}: inflow velocity for each time interval(Multiple values required if velin_num_periods>1)bvel_velout::Union{Nothing, Float64}: outflow velocity (if not specified, computed from mass balance)bvel_relax_d::Union{Nothing, Float64}: vert.distance from bvel_bot and bvel_top over which velocity is reduced linearlybvel_velbot::Union{Nothing, Int64}: bottom inflow velocity for use with bvel_face=CompensatingInflowbvel_veltop::Union{Nothing, Int64}: top inflow velocity for use with bvel_face=CompensatingInflowbvel_temperature_inflow::Union{Nothing, String}: bvel_temperature_inflow: Thermal age of the plate, which can be constant if set to Fixed_thermal_age or Constant_T_inflow (Temperature of the inflow material is constant everywhere)bvel_thermal_age::Union{Nothing, Float64}: In dimensional unit. If the user specify this value, he needs to specify the temperature of the mantle and top as wellbvel_temperature_mantle::Union{Nothing, Float64}: In dimensional unit. Temperature of the mantlebvel_temperature_top::Union{Nothing, Float64}: In dimensional unit. temperature of the topbvel_temperature_constant::Union{Nothing, Float64}: Constant temperature inflow.bvel_num_phase::Union{Nothing, Int64}: Imposes a stratigraphy of phase injected in the inflow boundary [if undefined, it uses the phase close to the boundary]bvel_phase::Union{Nothing, Vector{Int64}}: phase number of inflow material [if undefined, it uses the phase close to the boundary] from bottom to topbvel_phase_interval::Union{Nothing, Vector{Float64}}: Depth interval of injection of the phase (the interval is defined by num_phase+1 coordinates). e.g. [-120 -100 -10 0 ]open_bot_bound::Union{Nothing, Int64}: # Permeable lower boundary flagpermeable_phase_inflow::Union{Nothing, Int64}: Phase of the inflow material from the bottom (The temperature of the inflow phase it is the same of the bottom boundary) in case of open_bot_bound=1fix_phase::Union{Nothing, Int64}: fixed phase (no-flow condition)fix_cell::Union{Nothing, Int64}: fixed cells (no-flow condition)fix_cell_file::Union{Nothing, String}: fixed cells input file (extension is .xxxxxxxx.dat)temp_bot_num_periods::Union{Nothing, Int64}: How many periods with different temp_bot do we have?temp_bot_time_delim::Union{Nothing, Vector{Float64}}: At which time do we switch from one to the next period?Plume_InflowBoundary::Union{Nothing, Int64}: # have a plume-like inflow boundary @ bottomPlume_Type::Union{Nothing, String}: Type of plume inflow boundary."Inflow_type"or"Pressure_type"(circular) or"Permeable_Type"which combines the open bot boundary with the plume boundary condition (the option herein listed overwrites open_bot, so do not activate that)
Plume_Dimension::Union{Nothing, String}: 2D or 3D (circular)Plume_areaFrac::Union{Nothing, Float64}: how much of the plume is actually in the model. This usually 1 (default) but lower if the plume is in a corner of a symmetric setup and matters for the outflowPlume_Phase::Union{Nothing, Int64}: phase of plume materialPlume_Depth::Union{Nothing, Float64}: # depth of provenience of the plume (i.e. how far from the bottom of the model the plume source is)Plume_Mantle_Phase::Union{Nothing, Int64}: # Astenosphere phase (if the inflow occurs outside the plume radius)Plume_Temperature::Union{Nothing, Float64}: # temperature of inflow plumePlume_Inflow_Velocity::Union{Nothing, Float64}: # Inflow velocity (not required if Pressure_Type) in cm/year if using GEOunitsPlume_VelocityType::Union{Nothing, String}:"Gaussian"or"Poiseuille"Plume_Center::Union{Nothing, Vector{Float64}}: # [X,Y] of center (2nd only in case of 3D plume)Plume_Radius::Union{Nothing, Float64}: # Width/Radius of plumePlume_Phase_Mantle::Union{Nothing, Int64}: # Inflow phase. If the velocity happens to be positive in the domain, the inflow material has a constant phase and the temperature of the bottompres_top::Union{Nothing, Float64}: Pressure on the top boundarypres_bot::Union{Nothing, Float64}: Pressure on the bottom boundaryinit_pres::Union{Nothing, Int64}: pressure initial guess flag; linear profile between pres_top and pres_bot in the unconstrained cellsinit_temp::Union{Nothing, Int64}: temperature initial guess flag; linear profile between temp_top and temp_bot
LaMEM.LaMEM_Model.Dike Type
Defines the properties related to inserting dikesID::Int64: Material phase IDMf::Float64: value for dike/magma- accommodated extension, between 0 and 1, in the front of the box, for phase dikeMc::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 usedy_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 usedMb::Union{Nothing, Float64}: value for dike/magma-accommodated extension, between 0 and 1, in the back of the box, for phase dikePhaseID::Union{Nothing, Int64}: Phase IDPhaseTransID::Union{Nothing, Int64}: Phase transition ID
LaMEM.LaMEM_Model.FastScape Type
Structure that contains the parameters of the FastScape landscape-evolution model, which
replaces the built-in erosion/sedimentation when `FreeSurface(surf_mode=2, FastScape=FastScape(...))`
is used. Requires a LaMEM binary compiled with FastScape (LaMEM_jll >= 3.2.0).non_uniform_grid::Int64: LaMEM grid type flag [0-uniform, 1-non-uniform]; must be consistent with the LaMEM gridfs2D::Int64: dimensionality flag [0-3D LaMEM model, 1-2D model]; in 2D the 1D LaMEM surface is extended in the 2nd horizontal directionextendedRange::Float64: [only used if fs2D=1] length of the FastScape domain in the extended direction [length units, e.g. km]extendedNodes::Int64: [only used if fs2D=1 and non_uniform_grid=0] number of FastScape nodes in the extended direction (>2)fs_refine::Int64: surface-grid refinement factor; a factor n inserts n-1 equally spaced points between adjacent nodes in each directionmax_fs_dt::Float64: maximum FastScape substep [time units, e.g. Myr]; larger LaMEM steps are split into several FastScape substepssed_phases::Int64: LaMEM phase ID assigned to newly deposited sedimenttopo_boundary::String: topographic BC, 4 digits (one per boundary, same order asvel_boundary): 0-reflective/no-flux, 1-fixed height/open (sediment may leave)vel_boundary::String: surface velocity BC, 4 digits (one per boundary): 1-zero velocity, 0-keep velocity transferred from LaMEM; digit order: bottom (y-min), right (x-max), top (y-max), left (x-min)random_noise::Int64: add random perturbation to the initial topographysurf_out_nstep::Int64: write FastScape output every n coupled time stepsvec_times::Float64: vertical (z) exaggeration factor applied to the outputkf::Float64: bedrock river incision coefficient Kf [m^(1-2m)/yr]kfsed::Float64: sediment river incision coefficient; if < 0, kf is used for bothm::Float64: drainage area exponent in the stream power lawn::Float64: local slope exponent in the stream power lawkd::Float64: bedrock transport coefficient (hillslope diffusivity) [m^2/yr]kdsed::Float64: sediment transport coefficient; if < 0, kd is used for bothg::Float64: dimensionless bedrock deposition coefficient (enriched stream power law)gsed::Float64: dimensionless sediment deposition coefficient; if < 0, g is used for bothp::Float64: slope exponent for multi-direction flow routingset_marine::Int64: marine transport & compaction flag [0-off, 1-on]sealevel::Float64: [only used if set_marine=1] sea level [m]poroSilt::Float64: [only used if set_marine=1] reference (surface) porosity of siltporoSand::Float64: [only used if set_marine=1] reference (surface) porosity of sandzporoSilt::Float64: [only used if set_marine=1] e-folding depth of the porosity law for silt [m]zporoSand::Float64: [only used if set_marine=1] e-folding depth of the porosity law for sand [m]ratio::Float64: [only used if set_marine=1] silt fraction of material supplied from the continental domaindepth_siltsand_solve::Float64: [only used if set_marine=1] averaging depth used to solve the silt/sand transport equation [m]kdsSilt::Float64: [only used if set_marine=1] marine transport coefficient for silt [m^2/yr]kdsSand::Float64: [only used if set_marine=1] marine transport coefficient for sand [m^2/yr]
LaMEM.LaMEM_Model.FreeSurface Type
Structure that contains the LaMEM free surface information.surf_use::Int64: Free surface activation flagsurf_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 surfacesurf_air_phase::Union{Nothing, Int64}: phase ID of sticky air layersurf_max_angle::Float64: maximum angle with horizon (smoothed if larger)surf_topo_file::String: initial topography file (redundant)surf_mode::Int64: surface evolution mode [1-built-in erosion/sedimentation (default), 2-FastScape (requires theFastScapefield and LaMEM_jll >= 3.2.0)]erosion_model::Int64: erosion model [0-none (default), 1-infinitely fast, 2-prescribed rate with given level, 3-spatially limited]; surf_mode=1 onlyer_num_phases::Int64: number of erosion phaseser_time_delims::Vector{Float64}: erosion time delimiters (one less than number)er_rates::Vector{Float64}: constant erosion rates in different time periodser_levels::Vector{Int64}: levels above which we apply constant erosion rates in different time periodser_x_min::Union{Nothing, Vector{Float64}}: [only used if erosion_model=3] minimum x-coordinates of the spatially limited erosion zone, per erosion phaseer_x_max::Union{Nothing, Vector{Float64}}: [only used if erosion_model=3] maximum x-coordinates of the spatially limited erosion zone, per erosion phaseslope_dependent_erosion::Int64: slope-dependent erosion flag [0-none (default), 1-active]: E [m/yr] = prefactor_slope * slope^n_slope, applied on top of erosion_modelprefactor_slope::Float64: [only used if slope_dependent_erosion=1] erosion prefactor [m/yr]n_slope::Float64: [only used if slope_dependent_erosion=1] slope power exponenttopo_diff::Int64: activate topographic diffusion of the free surface [0-none (default), 1-active]topo_diffusivity::Float64: topographic diffusivity used if topo_diff=1sediment_model::Int64: sedimentation model [0-none (dafault), 1-prescribed rate with given level, 2-cont. margin]sed_num_layers::Int64: number of sediment layerssed_time_delims::Vector{Float64}: sediment layers time delimiters (one less than number)sed_rates::Vector{Float64}: sediment rates in different time periodssed_levels::Vector{Float64}: levels below which we apply constant sediment rates in different time periodssed_phases::Vector{Int64}: sediment layers phase numbers in different time periodsmarginO::Vector{Float64}: lateral coordinates of continental margin - originmarginE::Vector{Float64}: lateral coordinates of continental margin - 2nd pointhUp::Float64: up dip thickness of sediment cover (onshore)hDown::Float64: down dip thickness of sediment cover (off shore)dTrans::Float64: half of transition zoneTopography::Union{Nothing, GeophysicalModelGenerator.CartData}: Topography gridFastScape::Union{Nothing, FastScape}: FastScape parameters (used if surf_mode=2)
LaMEM.LaMEM_Model.GeomBox Type
LaMEM geometric primitive `Box` objectphase::Int64: phasebounds::Vector{Float64}: box bound coordinates:left,right,front,back,bottom,topTemperature::Union{Nothing, String}: optional: Temperature structure. possibilities: [constant, linear, halfspace]cstTemp::Union{Nothing, Float64}: required in case of [constant]: temperature value [in Celcius in case of GEO units]topTemp::Union{Nothing, Float64}: required in case of [linear,halfspace]: temperature @ top [in Celcius in case of GEO units]botTemp::Union{Nothing, Float64}: required in case of [linear,halfspace]: temperature @ top [in Celcius in case of GEO units]thermalAge::Union{Nothing, Float64}: required in case of [halfspace]: thermal age of lithosphere [in Myrs if GEO units are used]t_inject::Union{Nothing, Vector{Float64}}: optional: simulation times at which the primitive is stamped onto the markers (phase, temperature if given; APS, ATS and stresses are reset); at most 10, strictly increasing. If not given, the primitive defines the initial geometry (requires LaMEM_jll >= 3.3.0)n_inject::Union{Nothing, Int64}: number of injection times; set automatically fromt_inject
LaMEM.LaMEM_Model.GeomCylinder Type
LaMEM geometric primitive `Cylinder` objectphase::Int64: phaseradius::Float64: radius of cylinderbase::Vector{Float64}: center of base of cylindercap::Vector{Float64}: center of cap of cylinderTemperature::Union{Nothing, String}: optional: Temperature structure. possibilities: [constant]cstTemp::Union{Nothing, Float64}: required in case of [constant]: temperature value [in Celcius in case of GEO units]t_inject::Union{Nothing, Vector{Float64}}: optional: simulation times at which the primitive is stamped onto the markers (phase, temperature if given; APS, ATS and stresses are reset); at most 10, strictly increasing. If not given, the primitive defines the initial geometry (requires LaMEM_jll >= 3.3.0)n_inject::Union{Nothing, Int64}: number of injection times; set automatically fromt_inject
LaMEM.LaMEM_Model.GeomEllipsoid Type
LaMEM geometric primitive `Ellipsoid` objectphase::Int64: phaseaxes::Vector{Float64}: semi-axes of ellipsoid inx,yandzcenter::Vector{Float64}: center of sphereTemperature::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]t_inject::Union{Nothing, Vector{Float64}}: optional: simulation times at which the primitive is stamped onto the markers (phase, temperature if given; APS, ATS and stresses are reset); at most 10, strictly increasing. If not given, the primitive defines the initial geometry (requires LaMEM_jll >= 3.3.0)n_inject::Union{Nothing, Int64}: number of injection times; set automatically fromt_inject
LaMEM.LaMEM_Model.GeomHex Type
LaMEM geometric primitive `Hex` object to define hexahedral elementsphase::Int64: phasecoord::Vector{Float64}:x-y-zcoordinates for each of 8 nodes (24 parameters) (counter)-clockwise for an arbitrary face, followed by the opposite facet_inject::Union{Nothing, Vector{Float64}}: optional: simulation times at which the primitive is stamped onto the markers (phase, temperature if given; APS, ATS and stresses are reset); at most 10, strictly increasing. If not given, the primitive defines the initial geometry (requires LaMEM_jll >= 3.3.0)n_inject::Union{Nothing, Int64}: number of injection times; set automatically fromt_inject
LaMEM.LaMEM_Model.GeomLayer Type
LaMEM geometric primitive `Layer` objectphase::Int64: phasetop::Float64: top of layerbottom::Float64: bottom of layercosine::Union{Nothing, Int64}: optional: add a cosine perturbation on top of the interface (if 1)wavelength::Union{Nothing, Float64}: required if cosine: wavelength in x-directionamplitude::Union{Nothing, Float64}: required if cosine: amplitude of perturbationTemperature::Union{Nothing, String}: optional: Temperature structure. possibilities: [constant, linear, halfspace]cstTemp::Union{Nothing, Float64}: required in case of [constant]: temperature value [in Celcius in case of GEO units]topTemp::Union{Nothing, Float64}: required in case of [linear,halfspace]: temperature @ top [in Celcius in case of GEO units]botTemp::Union{Nothing, Float64}: required in case of [linear,halfspace]: temperature @ top [in Celcius in case of GEO units]thermalAge::Union{Nothing, Float64}: required in case of [halfspace]: thermal age of lithosphere [in Myrs if GEO units are used]t_inject::Union{Nothing, Vector{Float64}}: optional: simulation times at which the primitive is stamped onto the markers (phase, temperature if given; APS, ATS and stresses are reset); at most 10, strictly increasing. If not given, the primitive defines the initial geometry (requires LaMEM_jll >= 3.3.0)n_inject::Union{Nothing, Int64}: number of injection times; set automatically fromt_inject
LaMEM.LaMEM_Model.GeomRidgeSeg Type
LaMEM geometric primitive `RidgeSeg` objectphase::Int64: phasebounds::Vector{Float64}: box bound coordinates:left,right,front,back,bottom,topridgeseg_x::Vector{Float64}: coordinate order: left, right [can be different for oblique ridge]ridgeseg_y::Vector{Float64}: coordinate order: front, back [can be different for oblique ridge]Temperature::String: initial temperature structure [ridge must be set tohalfspace_age–> setTemp=4]topTemp::Float64: required in case of [linear,halfspace]: temperature @ top [in Celcius in case of GEO units]botTemp::Float64: required in case of [linear,halfspace]: temperature @ top [in Celcius in case of GEO units]age0::Float64: minimum age of seafloor at ridge [inMyrin case of GEO units]maxAge::Union{Nothing, Float64}: [optional] parameter that indicates the maximum thermal age of a platev_spread::Union{Nothing, Float64}: [optional] parameter that indicates the spreading velocity of the plate; if not defined it uses bvel_velin specified elsewheret_inject::Union{Nothing, Vector{Float64}}: optional: simulation times at which the primitive is stamped onto the markers (phase, temperature if given; APS, ATS and stresses are reset); at most 10, strictly increasing. If not given, the primitive defines the initial geometry (requires LaMEM_jll >= 3.3.0)n_inject::Union{Nothing, Int64}: number of injection times; set automatically fromt_inject
LaMEM.LaMEM_Model.GeomSphere Type
LaMEM geometric primitive `sphere` objectphase::Int64: phaseradius::Float64: radius of spherecenter::Vector{Float64}: center of sphereTemperature::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]t_inject::Union{Nothing, Vector{Float64}}: optional: simulation times at which the primitive is stamped onto the markers (phase, temperature if given; APS, ATS and stresses are reset); at most 10, strictly increasing. If not given, the primitive defines the initial geometry (requires LaMEM_jll >= 3.3.0)n_inject::Union{Nothing, Int64}: number of injection times; set automatically fromt_inject
LaMEM.LaMEM_Model.Grid Type
Structure that contains the LaMEM grid informationnmark_x::Int64: number of markers/element in x-directionnmark_y::Int64: number of markers/element in y-directionnmark_z::Int64: number of markers/element in x-directionnel_x::Vector{Int64}: number of elements in x-directionnel_y::Vector{Int64}: number of elements in y-directionnel_z::Vector{Int64}: number of elements in z-directioncoord_x::Vector{Float64}: coordinates in x-directioncoord_y::Vector{Float64}: coordinates in y-directioncoord_z::Vector{Float64}: coordinates in z-directionnseg_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 objectPhases::Array{Int32}: Phases; 3D phase informationTemp::Array{Float64}: Temp; 3D phase informationAPS::Array{Float64}: APS; accumulated plastic strain
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)
x ϵ [0.0, 0.7, 0.8, 1.0], bias=[0.3, 1.0, 3.0], nseg=3, Δmin=0.025000000000000022, Δmax=0.1499999999999999
y ϵ [-10.0 : 0.0]
z ϵ [-10.0 : 0.0]Example 2
julia> d=LaMEM.Grid(nel=(10,20))
LaMEM grid with constant Δ:
nel : ([10], [1], [20])
marker/cell : (3, 3, 3)
x ϵ [-10.0 : 10.0]
y ϵ [-10.0 : 0.0]
z ϵ [-10.0 : 0.0]LaMEM.LaMEM_Model.Materials Type
Structure that contains the material properties in the current simulationPhases::Vector{Phase}: Different Materials implementedSofteningLaws::Vector{Softening}: Softening laws implementedPhaseTransitions::Vector{PhaseTransition}: Internal Phase Transitions (that change the ID of markers) implementedDikes::Vector{Dike}: Dikes implemented (mostly for MOR simulations)PhaseAggregates::Vector{PhaseAggregate}: Phase aggregates (combines different phases such as upper_lower crust into one for visualization purposes)
LaMEM.LaMEM_Model.Model Type
ModelStructure that holds all the information to create a LaMEM input file
Scaling::Scaling: Scaling parametersGrid::Grid: LaMEM GridTime::Any: Time optionsFreeSurface::Any: Free surface optionsBoundaryConditions::Any: Boundary conditionsSolutionParams::Any: Global solution parametersSolver::Any: Solver options and optional PETSc optionsModelSetup::Any: Model setupOutput::Any: Output optionsPassiveTracers::Any: Passive tracersMaterials::Any: Material parameters for each of the phases
LaMEM.LaMEM_Model.Model Method
Model(args...)Allow to define a model setup by specifying some of the basic objects
Example
julia> d = Model(Grid(nel=(10,2,20)), Scaling(NO_units()))
LaMEM Model setup
|
|-- Scaling : GeoParams.Units.GeoUnits{GeoParams.Units.NONE}
|-- Grid : nel=(10, 2, 20); xϵ(-10.0, 10.0), yϵ(-10.0, 0.0), zϵ(-10.0, 0.0)
|-- Time : nstep_max=50; nstep_out=1; time_end=1.0; dt=0.05
|-- Boundary conditions : noslip=[0, 0, 0, 0, 0, 0]
|-- Solution parameters :
|-- Solver options : coupled_direct; mumps; penalty=1000.0
|-- Model setup options : Type=geom;
|-- Output options : filename=output; pvd=1; avd=0; surf=0
|-- Materials : 1 phases;LaMEM.LaMEM_Model.Model Method
Model(;
Scaling=Scaling(GEO_units()),
Grid=Grid(),
Time=Time(),
FreeSurface=FreeSurface(),
BoundaryConditions=BoundaryConditions(),
SolutionParams=SolutionParams(),
Solver=Solver(),
ModelSetup=ModelSetup(),
Output=Output(),
PassiveTracers=PassiveTracers(),
Materials=Materials()
)Creates a LaMEM Model setup.
Scaling::ScalingGrid::GridTime::AnyFreeSurface::AnyBoundaryConditions::AnySolutionParams::AnySolver::AnyModelSetup::AnyOutput::AnyPassiveTracers::AnyMaterials::Any
LaMEM.LaMEM_Model.ModelSetup Type
Structure that contains the LaMEM Model Setup and Advection optionsmsetup::String: Setup type - can begeom(phases are assigned from geometric primitives, usingadd_geom!(model, ...)),files(from julia input),polygons(from geomIO input, which requirespoly_fileto be specified)rand_noise::Int64: add random noise to the particle locationrand_noiseGP::Int64: random noise flag, subsequently applied to geometric primitivesbg_phase::Int64: background phase IDsave_mark::Int64: save marker to disk flagmark_load_file::String: marker input file (extension is .xxxxxxxx.dat), if usingmsetup=filesmark_save_file::String: marker output file (extension is .xxxxxxxx.dat)poly_file::String: polygon geometry file (redundant), if usingmsetup=polygonstemp_file::String: initial temperature file (redundant), if not set on markersadvect::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 parametermark_ctrl::String: marker control type; options aresubgrid(default; marker control enforced over fine scale grid),none(none),basic(AVD for cells + corner insertion), andavd(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 wemsetup``=geom; seeGeomSphere`
LaMEM.LaMEM_Model.Multigrid Type
Structure that has info about setting up multigrid for LaMEMnel::Tuple{Int64, Int64, Int64}: Number of elements at the fine levellevels::Int64: Number of levelssmooth::Int64: number of smoothening steps per levelsmooth_jacobi_factor::Float64: factor for jacbi smoothener oer levelsmoother::String: smoother used at every levelcoarse_ksp::String: coarse grid ksp type preonly or fgmrescoarse_pc::String: coarse grid pc type ["superlu_dist", "mumps", "gamg", "telescope","redundant"]coarse_coarse_pc::String: coarse coarse grid solver in case we use redundant or telescope coarse grid solvescoarse_coarse_ksp::String: coarse coarse grid solver in case we use redundant or telescope coarse grid solvescores::Int64: number of cores used in the simulationcores_coarse::Int64: number of cores used for coarse grid solver (in case we use pctelescope)gamg_threshold::Float64: GAMG thresholdgamg_coarse_eq_limit::Int64: GAMG coarse grid equation limitgamg_repartition::Bool: GAMG repartition coarse grids? (default=false)gamg_parallel_coarse::Bool: GAMG parallel coarse grid solver? (default=false)
LaMEM.LaMEM_Model.Output Type
Structure that contains the LaMEM output optionsout_file_name::Any: output file nameout_dir::Any: output directoryparam_file_name::Any: parameter filenamewrite_VTK_setup::Any: write VTK initial model setupout_pvd::Any: activate writing .pvd fileout_phase::Any: dominant phaseout_density::Any: densityout_visc_total::Any: total (viscoelastoplastic) viscosityout_visc_creep::Any: creep viscosityout_velocity::Any: velocityout_pressure::Any: (dynamic) pressureout_tot_press::Any: total pressureout_eff_press::Any: effective pressureout_over_press::Any: out_over_pressout_litho_press::Any: lithospheric pressureout_pore_press::Any: pore pressureout_temperature::Any: temperatureout_dev_stress::Any: deviatoric strain rate tensorout_j2_dev_stress::Any: second invariant of deviatoric stress tensorout_strain_rate::Any: deviatoric strain rate tensorout_j2_strain_rate::Any: second invariant of strain rate tensorout_shmax::Any: sh maxout_ehmax::Any: eh maxout_yield::Any: yield stressout_rel_dif_rate::Any: relative proportion of diffusion creep strainrateout_rel_dis_rate::Any: relative proportion of dislocation creep strainrateout_rel_prl_rate::Any: relative proportion of peierls creep strainrateout_rel_pl_rate::Any: relative proportion of plastic strainrateout_plast_strain::Any: accumulated plastic strainout_plast_dissip::Any: plastic dissipationout_tot_displ::Any: total displacementout_moment_res::Any: momentum residualout_cont_res::Any: continuity residualout_energ_res::Any: energy residualout_melt_fraction::Any: Melt fractionout_fluid_density::Any: fluid densityout_conductivity::Any: conductivityout_vel_gr_tensor::Any: velocity gradient tensorout_surf::Any: activate surface outputout_surf_pvd::Any: activate writing .pvd fileout_surf_velocity::Any: surface velocityout_surf_topography::Any: surface topographyout_surf_amplitude::Any: amplitude of topography (=topo-average(topo))out_surf_fs::Union{Nothing, Int64}: activate FastScape surface output (surf_mode=2 only; written to <out_file_name>_fs.pvd). The FastScape output flags are not written unless set, in which case LaMEM switches them all onout_fs_pvd::Union{Nothing, Int64}: activate writing FastScape .pvd fileout_surf_topofs::Union{Nothing, Int64}: FastScape topographyout_surf_silt_fraction::Union{Nothing, Int64}: silt fraction (marine transport, set_marine=1)out_surf_basement::Union{Nothing, Int64}: basement elevation (topography minus sediment thickness)out_surf_total_erosion::Union{Nothing, Int64}: cumulative erosionout_surf_drainage_area::Union{Nothing, Int64}: drainage areaout_surf_erosion_rate::Union{Nothing, Int64}: erosion rateout_surf_slope::Union{Nothing, Int64}: surface slopeout_surf_curvature::Union{Nothing, Int64}: surface curvatureout_surf_chi::Union{Nothing, Int64}: chi parameter (integrated drainage-area metric)out_surf_catchment::Union{Nothing, Int64}: catchment IDout_surf_lake_depth::Union{Nothing, Int64}: lake depthout_mark::Any: activate marker outputout_mark_pvd::Any: activate writing .pvd fileout_avd::Any: activate AVD phase outputout_avd_pvd::Any: activate writing .pvd fileout_avd_ref::Any: AVD grid refinement factorout_ptr::Any: activateout_ptr_ID::Any: ID of the passive tracersout_ptr_phase::Any: phase of the passive tracersout_ptr_Pressure::Any: interpolated pressureout_ptr_Temperature::Any: temperatureout_ptr_APS::Any: accumulated plastic strainout_ptr_MeltFraction::Any: melt fraction computed using P-T of the markerout_ptr_Active::Any: option that highlight the marker that are currently activeout_ptr_Grid_Mf::Any: option that allow to store the melt fraction seen within the cell
LaMEM.LaMEM_Model.PassiveTracers Type
Structure that contains the LaMEM passive tracers parameters.Passive_Tracer::Int64: activate passive tracers?"PassiveTracer_Box::Union{Nothing, Vector{Float64}}: Dimensions of box in which we distribute passive tracers [Left, Right, Front, Back, Bottom, Top]PassiveTracer_Resolution::Vector{Int64}: The number of passive tracers in every directionPassiveTracer_ActiveType::Union{Nothing, String}: Under which condition are they activated? ["Always"], "Melt_Fraction", "Temperature", "Pressure", "Time"PassiveTracer_ActiveValue::Union{Nothing, Float64}: The value to activate them
LaMEM.LaMEM_Model.Phase Type
Defines the material properties for each of the phasesID::Union{Nothing, Int64}: Material phase IDName::Union{Nothing, String}: Description of the phaserho::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}: Build-in DIFFUSION creep profiles: Example:"Dry__Olivine_diff_creep-Hirth_Kohlstedt_2003"Available build-in diffusion creep rheologies are:- From [Hirth, G. and Kohlstedt D. (2003), Rheology of the upper mantle and the mantle wedge: A view from the experimentalists]:
"Dry_Olivine_diff_creep-Hirth_Kohlstedt_2003""Wet_Olivine_diff_creep-Hirth_Kohlstedt_2003_constant_C_OH""Wet_Olivine_diff_creep-Hirth_Kohlstedt_2003"
- From [Rybacki and Dresen, 2000, JGR]:
"Dry_Plagioclase_RybackiDresen_2000""Wet_Plagioclase_RybackiDresen_2000"
Note that you can always specify your own, by setting
Bd,Ed,Vdaccordingly.disl_prof::Union{Nothing, String}: Build-in DISLOCATION creep profiles: Example:"Granite-Tirel_et_al_2008"Available build-in dislocation creep rheologies are:- From [Ranalli 1995]:
"Dry_Olivine-Ranalli_1995""Wet_Olivine-Ranalli_1995""Wet_Quarzite-Ranalli_1995""Quarzite-Ranalli_1995""Mafic_Granulite-Ranalli_1995""Plagioclase_An75-Ranalli_1995"
- From [Carter and Tsenn (1986). Flow properties of continental lithosphere - page 18]:
"Quartz_Diorite-Hansen_Carter_1982"
- From [J. de Bremond d'Ars et al. Tectonophysics (1999). Hydrothermalism and Diapirism in the Archaean: gravitational instability constrains. - page 5]
"Diabase-Caristan_1982""Tumut_Pond_Serpentinite-Raleigh_Paterson_1965"
- From [Mackwell, Zimmerman & Kohlstedt (1998). High-temperature deformation]:
"Maryland_strong_diabase-Mackwell_et_al_1998"
- From [Ueda et al (PEPI 2008)]:
"Wet_Quarzite-Ueda_et_al_2008"
- From [Huismans et al 2001]:
"Diabase-Huismans_et_al_2001""Granite-Huismans_et_al_2001"
- From [Burg And Podladchikov (1999)]:
"Dry_Upper_Crust-Schmalholz_Kaus_Burg_2009""Weak_Lower_Crust-Schmalholz_Kaus_Burg_2009""Olivine-Burg_Podladchikov_1999"
- From [Rybacki and Dresen, 2000, JGR]:
"Dry_Plagioclase_RybackiDresen_2000""Wet_Plagioclase_RybackiDresen_2000"
- From [Hirth, G. & Kohlstedt (2003), D. Rheology of the upper mantle and the mantle wedge: A view from the experimentalists]:
"Wet_Olivine_disl_creep-Hirth_Kohlstedt_2003""Wet_Olivine_disl_creep-Hirth_Kohlstedt_2003_constant_C_OH""Dry_Olivine_disl_creep-Hirth_Kohlstedt_2003"
- From [SchmalholzKausBurg(2009), Geology (wet olivine)]:
"Wet_Upper_Mantle-Burg_Schmalholz_2008""Granite-Tirel_et_al_2008"
- From [Urai et al.(2008)]:
"Ara_rocksalt-Urai_et_al.(2008)"
- From [Bräuer et al. (2011) Description of the Gorleben site (PART 4): Geotechnical exploration of the Gorleben salt dome - page 126]:
"RockSaltReference_BGRa_class3-Braeumer_et_al_2011"
- From [Mueller and Briegel (1978)]:
"Polycrystalline_Anhydrite-Mueller_and_Briegel(1978)"
Note that you can always specify your own, by setting
Bn,En,Vn, andnaccordingly.peir_prof::Union{Nothing, String}: Build-in PEIERLS creep profiles: example:"Olivine_Peierls-Kameyama_1999"Available profiles:"Olivine_Peierls-Kameyama_1999"
rho_n::Union{Nothing, Float64}: depth-dependent density model parameterrho_c::Union{Nothing, Float64}: depth-dependent density model parameterbeta::Union{Nothing, Float64}: pressure-dependent density model parameterG::Union{Nothing, Float64}: shear modulusKb::Union{Nothing, Float64}: bulk modulusE::Union{Nothing, Float64}: Young's modulusnu::Union{Nothing, Float64}: Poisson's ratioKp::Union{Nothing, Float64}: pressure dependence parameterBd::Union{Nothing, Float64}: DIFFUSION creep pre-exponential constantEd::Union{Nothing, Float64}: activation energyVd::Union{Nothing, Float64}: activation volumeeta0::Union{Nothing, Float64}: POWER LAW reference viscositye0::Union{Nothing, Float64}: reference strain rateBn::Union{Nothing, Float64}: DISLOCATION creep pre-exponential constantEn::Union{Nothing, Float64}: activation energyVn::Union{Nothing, Float64}: activation volumen::Union{Nothing, Float64}: power law exponentBp::Union{Nothing, Float64}: PEIERLS creep pre-exponential constantEp::Union{Nothing, Float64}: activation energyVp::Union{Nothing, Float64}: activation volumetaup::Union{Nothing, Float64}: scaling stressgamma::Union{Nothing, Float64}: approximation parameterq::Union{Nothing, Float64}: stress-dependence parametereta_fk::Union{Nothing, Float64}: reference viscosity for Frank-Kamenetzky viscositygamma_fk::Union{Nothing, Float64}: gamma parameter for Frank-Kamenetzky viscosityTRef_fk::Union{Nothing, Float64}: reference Temperature for Frank-Kamenetzky viscosity (if not set it is 0°C)ch::Union{Nothing, Float64}: cohesionfr::Union{Nothing, Float64}: friction angleeta_st::Union{Nothing, Float64}: stabilization viscosity (default is eta_min)eta_vp::Union{Nothing, Float64}: viscoplastic plasticity regularisation viscosityrp::Union{Nothing, Float64}: pore-pressure ratiochSoftID::Union{Nothing, Int64}: friction softening law IDfrSoftID::Union{Nothing, Int64}: cohesion softening law IDhealID::Union{Nothing, Int64}: healing ID, points to healTau in Softeningalpha::Union{Nothing, Float64}: thermal expansivityCp::Union{Nothing, Float64}: specific heat (capacity), J⋅K−1⋅kg−1k::Union{Nothing, Float64}: thermal conductivityA::Union{Nothing, Float64}: radiogenic heat productionT::Union{Nothing, Float64}: optional temperature to set within the phaseLatent_hx::Union{Nothing, Float64}: optional, used for dike heating, J/kgT_liq::Union{Nothing, Float64}: optional, used for dike heating, liquidus temperature of material, celsiusT_sol::Union{Nothing, Float64}: optional, used for dike heating, solidus temperature of material, celsiusT_Nu::Union{Nothing, Float64}: default value for thermal conductivity boundarynu_k::Union{Nothing, Float64}: optional parameter, Nusselt number for use with conductivityrho_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) heremfc::Union{Nothing, Float64}: melt fraction viscosity correction factor (positive scalar)GeoParams::Union{Nothing, Vector{GeoParams.MaterialParameters.ConstitutiveRelationships.AbstractCreepLaw}}: GeoParams creeplaws Set diffusion or dislocation creeplaws as provided by the GeoParams package:juliajulia> using GeoParams julia> a = SetDiffusionCreep(GeoParams.Diffusion.dry_anorthite_Rybacki_2006); julia> p = Phase(ID=1,Name="test", GeoParams=[a]);Note that GeoParams should be a vector, as you could, for example, have diffusion and dislocation creep parameters Note also that this will overwrite any other creeplaws provided in the Phase struct.
grainsize::Union{Nothing, Float64}: grainsize [m] (not used in LaMEM) This is not actually used in LaMEM, but is required when setting diffusion creep parameters by using GeoParams
LaMEM.LaMEM_Model.PhaseAggregate Type
Defines phase aggregates, which can be useful for visualization purposesname::String: Name of the phase aggregatephaseID::Union{Nothing, Vector{Int64}}: Phases to be combinednumPhase::Union{Nothing, Int64}: number of aggregated phases
LaMEM.LaMEM_Model.PhaseTransition Type
Defines phase transitions on markers (that change the Phase ID of a marker depending on some conditions)ID::Int64: Phase_transition law IDType::String: [Constant, Clapeyron, Box, NotInAirBox, dylib]: Constant - the phase transition occurs only at a fixed value of the parameter; Clapeyron - clapeyron slope; dylib - user-defined rule, compiled into the pluginlibraryName_Clapeyron::Union{Nothing, String}: Type of predefined Clapeyron slope, such as Mantle_Transition_660kmPTBox_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::Union{Nothing, 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 transitionConstantValue::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 PhaseBelowPhaseBelow::Union{Nothing, Vector{Int64}}: Below the chosen value the phase is PhaseBelow, above it, the value is 1PhaseInside::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::Union{Nothing, String}: [BothWays=default; BelowToAbove; AboveToBelow] Direction in which transition worksResetParam::Union{Nothing, String}: [APS] Parameter to reset on particles below PT or within boxPTBox_TempType::Union{Nothing, 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/yrt0_box::Union{Nothing, Float64}: [optional] beginning time of movemen in Myrt1_box::Union{Nothing, Float64}: [optional] end time of movement in Myrclapeyron_slope::Union{Nothing, Float64}: [optional] clapeyron slope of phase transition [in K/MPa];P = ( T - T0_clapeyron ) * clapeyron_slope + P0_clapeyronP0_clapeyron::Union{Nothing, Float64}: [optional] P0_clapeyron [Pa]T0_clapeyron::Union{Nothing, Float64}: [optional] T0_clapeyron [C]numberofequation::Union{Nothing, Int64}: Number of phase transition equations. Must be 1 or 2 for Clapeyron phase transitionslibrary::Union{Nothing, String}: [only for Type=dylib] path of the compiled phase transition plugin (as returned bybuild_phase_transition_plugin); a relative path is relative to the directory in which LaMEM runs (model.Output.out_dir)
`Type="dylib"` activates a user-defined phase transition rule, written in Julia and compiled into a
shared library (a LaMEM plugin) with `build_phase_transition_plugin`; `library` is the path of that
library and all other fields are ignored. LaMEM calls the rule every time step on all markers, after the
built-in phase transitions. A model can have at most one such entry, and does not need `Phasetrans=1`
for it. Example:
library = build_phase_transition_plugin("ptlib_myrule.jl")
add_phasetransition!(model, PhaseTransition(Type="dylib", library=library))LaMEM.LaMEM_Model.Scaling Type
Scaling{T} is a structure that contains the scaling info, employed in the current simulationScaling::Any: Scaling object (as in GeoParams), which can beGEO_units(),NO_units(), orSI_units()
LaMEM.LaMEM_Model.Softening Type
Defines strain softening parametersID::Int64: softening law IDAPS1::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 ratioLm::Union{Nothing, Float64}: Material length scale (in selected units, e.g. km in geo)APSheal2::Union{Nothing, Float64}: APS when healTau2 activateshealTau::Union{Nothing, Float64}: healing timescale parameter [Myr]healTau2::Union{Nothing, Float64}: healing timescale parameter [Myr] starting at APS=APSheal2
LaMEM.LaMEM_Model.SolutionParams Type
Structure that contains the LaMEM global solution parameters.gravity::Vector{Float64}: gravitational acceleration vectorFSSA::Float64: free surface stabilization parameter [0 - 1]; The value has to be between 0 and 1shear_heat_eff::Float64: shear heating efficiency parameter [0 - 1]Adiabatic_Heat::Float64: Adiabatic Heating activation flag and efficiency. [0.0 - 1.0] (e.g., 0.5 means that only 50 percent of the potential adiabatic heating affects the energy equation)act_temp_diff::Int64: temperature diffusion activation flagact_therm_exp::Int64: thermal expansion activation flagact_steady_temp::Int64: steady-state temperature initial guess activation flagsteady_temp_t::Float64: time for (quasi-)steady-state temperature initial guessnstep_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 viscosityeta_refbefore starting the simulationp_litho_visc::Int64: use lithostatic instead of dynamic pressure for creep lawsp_litho_plast::Int64: use lithostatic pressure for plasticityp_lim_plast::Int64: limit pressure at first iteration for plasticityp_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 modelgw_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 parameterget_permea::Float64: effective permeability computation activation flagrescal::Float64: stencil rescaling flag (for internal constraints, for example while computing permeability)mfmax::Float64: maximum melt fraction affecting viscosity reductionlmaxit::Int64: maximum number of local rheology iterationslrtol::Float64: local rheology iterations relative toleranceact_dike::Int64: dike activation flag (additonal term in divergence)useTk::Int64: switch to use T-dependent conductivity, 0: not activedikeHeat::Int64: switch to use Behn & Ito heat source in the dikeadiabatic_gradient::Float64: Adiabatic gradient in combination with Behn & Ito dikeCompute_velocity_gradient::Int64: compute the velocity gradient tensor 1: active, 0: not active. If active, it automatically activates the output in the .pvd filePhasetrans::Int64: Activate Phase Transitions on Particles or not, 0: not.Passive_Tracer::Int64: Activate Passive Tracers or not?
LaMEM.LaMEM_Model.Solver Type
Structure that contains the LaMEM solver options (the `<SolverOptionsStart>` block of a
LaMEM input file, LaMEM >= 3.0). Every field has LaMEM's own default value; only fields
that differ from the default are written to the input file. Tolerance fields are vectors
`[rtol, atol, maxit]` (or `[rtol, maxit]`), where `atol = -1` means automatic.
Raw PETSc options can still be passed through `PETSc_options`.
The LaMEM 2.x keywords `SolverType`, `DirectSolver`, `DirectPenalty`, `MGLevels`, `MGSweeps`,
`MGSmoother`, `MGJacobiDamp`, `MGCoarseSolver`, `MGRedundantNum` and `MGRedundantSolver` are
still accepted by the constructor and translated to the new options (with a warning).skip_defaults::Int64: specify solver options explicitly (skip the automatic defaults) [0/1]view_solvers::Int64: show the linear solver configuration [0/1]monitor_solvers::Int64: show the convergence of the linear iterations [0/1]set_linear_problem::Int64: linear problem: skip the nonlinear iterations [0/1]continue_on_fail::Int64: continue the simulation if the nonlinear solver diverged, unless a severe reason is detected [0/1]nonlinear_tolerances::Vector{Float64}: nonlinear solver: rtol, atol, maxit (atol = -1: automatic)linear_tolerances::Vector{Float64}: linear solver: rtol, atol, maxit (atol = -1: automatic)picard_to_newton::Vector{Float64}: Picard/Newton switching: picard rtol, picard minit, newton rtol, newton maxituse_line_search::Int64: use a line search in the nonlinear solver [0/1]use_eisenstat_walker::Int64: use Eisenstat-Walker adaptive linear tolerances [0/1]use_mat_free_jac::Int64: use a matrix-free Jacobian [0/1]stokes_solver::String: Stokes solver ["coupled_direct","block_direct","coupled_mg","block_mg","wbfbt"]direct_solver_type::String: direct solver package ["mumps","superlu_dist","default"(PETSc LU, sequential only)]block_tolerances::Vector{Float64}: block solves in block_mg and wbfbt: rtol, maxitpenalty::Float64: penalty parameter (only for the direct solvers)num_mg_levels::Int64: number of multigrid levels (-1: automatic)num_mat_free_levels::Int64: number of top matrix-free multigrid levels (only for coupled_mg)smoother_type::String: smoother preset ["light"(richardson + jacobi),"intermediate"(chebyshev + sor),"heavy"(gmres + bjacobi)]smoother_ksp::String: smoother KSP ["richardson","chebyshev","gmres"]smoother_pc::String: smoother PC ["jacobi","sor","bjacobi","asm"]smoother_damping::Float64: smoother damping (only for richardson)smoother_omega::Float64: smoother relaxation parameter (only for sor)smoother_num_sweeps::Int64: number of smoothing sweeps per levelcoarse_num_cpu::Int64: number of cpus for the coarse grid solve (0: all, -1: automatic)coarse_cells_per_cpu::Int64: cells per cpu on the coarse grid (only for coarse_num_cpu = -1)coarse_solver::String: coarse grid solver ["direct","hypre","bjacobi","asm"]coarse_tolerances::Vector{Float64}: coarse grid fgmres (hypre, bjacobi, asm): rtol, maxitsubdomain_num_per_cpu::Int64: subdomains per cpu (only for bjacobi and asm; -1: automatic)subdomain_cells_per_cpu::Int64: cells per subdomain (only for subdomain_num_per_cpu = -1)subdomain_overlap::Int64: subdomain overlap (only for asm)subdomain_ilu_levels::Int64: ILU levels in the subdomain solves (only for bjacobi and asm)init_thermal_solver::String: steady-state temperature solver ["mg","default"]thermal_tolerances::Vector{Float64}: thermal solver: rtol, atol, maxit (atol = -1: automatic)PETSc_options::Vector{String}: List with (optional) PETSc options
LaMEM.LaMEM_Model.Solver Method
Solver(; kwargs...)Keyword constructor. Accepts the fields of Solver and, for backwards compatibility, the LaMEM 2.x keywords SolverType, DirectSolver, DirectPenalty, MGLevels, MGSweeps, MGSmoother, MGJacobiDamp, MGCoarseSolver, MGRedundantNum, MGRedundantSolver, which are translated to the corresponding LaMEM 3.x options.
LaMEM.LaMEM_Model.Time Type
Structure that contains the LaMEM timestepping information. An explanation of the paramneters is given in the struct `Time_info`time_end::Float64: simulation end timedt::Float64: initial time stepdt_min::Float64: minimum time step (declare divergence if lower value is attempted)dt_max::Float64: maximum time stepdt_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) criterionCFLMAX::Float64: CFL criterion for elasticitynstep_max::Int64: maximum allowed number of steps (lower bound: time_end/dt_max)nstep_out::Int64: save output every n steps; Set this to -1 to deactivate saving outputnstep_rdb::Int64: save restart database every n stepsnum_dt_periods::Int64: number of time stepping periodstime_dt_periods::Vector{Int64}: timestamps where timestep should be fixed (first entry has to 0)step_dt_periods::Vector{Float64}: target timesteps ar timestamps abovenstep_ini::Int64: save output for n initial stepstime_tol::Float64: relative tolerance for time comparisons
LaMEM.LaMEM_Model.VelCylinder Type
LaMEM boundary condition internal velocty cylinder `VelCylinder` objectbaseX::Float64: X-coordinate of base of cylinderbaseY::Float64: Y-coordinate of base of cylinderbaseZ::Float64: Z-coordinate of base of cylindercapX::Float64: X-coordinate of cap of cylindercapY::Float64: Y-coordinate of cap of cylindercapZ::Float64: Z-coordinate of cap of cylinderradius::Float64: radius of cylindervx::Union{Nothing, Float64}: Vx velocity of cylinder (default is unconstrained)vy::Union{Nothing, Float64}: Vy velocity of cylinder (default is unconstrained)vz::Union{Nothing, Float64}: Vz velocity of cylinder (default is unconstrained)advect::Int64: cylinder advection flagvmag::Float64: magnitude of velocity applied along the cylinder's axis of orientationtype::String: velocity profile [uniform or parabolic]
LaMEM.LaMEM_Model.VelocityBox Type
VelocityBoxDefines a velocity region within the modelling domain by specifying its center point and width along the three axes.
cenX::Float64: X-coordinate of center of boxcenY::Float64: Y-coordinate of center of boxcenZ::Float64: Z-coordinate of center of boxwidthX::Float64: Width of box in x-directionwidthY::Float64: Width of box in y-directionwidthZ::Float64: Width of box in Z-directionvx::Union{Nothing, Float64}: Vx velocity of box (default is unconstrained)vy::Union{Nothing, Float64}: Vx velocity of box (default is unconstrained)vz::Union{Nothing, Float64}: Vx velocity of box (default is unconstrained)advect::Int64: box advection flag
LaMEM.IO_functions.project_onto_crosssection Method
project_onto_crosssection(model::Model, Cross::CartData)Reads the output of a LaMEM simulation and projects it onto a 2D cross-section Cross
LaMEM.LaMEM_Model.Check_LaMEM_Model Method
Check_LaMEM_Model(m::Model; warn_constant_grid=true)Checks the LaMEM Setup Model m for errors.
warn_constant_grid toggles the warning that is emitted when both the initial Phases and Temp grids are constant. Set it to false for intentionally uniform setups (e.g. the 0D rheology benchmark in stress_strainrate_0D).
LaMEM.LaMEM_Model.LaMEMPlugin_path Method
LaMEMPlugin_path()Absolute path of LaMEMPlugin.jl, the helper module that every phase-transition rule includes (it defines MarkerView, update, lamem_pt_wrapper, ... and the functions LaMEM uses to check the plugin interface). It is shipped with LaMEM.jl and matches the plugin interface (ABI v3) of the LaMEM_jll this package uses.
A rule file is compiled in a separate Julia process in which LaMEM.jl is not loaded, so it includes the helper by path, by convention from its own directory:
include(joinpath(@__DIR__, "LaMEMPlugin.jl"))
using .LaMEMPluginbuild_phase_transition_plugin copies the file next to the rule file if it is not there yet.
LaMEM.LaMEM_Model.above_surface! Method
above_surface!(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.
LaMEM.LaMEM_Model.add_dike! Method
add_dike!(model::Model, dike::Dike)This adds a phase transition phase_trans to model
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:
GeomSphereGeomEllipsoidGeomBoxGeomLayerGeomCylinderGeomRidgeSegGeomHex
LaMEM.LaMEM_Model.add_geom! Method
add_geom!(model::Model, geom_object)Add several geometric objects @ once.
sourceLaMEM.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")LaMEM.LaMEM_Model.add_phase! Method
add_phase!(model::Model, phase::Phase)This adds a phase (with material properties) to model
LaMEM.LaMEM_Model.add_phase! Method
add_phase!(model::Model, phases...)Add several phases @ once.
sourceLaMEM.LaMEM_Model.add_phaseaggregate! Method
add_phaseaggregate!(model::Model, phaseagg::PhaseAggregate)This adds a phase aggregate law phaseagg to model
LaMEM.LaMEM_Model.add_phasetransition! Method
add_phasetransition!(model::Model, phase_trans::PhaseTransition)This adds a phase transition phase_trans to model
LaMEM.LaMEM_Model.add_softening! Method
add_softening!(model::Model, soft::Softening)This adds a plastic softening law soft to model
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
sourceLaMEM.LaMEM_Model.add_vbox! Method
add_vbox!(model::Model, vboxes...)Add several phases @ once.
sourceLaMEM.LaMEM_Model.add_vbox! Method
add_vbox!(model::Model, vbox::VelocityBox)This adds a vbox (with its properties) to model
LaMEM.LaMEM_Model.below_surface! Method
below_surface!(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.
LaMEM.LaMEM_Model.build_phase_transition_plugin Method
library = build_phase_transition_plugin(rule_file::String; output_dir=dirname(rule_file), julia_env=nothing)Compiles the phase-transition rule in rule_file with JuliaC into a LaMEM plugin and returns the absolute path of the library, which is activated in a model with add_phasetransition!(model, PhaseTransition(Type="dylib", library=library)).
The plugin is named after the rule file, without extension and without ptlib_: ptlib_myrule.jl gives the bundle directory <output_dir>/build_myrule, with the library lib/libptlib_myrule.so (Linux), lib/libptlib_myrule.dylib (macOS) or bin/libptlib_myrule.dll (Windows). A bundle left over from an earlier build is removed first. The library needs the other files of its bundle, so always keep (or move) the whole build_<name> directory.
The rule file includes the helper module LaMEMPlugin.jl from its own directory (see LaMEMPlugin_path). If there is no LaMEMPlugin.jl next to rule_file, the one shipped with LaMEM.jl is copied there; an existing one is used as is.
Keyword arguments:
output_dir: directory in which the bundlebuild_<name>is created (default: the directory ofrule_file)julia_env: Julia environment used for the build, which must be able to installJuliaC(it is installed there if needed); a directory or a named environment such as"@juliac". By default, a temporary environment is created at the first call of a session and reused for later builds.
The build runs in a separate julia process (the same julia as the current session, which must be ≥ 1.12) and can take a few minutes.
Example
julia> library = build_phase_transition_plugin("ptlib_myrule.jl")
".../build_myrule/lib/libptlib_myrule.so"
julia> add_phasetransition!(model, PhaseTransition(Type="dylib", library=library))LaMEM.LaMEM_Model.copy_phase Method
copy_phase(phase::Phase; kwargs...)This copies a phase with material properties, while allowing to change some parameters
sourceLaMEM.LaMEM_Model.create_initialsetup Function
create_initialsetup(model::Model, cores::Int64=1, args::String=""; verbose=verbose)Creates the initial model setup of LaMEM from model, which includes:
- Writing the LaMEM (*.dat) input file
and in case we do not employ geometric primitives to create the setup:
Write the VTK file (if requested when
model.Output.write_VTK_setup=true)Write the marker files to disk (if
model.ModelSetup.msetup="files")
LaMEM.LaMEM_Model.cross_section Function
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
sourceLaMEM.LaMEM_Model.cross_section Function
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
LaMEM.LaMEM_Model.hasplasticity Method
hasplasticity(p::Phase)true if p contains plastic parameters (cohesion or friction angle)
LaMEM.LaMEM_Model.isdefault Method
isdefault(s1::S, s_default::S)Checks whether a struct s1 has default parameters s_default
LaMEM.LaMEM_Model.prepare_lamem Function
prepare_lamem(model::Model, cores::Int64=1, args::String=""; verbose=false, add_APS=false)Prepares a LaMEM run for the parameters specified in model, without running the simulation: 1) Create the *.dat file 2) Write markers to disk in case we use a "files" setup
This is useful if you want to prepare a model on one machine but run it on another one (e.g. a cluster).
add_APS: iftrue, write accumulated plastic strain (APS) to marker files (requires LaMEM ≥ 2.2.1)
Set model.Output.write_VTK_setup to true if you want to write a VTK file of the model setup.
LaMEM.LaMEM_Model.print_short Method
This creates a single string, so we can use it in the command line
sourceLaMEM.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.
LaMEM.LaMEM_Model.rm_geom! Method
rm_geom!(model::Model)This removes all existing geometric objects from model
LaMEM.LaMEM_Model.rm_last_phase! Method
rm_last_phase!(model::Model, phase::Phase)This removes the last added phase from model
LaMEM.LaMEM_Model.rm_last_vbox! Method
rm_last_vbox!(model::Model)This removes the last added vbox from model
LaMEM.LaMEM_Model.rm_phase! Method
rm_phase!(model::Model, ID::Int64)This removes a phase with ID from model
LaMEM.LaMEM_Model.rm_phase! Method
rm_phase!(model::Model)This removes all existing phases from model
LaMEM.LaMEM_Model.rm_vbox! Method
rm_vbox!(model::Model)This removes all existing velocity boxes from model
LaMEM.LaMEM_Model.set_air Method
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
sourceLaMEM.LaMEM_Model.set_geom! Method
set_geom!(model::Model, d::GeomSphere)Sets the geometry of the model using the GeomSphere geometric primitive d. This populates model.Grid.Phases and model.Grid.Temp using the GMG sphere primitive.
LaMEM.LaMEM_Model.stress_strainrate_0D Method
τ = stress_strainrate_0D(rheology, ε_vec::Vector; n=8, T=700, nstep_max=2, clean=true)Computes the stress for a given strain rate and 0D rheology setup, for viscous creep rheologies. n is the resolution in x,z, T the temperature, nstep_max the number of time steps, ε_vec the strainrate vector (in 1/s).
LaMEM.LaMEM_Model.write_LaMEM_inputFile Function
write_LaMEM_inputFile(d::Model,fname::String; dir=pwd())Writes a LaMEM input file based on the data stored in Model
sourceLaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::BoundaryConditions)Writes the boundary conditions related parameters to file
sourceLaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::FastScape)Writes the <FastScapeStart> ... <FastScapeEnd> block to file
LaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::FreeSurface)Writes the free surface related parameters to file
sourceLaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::GeomEllipsoid)LaMEM.LaMEM_Model.write_LaMEM_inputFile Method
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)LaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::Output)Writes the free surface related parameters to file
sourceLaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::ModelSetup)Writes options related to the Model Setup to disk
sourceLaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::Output)Writes the free surface related parameters to file
sourceLaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::PassiveTracers)Writes the boundary conditions related parameters to file
sourceLaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::Scaling)Writes the scaling/units section to the LaMEM input file io.
LaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::SolutionParams)Writes the boundary conditions related parameters to file
sourceLaMEM.LaMEM_Model.write_LaMEM_inputFile Method
write_LaMEM_inputFile(io, d::Solver)Writes the solver options (<SolverOptionsStart> block) to file
LaMEM.Run.run_lamem Function
run_lamem(model::Model, cores::Int64=1, args::String=""; wait=true, add_APS=false, logfile=nothing)Performs a LaMEM run for the parameters specified in model.
cores: number of MPI cores to useargs: additional command-line arguments passed to LaMEMwait: iftrue, wait for the simulation to finish before returningadd_APS: iftrue, write accumulated plastic strain (APS) to marker files. Requires LaMEM ≥ 2.2.1 (header 1211215). Default isfalse(LaMEM ≥ 2.2.0).logfile: if given, the LaMEM output is written to this file in addition to being shown in the REPL. A name without an extension gets".log"appended, and a relative name ends up inmodel.Output.out_dir, next to the other output of the run.append: whether to add the output to an existing logfile instead of replacing it. By default this happens for a restart (argscontaining-mode restart), so that the log of a simulation that was restarted stays in one file.
Example
julia> run_lamem(model, 1, logfile="test") # saved to <out_dir>/test.log
julia> run_lamem(model, 1, "-mode restart", logfile="test") # appended to the same file
