You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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}
13
15
14
16
Create a WENO scheme structure for the given field `u` on the specified `grid` using Chmy.jl.
15
17
16
18
# 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).
20
22
- `stag::Bool`: Whether the grid is staggered (velocities on cell faces) or not (velocities on cell centers).
21
23
"""
22
24
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")
69
71
70
72
71
73
"""
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
grid::StructuredGrid, arch) where {T_field <: AbstractField{<:Real, 1}}
73
79
74
80
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.
75
81
76
82
# 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.
83
89
"""
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)
85
93
86
94
launch = Launcher(arch, grid)
87
95
@@ -112,19 +120,26 @@ end
112
120
113
121
114
122
"""
115
-
WENO_step!(u::T_field, v, weno::FiniteDiffWENO5.WENOScheme, Δt, Δx, grid::StructuredGrid, arch) where T_field <: AbstractField{<:Real} where names
grid::StructuredGrid, arch) where T_field <: AbstractField{<:Real} where names
116
128
117
129
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.
118
130
119
131
# 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.
126
138
"""
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}}
grid::StructuredGrid, arch) where T_field <: AbstractArray{<:Real, 3}
164
183
165
184
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.
166
185
167
186
# 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.
176
195
"""
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}}
backend::Backend) where T_field <: AbstractField{<:Real} where names
124
131
125
132
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.
126
133
127
134
# 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.).
135
142
"""
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}}
backend::Backend) where T_KA <: AbstractArray{<:Real, 3}
184
195
185
196
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.
186
197
187
198
# 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).
196
207
"""
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}}
0 commit comments