593593
594594
595595"""
596- add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim::Vector() , ylim=Vector(2) , zlim=Vector() , phase = ConstantPhase(1), T=nothing, cell=false )
596+ add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=Tuple{} , ylim=nothing , zlim=Tuple{} , phase = ConstantPhase(1), T=nothing, cell=false )
597597
598598Adds a polygon with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models
599599
@@ -625,7 +625,7 @@ LaMEM Grid:
625625 z ϵ [-2.0 : 0.0]
626626julia> Phases = zeros(Int32, size(Grid.X));
627627julia> Temp = zeros(Float64, size(Grid.X));
628- 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))
628+ 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))
629629julia> Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
630630julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to paraview
6316311-element Vector{String}:
@@ -634,10 +634,20 @@ julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to para
634634
635635"""
636636function add_polygon! (Phase, Temp, Grid:: AbstractGeneralGrid ; # required input
637- xlim:: Vector = [] , ylim:: Vector = [] , zlim:: Vector = [], # limits of the box
637+ xlim= Tuple{} , ylim= nothing , zlim= Tuple{}, # limits of the box
638638 phase = ConstantPhase (1 ), # Sets the phase number(s) in the box
639639 T= nothing , cell= false ) # Sets the thermal structure (various functions are available)
640640
641+
642+ xlim = collect (xlim)
643+ ylim = collect (ylim)
644+ zlim = collect (zlim)
645+
646+ xlim = Float64 .(xlim)
647+ ylim = Float64 .(ylim)
648+ zlim = Float64 .(zlim)
649+
650+
641651# Retrieve 3D data arrays for the grid
642652X,Y,Z = coordinate_grids (Grid, cell= cell)
643653
0 commit comments