-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update Spaces documentation page #2068
Comments
From #2082 (review):
|
I think we can address these in our docs page. I think we need a bit more of a short over-arching story showing a UML diagram of everything that builds up to a space. From there we can expand onto fields / operators. |
It might be nice if we could automatically generate a UML from objects. It's a bit difficult to do this in the sense that there are many many objects in a space, but if we filter objects at a certain depth, I think we can make something reasonable. For example, using StructuredPrinting.jl: import ClimaCore
using ClimaCore.CommonSpaces
space = ExtrudedCubedSphereSpace(;
z_elem = 10,
z_min = 0,
z_max = 1,
radius = 10,
h_elem = 10,
n_quad_points = 4,
staggering = Grids.CellCenter()
)
using StructuredPrinting
print_obj = x -> occursin("ClimaCore", string(parentmodule(typeof(x)))) && !(eltype(x) <: ClimaCore.Geometry.AxisTensor) && !(x isa ClimaCore.DataLayouts.AbstractData)
o = Options(; print_obj, max_type_depth = 1)
@structured_print space o Which gives: julia> import ClimaCore
julia> using ClimaCore.CommonSpaces
julia> space = ExtrudedCubedSphereSpace(;
z_elem = 10,
z_min = 0,
z_max = 1,
radius = 10,
h_elem = 10,
n_quad_points = 4,
staggering = Grids.CellCenter()
)
CenterExtrudedFiniteDifferenceSpace:
context: SingletonCommsContext using CPUSingleThreaded
horizontal:
mesh: 10×10×6-element EquiangularCubedSphere of SphereDomain: radius = 10.0
quadrature: 4-point Gauss-Legendre-Lobatto quadrature
vertical:
mesh: 10-element IntervalMesh of IntervalDomain: z ∈ [0.0,1.0] (:bottom, :top)
julia> using StructuredPrinting
julia> print_obj = x -> occursin("ClimaCore", string(parentmodule(typeof(x)))) && !(eltype(x) <: ClimaCore.Geometry.AxisTensor) && !(x isa ClimaCore.DataLayouts.AbstractData)
#1 (generic function with 1 method)
julia> o = Options(; print_obj, max_type_depth = 1)
Options{var"#1#2", Returns{Bool}, StructuredPrinting.var"#5#9", Returns{Bool}}(var"#1#2"(), Returns{Bool}(false), StructuredPrinting.var"#5#9"(), Returns{Bool}(true), 1000, 1)
julia> @structured_print space o
space
space.grid::ClimaCore.Grids.ExtrudedFiniteDifferenceGrid{…}
space.grid.horizontal_grid::ClimaCore.Grids.SpectralElementGrid2D{…}
space.grid.horizontal_grid.topology::ClimaCore.Topologies.Topology2D{…}
space.grid.horizontal_grid.topology.mesh::ClimaCore.Meshes.EquiangularCubedSphere{…}
space.grid.horizontal_grid.topology.mesh.domain::ClimaCore.Domains.SphereDomain{…}
space.grid.horizontal_grid.topology.mesh.localelementmap::ClimaCore.Meshes.NormalizedBilinearMap
space.grid.horizontal_grid.quadrature_style::ClimaCore.Quadratures.GLL{…}
space.grid.horizontal_grid.global_geometry::ClimaCore.Geometry.SphericalGlobalGeometry{…}
space.grid.vertical_grid::ClimaCore.Grids.FiniteDifferenceGrid{…}
space.grid.vertical_grid.topology::ClimaCore.Topologies.IntervalTopology{…}
space.grid.vertical_grid.topology.mesh::ClimaCore.Meshes.IntervalMesh{…}
space.grid.vertical_grid.topology.mesh.domain::ClimaCore.Domains.IntervalDomain{…}
space.grid.vertical_grid.topology.mesh.domain.coord_min::ClimaCore.Geometry.ZPoint{…}
space.grid.vertical_grid.topology.mesh.domain.coord_max::ClimaCore.Geometry.ZPoint{…}
space.grid.vertical_grid.global_geometry::ClimaCore.Geometry.CartesianGlobalGeometry
space.grid.hypsography::ClimaCore.Grids.Flat
space.grid.global_geometry::ClimaCore.Geometry.ShallowSphericalGlobalGeometry{…}
space.staggering::ClimaCore.Grids.CellCenter Some of these things are kind of internals, but it would be nice to somehow make a diagram of this so that new users understand the composition of a space. |
Maybe we can use Kroki? using Kroki
uml = ditaa"""
+--------+
| |
| Field |
| |
+--------+
+--------+
| |
| Space |
| |
+--------+
+-------------+
| |
| Topology |
| |
+-------------+
+-------------+
| |
| Mesh |
| |
+-------------+
+-------------+
| |
| Domain |
| |
+-------------+
""" |
We should probably improve the user-side documentation of making grids / spaces, as a sort of introduction to using basic ClimaCore components.
The text was updated successfully, but these errors were encountered: