Skip to content

Commit 1344d58

Browse files
Move Δz_metric_component to Geometry module (#2336)
1 parent 3f7d9b9 commit 1344d58

4 files changed

Lines changed: 27 additions & 22 deletions

File tree

docs/src/APIs/geometry_api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ Geometry.AbstractGlobalGeometry
1111
Geometry.CartesianGlobalGeometry
1212
```
1313

14+
## LocalGeometry
15+
16+
```@docs
17+
Geometry.LocalGeometry
18+
```
19+
20+
## Internals
21+
22+
```@docs
23+
Geometry.Δz_metric_component
24+
```
25+
1426
## Coordinates
1527

1628
```@docs

docs/src/APIs/spaces_api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ Spaces.FiniteDifferenceSpace
3434
Users should construct either the center or face space from the mesh, then construct
3535
the other space from the original one: this internally reuses the same data structures, and avoids allocating additional memory.
3636

37-
### Internals
38-
39-
```@docs
40-
Spaces.Δz_metric_component
41-
```
42-
4337
## Spectral Element Spaces
4438

4539
```@docs

src/Geometry/Geometry.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,18 @@ include("conversions.jl")
3131
include("globalgeometry.jl")
3232
include("rmul_with_projection.jl")
3333

34+
"""
35+
Δz_metric_component(::Type{<:AbstractPoint})
36+
37+
The index of the z-component of an abstract point
38+
in an `AxisTensor`.
39+
"""
40+
Δz_metric_component(::Type{<:LatLongZPoint}) = 9
41+
Δz_metric_component(::Type{<:Cartesian3Point}) = 1
42+
Δz_metric_component(::Type{<:Cartesian13Point}) = 4
43+
Δz_metric_component(::Type{<:Cartesian123Point}) = 9
44+
Δz_metric_component(::Type{<:XYZPoint}) = 9
45+
Δz_metric_component(::Type{<:ZPoint}) = 1
46+
Δz_metric_component(::Type{<:XZPoint}) = 4
47+
3448
end # module

src/Spaces/finitedifference.jl

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,31 +107,16 @@ nlevels(space::FiniteDifferenceSpace) = length(space)
107107
# TODO: deprecate?
108108
Base.length(space::FiniteDifferenceSpace) = length(coordinates_data(space))
109109

110-
"""
111-
Δz_metric_component(::Type{<:Goemetry.AbstractPoint})
112-
113-
The index of the z-component of an abstract point
114-
in an `AxisTensor`.
115-
"""
116-
Δz_metric_component(::Type{<:Geometry.LatLongZPoint}) = 9
117-
Δz_metric_component(::Type{<:Geometry.Cartesian3Point}) = 1
118-
Δz_metric_component(::Type{<:Geometry.Cartesian13Point}) = 4
119-
Δz_metric_component(::Type{<:Geometry.Cartesian123Point}) = 9
120-
Δz_metric_component(::Type{<:Geometry.XYZPoint}) = 9
121-
Δz_metric_component(::Type{<:Geometry.ZPoint}) = 1
122-
Δz_metric_component(::Type{<:Geometry.XZPoint}) = 4
123-
124110
"""
125111
Δz_data(space::AbstractSpace)
126112
127113
A DataLayout containing the `Δz` on a given space `space`.
128114
"""
129115
function Δz_data(space::AbstractSpace)
130116
lg = local_geometry_data(space)
131-
data_layout_type = eltype(lg.coordinates)
132117
return getproperty(
133118
lg.∂x∂ξ.components.data,
134-
Δz_metric_component(data_layout_type),
119+
Geometry.Δz_metric_component(eltype(lg.coordinates)),
135120
)
136121
end
137122

0 commit comments

Comments
 (0)