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 283283function surface_velocity (ᶠu₃, ᶠuₕ³)
284284 sfc_u₃ = Fields. level (ᶠu₃. components. data.:1 , half)
285285 sfc_uₕ³ = Fields. level (ᶠuₕ³. components. data.:1 , half)
286- sfc_g³³ = g³³_field (sfc_u₃)
286+ sfc_g³³ = g³³_field (axes ( sfc_u₃) )
287287 return @. lazy (- sfc_uₕ³ / sfc_g³³) # u³ = uₕ³ + w³ = uₕ³ + w₃ * g³³
288288end
289289
Original file line number Diff line number Diff line change @@ -117,12 +117,13 @@ function compute_strain_rate_face(u::Fields.Field)
117117end
118118
119119"""
120- g³³_field(field )
120+ g³³_field(space )
121121
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.
123124"""
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
126127 end_index = fieldcount (eltype (g_field)) # This will be 4 in 2D and 9 in 3D.
127128 return g_field.:($ end_index) # For both 2D and 3D spaces, g³³ = g[end].
128129end
Original file line number Diff line number Diff line change 166166 (; cent_space, face_space) = get_cartesian_spaces ()
167167 lg_gⁱʲ = cent_space. grid. center_local_geometry. gⁱʲ
168168 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³³
172171 @test maximum (abs .(lg_g³³ .- CA. g³³ .(lg_gⁱʲ). components. data.:1 )) == 0
173172 @test maximum (abs .(CA. g³ʰ .(lg_gⁱʲ). components. data.:1 )) == 0
174173 @test maximum (abs .(CA. g³ʰ .(lg_gⁱʲ). components. data.:2 )) == 0
You can’t perform that action at this time.
0 commit comments