File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 283
283
function surface_velocity (ᶠu₃, ᶠuₕ³)
284
284
sfc_u₃ = Fields. level (ᶠu₃. components. data.:1 , half)
285
285
sfc_uₕ³ = Fields. level (ᶠuₕ³. components. data.:1 , half)
286
- sfc_g³³ = g³³_field (sfc_u₃)
286
+ sfc_g³³ = g³³_field (axes ( sfc_u₃) )
287
287
return @. lazy (- sfc_uₕ³ / sfc_g³³) # u³ = uₕ³ + w³ = uₕ³ + w₃ * g³³
288
288
end
289
289
Original file line number Diff line number Diff line change @@ -117,12 +117,13 @@ function compute_strain_rate_face(u::Fields.Field)
117
117
end
118
118
119
119
"""
120
- g³³_field(field )
120
+ g³³_field(space )
121
121
122
- Extracts the value of `g³³` from `Fields.local_geometry_field(field)`.
122
+ Extracts the value of `g³³`, the 3rd component of the metric terms that convert
123
+ Covariant AxisTensors to Contravariant AxisTensors, from the given space.
123
124
"""
124
- function g³³_field (field )
125
- g_field = Fields. local_geometry_field (field ). gⁱʲ. components. data
125
+ function g³³_field (space )
126
+ g_field = Fields. local_geometry_field (space ). gⁱʲ. components. data
126
127
end_index = fieldcount (eltype (g_field)) # This will be 4 in 2D and 9 in 3D.
127
128
return g_field.:($ end_index) # For both 2D and 3D spaces, g³³ = g[end].
128
129
end
Original file line number Diff line number Diff line change 166
166
(; cent_space, face_space) = get_cartesian_spaces ()
167
167
lg_gⁱʲ = cent_space. grid. center_local_geometry. gⁱʲ
168
168
lg_g³³ = lg_gⁱʲ. components. data.:9
169
- @test Fields. field_values (
170
- CA. g³³_field (Fields. coordinate_field (cent_space). x),
171
- ) == lg_g³³
169
+ (; x) = Fields. coordinate_field (cent_space)
170
+ @test Fields. field_values (CA. g³³_field (axes (x))) == lg_g³³
172
171
@test maximum (abs .(lg_g³³ .- CA. g³³ .(lg_gⁱʲ). components. data.:1 )) == 0
173
172
@test maximum (abs .(CA. g³ʰ .(lg_gⁱʲ). components. data.:1 )) == 0
174
173
@test maximum (abs .(CA. g³ʰ .(lg_gⁱʲ). components. data.:2 )) == 0
You can’t perform that action at this time.
0 commit comments