Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Oct 24, 2023
1 parent 1973dac commit 529d48b
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/hybrid/sphere/deformation_flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function run_deformation_flow(use_limiter, fct_op)
Geometry.LatLongZPoint(ϕ_c, λ_c1, FT(0)),
Geometry.LatLongZPoint(ϕ_c, λ_c2, FT(0)),
)
horz_geometry = horz_space.global_geometry
horz_geometry = Spaces.global_geometry(horz_space)
rds = map(centers) do center
Geometry.great_circle_distance(coord, center, horz_geometry)
end
Expand Down
2 changes: 1 addition & 1 deletion examples/sphere/limiters_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ for (k, ne) in enumerate(ne_seq)

coords = Fields.coordinate_field(space)
Δh[k] = 2 * R / ne
global_geom = space.global_geometry
global_geom = Spaces.global_geometry(space)

# Initialize state
y0 = map(coords) do coord
Expand Down
2 changes: 1 addition & 1 deletion examples/sphere/solidbody.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ for (k, ne) in enumerate(ne_seq)

Δh[k] = 2 * R / ne

global_geom = space.global_geometry
global_geom = Spaces.global_geometry(space)

h_init = map(coords) do coord
rd = Geometry.great_circle_distance(coord, center, global_geom)
Expand Down
2 changes: 1 addition & 1 deletion lib/ClimaCoreMakie/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function plot_vertices(
space,
ClimaCore.Geometry.Cartesian123Point.(
ClimaCore.Fields.coordinate_field(space),
Ref(space.global_geometry),
Ref(Spaces.global_geometry(space)),
),
)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ClimaCoreVTK/src/ClimaCoreVTK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function WriteVTK.vtk_grid(
coords =
Geometry.Cartesian123Point.(
Fields.coordinate_field(gridspace),
Ref(gridspace.global_geometry),
Ref(Spaces.global_geometry(gridspace)),
)
coord_vecs = (
vec(parent(coords.x1)),
Expand Down
5 changes: 3 additions & 2 deletions lib/ClimaCoreVTK/src/space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ end
function vtk_grid_space(space::Spaces.FaceExtrudedFiniteDifferenceSpace)
# this will need to be updated for warped meshes
horizontal_space = vtk_grid_space(Spaces.horizontal_space(space))
vertical_space = Spaces.FaceFiniteDifferenceSpace(space.vertical_topology)
vertical_space =
Spaces.FaceFiniteDifferenceSpace(Spaces.vertical_topology(space))
return Spaces.ExtrudedFiniteDifferenceSpace(
horizontal_space,
vertical_space,
Expand Down Expand Up @@ -246,7 +247,7 @@ function vtk_cell_space(gridspace::Spaces.FaceExtrudedFiniteDifferenceSpace)
# this will need to be updated for warped meshes
horizontal_space = vtk_cell_space(Spaces.horizontal_space(gridspace))
vertical_space =
Spaces.CenterFiniteDifferenceSpace(gridspace.vertical_topology)
Spaces.CenterFiniteDifferenceSpace(Spaces.vertical_topology(gridspace))
return Spaces.ExtrudedFiniteDifferenceSpace(
horizontal_space,
vertical_space,
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ function Base.Broadcast.broadcasted(
fs,
V,
arg,
tuple(space.global_geometry),
tuple(Spaces.global_geometry(space)),
local_geometry_field(space),
)
end
Expand Down
1 change: 1 addition & 0 deletions src/Grids/column.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ local_geometry_data(colgrid::ColumnGrid, staggering::Staggering) = column(
local_geometry_data(colgrid.full_grid, staggering::Staggering),
colgrid.colidx,
)
global_geometry(colgrid::ColumnGrid) = global_geometry(colgrid.full_grid)
2 changes: 2 additions & 0 deletions src/Grids/extruded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ local_geometry_data(grid::AbstractExtrudedFiniteDifferenceGrid, ::CellCenter) =
grid.center_local_geometry
local_geometry_data(grid::AbstractExtrudedFiniteDifferenceGrid, ::CellFace) =
grid.face_local_geometry
global_geometry(grid::AbstractExtrudedFiniteDifferenceGrid) =
grid.global_geometry

quadrature_style(grid::ExtrudedFiniteDifferenceGrid) =
quadrature_style(grid.horizontal_grid)
Expand Down
1 change: 1 addition & 0 deletions src/Grids/finitedifference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ local_geometry_data(grid::FiniteDifferenceGrid, ::CellCenter) =
grid.center_local_geometry
local_geometry_data(grid::FiniteDifferenceGrid, ::CellFace) =
grid.face_local_geometry
global_geometry(grid::FiniteDifferenceGrid) = grid.global_geometry
1 change: 1 addition & 0 deletions src/Grids/level.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ local_geometry_data(colgrid::LevelGrid{<:Any, PlusHalf{Int}}, ::Nothing) =
local_geometry_data(levelgrid.full_grid, CellFace()),
levelgrid.level + half,
)
global_geometry(levlgrid::LevelGrid) = global_geometry(levlgrid.full_grid)
1 change: 1 addition & 0 deletions src/Grids/spectralelement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ topology(grid::AbstractSpectralElementGrid) = grid.topology

local_geometry_data(grid::AbstractSpectralElementGrid, ::Nothing) =
grid.local_geometry
global_geometry(grid::AbstractSpectralElementGrid) = grid.global_geometry

quadrature_style(grid::AbstractSpectralElementGrid) = grid.quadrature_style
local_dss_weights(grid::SpectralElementGrid1D) = grid.dss_weights
Expand Down
3 changes: 3 additions & 0 deletions src/Spaces/Spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import ..Grids:
topology,
vertical_topology,
local_geometry_data,
global_geometry,
local_dss_weights,
quadrature_style

Expand Down Expand Up @@ -63,6 +64,8 @@ vertical_topology(space::AbstractSpace) = vertical_topology(grid(space))
local_geometry_data(space::AbstractSpace) =
local_geometry_data(grid(space), staggering(space))

global_geometry(space::AbstractSpace) = global_geometry(grid(space))

space(refspace::AbstractSpace, staggering::Staggering) =
space(grid(refspace), staggering)

Expand Down

0 comments on commit 529d48b

Please sign in to comment.