@@ -253,13 +253,13 @@ function add_box!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
253
253
# Compute thermal structure accordingly. See routines below for different options
254
254
if T != nothing
255
255
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)
257
257
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)
259
259
end
260
260
261
261
# 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)
263
263
264
264
return nothing
265
265
end
@@ -355,11 +355,11 @@ function add_layer!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
355
355
356
356
# Compute thermal structure accordingly. See routines below for different options
357
357
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)
359
359
end
360
360
361
361
# 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)
363
363
364
364
return nothing
365
365
end
@@ -426,11 +426,11 @@ function add_sphere!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
426
426
427
427
# Compute thermal structure accordingly. See routines below for different options
428
428
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)
430
430
end
431
431
432
432
# 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)
434
434
435
435
return nothing
436
436
end
@@ -512,17 +512,17 @@ function add_ellipsoid!(Phase, Temp, Grid::AbstractGeneralGrid; # required i
512
512
513
513
# Compute thermal structure accordingly. See routines below for different options
514
514
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)
516
516
end
517
517
518
518
# 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)
520
520
521
521
return nothing
522
522
end
523
523
524
524
"""
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,
526
526
phase = ConstantPhase(1),
527
527
T=nothing, cell=false )
528
528
@@ -566,7 +566,7 @@ julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to para
566
566
```
567
567
"""
568
568
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
570
570
phase = ConstantPhase (1 ), # Sets the phase number(s) in the sphere
571
571
T= nothing , cell= false ) # Sets the thermal structure (various functions are available)
572
572
@@ -597,11 +597,11 @@ function add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
597
597
598
598
# Compute thermal structure accordingly. See routines below for different options
599
599
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)
601
601
end
602
602
603
603
# 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)
605
605
606
606
return nothing
607
607
end
622
622
623
623
624
624
"""
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 )
626
626
627
627
628
628
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
664
664
665
665
"""
666
666
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
668
668
phase = ConstantPhase (1 ), # Sets the phase number(s) in the box
669
669
T= nothing , cell= false ) # Sets the thermal structure (various functions are available)
670
670
0 commit comments