Skip to content

Commit 48a2b8c

Browse files
authored
Merge pull request #7 from JuliaGeodynamics/fix_type
Add more type restriction and update docstrings
2 parents fe5de59 + 6379299 commit 48a2b8c

File tree

6 files changed

+126
-76
lines changed

6 files changed

+126
-76
lines changed

ext/ChmyExt.jl

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ import FiniteDiffWENO5: WENOScheme, WENO_step!
99

1010

1111
"""
12-
WENOScheme(u::AbstractField{T, N}, grid; boundary=(2, 2), stag=true) where {T, N}
12+
WENOScheme(u::AbstractField{T, N},
13+
grid::StructuredGrid;
14+
boundary=(2, 2), stag=true) where {T, N}
1315
1416
Create a WENO scheme structure for the given field `u` on the specified `grid` using Chmy.jl.
1517
1618
# Arguments
17-
- `c0::AbstractField{T, N}`: The input field for which the WENO scheme is to be created. Only used to get the type and size.
18-
- `grid::StructuredGrid`: The computational grid.
19-
- `boundary::NTuple{2N, Int}`: A tuple specifying the boundary conditions for each dimension (0: homogeneous Neumann, 1: homogeneous Dirichlet, 2: periodic). Default is periodic (2).
19+
- `c0::AbstractField{T, N}`: Input field for which the WENO scheme is to be created. Only used to get the type and size.
20+
- `grid::StructuredGrid`: Computational grid.
21+
- `boundary::NTuple{2N, Int}`: Tuple specifying the boundary conditions for each dimension (0: homogeneous Neumann, 1: homogeneous Dirichlet, 2: periodic). Default is periodic (2).
2022
- `stag::Bool`: Whether the grid is staggered (velocities on cell faces) or not (velocities on cell centers).
2123
"""
2224
function WENOScheme(c0::AbstractField{T, N}, grid::StructuredGrid; boundary::NTuple = (2, 2), stag::Bool = true, kwargs...) where {T, N}
@@ -69,19 +71,25 @@ include("KAExt3D.jl")
6971

7072

