Skip to content

Commit 8aa10f1

Browse files
authored
Update Setup_geometry.jl
1 parent 428fb96 commit 8aa10f1

File tree

1 file changed

+13
-27
lines changed

1 file changed

+13
-27
lines changed

src/Setup_geometry.jl

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using GeoParams
99
# These are routines that help to create input geometries, such as slabs with a given angle
1010
#
1111

12-
export AddBox!, AddSphere!, AddEllipsoid!, AddCylinder!, AddLayer!, addPolygon!,addStripes!,
12+
export AddBox!, AddSphere!, AddEllipsoid!, AddCylinder!, AddLayer!, addPolygon!, addStripes!,
1313
makeVolcTopo,
1414
ConstantTemp, LinearTemp, HalfspaceCoolingTemp, SpreadingRateTemp, LithosphericTemp,
1515
ConstantPhase, LithosphericPhases,
@@ -580,24 +580,20 @@ end
580580

581581

582582
"""
583-
function addPolygon!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
584-
xlim=Vector(), ylim=Vector(2), zlim=Vector(), # limits of the box
585-
phase = ConstantPhase(1), # Sets the phase number(s) in the box
586-
T=nothing )
587-
Adds a polygon with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models
583+
addPolygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::Vector(), ylim=Vector(2), zlim=Vector(), phase = ConstantPhase(1), T=nothing )
588584
585+
Adds a polygon with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models
589586
590587
Parameters
591588
====
592-
- Phase - Phase array (consistent with Grid)
593-
- Temp - Temperature array (consistent with Grid)
594-
- Grid - Grid structure (usually obtained with ReadLaMEM_InputFile)
595-
- xlim - x-coordinate of the polygon points, same ordering as zlim, number of points unlimited
596-
- ylim - y-coordinate, limitation in length possible (two values (start and stop))
597-
- zlim - z-coordinate of the polygon points, same ordering as xlim, number of points unlimited
598-
- phase - specifies the phase of the box. See `ConstantPhase()`
599-
- T - specifies the temperature of the box. See `ConstantTemp()`,`LinearTemp()`,`HalfspaceCoolingTemp()`,`SpreadingRateTemp()`
600-
589+
- `Phase` - Phase array (consistent with Grid)
590+
- `Temp` - Temperature array (consistent with Grid)
591+
- `Grid` - Grid structure (usually obtained with ReadLaMEM_InputFile)
592+
- `xlim` - `x`-coordinate of the polygon points, same ordering as zlim, number of points unlimited
593+
- `ylim` - `y`-coordinate, limitation in length possible (two values (start and stop))
594+
- `zlim` - `z`-coordinate of the polygon points, same ordering as xlim, number of points unlimited
595+
- `phase` - specifies the phase of the box. See `ConstantPhase()`
596+
- `T` - specifies the temperature of the box. See `ConstantTemp()`,`LinearTemp()`,`HalfspaceCoolingTemp()`,`SpreadingRateTemp()`
601597
602598
Example
603599
========
@@ -623,10 +619,8 @@ julia> Write_Paraview(Model3D,"LaMEM_ModelSetup") # Save model to para
623619
```
624620
625621
"""
626-
627-
628622
function addPolygon!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
629-
xlim=Vector(), ylim=Vector(2), zlim=Vector(), # limits of the box
623+
xlim::Vector=[], ylim::Vector=[], zlim::Vector=[], # limits of the box
630624
phase = ConstantPhase(1), # Sets the phase number(s) in the box
631625
T=nothing ) # Sets the thermal structure (various functions are available)
632626

@@ -638,7 +632,6 @@ ind_slice = zeros(Bool,size(X[:,1,:]))
638632

639633
# find points within the polygon, only in 2D
640634
for i = 1:size(Y)[2]
641-
642635
if Y[1,i,1] >= ylim[1] && Y[1,i,1]<=ylim[2]
643636
inPolygon!(ind_slice, xlim,zlim, X[:,i,:], Z[:,i,:])
644637
ind[:,i,:] = ind_slice
@@ -650,7 +643,7 @@ end
650643

651644
# Compute thermal structure accordingly. See routines below for different options
652645
if T != nothing
653-
Temp[ind] = Compute_ThermalStructure(Temp[ind], X[ind], Y[ind], Z[ind], Phase[ind], T)
646+
Temp[ind] = Compute_ThermalStructure(Temp[ind], X[ind], Y[ind], Z[ind], Phase[ind], T)
654647
end
655648

656649
# Set the phase. Different routines are available for that - see below.
@@ -659,12 +652,6 @@ Phase[ind] = Compute_Phase(Phase[ind], Temp[ind], X[ind], Y[ind], Z[ind], phase)
659652
return nothing
660653
end
661654

662-
663-
664-
665-
666-
667-
668655
"""
669656
makeVolcTopo(Grid::LaMEM_grid; center::Array{Float64, 1}, height::Float64, radius::Float64, crater::Float64,
670657
base=0.0m, background=nothing)
@@ -894,7 +881,6 @@ function Compute_ThermalStructure(Temp, X, Y, Z, Phase, s::SpreadingRateTemp)
894881
SecYear = 3600*24*365
895882
dz = Z[end]-Z[1];
896883

897-
898884
MantleAdiabaticT = Tmantle .+ Adiabat*abs.(Z); # Adiabatic temperature of mantle
899885

900886
if MORside=="left"

0 commit comments

Comments
 (0)