Skip to content

Commit 7dc6bd8

Browse files
committed
Merge remote-tracking branch 'origin/bk-chmy' into bk-chmy
2 parents 779798d + 41e9b43 commit 7dc6bd8

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/Setup_geometry.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,13 @@ function add_box!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
253253
# Compute thermal structure accordingly. See routines below for different options
254254
if T != nothing
255255
if isa(T,LithosphericTemp)
256-
Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase)
256+
@views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase)
257257
end
258-
Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T)
258+
@views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T)
259259
end
260260

261261
# Set the phase. Different routines are available for that - see below.
262-
Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase)
262+
@views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase)
263263

264264
return nothing
265265
end
@@ -355,11 +355,11 @@ function add_layer!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
355355

356356
# Compute thermal structure accordingly. See routines below for different options
357357
if !isnothing(T)
358-
Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T)
358+
@views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T)
359359
end
360360

361361
# Set the phase. Different routines are available for that - see below.
362-
Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase)
362+
@views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase)
363363

364364
return nothing
365365
end
@@ -426,11 +426,11 @@ function add_sphere!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
426426

427427
# Compute thermal structure accordingly. See routines below for different options
428428
if T != nothing
429-
Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T)
429+
@views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T)
430430
end
431431

432432
# Set the phase. Different routines are available for that - see below.
433-
Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase)
433+
@views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase)
434434

435435
return nothing
436436
end
@@ -512,17 +512,17 @@ function add_ellipsoid!(Phase, Temp, Grid::AbstractGeneralGrid; # required i
512512

513513
# Compute thermal structure accordingly. See routines below for different options
514514
if T != nothing
515-
Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T)
515+
@views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T)
516516
end
517517

518518
# Set the phase. Different routines are available for that - see below.
519-
Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase)
519+
@views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase)
520520

521521
return nothing
522522
end
523523

524524
"""
525-
add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; base::NTuple{3, } = (-1,-1,-1.5), cap::NTuple{3, } = (-1,-1,-0.5), radius::Number,
525+
add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; base::NTuple{3} = (-1,-1,-1.5), cap::NTuple{3} = (-1,-1,-0.5), radius::Number,
526526
phase = ConstantPhase(1),
527527
T=nothing, cell=false )
528528
@@ -566,7 +566,7 @@ julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to para
566566
```
567567
"""
568568
function add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
569-
base::NTuple{3, } = (-1,-1,-1.5), cap::NTuple{3, } = (-1,-1,-0.5), radius::Number, # center and radius of the sphere
569+
base::NTuple{3} = (-1,-1,-1.5), cap::NTuple{3} = (-1,-1,-0.5), radius::Number, # center and radius of the sphere
570570
phase = ConstantPhase(1), # Sets the phase number(s) in the sphere
571571
T=nothing, cell=false ) # Sets the thermal structure (various functions are available)
572572

@@ -597,11 +597,11 @@ function add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
597597

598598
# Compute thermal structure accordingly. See routines below for different options
599599
if !isnothing(T)
600-
Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T)
600+
@views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T)
601601
end
602602

603603
# Set the phase. Different routines are available for that - see below.
604-
Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase)
604+
@views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase)
605605

606606
return nothing
607607
end
@@ -622,7 +622,7 @@ end
622622

623623

624624
"""
625-
add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=(), ylim::Tuple = (0,0.8), zlim=(), phase = ConstantPhase(1), T=nothing, cell=false )
625+
add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=(), ylim::Tuple = (0.0,0.8), zlim=(), phase = ConstantPhase(1), T=nothing, cell=false )
626626
627627
628628
Adds a polygon with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models
@@ -664,7 +664,7 @@ julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to para
664664
665665
"""
666666
function add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
667-
xlim=(), ylim::Tuple = (0,0.8), zlim=(), # limits of the box
667+
xlim=(), ylim::Tuple = (0.0,0.8), zlim=(), # limits of the box
668668
phase = ConstantPhase(1), # Sets the phase number(s) in the box
669669
T=nothing, cell=false ) # Sets the thermal structure (various functions are available)
670670

0 commit comments

Comments
 (0)