Staggered Grid Initialization
EarthBox.StaggeredGrid.initialize! — Function
initialize!(
model::ModelData;
grid_type::Union{Int, String, Symbol, Nothing}=nothing,
parameters::Union{Dict{String, <:Union{Float64, Int64, String}}, Nothing}=nothing
)::NothingInitialize staggered grid with the specified grid type and parameters.
Arguments
model::ModelData- The model data object containing model parameters and arrays.
grid_type- Controls the type of grid. The
grid_typeargument can be an integer ID, a string, a symbol, ornothing. Grid type is stored in the model data container as an integer ID (itype_grid) and a corresponding string name (stype_grid). Ifgrid_typeis nothing the current grid type defined in the model data container will be used. Grid type parameters can be accessed from the model data container as follows:itype_grid = model.grids.parameters.grid_options.itype_grid.valuestype_grid = model.grids.parameters.grid_options.stype_grid.value
- Controls the type of grid. The
parameters- Dictionary of parameters used to define the grid type. Currently this is only used for
grid_type = :TtypeRefinedGrid. See the section below called Parameter Dictionary Keys for more information.
- Dictionary of parameters used to define the grid type. Currently this is only used for
Returns
Nothing
Grid Types
Available grid types (string, symbol, or integer ID) are as follows:
UniformGridgrid_typevalue:"UniformGrid",:UniformGrid, or0- Uniform basic grid.
TtypeRefinedGridgrid_typevalue:"TtypeRefinedGrid",:TtypeRefinedGrid, or1- Basic grid has lateral refinement in the central part of the model and vertical refinement in the upper part of the model (i.e. T-type).
Grid51x51UniformRefinementAlongSidesgrid_typevalue:"Grid51x51UniformRefinementAlongSides",:Grid51x51UniformRefinementAlongSides, or2- 51x51 basic grid with high-resolution along sides. This type is used for convection in a box benchmarks.
Grid51x51SmoothedRefinementAlongSidesgrid_typevalue:"Grid51x51SmoothedRefinementAlongSides",:Grid51x51SmoothedRefinementAlongSides, or3- 51x51 basic grid with smoothed high-resolution zones along sides. This grid is used for convection in a box benchmarks.
Parameter Dictionary Keys
Required parameter keys for grid type :TtypeRefinedGrid:
"xo_highres": Starting x-coordinate of high resolution region in meters"xf_highres": Ending x-coordinate of high resolution region in meters"yf_highres": Ending y-coordinate of high resolution region in meters"dx_highres": Grid spacing in x-direction for high resolution region in meters"dy_highres": Grid spacing in y-direction for high resolution region in meters
Optional parameter keys for grid type :TtypeRefinedGrid:
"iuse_trench": Flag to enable trench-based refinement (0 or 1)"iuse_refinement_delay": Flag to enable delayed refinement (0 or 1)"refinement_time": Time in Myr when refinement should occur
Notes:
- T-type parameters do not need to be provided as input if they were previously defined when initializing the model using
EarthBoxState.
Accessing Option Names
Available option names for grid_type can be accessed as follows:
StaggeredGrid.option_names.UniformGridStaggeredGrid.option_names.TtypeRefinedGridStaggeredGrid.option_names.Grid51x51UniformRefinementAlongSidesStaggeredGrid.option_names.Grid51x51SmoothedRefinementAlongSides