Skip to content

Commit

Permalink
Try #1487:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Oct 24, 2023
2 parents f31a62a + 907bf20 commit 5516371
Show file tree
Hide file tree
Showing 52 changed files with 2,967 additions and 2,473 deletions.
4 changes: 2 additions & 2 deletions .dev/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ version = "0.21.4"

[[deps.JuliaFormatter]]
deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "PrecompileTools", "Tokenize"]
git-tree-sha1 = "80031f6e58b09b0de4553bf63d9a36ec5db57967"
git-tree-sha1 = "0bac3374ff3aa798148669ecb5559ba20c8b0e73"
uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
version = "1.0.39"
version = "1.0.40"

[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
Expand Down
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Memoize = "c03570c3-d221-55d1-a50c-7939bbd78826"
PkgVersion = "eebad327-c553-4316-9ea0-9fa01ccd7688"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Expand All @@ -28,6 +29,7 @@ Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
WeakValueDicts = "897b6980-f191-5a31-bcb0-bf3c4585e0c1"

[compat]
Adapt = "3"
Expand All @@ -43,13 +45,15 @@ GaussQuadrature = "0.5"
GilbertCurves = "0.1"
HDF5 = "0.16, 0.17"
IntervalSets = "0.5, 0.6, 0.7"
Memoize = "0.4"
PkgVersion = "0.1, 0.2, 0.3"
RecursiveArrayTools = "2"
Requires = "1"
RootSolvers = "0.3, 0.4"
Static = "0.4, 0.5, 0.6, 0.7, 0.8"
StaticArrays = "1"
UnPack = "1"
WeakValueDicts = "0.1"
julia = "1.8"

[extras]
Expand Down
13 changes: 12 additions & 1 deletion docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ uuid = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
version = "0.5.5"

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "UnPack"]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "UnPack", "WeakValueDicts"]
path = ".."
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.10.55"
Expand Down Expand Up @@ -1477,6 +1477,12 @@ git-tree-sha1 = "c13304c81eec1ed3af7fc20e75fb6b26092a1102"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.2"

[[deps.Memoize]]
deps = ["MacroTools"]
git-tree-sha1 = "2b1dfcba103de714d31c033b5dacc2e4a12c7caa"
uuid = "c03570c3-d221-55d1-a50c-7939bbd78826"
version = "0.4.4"

