-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c173f80
commit 5837d82
Showing
6 changed files
with
83 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
# Deprecated methods | ||
|
||
import ClimaComms | ||
import .Grids: FiniteDifferenceGrid, CellFace, CellCenter | ||
import .Spaces: | ||
CenterFiniteDifferenceSpace, | ||
FaceFiniteDifferenceSpace, | ||
FiniteDifferenceSpace | ||
import .Topologies: IntervalTopology | ||
import .Meshes: IntervalMesh | ||
|
||
@deprecate IntervalTopology(mesh::IntervalMesh) IntervalTopology( | ||
ClimaComms.SingletonCommsContext(ClimaComms.device()), | ||
mesh, | ||
) | ||
|
||
@deprecate FaceFiniteDifferenceSpace(mesh::IntervalMesh) FiniteDifferenceSpace( | ||
FiniteDifferenceGrid(ClimaComms.device(), mesh), | ||
CellFace(), | ||
) | ||
@deprecate CenterFiniteDifferenceSpace(mesh::IntervalMesh) FiniteDifferenceSpace( | ||
FiniteDifferenceGrid(ClimaComms.device(), mesh), | ||
CellCenter(), | ||
) | ||
|
||
@deprecate FiniteDifferenceGrid(mesh::IntervalMesh) FiniteDifferenceGrid( | ||
IntervalTopology(ClimaComms.device(), mesh), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#= | ||
julia --project | ||
using Revise; include(joinpath("test", "deprecations.jl")) | ||
=# | ||
using Test | ||
using ClimaCore: Geometry, Quadratures, Domains, Meshes, Topologies, Spaces | ||
import ClimaCore.Spaces: | ||
CenterFiniteDifferenceSpace, | ||
FaceFiniteDifferenceSpace, | ||
FiniteDifferenceSpace | ||
import ClimaCore.Grids: FiniteDifferenceGrid | ||
import ClimaComms | ||
ClimaComms.@import_required_backends | ||
|
||
@testset "Deprecations" begin | ||
FT = Float64 | ||
context = ClimaComms.SingletonCommsContext() | ||
R = FT(6.371229e6) | ||
npoly = 3 | ||
z_max = FT(30e3) | ||
z_elem = 64 | ||
h_elem = 30 | ||
# horizontal space | ||
domain = Domains.SphereDomain(R) | ||
horizontal_mesh = Meshes.EquiangularCubedSphere(domain, h_elem) | ||
horizontal_topology = Topologies.Topology2D( | ||
context, | ||
horizontal_mesh, | ||
Topologies.spacefillingcurve(horizontal_mesh), | ||
) | ||
quad = Quadratures.GLL{npoly + 1}() | ||
h_space = Spaces.SpectralElementSpace2D(horizontal_topology, quad) | ||
|
||
# vertical space | ||
z_domain = Domains.IntervalDomain( | ||
Geometry.ZPoint(zero(z_max)), | ||
Geometry.ZPoint(z_max); | ||
boundary_names = (:bottom, :top), | ||
) | ||
z_mesh = Meshes.IntervalMesh(z_domain, nelems = z_elem) | ||
|
||
# deprecated methods: | ||
@test_deprecated Topologies.IntervalTopology(z_mesh) | ||
@test_deprecated FaceFiniteDifferenceSpace(z_mesh) | ||
@test_deprecated CenterFiniteDifferenceSpace(z_mesh) | ||
@test_deprecated FiniteDifferenceGrid(z_mesh) | ||
end | ||
|
||
nothing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters