Skip to content

Commit 3ba625e

Browse files
authored
Merge pull request #98 from APiccolo89/bk-geodynamics-tutorial_1
Small additional note to the "Tutorial_NumericalModel_3D.jl" []
2 parents cfe8b78 + 51a168e commit 3ba625e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Setup_geometry.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ function AddBox!(Phase, Temp, Grid::AbstractGeneralGrid; # requi
201201
Origin = (xlim[1], ylim[1], zlim[2]) # upper-left corner
202202
end
203203

204+
if Origin !== nothing && isa(T, McKenzie_subducting_slab)
205+
@warn "McKenzie temperature does not require the definition of 'Origin' field; if Origin is defined it must be equal to [xmin,ymin,zmax] of the box that has been defined."
206+
if Origin[1] != xlim[1] || Origin[2] != ylim[1] || Origin[3] != zlim[2]
207+
@error "Origin is not set up correctly. For fixing the problem Origin can be left blank or Origin = [xmin,ymin,zmax] of the box"
208+
end
209+
end
210+
204211
# Perform rotation of 3D coordinates:
205212
Xrot = X .- Origin[1];
206213
Yrot = Y .- Origin[2];

tutorials/Tutorial_NumericalModel_3D.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Temp = fill(1350.0, nx,ny,nz);
3333

3434
# We use a lithospheric structure, which can be specified with the `LithosphericPhases` structure, where you can indicate `Layers` (the thickness of each lithospheric layer, starting from the top), and `Phases` the phases of the corresponding layers.
3535
# Note that if the lowermost layer has the same phase as the mantle, you can define `Tlab` as the lithosphere-asthenosphere boundary which will automatically adjust the phase depending on temperature
36+
37+
# Also note that `Origin` must be set at [`xmin`,`ymin`,`zmax`] of the box, or should be left out if you use this along with the `McKenzie_subducting_slab` thermal structure.
38+
39+
3640
lith = LithosphericPhases(Layers=[15 45 10], Phases=[0 1 2])
3741
v_spreading_cm_yr = 3
3842
AddBox!(Phases, Temp, Grid; xlim=(-800,0.0), ylim=(-400, 400.0), zlim=(-80.0, 0.0), phase = lith,

0 commit comments

Comments
 (0)