7173
"""
72-
WENO_step!(u::T_field, v::NamedTuple{names, <:Tuple{<:T_field}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, grid::StructuredGrid, arch) where T_field <: AbstractField{<:Real} where names
74+
WENO_step!(u::T_field,
75+
v::NamedTuple{(:x,), <:Tuple{<:AbstractField{<:Real, 1}}},
76+
weno::FiniteDiffWENO5.WENOScheme,
77+
Δt, Δx,
78+
grid::StructuredGrid, arch) where {T_field <: AbstractField{<:Real, 1}}
7379
7480
Advance the solution `u` by one time step using the 3rd-order Runge-Kutta method with WENO5 spatial discretization using Chmy.jl fields in 1D.
7581
7682
# Arguments
77-
- `u::T_field`: The current solution field to be updated in place.
78-
- `v::NamedTuple{names, <:Tuple{<:T_field}}`: The velocity field (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple with field `:x`.
79-
- `weno::WENOScheme`: The WENO scheme structure containing necessary parameters and fields.
80-
- `Δt`: The time step size.
81-
- `Δx`: The spatial grid size.
82-
- `grid::StructuredGrid`: The computational grid.
83+
- `u::T_field`: Current solution field to be updated in place.
84+
- `v::NamedTuple{(:x,), <:Tuple{<:AbstractField{<:Real, 1}}}`: Velocity field (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple with field `:x`.
85+
- `weno::WENOScheme`: WENO scheme structure containing necessary parameters and fields.
86+
- `Δt`: Time step size.
87+
- `Δx`: Spatial grid size.
88+
- `grid::StructuredGrid`: Computational grid from Chmy.
8389
"""
84-
function WENO_step!(u::T_field, v::NamedTuple{(:x,), <:Tuple{<:T_field}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, grid::StructuredGrid, arch) where {T_field <: AbstractVector{<:Real}}
90+
function WENO_step!(u::T_field, v::NamedTuple{(:x,), <:Tuple{<:AbstractField{<:Real, 1}}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, grid::StructuredGrid, arch) where {T_field <: AbstractField{<:Real, 1}}
91+
92+
@assert get_backend(u) == get_backend(v.x)
8593

8694
launch = Launcher(arch, grid)
8795

@@ -112,19 +120,26 @@ end
112120

113121

114122
"""
115-
WENO_step!(u::T_field, v, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, grid::StructuredGrid, arch) where T_field <: AbstractField{<:Real} where names
123+
WENO_step!(u::T_field,
124+
v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractField{<:Real}, 2}}},
125+
weno::FiniteDiffWENO5.WENOScheme,
126+
Δt, Δx,
127+
grid::StructuredGrid, arch) where T_field <: AbstractField{<:Real} where names
116128
117129
Advance the solution `u` by one time step using the 3rd-order Runge-Kutta method with WENO5 spatial discretization using Chmy.jl fields in 2D.
118130
119131
# Arguments
120-
- `u::T_field`: The current solution field to be updated in place.
121-
- `v::NamedTuple{names, <:Tuple{<:T_field}}`: The velocity field (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple with fields `:x` and `:y`.
122-
- `weno::WENOScheme`: The WENO scheme structure containing necessary parameters and fields.
123-
- `Δt`: The time step size.
124-
- `Δx`: The spatial grid size.
125-
- `grid::StructuredGrid`: The computational grid.
132+
- `u::T_field`: Current solution field to be updated in place.
133+
- `v::NamedTuple{names, <:Tuple{<:T_field}}`: The velocity field (can be staggered or not based on `weno.stag`).
134+
- `weno::WENOScheme`: WENO scheme structure containing necessary parameters and fields.
135+
- `Δt`: Time step size.
136+
- `Δx`: Spatial grid size.
137+
- `grid::StructuredGrid`: Computational grid from Chmy.
126138
"""
127-
function WENO_step!(u::T_field, v::NamedTuple{names, <:Tuple{Vararg{AbstractField{<:Real}, 2}}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, grid::StructuredGrid, arch) where {T_field <: AbstractField{<:Real, 2}, names}
139+
function WENO_step!(u::T_field, v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractField{<:Real}, 2}}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, grid::StructuredGrid, arch) where {T_field <: AbstractField{<:Real, 2}}
140+
141+
@assert get_backend(u) == get_backend(v.x)
142+
@assert get_backend(u) == get_backend(v.y)
128143

129144
launch = Launcher(arch, grid)
130145

@@ -160,21 +175,29 @@ end
160175

161176

162177
"""
163-
WENO_step!(u::T_field, v, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, Δz, grid::StructuredGrid, arch) where T_field <: AbstractArray{<:Real, 3}
178+
WENO_step!(u::T_field,
179+
v::NamedTuple{names, <:Tuple{Vararg{AbstractField{<:Real}, 2}}},
180+
weno::FiniteDiffWENO5.WENOScheme,
181+
Δt, Δx, Δy, Δz,
182+
grid::StructuredGrid, arch) where T_field <: AbstractArray{<:Real, 3}
164183
165184
Advance the solution `u` by one time step using the 3rd-order Runge-Kutta method with WENO5 spatial discretization using Chmy.jl fields in 3D.
166185
167186
# Arguments
168-
- `u::T_field`: The current solution field to be updated in place.
169-
- `v::NamedTuple{names, <:Tuple{<:T_field}}`: The velocity field (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple with fields `:x`, `:y` and `:z`.
170-
- `weno::WENOScheme`: The WENO scheme structure containing necessary parameters and fields.
171-
- `Δt`: The time step size.
172-
- `Δx`: The spatial grid size.
173-
- `Δy`: The spatial grid size.
174-
- `Δz`: The spatial grid size.
175-
- `grid::StructuredGrid`: The computational grid.
187+
- `u::T_field`: Current solution field to be updated in place.
188+
- `v::NamedTuple{names, <:Tuple{Vararg{AbstractField{<:Real}, 2}}}`: Velocity field (can be staggered or not based on `weno.stag`).
189+
- `weno::WENOScheme`: WENO scheme structure containing necessary parameters and fields.
190+
- `Δt`: Time step size.
191+
- `Δx`: Spatial grid size.
192+
- `Δy`: Spatial grid size.
193+
- `Δz`: Spatial grid size.
194+
- `grid::StructuredGrid`: Computational grid from Chmy.
176195
"""
177-
function WENO_step!(u::T_field, v, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, Δz, grid::StructuredGrid, arch) where {T_field <: AbstractArray{<:Real, 3}}
196+
function WENO_step!(u::T_field, v::NamedTuple{(:x, :y, :z), <:Tuple{Vararg{AbstractField{<:Real}, 3}}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, Δz, grid::StructuredGrid, arch) where {T_field <: AbstractArray{<:Real, 3}}
197+
198+
@assert get_backend(u) == get_backend(v.x)
199+
@assert get_backend(u) == get_backend(v.y)
200+
@assert get_backend(u) == get_backend(v.z)
178201

179202
launch = Launcher(arch, grid)
180203

ext/KAExt.jl

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ include("KAExt2D.jl")
7373
include("KAExt3D.jl")
7474

7575
"""
76-
WENO_step!(u::T_KA, v::NamedTuple{names, <:Tuple{<:T_KA}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, backend::Backend) where T_KA <: AbstractField{<:Real} where names
76+
WENO_step!(u::T_KA,
77+
v::NamedTuple{names, <:Tuple{<:T_KA}},
78+
weno::FiniteDiffWENO5.WENOScheme, Δt, Δx,
79+
backend::Backend) where T_KA <: AbstractField{<:Real} where names
7780
7881
Advance the solution `u` by one time step using the 3rd-order Runge-Kutta method with WENO5 spatial discretization using Chmy.jl fields in 1D.
7982
@@ -85,7 +88,7 @@ Advance the solution `u` by one time step using the 3rd-order Runge-Kutta method
8588
- `Δx`: The spatial grid size.
8689
- `backend::Backend`: The KernelAbstractions backend in use (e.g., CPU(), CUDABackend(), etc.).
8790
"""
88-
function WENO_step!(u::T_KA, v::NamedTuple{(:x,), <:Tuple{<:T_KA}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, backend::Backend) where {T_KA <: AbstractVector{<:Real}}
91+
function WENO_step!(u::T_KA, v::NamedTuple{(:x,), <:Tuple{<:AbstractArray{<:Real}}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, backend::Backend) where {T_KA <: AbstractVector{<:Real}}
8992

9093
@assert get_backend(u) == backend
9194
@assert get_backend(v.x) == backend
@@ -120,20 +123,24 @@ end
120123

121124

122125
"""
123-
WENO_step!(u::T_field, v, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, backend::Backend) where T_field <: AbstractField{<:Real} where names
126+
WENO_step!(u::T_field,
127+
v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractArray{<:Real}, 2}}},
128+
weno::FiniteDiffWENO5.WENOScheme,
129+
Δt, Δx, Δy,
130+
backend::Backend) where T_field <: AbstractField{<:Real} where names
124131
125132
Advance the solution `u` by one time step using the 3rd-order Runge-Kutta method with WENO5 spatial discretization using Chmy.jl fields in 2D.
126133
127134
# Arguments
128-
- `u::T_KA`: The current solution field to be updated in place.
129-
- `v::NamedTuple{names, <:Tuple{<:T_KA}}`: The velocity field (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple with fields `:x` and `:y`.
130-
- `weno::WENOScheme`: The WENO scheme structure containing necessary parameters and fields.
131-
- `Δt`: The time step size.
132-
- `Δx`: The spatial grid size.
133-
- `Δy`: The spatial grid size.
134-
- `backend::Backend`: The KernelAbstractions backend in use (e.g., CPU(), CUDABackend(), etc.).
135+
- `u::T_KA`: Current solution field to be updated in place.
136+
- `v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractArray{<:Real}, 2}}}`: Velocity field (can be staggered or not based on `weno.stag`).
137+
- `weno::WENOScheme`: WENO scheme structure containing necessary parameters and fields.
138+
- `Δt`: Time step size.
139+
- `Δx`: Spatial grid size.
140+
- `Δy`: Spatial grid size.
141+
- `backend::Backend`: KernelAbstractions backend in use (e.g., CPU(), CUDABackend(), etc.).
135142
"""
136-
function WENO_step!(u::T_KA, v::NamedTuple{(:x, :y), <:Tuple{<:AbstractArray{<:Real}, <:AbstractArray{<:Real}}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, backend::Backend) where {T_KA <: AbstractArray{<:Real, 2}}
143+
function WENO_step!(u::T_KA, v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractArray{<:Real}, 2}}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, backend::Backend) where {T_KA <: AbstractArray{<:Real, 2}}
137144

138145
@assert get_backend(u) == backend
139146
@assert get_backend(v.x) == backend
@@ -180,21 +187,25 @@ end
180187

181188

182189
"""
183-
WENO_step!(u::T_KA, v, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, Δz, grid::StructuredGrid, arch) where T_KA <: AbstractArray{<:Real, 3}
190+
WENO_step!(u::T_KA,
191+
v::NamedTuple{(:x, :y, :z), <:Tuple{Vararg{AbstractArray{<:Real}, 3}}},
192+
weno::FiniteDiffWENO5.WENOScheme,
193+
Δt, Δx, Δy, Δz,
194+
backend::Backend) where T_KA <: AbstractArray{<:Real, 3}
184195
185196
Advance the solution `u` by one time step using the 3rd-order Runge-Kutta method with WENO5 spatial discretization using Chmy.jl fields in 3D.
186197
187198
# Arguments
188-
- `u::T_KA`: The current solution field to be updated in place.
189-
- `v::NamedTuple{names, <:Tuple{<:T_KA}}`: The velocity field (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple with fields `:x`, `:y` and `:z`.
190-
- `weno::WENOScheme`: The WENO scheme structure containing necessary parameters and fields.
191-
- `Δt`: The time step size.
192-
- `Δx`: The spatial grid size.
193-
- `Δy`: The spatial grid size.
194-
- `Δz`: The spatial grid size.
195-
- `backend::Backend`: The computational backend to use (e.g., CPU, GPU).
199+
- `u::T_KA`: Current solution field to be updated in place.
200+
- `v::NamedTuple{names, <:Tuple{<:T_KA}}`: Velocity field (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple with fields `:x`, `:y` and `:z`.
201+
- `weno::WENOScheme`: WENO scheme structure containing necessary parameters and fields.
202+
- `Δt`: Time step size.
203+
- `Δx`: Spatial grid size.
204+
- `Δy`: Spatial grid size.
205+
- `Δz`: Spatial grid size.
206+
- `backend::Backend`: Computational backend to use (e.g., CPU, GPU).
196207
"""
197-
function WENO_step!(u::T_KA, v, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, Δz, backend::Backend) where {T_KA <: AbstractArray{<:Real, 3}}
208+
function WENO_step!(u::T_KA, v::NamedTuple{(:x, :y, :z), <:Tuple{Vararg{AbstractArray{<:Real}, 3}}}, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, Δy, Δz, backend::Backend) where {T_KA <: AbstractArray{<:Real, 3}}
198209

199210
@assert get_backend(u) == backend
200211
@assert get_backend(v.x) == backend

src/1D/time_stepping.jl

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
"""
2-
WENO_step!(u::T, v, weno::WENOScheme, Δt, Δx) where T <: AbstractVector{<:Real}
2+
WENO_step!(u::T,
3+
v::NamedTuple{(:x,), <:Tuple{<:Vector{<:Real}}},
4+
weno::WENOScheme,
5+
Δt, Δx) where T <: AbstractVector{<:Real}
36
47
Advance the solution `u` by one time step using the 3rd-order SSP Runge-Kutta method with WENO5-Z as the spatial discretization in 1D.
58
69
# Arguments
7-
- `u::T`: The current solution array to be updated in place.
8-
- `v`: The velocity array (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple like (x=...).
9-
- `weno::WENOScheme`: The WENO scheme structure containing necessary parameters and temporary arrays.
10-
- `Δt`: The time step size.
11-
- `Δx`: The spatial grid size.
10+
- `u::T`: Current solution array to be updated in place.
11+
- `v::NamedTuple{(:x,), <:Tuple{<:Vector{<:Real}}}`: Velocity array (can be staggered or not based on `weno.stag`).
12+
- `weno::WENOScheme`: WENO scheme structure containing necessary parameters and temporary arrays.
13+
- `Δt`: Time step size.
14+
- `Δx`: Spatial grid size.
1215
1316
Citation: Borges et al. 2008: "An improved weighted essentially non-oscillatory scheme for hyperbolic conservation laws"
1417
doi:10.1016/j.jcp.2007.11.038
1518
"""
16-
function WENO_step!(u::T, v, weno::WENOScheme, Δt, Δx) where {T <: Vector{<:Real}}
19+
function WENO_step!(u::T, v::NamedTuple{(:x,), <:Tuple{<:Vector{<:Real}}}, weno::WENOScheme, Δt, Δx) where {T <: Vector{<:Real}}
1720

1821
nx = size(u, 1)
1922
Δx_ = inv(Δx)

src/2D/time_stepping.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
"""
2-
WENO_step!(u::T, v, weno::WENOScheme, Δt, Δx, Δy) where T <: AbstractArray{<:Real, 2}
2+
WENO_step!(u::T,
3+
v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractArray{<:Real}, 2}}},
4+
weno::WENOScheme,
5+
Δt, Δx, Δy) where {T <: AbstractArray{<:Real, 2}}
36
47
Advance the solution `u` by one time step using the 3rd-order SSP Runge-Kutta method with WENO5-Z as the spatial discretization in 2D.
58
69
# Arguments
7-
- `u::T`: The current solution array to be updated in place.
8-
- `v`: The velocity array (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple like (x=..., y=...).
9-
- `weno::WENOScheme`: The WENO scheme structure containing necessary parameters and temporary arrays.
10-
- `Δt`: The time step size.
11-
- `Δx`: The spatial grid size in the x-direction.
12-
- `Δy`: The spatial grid size in the y-direction.
10+
- `u::T`: Current solution array to be updated in place.
11+
- `v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractArray{<:Real}, 2}}}`: Velocity array (can be staggered or not based on `weno.stag`).
12+
- `weno::WENOScheme`: WENO scheme structure containing necessary parameters and temporary arrays.
13+
- `Δt`: Time step size.
14+
- `Δx`: Spatial grid size in the x-direction.
15+
- `Δy`: Spatial grid size in the y-direction.
1316
1417
Citation: Borges et al. 2008: "An improved weighted essentially non-oscillatory scheme for hyperbolic conservation laws"
1518
doi:10.1016/j.jcp.2007.11.038
1619
"""
17-
function WENO_step!(u::T, v, weno::WENOScheme, Δt, Δx, Δy) where {T <: Array{<:Real, 2}}
20+
function WENO_step!(u::T, v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractArray{<:Real}, 2}}}, weno::WENOScheme, Δt, Δx, Δy) where {T <: Array{<:Real, 2}}
1821

