Skip to content

Commit 2b123bd

Browse files
committed
bugfixes
1 parent 787dc9f commit 2b123bd

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

src/Setup_geometry.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ end
147147

148148

149149
"""
150-
add_box!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::NTuple{2, _T} = (20,100), [ylim::NTuple{2, _T} = (1,10)], zlim::NTuple{2, _T} = (10,80),
150+
add_box!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::Tuple = (20,100), [ylim::Tuple = (1,10)], zlim::Tuple = (10,80),
151151
Origin=nothing, StrikeAngle=0, DipAngle=0,
152152
phase = ConstantPhase(1),
153153
T=nothing,
154-
cell=false ) where _T
154+
cell=false )
155155
156156
Adds a box with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models
157157
@@ -206,11 +206,11 @@ julia> write_paraview(Grid,"LaMEM_ModelSetup") # Save model to paraview
206206
```
207207
"""
208208
function add_box!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
209-
xlim::NTuple{2, _T} = (20,100), ylim=nothing, zlim::NTuple{2, _T} = (10,80), # limits of the box
209+
xlim::Tuple = (20,100), ylim=nothing, zlim::Tuple = (10,80), # limits of the box
210210
Origin=nothing, StrikeAngle=0, DipAngle=0, # origin & dip/strike
211211
phase = ConstantPhase(1), # Sets the phase number(s) in the box
212212
T=nothing, # Sets the thermal structure (various functions are available)
213-
cell=false ) where _T # if true, Phase and Temp are defined on cell centers
213+
cell=false ) # if true, Phase and Temp are defined on cell centers
214214

215215
# Retrieve 3D data arrays for the grid
216216
X,Y,Z = coordinate_grids(Grid, cell=cell)
@@ -266,9 +266,9 @@ end
266266

267267

268268
"""
269-
add_layer!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::NTuple{2, _T} = (1,100), [ylim::NTuple{2, _T} = (0,20)], zlim::NTuple{2, _T} = (0,-100),
269+
add_layer!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::Tuple = (1,100), [ylim::Tuple = (0,20)], zlim::Tuple = (0,-100),
270270
phase = ConstantPhase(1),
271-
T=nothing, cell=false ) where _T
271+
T=nothing, cell=false )
272272
273273
274274
Adds a layer with phase & temperature structure to a 3D model setup. The most common use would be to add a lithospheric layer to a model setup.
@@ -414,7 +414,7 @@ julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to para
414414
function add_sphere!(Phase, Temp, Grid::AbstractGeneralGrid; # required input
415415
cen::NTuple{3, _T} = (0,0,-1), radius::Number, # center and radius of the sphere
416416
phase = ConstantPhase(1), # Sets the phase number(s) in the sphere
417-
T=nothing, cell=false ) where _T # Sets the thermal structure (various functions are available)
417+
T=nothing, cell=false ) where _T # Sets the thermal structure (various functions are available)
418418

419419
# Retrieve 3D data arrays for the grid
420420
X,Y,Z = coordinate_grids(Grid, cell=cell)
@@ -484,7 +484,7 @@ function add_ellipsoid!(Phase, Temp, Grid::AbstractGeneralGrid; # required i
484484
cen::NTuple{3, _T} = (-1,-1,-1), axes::NTuple{3, _T} = (0.2,0.1,0.5), # center and semi-axes of the ellpsoid
485485
Origin=nothing, StrikeAngle=0, DipAngle=0, # origin & dip/strike
486486
phase = ConstantPhase(1), # Sets the phase number(s) in the box
487-
T=nothing, cell=false ) where _T # Sets the thermal structure (various functions are available)
487+
T=nothing, cell=false ) where _T # Sets the thermal structure (various functions are available)
488488

489489
if Origin==nothing
490490
Origin = cen # center
@@ -522,9 +522,9 @@ function add_ellipsoid!(Phase, Temp, Grid::AbstractGeneralGrid; # required i
522522
end
523523

524524
"""
525-
add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; base::NTuple{3, _T} = (-1,-1,-1.5), cap::NTuple{3, _T} = (-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),
527-
T=nothing, cell=false ) where _T
527+
T=nothing, cell=false )
528528
529529
530530
Adds a cylinder with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models
@@ -566,9 +566,9 @@ 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, _T} = (-1,-1,-1.5), cap::NTuple{3, _T} = (-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
571-
T=nothing, cell=false ) where _T # Sets the thermal structure (various functions are available)
571+
T=nothing, cell=false ) # Sets the thermal structure (various functions are available)
572572

573573
# axis vector of cylinder
574574
axVec = cap .- base
@@ -622,7 +622,7 @@ end
622622

623623

624624
"""
625-
add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=(), ylim::NTuple{2, _T} = (0,0.8), zlim=(), phase = ConstantPhase(1), T=nothing, cell=false ) where _T
625+
add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=(), ylim::Tuple = (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,9 +664,9 @@ 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::NTuple{2, _T} = (0,0.8), zlim=(), # limits of the box
667+
xlim=(), ylim::Tuple = (0,0.8), zlim=(), # limits of the box
668668
phase = ConstantPhase(1), # Sets the phase number(s) in the box
669-
T=nothing, cell=false ) where _T # Sets the thermal structure (various functions are available)
669+
T=nothing, cell=false ) # Sets the thermal structure (various functions are available)
670670

671671

672672
xlim_ = Float64.(collect(xlim))

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using GeophysicalModelGenerator
22
using Test
33

44
@testset verbose = true "GeophysicalModelGenerator" begin
5+
56
@testset "Data import.jl" begin
67
include("test_data_import.jl")
78
end
@@ -80,6 +81,7 @@ using Test
8081
@testset "ASAGI_IO" begin
8182
include("test_ASAGI_IO.jl")
8283
end
84+
8385
@testset "Chmy" begin
8486
include("test_Chmy.jl")
8587
end

test/test_Chmy.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CartGrid = create_CartGrid(grid)
2626
@test sum.(CartGrid.coord1D) == (0.0, 0.0, 0.0)
2727

2828
# test add_box! directly. Note that this requires you to specify a "cell" keyword for Center() locations
29-
add_box!(Phases_C,Temp_C,CartGrid, xlim=(0,1.0), zlim=(-2,0), phase=ConstantPhase(3), cell=true)
29+
add_box!(Phases_C,Temp_C,CartGrid, xlim=(0.0,1.0), zlim=(-2,0), phase=ConstantPhase(3), cell=true)
3030
@test extrema(Phases_C) == (0,3)
3131

3232
add_box!(Phases_V,Temp_V,CartGrid, xlim=(0,1.0), zlim=(-2,0), phase=ConstantPhase(3))

0 commit comments

Comments
 (0)