Skip to content

Commit 1864854

Browse files
committed
add 2D test
1 parent 56e0d15 commit 1864854

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/test_setup_geometry.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,25 @@ addSlab!(Phase,Temp,Cart, t1, phase=phase, T = T_slab)
267267
@test Temp[84,84,110] 718.8406936737412
268268

269269
Data_Final = CartData(X,Y,Z,(Phase=Phase,Temp=Temp))
270+
271+
272+
273+
# 2D slab:
274+
nx,nz = 512,128
275+
x = range(-1000,1000, nx);
276+
z = range(-660,0, nz);
277+
Grid2D = CartData(XYZGrid(x,0,z))
278+
Phases = zeros(Int64, nx, 1, nz);
279+
Temp = fill(1350.0, nx, 1, nz);
280+
AddBox!(Phases, Temp, Grid2D; xlim=(-800,0.0), zlim=(-80.0, 0.0), phase = ConstantPhase(1));
281+
282+
trench = Trench(Start=(0.0,-100.0), End=(0.0,100.0), Thickness=80.0, θ_max=30.0, Length=300, Lb=150);
283+
addSlab!(Phases, Temp, Grid2D, trench, phase = ConstantPhase(2));
284+
@test extrema(Phases) == (0, 2)
285+
286+
# Add them to the `CartData` dataset:
287+
Grid2D = CartData(Grid2D.x.val, Grid2D.y.val, Grid2D.z.val ,(;Phases, Temp))
288+
289+
#Write_Paraview(Grid2D,"Grid2D_SubductionCurvedMechanical");
290+
291+

0 commit comments

Comments
 (0)