Numerical model setups
In order to generate numerical simulations from setups created with GeophysicalModelGenerator.jl, we provide a few routines that directly create setups.
The routines provided here have the following functionality:
Add lithospheric boxes to a setup, that may have a layered structure and various thermal structures
Add various geometries (spheres, cuylinders, ellipsoids)
Add lithospheric structure
Add various 1D thermal structures (and possibilities to combine them)
Map-view outlines of plates, weak zones, faults and trenches can be drawn in any vector graphics program, such as Inkscape, Affinity or Illustrator, exported as SVG and read with read_outlines, which returns them in drawing order: closed ones as polygons for add_plate!, open ones as Trace of add_fault! and Trench. Name each shape (or its layer) after the outline it represents, and draw a reference line whose end points have known model coordinates, or let the page span the model domain. write_outlines stores outlines as a CSV file.
Layers with curved or perturbed interfaces, listric faults, faults with a curved trace and Gaussian thermal anomalies are shown in the tutorial Curved layers, curved faults and thermal anomalies.
Functions
GeophysicalModelGenerator.add_box! Function
add_box!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::Tuple = (20,100), [ylim::Tuple = (1,10)], zlim::Tuple = (10,80),
Origin=nothing, StrikeAngle=0, DipAngle=0,
phase = ConstantPhase(1),
T=nothing,
segments=nothing,
cell=false )Adds a box with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models
Parameters
Phase- Phase array (consistent with Grid)Temp- Temperature array (consistent with Grid)Grid- grid structure (can be any of the grid types inGMG)xlim- left/right coordinates of boxylim- front/back coordinates of box [optional; if not specified we use the whole box]zlim- bottom/top coordinates of boxOrigin- the origin, used to rotate the box around. Default is the left-front-top corner. Depths of the phase and temperature structures are measured from the top of the box, whereverOriginliesStrikeAngle- strike angle of slabDipAngle- dip angle of slabphase- specifies the phase of the box. SeeConstantPhase(),LithosphericPhases();nothingkeeps the phasesT- specifies the temperature of the box. SeeConstantTemp(),LinearTemp(),HalfspaceCoolingTemp(),SpreadingRateTemp(),LithosphericTemp()segments- optional parameter to define multiple ridge segments within the box, forT = SpreadingRateTemp()cell- if true,PhaseandTempare defined on centers
Examples
Example 1) Box with constant phase and temperature & a dip angle of 10 degrees:
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
LaMEM Grid:
nel : (32, 32, 32)
marker/cell : (3, 3, 3)
markers : (96, 96, 96)
x ϵ [-3.0 : 3.0]
y ϵ [-2.0 : 2.0]
z ϵ [-2.0 : 0.0]
julia> Phases = zeros(Int32, size(Grid.X));
julia> Temp = zeros(Float64, size(Grid.X));
julia> add_box!(Phases,Temp,Grid, xlim=(0,500), zlim=(-50,0), phase=ConstantPhase(3), DipAngle=10, T=ConstantTemp(1000))
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"Example 2) Box with halfspace cooling profile
julia> Grid = CartData(xyz_grid(-1000:10:1000,0,-660:10:0))
julia> Phases = zeros(Int32, size(Grid));
julia> Temp = zeros(Float64, size(Grid));
julia> add_box!(Phases,Temp,Grid, xlim=(0,500), zlim=(-50,0), phase=ConstantPhase(3), DipAngle=10, T=HalfspaceCoolingTemp(Age=30))
julia> Grid = addfield(Grid, (;Phases,Temp)); # Add to Cartesian model
julia> write_paraview(Grid,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"Example 3) Box with ridge thermal structure ```julia-repl julia> Grid = CartData(xyz_grid(-1000:10:1000, -1000:10:1000, -660:5:0)) julia> Phases = fill(2, size(Grid)); julia> Temp = fill(1350.0, size(Grid)); julia> segments = [((-500.0, -1000.0), (-500.0, 0.0)), ((-250.0, 0.0), (-250.0, 200.0)), ((-750.0, 200.0), (-750.0, 1000.0))]; julia> lith = LithosphericPhases(Layers=[15 55], Phases=[1 2], Tlab=1250); julia> add_box!(Phases, Temp, Grid; xlim=(-1000.0, 0.0), ylim=(-500.0, 500.0), zlim=(-80.0, 0.0), phase=lith, T=SpreadingRateTemp(SpreadingVel=3), segments=segments) julia> Grid = addfield(Grid, (; Phases, Temp)); # Add to Cartesian model julia> write_paraview(Grid, "Ridge_Thermal_Structure") # Save model to Paraview 1-element Vector{String}: "Ridge_Thermal_Structure.vts"
sourceadd_box!(Phase, Temp, Grid::AbstractGeneralGrid,
bounds::AbstractVector{<:AbstractVector{<:Real}};
Origin = nothing, StrikeAngle = 0, DipAngle = 0,
phase = ConstantPhase(1),
T = nothing,
segments = nothing,
cell = false )Add box function but getting bounds as a vector bounds in a way of [[xmin,xmax],[ymin,ymax],[zmin,zmax]]. If bounds is empty return nothing
sourceGeophysicalModelGenerator.add_layer! Function
add_layer!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::Tuple = (1,100), [ylim::Tuple = (0,20)], zlim::Tuple = (0,-100),
phase = ConstantPhase(1),
T=nothing, cell=false )Adds a layer with phase & temperature structure to a 3D model setup. The most common use would be to add a lithospheric layer to a model setup. This simplifies creating model geometries in geodynamic models
Parameters
Phase- Phase array (consistent with Grid)Temp- Temperature array (consistent with Grid)Grid- grid structure (usually obtained with read_LaMEM_inputfile, but can also be other grid types)xlim- left/right coordinates of boxylim- front/back coordinates of boxzlim- bottom/top coordinates of box. Each bound is either a number, a functionz(x, y), or a surfaceCartData(e.g. imported topography or a Moho map), which gives a layer with a curved or perturbed bottom or top surface. A surface must coverxlimandylim.phase- specifies the phase of the box. SeeConstantPhase(),LithosphericPhases();nothingkeeps the phasesT- specifies the temperature of the box. SeeConstantTemp(),LinearTemp(),HalfspaceCoolingTemp(),SpreadingRateTemp()
Numeric limits may be given in either order. Thermal and phase structures see the vertical coordinate z - top(x, y), the (negative) depth below the top of the layer, so that the layers of LithosphericPhases and the profile of HalfspaceCoolingTemp start at the top of the layer, whether it is a number or a curved surface. LinearTemp goes from Ttop at the top to Tbot at the bottom of the layer at every (x, y).
Examples
Example 1) Layer with constant phase and temperature
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
LaMEM Grid:
nel : (32, 32, 32)
marker/cell : (3, 3, 3)
markers : (96, 96, 96)
x ϵ [-3.0 : 3.0]
y ϵ [-2.0 : 2.0]
z ϵ [-2.0 : 0.0]
julia> Phases = zeros(Int32, size(Grid.X));
julia> Temp = zeros(Float64, size(Grid.X));
julia> add_layer!(Phases,Temp,Grid, zlim=(-50,0), phase=ConstantPhase(3), T=ConstantTemp(1000))
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"Example 2) Box with halfspace cooling profile
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
julia> Phases = zeros(Int32, size(Grid.X));
julia> Temp = zeros(Float64, size(Grid.X));
julia> add_layer!(Phases,Temp,Grid, zlim=(-50,0), phase=ConstantPhase(3), T=HalfspaceCoolingTemp())
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"Example 3) Layer with a sinusoidal bottom surface, as for a Rayleigh-Taylor instability
julia> Grid = CartData(xyz_grid(-3:0.05:3, 0, -2:0.05:0))
julia> Phases = zeros(Int32, size(Grid));
julia> Temp = zeros(Float64, size(Grid));
julia> add_layer!(Phases, Temp, Grid, zlim=((x, y) -> -0.5 + 0.05cospi(x), 0), phase=ConstantPhase(1))GeophysicalModelGenerator.add_sphere! Function
add_sphere!(Phase, Temp, Grid::AbstractGeneralGrid; cen::Tuple = (0,0,-1), radius::Number,
phase = ConstantPhase(1).
T=nothing, cell=false )Adds a sphere with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models. Depths in phase and T are measured below the top of the sphere.
Parameters
Phase- Phase array (consistent with Grid)Temp- Temperature array (consistent with Grid)Grid- LaMEM grid structure (usually obtained with read_LaMEM_inputfile)cen- center coordinates of sphereradius- radius of spherephase- specifies the phase of the box. SeeConstantPhase(),LithosphericPhases();nothingkeeps the phasesT- specifies the temperature of the box. SeeConstantTemp(),LinearTemp(),HalfspaceCoolingTemp(),SpreadingRateTemp()cell- if true,PhaseandTempare defined on cell centers
Example
Sphere with constant phase and temperature:
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
LaMEM Grid:
nel : (32, 32, 32)
marker/cell : (3, 3, 3)
markers : (96, 96, 96)
x ϵ [-3.0 : 3.0]
y ϵ [-2.0 : 2.0]
z ϵ [-2.0 : 0.0]
julia> Phases = zeros(Int32, size(Grid.X));
julia> Temp = zeros(Float64, size(Grid.X));
julia> add_sphere!(Phases,Temp,Grid, cen=(0,0,-1), radius=0.5, phase=ConstantPhase(2), T=ConstantTemp(800))
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"GeophysicalModelGenerator.add_ellipsoid! Function
add_ellipsoid!(Phase, Temp, Grid::AbstractGeneralGrid; cen::Tuple = (-1,-1,-1), axes::Tuple = (0.2,0.1,0.5),
Origin=nothing, StrikeAngle=0, DipAngle=0,
phase = ConstantPhase(1).
T=nothing, cell=false )Adds an Ellipsoid with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models. Depths in phase and T are measured below the top of the ellipsoid.
Parameters
Phase- Phase array (consistent with Grid)Temp- Temperature array (consistent with Grid)Grid- LaMEM grid structure (usually obtained with read_LaMEM_inputfile)cen- center coordinates of sphereaxes- semi-axes of ellipsoid in X,Y,ZOrigin- the origin, used to rotate the box around. Default is the left-front-top cornerStrikeAngle- strike angle of slabDipAngle- dip angle of slabphase- specifies the phase of the box. SeeConstantPhase(),LithosphericPhases();nothingkeeps the phasesT- specifies the temperature of the box. SeeConstantTemp(),LinearTemp(),HalfspaceCoolingTemp(),SpreadingRateTemp()cell- if true,PhaseandTempare defined on cell centers
Example
Ellipsoid with constant phase and temperature, rotated 90 degrees and tilted by 45 degrees:
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
LaMEM Grid:
nel : (32, 32, 32)
marker/cell : (3, 3, 3)
markers : (96, 96, 96)
x ϵ [-3.0 : 3.0]
y ϵ [-2.0 : 2.0]
z ϵ [-2.0 : 0.0]
julia> Phases = zeros(Int32, size(Grid.X));
julia> Temp = zeros(Float64, size(Grid.X));
julia> add_ellipsoid!(Phases,Temp,Grid, cen=(-1,-1,-1), axes=(0.2,0.1,0.5), StrikeAngle=90, DipAngle=45, phase=ConstantPhase(3), T=ConstantTemp(600))
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"GeophysicalModelGenerator.add_cylinder! Function
add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; base::Tuple = (-1,-1,-1.5), cap::Tuple = (-1,-1,-0.5), radius::Number,
phase = ConstantPhase(1),
T=nothing, cell=false )Adds a cylinder with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models. Depths in phase and T are measured below the top of the cylinder.
Parameters
Phase- Phase array (consistent with Grid)Temp- Temperature array (consistent with Grid)Grid- Grid structure (usually obtained withread_LaMEM_inputfile)base- center coordinate of bottom of cylindercap- center coordinate of top of cylinderradius- radius of the cylinderphase- specifies the phase of the box. SeeConstantPhase(),LithosphericPhases();nothingkeeps the phasesT- specifies the temperature of the box. SeeConstantTemp(),LinearTemp(),HalfspaceCoolingTemp(),SpreadingRateTemp()cell- if true,PhaseandTempare defined on cell centers
Example
Cylinder with constant phase and temperature:
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
LaMEM Grid:
nel : (32, 32, 32)
marker/cell : (3, 3, 3)
markers : (96, 96, 96)
x ϵ [-3.0 : 3.0]
y ϵ [-2.0 : 2.0]
z ϵ [-2.0 : 0.0]
julia> Phases = zeros(Int32, size(Grid.X));
julia> Temp = zeros(Float64, size(Grid.X));
julia> add_cylinder!(Phases,Temp,Grid, base=(-1,-1,-1.5), cap=(1,1,-0.5), radius=0.25, phase=ConstantPhase(4), T=ConstantTemp(400))
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"GeophysicalModelGenerator.add_stripes! Function
add_stripes!(Phase, Grid::AbstractGeneralGrid;
stripAxes = (1,1,0),
stripeWidth = 0.2,
stripeSpacing = 1,
Origin = nothing,
StrikeAngle = 0,
DipAngle = 0,
phase = ConstantPhase(3),
stripePhase = ConstantPhase(4),
cell = false)Adds stripes to a pre-defined phase (e.g. added using add_box!)
Parameters
Phase- Phase array (consistent with Grid)Grid- grid structure (usually obtained with read_LaMEM_inputfile, but can also be other grid types)stripAxes- sets the axis for which we want the stripes. Default is (1,1,0) i.e. X, Y and not ZstripeWidth- width of the stripestripeSpacing- space between two stripesOrigin- the origin, used to rotate the stripes around. Default is the corner of the grid with the maximum x, y and zStrikeAngle- strike angleDipAngle- dip anglephase- specifies the phase we want to apply stripes tostripePhase- specifies the stripe phasecell- if true,PhaseandTempare defined on centers
Example
Example: Box with striped phase and constant temperature & a dip angle of 10 degrees:
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
LaMEM Grid:
nel : (32, 32, 32)
marker/cell : (3, 3, 3)
markers : (96, 96, 96)
x ϵ [-3.0 : 3.0]
y ϵ [-2.0 : 2.0]
z ϵ [-2.0 : 0.0]
julia> Phases = zeros(Int32, size(Grid.X));
julia> Temp = zeros(Float64, size(Grid.X));
julia> add_box!(Phases,Temp,Grid, xlim=(0,500), zlim=(-50,0), phase=ConstantPhase(3), DipAngle=10, T=ConstantTemp(1000))
julia> add_stripes!(Phases, Grid, stripAxes=(1,1,1), stripeWidth=0.2, stripeSpacing=1, Origin=nothing, StrikeAngle=0, DipAngle=10, phase=ConstantPhase(3), stripePhase=ConstantPhase(4))
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"GeophysicalModelGenerator.add_slab! Function
add_slab!(Phase, Temp, Grid::AbstractGeneralGrid, trench::Trench; phase = ConstantPhase(1), T = nothing, cell=false)Adds a curved slab with phase & temperature structure to a 3D model setup.
Parameters
Phase- Phase array (consistent with Grid)Temp- Temperature array (consistent with Grid)Grid- grid structure (can be any of the grid types inGMG)trench- Trench structurephase- specifies the phase of the box. SeeConstantPhase(),LithosphericPhases();nothingkeeps the phasesT- specifies the temperature of the box. SeeConstantTemp(),LinearTemp(),HalfspaceCoolingTemp(),SpreadingRateTemp(),LithosphericTemp()cell- if true,PhaseandTempare defined on cells
Examples
Example 1) Slab
julia> x = LinRange(0.0,1200.0,128);
julia> y = LinRange(0.0,1200.0,128);
julia> z = LinRange(-660,50,128);
julia> Cart = CartData(xyz_grid(x, y, z));
julia> Phase = ones(Int64,size(Cart));
julia> Temp = fill(1350.0,size(Cart));
# Define the trench:
julia> trench= Trench(Start = (400.0,400.0), End = (800.0,800.0), θ_max = 45.0, direction = 1.0, n_seg = 50, Length = 600.0, Thickness = 80.0, Lb = 500.0, d_decoupling = 100.0, type_bending =:Ribe)
julia> phase = LithosphericPhases(Layers=[5 7 88], Phases = [2 3 4], Tlab=nothing)
julia> TsHC = HalfspaceCoolingTemp(Tsurface=20.0, Tmantle=1350, Age=30, Adiabat=0.4)
julia> add_slab!(Phase, Temp, Cart, trench, phase = phase, T = TsHC)add_slab!(Phase, Temp, Grid::AbstractGeneralGrid, slab::BezierSlab; phase = ConstantPhase(1), T = nothing, cell = false)Adds a slab whose top is a Bézier surface, see BezierSlab.
GeophysicalModelGenerator.add_fault! Function
add_fault!(Phase, Temp, Grid::AbstractGeneralGrid;
Start=(20,100), End=(10,80),
Trace=nothing,
Fault_thickness=10.0,
Depth_extent=nothing,
DipAngle=0e0,
DetachmentDepth=nothing,
phase=ConstantPhase(1),
T=nothing,
cell=false)Adds a fault to the given 3D grid by modifying the Phase and Temp arrays. For a 2D grid, use add_box instead. Depths in phase and T are measured below the top of the fault's Depth_extent.
Arguments
Phase: Phase arrayTemp: Temp arrayGrid: The grid on which the fault is to be added.Start: Tuple representing the starting coordinates of the fault (X, Y).End: Tuple representing the ending coordinates of the fault (X, Y).Trace: If notnothing, the surface trace of the fault as a polyline of two or more points(X, Y), which replacesStartandEnd. The fault follows the curved trace, and its dip is perpendicular to it.Fault_thickness: Thickness of the fault.Depth_extent: Depth extent of the fault. Ifnothing, the fault extends through the entire domain.DipAngle: Dip angle of the fault, measured from the vertical. A positive angle dips to the right of the direction fromStarttoEnd(or alongTrace).DetachmentDepth: Ifnothing, the fault is planar. Otherwise, the fault is listric: it starts withDipAngleatz = 0and flattens with depth into a horizontal detachment atz = -DetachmentDepth, followingz = -DetachmentDepth * (1 - exp(-h / (DetachmentDepth * tand(DipAngle))))at a horizontal distancehfrom the trace. The thickness is accurate where the curvature radius exceedsFault_thickness.phase: Phase to be assigned to the fault;nothingkeeps the phasesT: Temperature to be assigned to the fault. Ifnothing, the temperature is not modified.
Example
add_fault!(Phase, Temp, Grid;
Start=(20,100), End=(10,80),
Fault_thickness=10.0,
Depth_extent=(-25.0, 0.0),
DipAngle=-10.0,
phase=ConstantPhase(1)
)Listric normal fault that flattens into a detachment at 15 km depth:
add_fault!(Phase, Temp, Grid;
Start=(50,0), End=(50,100),
Fault_thickness=2.0,
DipAngle=30.0,
DetachmentDepth=15.0,
phase=ConstantPhase(1)
)Fault with a curved surface trace, dipping towards the center of the arc:
add_fault!(Phase, Temp, Grid;
Trace=[(50 + 40cosd(a), 50 + 40sind(a)) for a in 0:10:180],
Fault_thickness=2.0,
DipAngle=-30.0,
phase=ConstantPhase(1)
)GeophysicalModelGenerator.make_volc_topo Function
make_volc_topo(Grid::Union{LaMEM_grid, CartData}; center, height, radius, crater=0.0, base=0.0, background=nothing)
Creates a generic volcano topography (cones and truncated cones). For a LaMEM_grid it returns a CartData with the topography as field Topography; for a CartData it returns the topography as a Matrix.
Parameters
Grid - LaMEM grid (created by read_LaMEM_inputfile)
center - x- and -coordinates of center of volcano
height - height of volcano
radius - radius of volcano
Optional Parameters
crater - this will create a truncated cone and the option defines the radius of the flat top
base - this sets the flat topography around the volcano
background - this allows loading in a topography and only adding the volcano on top (also allows stacking of several cones to get a volcano with different slopes)
Example
Cylinder with constant phase and temperature:
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
LaMEM Grid:
nel : (32, 32, 32)
marker/cell : (3, 3, 3)
markers : (96, 96, 96)
x ϵ [-3.0 : 3.0]
y ϵ [-2.0 : 2.0]
z ϵ [-2.0 : 0.0]
julia> Topo = make_volc_topo(Grid, center=[0.0,0.0], height=0.4, radius=1.5, crater=0.5, base=0.1)
CartData
size : (33, 33, 1)
x ϵ [ -3.0 : 3.0]
y ϵ [ -2.0 : 2.0]
z ϵ [ 0.1 : 0.4]
fields : (:Topography,)
attributes: ["note"]
julia> Topo = make_volc_topo(Grid, center=[0.0,0.0], height=0.8, radius=0.5, crater=0.0, base=0.4, background=Topo.fields.Topography)
CartData
size : (33, 33, 1)
x ϵ [ -3.0 : 3.0]
y ϵ [ -2.0 : 2.0]
z ϵ [ 0.1 : 0.8]
fields : (:Topography,)
attributes: ["note"]
julia> write_paraview(Topo,"VolcanoTopo") # Save topography to paraview
Saved file: VolcanoTopo.vtsGeophysicalModelGenerator.ConstantTemp Type
ConstantTemp(T=1000)Sets a constant temperature inside the box
Parameters
- T : the value
GeophysicalModelGenerator.LinearTemp Type
LinearTemp(Ttop=0, Tbot=1350)Set a linear temperature structure from top to bottom.
Ttop is applied at the top of the region the structure is added to (e.g. the top of the box or polygon) and Tbot at its bottom, wherever these are located; the temperature varies linearly in between.
Parameters
Ttop : the value @ the top
Tbot : the value @ the bottom
GeophysicalModelGenerator.HalfspaceCoolingTemp Type
HalfspaceCoolingTemp(Tsurface=0, Tmantle=1350, Age=60, Adiabat=0)Sets a halfspace temperature structure in plate.
Tsurface is applied at the top of the region the structure is added to (e.g. the top of the box or polygon), and the depth used in the cooling model is measured from there.
Parameters
Tsurface : surface temperature [C]
Tmantle : mantle temperature [C]
Age : Thermal Age of plate [Myrs]
Adiabat : Mantle Adiabat [K/km]
GeophysicalModelGenerator.SpreadingRateTemp Type
SpreadingRateTemp(Tsurface=0, Tmantle=1350, Adiabat=0, MORside="left",SpreadingVel=3, AgeRidge=0, maxAge=60)Sets a halfspace temperature structure within the box, combined with a spreading rate (which implies that the plate age varies)
Parameters
Tsurface : surface temperature [C]
Tmantle : mantle temperature [C]
Adiabat : Mantle Adiabat [K/km]
MORside : side of the box where the MOR is located ["left","right","front","back"]
SpreadingVel : spreading velocity [cm/yr]
AgeRidge : thermal age of the ridge [Myrs]
maxAge : maximum thermal Age of plate [Myrs]
Note: a thermal age of zero, at a ridge with AgeRidge = 0, is taken as 1e-6 s to avoid division by zero
GeophysicalModelGenerator.LithosphericTemp Type
LithosphericTemp(Tsurface=0.0, Tpot=1350.0, dTadi=0.5,
ubound="const", lbound="const, utbf = 50.0e-3, ltbf = 10.0e-3,
age = 120.0, dtfac = 0.9, nz = 201,
rheology = example_CLrheology()
)Calculates a 1D temperature profile [C] for variable thermal parameters including radiogenic heat source and linearly interpolates the temperature profile onto the box. The thermal parameters are defined in rheology and the structure of the lithosphere is define by LithosphericPhases().
Parameters
Tsurface : surface temperature [C]
Tpot : potential mantle temperature [C]
dTadi : adiabatic gradient [K/km]
ubound : Upper thermal boundary condition ["const","flux"]
lbound : Lower thermal boundary condition ["const","flux"]
utbf : Upper thermal heat flux [W/m]; if ubound == "flux"
ltbf : Lower thermal heat flux [W/m]; if lbound == "flux"
age : age of the lithosphere [Ma]
dtfac : Diffusion stability criterion to calculate T_age
nz : Grid spacing for the 1D profile within the box
rheology : Structure containing the thermal parameters for each phase [default example_CLrheology]
GeophysicalModelGenerator.ConstantPhase Type
ConstantPhase(phase=1)Sets a constant phase inside the box
Parameters
- phase : the value
GeophysicalModelGenerator.compute_phase Function
Phase = compute_phase(Phase, Temp, X, Y, Z, s::LithosphericPhases; Ztop = 0)or
Phase = compute_phase(Phase, Temp, Grid::LaMEM_grid, s::LithosphericPhases)This copies the layered lithosphere onto the Phase matrix.
Parameters
Phase - Phase array
Temp - Temperature array
X - x-coordinate array (consistent with Phase and Temp)
Y - y-coordinate array (consistent with Phase and Temp)
Z - Vertical coordinate array (consistent with Phase and Temp)
s - LithosphericPhases
Ztop - Vertical coordinate of top of model box
Grid - LaMEM grid (usually obtained with read_LaMEM_inputfile);
Ztopis the top of the grid
GeophysicalModelGenerator.LithosphericPhases Type
LithosphericPhases(Layers=[10 20 15], Phases=[1 2 3 4], Tlab=nothing )This allows defining a layered lithosphere. Layering is defined from the top downwards.
Parameters
Layers : The thickness of each layer, ordered from top to bottom. The thickness of the last layer does not have to be specified.
Phases : The phases of the layers, ordered from top to bottom.
Tlab : Temperature of the lithosphere asthenosphere boundary. If specified, the phases at locations with T>Tlab are set to Phases[end].
GeophysicalModelGenerator.McKenzie_subducting_slab Type
McKenzie_subducting_slabThermal structure by McKenzie for a subducted slab that is fully embedded in the mantle.
Parameters
Tsurface: Top T [C]Tmantle: Bottom T [C]Adiabat: Adiabatic gradient in K/kmv_cm_yr: Subduction velocity [cm/yr]κ: Thermal diffusivity [m2/s]it: Number iterations employed in the harmonic summation
GeophysicalModelGenerator.LinearWeightedTemperature Type
LinearWeightedTemperatureStructure that defined a linear average temperature between two temperature fields as a function of distance
Parameters
w_min: Minimum weight
w_max: Maximum weight
crit_dist: Critical distance; in
add_slab!with aTrenchanddir = :X, the length along the slab down tod_decouplingdir: Direction of the averaging (
:X,:Yor:Z)F1: First temperature field
F2: Second temperature field
GeophysicalModelGenerator.GaussianTemp Type
GaussianTemp(Amplitude=200, Width=50)Adds a Gaussian temperature anomaly to the current temperature (e.g. a geotherm set before), centered in the region it is added to (e.g. the center of a sphere or box), as for a plume head or a thermal seed:
T = T + Amplitude * exp(-((x - x0)² / Wx² + (y - y0)² / Wy² + (z - z0)² / Wz²) / 2)
Parameters
Amplitude : temperature anomaly at the center [C]; negative for a cold anomaly
Width : standard deviation of the Gaussian [km], either one value or a tuple
(Wx, Wy, Wz). A width ofInfgives a temperature that is constant along that axis, e.g.(50, 50, Inf)for a vertical plume conduit.
Choose a region that extends to about three widths from its center, so that the anomaly fades out at its edge.
sourceGeophysicalModelGenerator.Trench Type
Trench structureStructure that defines the geometry of the trench and the slab.
Parameters
Start- Start of the trench (x,y) coordinatesEnd- End of the trench (x,y) coordinatesTrace- If notnothing, the trench as a polyline of two or more (x,y) points, which replacesStartandEnd; seebezier_curvefor smooth curves. The slab bends perpendicular to the curved trench, to its left fordirection = 1and to its right fordirection = -1, and ends at the ends of the trench.n_seg- The number of segment through which the slab is discretize along the dipLength- The length of the slabThickness- The thickness of the slabLb- Critical distance through which apply the bending angle functions Lb ∈ [0,Length];θ_max- maximum angle of bending ∈ [0°,90°].direction- the direction of the dip The rotation of the coordinate system is done as such that the new X is parallel to the segment. Since the rotation is anticlockwise the coordinate y has specific values: direction tells if the subduction is directed along the positive or negative direction of the new y coordinate system. In practice, it apply an additional transformation to y by multiplying it with -1 or +1;d_decoupling- depth at which the slab is fully submerged into the mantle. ALinearWeightedTemperatureof the slab withdir = :Xblends its two structures over the length along the slab down to this depth; with anotherdir, itscrit_distis kept.type_bending- is the type of bending angle of the slab [:Linear,:Ribe]. The angle of slab changes as a function ofl(∈ [0,Length]).lis the actual distance along the slab length from the trench. In case: -:Linearmath θ(l) = ((θ_max - 0.0)/(Lb-0))*l; -:Ribemath θ(l) = θ_max*l^2*((3*Lb-2*l))/(Lb^3); which is taken from Ribe 2010 [Bending mechanics and mode selection in free subduction: a thin-sheet analysis] For l>Lb, θ(l) = θ_max;WeakzoneThickness- Thickness of the weakzone [km]WeakzonePhase- Phase of the weakzoneBending- If notnothing, the dip profile as(angle, length)pairs, e.g.[(20, 150), (80, 250)]: starting at 0° where the slab starts, the dip changes linearly to each angle (in degrees) over each length (in km) along the top of the slab. It replacesLength,Lb,θ_maxandtype_bending.Behind- Length [km] of the slab behind the trench, where the slab starts, e.g. to bend the plate before the trench.ThermalThickness- If notnothing, the thickness [km] below the top of the slab within whichadd_slab!sets the temperature, with the phases set withinThickness; e.g. to reach the mantle temperature at the base of the thermal structure of the slab.Tear- If notnothing, aTearthat thins the slab towards a slab break-off.StartandTipof the tear are distances along the trench fromStartof the trench (alongTracefor a curved trench), or map points.ThermalThicknessthins by the same factor asThickness, and the weak zone thins by it with its base on the slab surface, so that both vanish where the slab is torn.
GeophysicalModelGenerator.Tear Type
Tear(; Depth, Width, Start, Tip)Tear of a slab towards a slab break-off, for the Tear of a BezierSlab or a Trench. The slab necks around the depth Depth [km, positive downwards]: the neck starts at Start along the trench, where the slab has its full thickness, and deepens towards Tip, where the slab is torn through at Depth; beyond Tip the torn gap widens, with a detached slab below it. Width [km] is the vertical width of the neck. The tear runs in either direction along the trench.
Start and Tip are each a distance [km] along the trench (see BezierSlab and Trench), or a map point (x, y) whose nearest point on the trench in map view sets that distance; a map point beyond the ends of the trench is an error.
At a point of the slab surface at distance a along the trench and depth z, the slab thickness is multiplied by
φ = clamp(1 - A exp(-((z - Depth) / Width)²), 0, 1), A = max(0, (a - Start) / (Tip - Start))The thickness is thus continuous and full before Start; beyond Tip (A > 1) the slab is torn over the depth interval |z - Depth| ≤ Width √(log A). Thermal and phase structures see the distance below the surface stretched by 1 / φ, so that crust and thermal boundary layer thin with the slab. The temperature is then blended with the temperature T₀ before the slab is added, T₀ + φ (T_slab - T₀), so that the neck warms as it thins, and the torn gap keeps T₀.
Example
julia> tear = Tear(; Depth = 180, Width = 50, Start = 550, Tip = 770);
julia> add_slab!(Phases, Temp, Grid, BezierSlab(; Points, Thickness = 80, Tear = tear); phase = ConstantPhase(1))GeophysicalModelGenerator.BezierSlab Type
BezierSlab(; Points, Thickness = 100.0, Tear = nothing)Slab whose top is a tensor-product Bézier surface, for add_slab!. Points[i, j] = (x, y, z) are the control points: i runs along the trench and j down the dip, such that the slab dips to the right of the trench seen in the direction of increasing i. The sections Points[i, :] may differ along the trench, and a slab whose sections start horizontally joins smoothly to a plate added with add_plate! along bezier_curve(Points[:, 1]).
The slab extends Thickness below the surface, measured perpendicular to it, so the surface must bend with radii larger than Thickness. Thickness is a number or a function (x, y, z) -> thickness of the point of the surface, e.g. to thin the slab towards a slab break-off, where the thickness reaches 0. Where a function thins the slab, it is compressed: thermal and phase structures see the distance below the surface stretched to the largest thickness, so that crust and thermal boundary layer thin with the slab and the temperature stays continuous.
Tear is nothing or a Tear, which thins the slab towards a slab break-off; it multiplies Thickness, also if that is a function. The distances Start and Tip of the tear are measured in map view along the edge bezier_curve(Points[:, 1]) of the surface, the trench, from its first point; a point of the surface is as far along the trench as the point of the edge with the same parameter along the trench.
Thermal and phase structures see the slab in its own coordinates: x is an estimate of the distance along the dip (from the mean length of the control polygons in j), which McKenzie_subducting_slab uses; y is the depth of the surface above the point; and z is the distance below the surface. A LinearWeightedTemperature with dir = :Y thus blends two thermal structures with the depth of the slab surface, e.g. from half-space cooling at the trench to McKenzie_subducting_slab at the base of the overriding plate.
Example
A trench that bends in map view, with sections that steepen along it:
julia> trench = [(300.0, 0.0), (300.0, 400.0), (600.0, 600.0), (600.0, 1000.0)]; # control points along the trench
julia> section(dip) = [(0.0, 0.0), (120.0, 0.0), (220.0, -60.0), (220 + 250cosd(dip), -60 - 250sind(dip))]; # (distance, depth)
julia> dips = (30, 40, 50, 60);
julia> Points = [(trench[i][1] + section(dips[i])[j][1], trench[i][2], section(dips[i])[j][2]) for i in 1:4, j in 1:4];
julia> Grid = CartData(xyz_grid(0:20:1000, 0:20:1000, -400:20:0));
julia> Phases = zeros(Int32, size(Grid));
julia> Temp = zeros(Float64, size(Grid));
julia> add_slab!(Phases, Temp, Grid, BezierSlab(; Points, Thickness = 80.0); phase = ConstantPhase(1))GeophysicalModelGenerator.add_plate! Function
add_plate!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=(), ylim=(), zlim::Tuple = (0.0,0.8), phase = ConstantPhase(1), T=nothing, segments=nothing, cell=false )Adds a tectonic plate with phase and temperature structure to a 3D model setup. Depths in phase and T are measured below the top of the plate (the maximum of zlim). This function enables the definition of tectonic plates in the xy plane and projects them along the z-axis, providing a flexible approach to model complex plate geometries. Parameters ==========
Phase- Phase array (consistent with Grid)Temp- Temperature array (consistent with Grid)Grid- Grid structure (usually obtained with read_LaMEM_inputfile)xlim-x-coordinate of the polygon points, same ordering as ylim, number of points unlimitedylim-y-coordinate of the polygon points, same ordering as xlim, number of points unlimitedzlim-z-coordinate range for projecting the polygon (start and stop, two values)phase- Specifies the phase of the plate. SeeConstantPhase();nothingkeeps the phasesT- Specifies the temperature of the plate. SeeConstantTemp(),LinearTemp(),HalfspaceCoolingTemp(),SpreadingRateTemp()segments- Optional. Ridge segments forT = SpreadingRateTemp(), from which the plate age is measured.cell- If true,PhaseandTempare defined on cell centers
Example
Tectonic plate in the xy plane with phase and temperature structure: ```julia-repl julia> x, y, z = -1000.0:4:0.0, -1000.0:4:1000.0, -660.0:5:0.0; julia> Grid = CartData(xyz_grid(x, y, z)) Grid: nel : (512, 512, 128) marker/cell : (1, 1, 1) markers : (512, 512, 128) x ϵ [-1000.0 : 0.0] y ϵ [-1000.0 : 1000.0] z ϵ [-660.0 : 0.0] julia> Phases = zeros(Int32, size(Grid.X)) julia> Temp = zeros(Float64, size(Grid.X)) julia> segments = [ ((-500.0, -1000.0), (-500.0, 0.0)), # Segment 1 ((-250.0, 0.0), (-250.0, 200.0)), # Segment 2 ((-750.0, 200.0), (-750.0, 1000.0)) # Segment 3 ] julia> lith = LithosphericPhases(Layers=[15 55], Phases=[1 2], Tlab=1250) julia> add_plate!(Phases, Temp, Grid; xlim=(-1000.0, -750.0, -250.0, 0.0, -250.0, -750.0), ylim=(0.0, 500.0, 500.0, 0.0, -500.0, -500.0), zlim=(-150.0, 0.0), phase=lith, T=SpreadingRateTemp(SpreadingVel=3), segments=segments) julia> Grid = addfield(Grid, (; Phases, Temp)) # Add fields julia> write_paraview(Grid, "Plate") # Save model to Paraview 1-element Vector{String}: "Plate.vts"
sourceadd_plate!(Phase, Temp, Grid::AbstractGeneralGrid,
bounds::AbstractVector{<:AbstractVector{<:Real}};
phase = ConstantPhase(1),
T = nothing,
segments = nothing,
cell = false )Add plate function but getting bounds as a vector bounds in a way of [[xmin,xmax],[ymin,ymax],[zmin,zmax]]. If bounds is empty return nothing
sourceGeophysicalModelGenerator.add_polygon! Function
add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=(), ylim=(0.0,0.8), zlim=(), phase = ConstantPhase(1), T=nothing, cell=false )Adds a polygon with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models. Depths in phase and T are measured below the top of the polygon (the maximum of zlim).
Parameters
Phase- Phase array (consistent with Grid)Temp- Temperature array (consistent with Grid)Grid- Grid structure (usually obtained with read_LaMEM_inputfile)xlim-x-coordinate of the polygon points, same ordering as zlim, number of points unlimitedylim-y-coordinate, limitation in length possible (two values (start and stop))zlim-z-coordinate of the polygon points, same ordering as xlim, number of points unlimitedphase- specifies the phase of the box. SeeConstantPhase();nothingkeeps the phasesT- specifies the temperature of the box. SeeConstantTemp(),LinearTemp(),HalfspaceCoolingTemp(),SpreadingRateTemp()cell- if true,PhaseandTempare defined on cell centers
Example
Polygon with constant phase and temperature:
julia> Grid = read_LaMEM_inputfile("test_files/SaltModels.dat")
LaMEM Grid:
nel : (32, 32, 32)
marker/cell : (3, 3, 3)
markers : (96, 96, 96)
x ϵ [-3.0 : 3.0]
y ϵ [-2.0 : 2.0]
z ϵ [-2.0 : 0.0]
julia> Phases = zeros(Int32, size(Grid.X));
julia> Temp = zeros(Float64, size(Grid.X));
julia> add_polygon!(Phase, Temp, Cart; xlim=(0,0, 1.6, 2.0),ylim=(0,0.8), zlim=(0,-1,-2,0), phase = ConstantPhase(8), T=ConstantTemp(30))
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
1-element Vector{String}:
"LaMEM_ModelSetup.vts"add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid,
bounds::AbstractVector{<:AbstractVector{<:Real}};
phase = ConstantPhase(1),
T = nothing,
cell = false )Add polygon function but getting bounds as a vector bounds in a way of [[xmin,xmax],[ymin,ymax],[zmin,zmax]]. If bounds is empty return nothing
sourceGeophysicalModelGenerator.add_volcano! Function
add_volcano!( Phases, Temp, Grid::CartData; volcanic_phase, center, height, radius, crater, base, background, T, )
Adds a volcano topography (cones and truncated cones)
Parameters
Phases - Phase array (consistent with Grid)
Temp - Temperature array (consistent with Grid)
Grid - CartData
Optional Parameters
volcanic_phase - phase number of the volcano,
center - x- and -coordinates of center of volcano
height - height of volcano
radius - radius of volcano
T - temperature structure, applied to every point with a phase > 0 (all rock, not only the volcano; phase 0 is taken as air), with depth measured from the new topography, so that isotherms follow the volcano surface
crater - this will create a truncated cone and the option defines the radius of the flat top
base - this sets the flat topography around the volcano
background - this allows loading in a topography and only adding the volcano on top (also allows stacking of several cones to get a volcano with different slopes)
GeophysicalModelGenerator.compute_slab_surface Function
Top, Bot = compute_slab_surface(trench::Trench)Computes the (x,z) coordinates of the slab top, bottom surface using the mid surface of the slab as reference.
Parameters
trench-Trenchstructure that contains the relevant parameters
Method
It computes it by discretizing the slab surface in n_seg segments, and computing the average bending angle (which is a function of the current length of the slab). Next, it compute the coordinates assuming that the trench is at 0.0, and assuming a positive θ_max angle.
GeophysicalModelGenerator.compute_thermal_structure Function
compute_thermal_structure(Temp, X, Y, Z, Phase, s::SpreadingRateTemp, segments)Calculates the temperature distribution across the plate considering multiple ridge segments.
This function computes the thermal structure based on the perpendicular distance from each point to its corresponding ridge segment, and applies a thermal model using a spreading velocity and thermal age.
Parameters
Temp : Temperature field to be updated (array)
X, Y, Z : Coordinates of the points (arrays)
Phase : Phase of the material (unused)
s : SpreadingRateTemp object containing the thermal and spreading parameters
segments : List of ridge segments, where each segment is defined by two tuples representing the start and end coordinates (x1, y1) and (x2, y2) for each segment.
Note
The temperature at each point is calculated using the thermal age, which is determined by the spreading velocity and the distance from the point to the ridge segment that produced it. Consecutive segments are joined by transform faults, from the end of one segment to the start of the next; the fracture zones continue the transform faults as straight lines and separate the regions of the segments. The segments are therefore ordered along the ridge, and each pair of consecutive segments must lie on opposite sides of their transform fault.
The function works with one or more segments, and the ridge can be placed at any position within the box, not only at its boundary.
The thermal age is capped at maxAge years, and the temperature is adjusted based on the distance to the ridge and the corresponding thermal gradient.
compute_thermal_structure(Temp, X, Y, Z, Phase, s::McKenzie_subducting_slab)Compute the temperature field of a McKenzie_subducting_slab. Uses the analytical solution of McKenzie (1969) ["Speculations on the consequences and causes of plate motions"]. Depth is measured from the top of the region, and the slab thickness is the height of the region.
Parameters
=============================
Temp: Temperature arrayX: X ArrayY: Y ArrayZ: Z ArrayPhase: Phase arrays:McKenzie_subducting_slab
compute_thermal_structure(Temp, X, Y, Z, Phase, s::LinearWeightedTemperature)Weight average along distance
Do a weight average between two field along a specified direction
Given a distance (could be any array, from X,Y) -> the weight of F1 increase from the origin, while F2 decreases.
This function has been conceived for averaging the solution of McKenzie and half space cooling models, but it can be used to smooth the temperature field from continent ocean:
Select the boundary to apply;
transform the coordinate such that dist represent the perpendicular direction along which you want to apply this smoothening and in a such way that 0.0 is the point in which the weight of F1 is equal to 0.0;
Select the points that belongs to this area
compute the thermal fields
then modify F.
GeophysicalModelGenerator.bezier_curve Function
bezier_curve(points, n = 100)Returns n points along the Bézier curve with control points points, such as [(x1, y1), (x2, y2), ...]. The curve starts at the first and ends at the last control point; its degree is one less than the number of control points. The result can be used wherever a polyline is expected, e.g. as Trace of a Trench or of add_fault!, or as polygon of add_plate!. Curves joined end to end form a path; drop the first point of every following curve, as consecutive points of a trace must differ.
Example
julia> trace = bezier_curve([(400.0, 0.0), (400.0, 500.0), (700.0, 500.0), (700.0, 1000.0)], 50);
julia> trench = Trench(Trace = trace, Thickness = 80.0, θ_max = 45.0, Length = 400, Lb = 200);GeophysicalModelGenerator.read_outlines Function
outlines = read_outlines(filename; tolerance = 1.0, bounds = nothing, reference = nothing)Reads named map-view outlines, such as plate boundaries, weak zones and trenches, from a file. Returns a vector of named tuples (; name, closed, x, y) in the order of the file, which is the drawing order of an SVG file, so that later outlines can be painted over earlier ones. A closed outline is a polygon, e.g. for add_plate!(Phase, Temp, Grid; xlim = o.x, ylim = o.y, ...); only an open outline is valid as Trace of add_fault! or of a Trench, which also reject traces that turn by more than 90° between consecutive segments.
The format follows from the extension of filename:
.csv: one row per vertex with the columnsid,name,closed,x,y, as written bywrite_outlines; the rows of an outline share itsid, andclosedis 0 or 1. Lines starting with#are comments..svg: every visible shape (path,rect,circle,ellipse,line,polyline,polygon) outsidedefs, clip paths, masks, patterns, symbols and markers is an outline, so that drawings from any vector graphics program (Inkscape, Affinity, Illustrator, ...) can be read. Elements hidden bydisplay: none, such as hidden Inkscape layers, give no outlines, though they may hold the reference shape, and shapes exported as images, e.g. because they are semi-transparent, are not read. An outline is named by its attributelabel(geomIO, or Inkscape'sinkscape:label) ordata-name(Illustrator), else by the label of its closest labeled group or Inkscape layer (or the layer'sid), else by its ownid, else by theidof its closest group (the layer name in Affinity). A<use>with a label names its copy. A path with several subpaths, e.g. a polygon with holes, gives one outline of the same name per subpath. A subpath that ends at its start is closed. Curves and arcs are flattened into polylines that deviate less thantolerancefrom them, in model units. Drawing coordinates are mapped to model coordinates by one ofreference = name => ((X0, Y0), (X1, Y1)): the shapename, typically a straight line, starts at the model coordinates(X0, Y0)and ends at(X1, Y1);bounds = (xmin, xmax, ymin, ymax): the model coordinates of theviewBoxof the drawing (its page);a shape with an attribute
CoordRef = "X0,Y0 X1,Y1", as in geomIO, used if neither keyword is given.
The reference shape is not returned as an outline and must span a nonzero extent in x and y. Lengths with units (e.g.
width="10mm"of arect), arc flags written without a separator before the next number (a 5 5 0 0110 0) and<use>of a<symbol>with aviewBoxare not supported and throw an error.
Example
julia> outlines = read_outlines("MapviewSetup.svg"; tolerance = 4.0);
julia> adria = only(filter(o -> o.name == "Adria", outlines));
julia> add_plate!(Phases, Temp, Grid; xlim = adria.x, ylim = adria.y, zlim = (-110, 0), phase = LithosphericPhases(Layers = [30, 80], Phases = [10, 3, 1]))GeophysicalModelGenerator.write_outlines Function
write_outlines(filename, outlines; comment = nothing)Writes outlines, a vector of named tuples (; name, closed, x, y) as returned by read_outlines, to the CSV file filename, with one row per vertex and the columns id,name,closed,x,y. comment is written as # lines at the top, e.g. to record the source and units of the outlines.