[[deps.MicrosoftMPI_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "a7023883872e52bc29bcaac74f19adf39347d2d5"
Expand Down Expand Up @@ -2543,6 +2549,11 @@ git-tree-sha1 = "4528479aa01ee1b3b4cd0e6faef0e04cf16466da"
uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91"
version = "1.25.0+0"

[[deps.WeakValueDicts]]
git-tree-sha1 = "98528c2610a5479f091d470967a25becfd83edd0"
uuid = "897b6980-f191-5a31-bcb0-bf3c4585e0c1"
version = "0.1.0"

[[deps.WoodburyMatrices]]
deps = ["LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "de67fa59e33ad156a590055375a30b23c40299d3"
Expand Down
1 change: 0 additions & 1 deletion docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ Spaces.dss_ghost!
Spaces.create_dss_buffer
Spaces.fill_send_buffer!
Spaces.DSSBuffer
Spaces.create_ghost_buffer
Spaces.load_from_recv_buffer!
Spaces.weighted_dss_start!
Spaces.weighted_dss_internal!
Expand Down
13 changes: 12 additions & 1 deletion examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ uuid = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
version = "0.5.5"

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "UnPack"]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "UnPack", "WeakValueDicts"]
path = ".."
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.10.55"
Expand Down Expand Up @@ -1226,6 +1226,12 @@ git-tree-sha1 = "c13304c81eec1ed3af7fc20e75fb6b26092a1102"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.2"

[[deps.Memoize]]
deps = ["MacroTools"]
git-tree-sha1 = "2b1dfcba103de714d31c033b5dacc2e4a12c7caa"
uuid = "c03570c3-d221-55d1-a50c-7939bbd78826"
version = "0.4.4"

[[deps.MicroCollections]]
deps = ["BangBang", "InitialValues", "Setfield"]
git-tree-sha1 = "629afd7d10dbc6935ec59b32daeb33bc4460a42e"
Expand Down Expand Up @@ -2082,6 +2088,11 @@ git-tree-sha1 = "4528479aa01ee1b3b4cd0e6faef0e04cf16466da"
uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91"
version = "1.25.0+0"

[[deps.WeakValueDicts]]
git-tree-sha1 = "98528c2610a5479f091d470967a25becfd83edd0"
uuid = "897b6980-f191-5a31-bcb0-bf3c4585e0c1"
version = "0.1.0"

[[deps.WriteVTK]]
deps = ["Base64", "CodecZlib", "FillArrays", "LightXML", "TranscodingStreams", "VTKBase"]
git-tree-sha1 = "41f0dc2a8f6fd860c266b91fd5cdf4fead65ae69"
Expand Down
2 changes: 1 addition & 1 deletion examples/bickleyjet/bickleyjet_dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function rhs!(dydt, y, (parameters, numflux), t)
dydt_data .= RecursiveApply.rdiv.(dydt_data, space.local_geometry.WJ)
M = Spaces.Quadratures.cutoff_filter_matrix(
Float64,
space.quadrature_style,
Spaces.quadrature_rule(space),
3,
)
Operators.tensor_product!(dydt_data, M)
Expand Down
6 changes: 2 additions & 4 deletions examples/hybrid/hybrid3dcs_dss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ function hybrid3dcubedsphere_dss_profiler(
c = center_initial_condition(ᶜlocal_geometry),
f = face_initial_condition(ᶠlocal_geometry),
)
ghost_buffer = (
c = Spaces.create_ghost_buffer(Y.c),
f = Spaces.create_ghost_buffer(Y.f),
)
ghost_buffer =
(c = Spaces.create_dss_buffer(Y.c), f = Spaces.create_dss_buffer(Y.f))
dss_buffer_f = Spaces.create_dss_buffer(Y.f)
dss_buffer_c = Spaces.create_dss_buffer(Y.c)
nsamples = 10000
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/sphere/remap_pipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function remap2latlon(filein, nc_dir, nlat, nlon)
# reconstruct space, obtain Nq from space
cspace = axes(Y.c)
hspace = Spaces.horizontal_space(cspace)
Nq = Spaces.Quadratures.degrees_of_freedom(hspace.quadrature_style)
Nq = Spaces.Quadratures.degrees_of_freedom(Spaces.quadrature_rule(hspace))

# create a temporary dir for intermediate data
remap_tmpdir = nc_dir * "remaptmp/"
Expand Down
12 changes: 4 additions & 8 deletions lib/ClimaCorePlots/src/ClimaCorePlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RecipesBase.@recipe function f(
coord_field = Fields.coordinate_field(space)

lagrange_quad = Spaces.Quadratures.ClosedUniform{Nu}()
dataspace = Spaces.SpectralElementSpace1D(space.topology, lagrange_quad)
dataspace =
Spaces.SpectralElementSpace1D(Spaces.topology(space), lagrange_quad)
interp = Operators.Interpolate(dataspace)
ifield = interp.(field)

Expand Down Expand Up @@ -251,12 +252,7 @@ RecipesBase.@recipe function f(
field::Fields.Field{<:Any, S};
hinterpolate = 0,
ncolors = 256,
) where {
S <: Spaces.ExtrudedFiniteDifferenceSpace{
<:Any,
<:Spaces.IntervalSpectralElementSpace1D,
},
}
) where {S <: Spaces.ExtrudedFiniteDifferenceSpace2D}
hcoord, vcoord, data = _slice_triplot(field, hinterpolate, ncolors)
coord_symbols = propertynames(Fields.coordinate_field(axes(field)))

Expand Down Expand Up @@ -364,7 +360,7 @@ RecipesBase.@recipe function f(
hinterpolate = 0,
ncolors = 256,
) where {
S <: Spaces.ExtrudedFiniteDifferenceSpace{
S <: Spaces.ExtrudedFiniteDifferenceSpace3D{
<:Any,
<:Spaces.RectilinearSpectralElementSpace2D,
},
Expand Down
8 changes: 4 additions & 4 deletions lib/ClimaCoreTempestRemap/src/onlineremap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ function generate_map(
out_type = "cgll",
)
if (target_space_distr != nothing)
comms_ctx = target_space_distr.topology.context
comms_ctx = ClimaComms.context(target_space_distr)
else
comms_ctx = target_space.topology.context
comms_ctx = ClimaComms.context(target_space)
end

if ClimaComms.iamroot(comms_ctx)
# write meshes and generate weights on root process (using global indices)
write_exodus(meshfile_source, source_space.topology)
write_exodus(meshfile_target, target_space.topology)
write_exodus(meshfile_source, Spaces.topology(source_space))
write_exodus(meshfile_target, Spaces.topology(target_space))
overlap_mesh(meshfile_overlap, meshfile_source, meshfile_target)
remap_weights(
weightfile,
Expand Down
46 changes: 24 additions & 22 deletions lib/ClimaCoreVTK/src/space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,10 @@ Construct a vector of `MeshCell` objects representing the elements of `space` as
an unstuctured mesh of Lagrange polynomial cells, suitable for passing to
`vtk_grid`.
"""
function vtk_cells_lagrange(
gspace::Spaces.SpectralElementSpace2D{
T,
Spaces.Quadratures.ClosedUniform{Nq},
},
) where {T, Nq}
# TODO: this should depend on the backing DataLayouts (e.g. IJFH)
function vtk_cells_lagrange(gspace::Spaces.SpectralElementSpace2D)
quad = Spaces.quadrature_style(gspace)
@assert quad isa Quadratures.ClosedUniform
Nq = Quadratures.degrees_of_freedom(quad) # TODO: this should depend on the backing DataLayouts (e.g. IJFH)
con_map = vtk_connectivity_map_lagrange(Nq, Nq)
[
MeshCell(
Expand All @@ -107,7 +104,8 @@ an unstuctured mesh of linear cells, suitable for passing to
`vtk_grid`.
"""
function vtk_cells_linear(gridspace::Spaces.SpectralElementSpace2D)
Nq = Spaces.Quadratures.degrees_of_freedom(gridspace.quadrature_style)
Nq =
Spaces.Quadratures.degrees_of_freedom(Spaces.quadrature_rule(gridspace))
Nh = Topologies.nlocalelems(gridspace)
ind = LinearIndices((1:Nq, 1:Nq, 1:Nh))
cells = [
Expand All @@ -126,7 +124,7 @@ end

function vtk_cells_linear(gridspace::Spaces.FaceExtrudedFiniteDifferenceSpace2D)
hspace = Spaces.horizontal_space(gridspace)
Nq = Spaces.Quadratures.degrees_of_freedom(hspace.quadrature_style)
Nq = Spaces.Quadratures.degrees_of_freedom(Spaces.quadrature_rule(hspace))
Nh = Topologies.nlocalelems(hspace)
Nv = Spaces.nlevels(gridspace)
ind = LinearIndices((1:Nv, 1:Nq, 1:Nh)) # assume VIFH
Expand All @@ -145,7 +143,7 @@ function vtk_cells_linear(gridspace::Spaces.FaceExtrudedFiniteDifferenceSpace2D)
end
function vtk_cells_linear(gridspace::Spaces.FaceExtrudedFiniteDifferenceSpace3D)
hspace = Spaces.horizontal_space(gridspace)
Nq = Spaces.Quadratures.degrees_of_freedom(hspace.quadrature_style)
Nq = Spaces.Quadratures.degrees_of_freedom(Spaces.quadrature_rule(hspace))
Nh = Topologies.nlocalelems(hspace)
Nv = Spaces.nlevels(gridspace)
ind = LinearIndices((1:Nv, 1:Nq, 1:Nq, 1:Nh)) # assumes VIJFH
Expand Down Expand Up @@ -180,20 +178,20 @@ This generally does two things:
- Modifies the vertical space to be on the faces.
"""
function vtk_grid_space(space::Spaces.SpectralElementSpace1D)
if space.quadrature_style isa Spaces.Quadratures.ClosedUniform
if Spaces.quadrature_rule(space) isa Spaces.Quadratures.ClosedUniform
return space
end
Nq = Spaces.Quadratures.degrees_of_freedom(space.quadrature_style)
Nq = Spaces.Quadratures.degrees_of_freedom(Spaces.quadrature_rule(space))
lagrange_quad = Spaces.Quadratures.ClosedUniform{Nq}()
return Spaces.SpectralElementSpace1D(space.topology, lagrange_quad)
return Spaces.SpectralElementSpace1D(Spaces.topology(space), lagrange_quad)
end
function vtk_grid_space(space::Spaces.SpectralElementSpace2D)
if space.quadrature_style isa Spaces.Quadratures.ClosedUniform
if Spaces.quadrature_rule(space) isa Spaces.Quadratures.ClosedUniform
return space
end
Nq = Spaces.Quadratures.degrees_of_freedom(space.quadrature_style)
Nq = Spaces.Quadratures.degrees_of_freedom(Spaces.quadrature_rule(space))
lagrange_quad = Spaces.Quadratures.ClosedUniform{Nq}()
return Spaces.SpectralElementSpace2D(space.topology, lagrange_quad)
return Spaces.SpectralElementSpace2D(Spaces.topology(space), lagrange_quad)
end
function vtk_grid_space(space::Spaces.FaceExtrudedFiniteDifferenceSpace)
# this will need to be updated for warped meshes
Expand Down Expand Up @@ -226,16 +224,20 @@ This generally does two things:
- Modifies the vertical space to be on the centers.
"""
function vtk_cell_space(gridspace::Spaces.SpectralElementSpace1D)
@assert gridspace.quadrature_style isa Spaces.Quadratures.ClosedUniform
Nq = Spaces.Quadratures.degrees_of_freedom(gridspace.quadrature_style)
@assert Spaces.quadrature_rule(gridspace) isa
Spaces.Quadratures.ClosedUniform
Nq =
Spaces.Quadratures.degrees_of_freedom(Spaces.quadrature_rule(gridspace))
quad = Spaces.Quadratures.Uniform{Nq - 1}()
return Spaces.SpectralElementSpace1D(gridspace.topology, quad)
return Spaces.SpectralElementSpace1D(Spaces.topology(gridspace), quad)
end
function vtk_cell_space(gridspace::Spaces.SpectralElementSpace2D)
@assert gridspace.quadrature_style isa Spaces.Quadratures.ClosedUniform
Nq = Spaces.Quadratures.degrees_of_freedom(gridspace.quadrature_style)
@assert Spaces.quadrature_rule(gridspace) isa
Spaces.Quadratures.ClosedUniform
Nq =
Spaces.Quadratures.degrees_of_freedom(Spaces.quadrature_rule(gridspace))
quad = Spaces.Quadratures.Uniform{Nq - 1}()
return Spaces.SpectralElementSpace2D(gridspace.topology, quad)
return Spaces.SpectralElementSpace2D(Spaces.topology(gridspace), quad)
end
function vtk_cell_space(gridspace::Spaces.FaceExtrudedFiniteDifferenceSpace)
# this will need to be updated for warped meshes
Expand Down
13 changes: 12 additions & 1 deletion perf/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ uuid = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
version = "0.5.5"

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "UnPack"]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "CUDA", "ClimaComms", "CubedSphere", "DataStructures", "DocStringExtensions", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "LinearAlgebra", "Memoize", "PkgVersion", "RecursiveArrayTools", "Requires", "RootSolvers", "SparseArrays", "Static", "StaticArrays", "Statistics", "UnPack", "WeakValueDicts"]
path = ".."
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.10.55"
Expand Down Expand Up @@ -1260,6 +1260,12 @@ git-tree-sha1 = "c13304c81eec1ed3af7fc20e75fb6b26092a1102"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.2"

[[deps.Memoize]]
deps = ["MacroTools"]
git-tree-sha1 = "2b1dfcba103de714d31c033b5dacc2e4a12c7caa"
uuid = "c03570c3-d221-55d1-a50c-7939bbd78826"
version = "0.4.4"

[[deps.MicrosoftMPI_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "a7023883872e52bc29bcaac74f19adf39347d2d5"
Expand Down Expand Up @@ -2128,6 +2134,11 @@ git-tree-sha1 = "4528479aa01ee1b3b4cd0e6faef0e04cf16466da"
uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91"
version = "1.25.0+0"

[[deps.WeakValueDicts]]
git-tree-sha1 = "98528c2610a5479f091d470967a25becfd83edd0"
uuid = "897b6980-f191-5a31-bcb0-bf3c4585e0c1"
version = "0.1.0"

[[deps.WidthLimitedIO]]
deps = ["Unicode"]
git-tree-sha1 = "71142739e695823729a335e9bc124ef41ec1433a"
Expand Down
2 changes: 2 additions & 0 deletions src/ClimaCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ include("Geometry/Geometry.jl")
include("Domains/Domains.jl")
include("Meshes/Meshes.jl")
include("Topologies/Topologies.jl")
include("Quadratures/Quadratures.jl")
include("Grids/Grids.jl")
include("Spaces/Spaces.jl")
include("Fields/Fields.jl")
include("Operators/Operators.jl")
Expand Down
Loading

0 comments on commit 5516371

Please sign in to comment.