1922
nx, ny = size(u, 1), size(u, 2)
2023
Δx_, Δy_ = inv(Δx), inv(Δy)

src/3D/time_stepping.jl

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
"""
2-
WENO_step!(u::T, v, weno::WENOScheme, Δt, Δx, Δy, Δz) where T <: AbstractArray{<:Real, 3}
2+
WENO_step!(u::T,
3+
v::NamedTuple{(:x, :y, :z), <:Tuple{Vararg{Array{<:Real}, 3}}},
4+
weno::WENOScheme,
5+
Δt, Δx, Δy, Δz) where T <: AbstractArray{<:Real, 3}
36
47
Advance the solution `u` by one time step using the 3rd-order SSP Runge-Kutta method with WENO5-Z as the spatial discretization in 3D.
58
69
# Arguments
7-
- `u::T`: The current solution array to be updated in place.
8-
- `v`: The velocity array (can be staggered or not based on `weno.stag`). Needs to be a NamedTuple like (x=..., y=..., z=...).
9-
- `weno::WENOScheme`: The WENO scheme structure containing necessary parameters and temporary arrays.
10-
- `Δt`: The time step size.
11-
- `Δx`: The spatial grid size in the x-direction.
12-
- `Δy`: The spatial grid size in the y-direction.
13-
- `Δz`: The spatial grid size in the z-direction.
10+
- `u::T`: Current solution array to be updated in place.
11+
- `v::NamedTuple{(:x, :y, :z), <:Tuple{Vararg{Array{<:Real}, 3}}}`: Velocity fields in each direction, possibly staggered depending on `weno.stag`.
12+
- `weno::WENOScheme`: WENO scheme structure containing necessary parameters and temporary arrays.
13+
- `Δt`: Time step size.
14+
- `Δx`: Spatial grid size in the x-direction.
15+
- `Δy`: Spatial grid size in the y-direction.
16+
- `Δz`: Spatial grid size in the z-direction.
1417
1518
Citation: Borges et al. 2008: "An improved weighted essentially non-oscillatory scheme for hyperbolic conservation laws"
1619
doi:10.1016/j.jcp.2007.11.038
1720
"""
18-
function WENO_step!(u::T, v, weno::WENOScheme, Δt, Δx, Δy, Δz) where {T <: Array{<:Real, 3}}
21+
function WENO_step!(u::T, v::NamedTuple{(:x, :y, :z), <:Tuple{Vararg{Array{<:Real}, 3}}}, weno::WENOScheme, Δt, Δx, Δy, Δz) where {T <: Array{<:Real, 3}}
1922

2023
nx, ny, nz = size(u, 1), size(u, 2), size(u, 3)
2124
Δx_, Δy_, Δz_ = inv(Δx), inv(Δy), inv(Δz)

test/test_3D_advection.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,14 @@
171171
vy0 = ones(size(Y3D))
172172
vz0 = zeros(size(Z3D)) # Rotation in XY plane only
173173

174-
v = (; x = vx0, y = vy0, z = vz0)
174+
v = (;
175+
x = Field(arch, grid, Center()),
176+
y = Field(arch, grid, Center()),
177+
z = Field(arch, grid, Center()),
178+
)
179+
set!(v.x, vy0)
180+
set!(v.y, vx0)
181+
set!(v.z, vz0)
175182

176183
x0 = 1 / 4
177184
c = 0.08

0 commit comments

Comments
 (0)