-
Notifications
You must be signed in to change notification settings - Fork 35
Changed input style for add_polygon! #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
f933def
41b06b6
fd39d65
3c5027d
e0a2be1
db96858
c82028d
6c597cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -593,7 +593,7 @@ end | |
|
||
|
||
""" | ||
add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::Vector(), ylim=Vector(2), zlim=Vector(), phase = ConstantPhase(1), T=nothing, cell=false ) | ||
add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=Tuple{}, ylim=Tuple{2}, zlim=Tuple{}, phase = ConstantPhase(1), T=nothing, cell=false ) | ||
|
||
Adds a polygon with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models | ||
|
||
|
@@ -625,7 +625,7 @@ LaMEM Grid: | |
z ϵ [-2.0 : 0.0] | ||
julia> Phases = zeros(Int32, size(Grid.X)); | ||
julia> Temp = zeros(Float64, size(Grid.X)); | ||
julia> add_polygon!(Phase, Temp, Cart; xlim=[0.0,0.0, 1.6, 2.0],ylim=[0.0,0.8], zlim=[0.0,-1.0,-2.0,0.0], phase = ConstantPhase(8), T=ConstantTemp(30)) | ||
julia> add_polygon!(Phase, Temp, Cart; xlim=(0,0, 1.6, 2.0),ylim=(0,0.8), zlim=(0,-1,-2,0), phase = ConstantPhase(8), T=ConstantTemp(30)) | ||
julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model | ||
julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview | ||
1-element Vector{String}: | ||
|
@@ -634,10 +634,20 @@ julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to para | |
|
||
""" | ||
function add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; # required input | ||
xlim::Vector=[], ylim::Vector=[], zlim::Vector=[], # limits of the box | ||
xlim=Tuple{}, ylim=Tuple{2}, zlim=Tuple{}, # limits of the box | ||
|
||
phase = ConstantPhase(1), # Sets the phase number(s) in the box | ||
T=nothing, cell=false ) # Sets the thermal structure (various functions are available) | ||
|
||
|
||
xlim = collect(xlim) | ||
|
||
ylim = collect(ylim) | ||
zlim = collect(zlim) | ||
|
||
xlim = Float64.(xlim) | ||
ylim = Float64.(ylim) | ||
zlim = Float64.(zlim) | ||
|
||
|
||
# Retrieve 3D data arrays for the grid | ||
X,Y,Z = coordinate_grids(Grid, cell=cell) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of
Tuple{}
andTuple{2}
? If you want to make empty tuples you can to justxlim=()