Skip to content

Commit fd39d65

Browse files
committed
Making it time stable
1 parent 41b06b6 commit fd39d65

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/Setup_geometry.jl

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -639,13 +639,9 @@ function add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
639639
T=nothing, cell=false ) # Sets the thermal structure (various functions are available)
640640

641641

642-
xlim = collect(xlim)
643-
ylim = collect(ylim)
644-
zlim = collect(zlim)
645-
646-
xlim = Float64.(xlim)
647-
ylim = Float64.(ylim)
648-
zlim = Float64.(zlim)
642+
xlim_ = Float64.(collect(xlim))
643+
ylim_ = Float64.(collect(ylim))
644+
zlim_ = Float64.(collect(zlim))
649645

650646

651647
# Retrieve 3D data arrays for the grid
@@ -656,8 +652,8 @@ ind_slice = zeros(Bool,size(X[:,1,:]))
656652

657653
# find points within the polygon, only in 2D
658654
for i = 1:size(Y)[2]
659-
if Y[1,i,1] >= ylim[1] && Y[1,i,1]<=ylim[2]
660-
inpolygon!(ind_slice, xlim,zlim, X[:,i,:], Z[:,i,:])
655+
if Y[1,i,1] >= ylim_[1] && Y[1,i,1]<=ylim_[2]
656+
inpolygon!(ind_slice, xlim_,zlim_, X[:,i,:], Z[:,i,:])
661657
ind[:,i,:] = ind_slice
662658
else
663659
ind[:,i,:] = zeros(size(X[:,1,:]))

test/test_setup_geometry.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ TsHC = HalfspaceCoolingTemp(Tsurface=20.0, Tmantle=1350, Age=120, Adiabat=0.4)
284284
TsMK = McKenzie_subducting_slab(Tsurface = 20.0, Tmantle = 1350.0, v_cm_yr = 4.0, Adiabat = 0.0)
285285
T_slab = LinearWeightedTemperature(crit_dist=600, F1=TsHC, F2=TsMK);
286286
phase = LithosphericPhases(Layers=[5 7 88], Phases = [2 3 4], Tlab=nothing)
287+
287288
t1 = Trench(Start = (400.0,400.0), End = (800.0,800.0),θ_max = 90.0, direction = 1.0, n_seg = 50, Length = 600.0, Thickness = 80.0, Lb = 500.0,d_decoupling = 100.0, type_bending =:Ribe, WeakzoneThickness=10, WeakzonePhase=9)
288289

289290
add_slab!(Phase,Temp,Cart, t1, phase=phase, T = T_slab)

0 commit comments

Comments
 (0)