Skip to content

Commit 2cf3b22

Browse files
committed
chore: rename cached variable
1 parent 14503e4 commit 2cf3b22

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

lib/NeuralClosure/src/data_generation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function create_les_data(;
201201
# Since processors are called outside
202202
# Runge-Kutta steps, there is no danger
203203
# in overwriting the arrays.
204-
F = cache.u₀,
204+
F = cache.ustart,
205205
p = cache.p,
206206
),
207207
),

src/time_steppers/step_explicit_runge_kutta.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ function timestep!(method::ExplicitRungeKuttaMethod, stepper, Δt; θ = nothing,
55
(; setup, psolver, u, temp, t, n) = stepper
66
(; closure_model, temperature) = setup
77
(; A, b, c) = method
8-
(; uprev, ku, p, tempprev, ktemp, diff) = cache
8+
(; ustart, ku, p, tempstart, ktemp, diff) = cache
99
nstage = length(b)
1010
m = closure_model
1111

1212
# Update current solution
13-
tprev = t
14-
copyto!(uprev, u)
15-
isnothing(temp) || copyto!(tempprev, temp)
13+
tstart = t
14+
copyto!(ustart, u)
15+
isnothing(temp) || copyto!(tempstart, temp)
1616

1717
for i = 1:nstage
1818
# Compute force at current stage i
@@ -29,15 +29,15 @@ function timestep!(method::ExplicitRungeKuttaMethod, stepper, Δt; θ = nothing,
2929
isnothing(m) || (ku[i] .+= m(u, θ))
3030

3131
# Intermediate time step
32-
t = tprev + c[i] * Δt
32+
t = tstart + c[i] * Δt
3333

3434
# Apply stage forces
35-
u .= uprev
35+
u .= ustart
3636
for j = 1:i
3737
@. u += Δt * A[i, j] * ku[j]
3838
end
3939
if !isnothing(temp)
40-
temp .= tempprev
40+
temp .= tempstart
4141
for j = 1:i
4242
@. temp += Δt * A[i, j] * ktemp[j]
4343
end
@@ -66,8 +66,8 @@ function timestep(method::ExplicitRungeKuttaMethod, stepper, Δt; θ = nothing)
6666
m = closure_model
6767

6868
# Update current solution (does not depend on previous step size)
69-
tprev = t
70-
uprev = u
69+
tstart = t
70+
ustart = u
7171
ku = ()
7272
ktemp = ()
7373

@@ -89,15 +89,15 @@ function timestep(method::ExplicitRungeKuttaMethod, stepper, Δt; θ = nothing)
8989
isnothing(temp) || (ktemp = (ktemp..., Ftemp))
9090

9191
# Intermediate time step
92-
t = tprev + c[i] * Δt
92+
t = tstart + c[i] * Δt
9393

9494
# Apply stage forces
95-
u = uprev
95+
u = ustart
9696
for j = 1:i
9797
u = @. u + Δt * A[i, j] * ku[j]
9898
end
9999
if !isnothing(temp)
100-
temp = tempprev
100+
temp = tempstart
101101
for j = 1:i
102102
temp = @. temp + Δt * A[i, j] * ktemp[j]
103103
end

src/time_steppers/time_stepper_caches.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ function ode_method_cache(::OneLegMethod, setup)
3232
end
3333

3434
function ode_method_cache(method::ExplicitRungeKuttaMethod, setup)
35-
uprev = vectorfield(setup)
35+
ustart = vectorfield(setup)
3636
ns = length(method.b)
3737
ku = map(i -> vectorfield(setup), 1:ns)
3838
p = scalarfield(setup)
3939
if isnothing(setup.temperature)
40-
tempprev = nothing
40+
tempstart = nothing
4141
ktemp = nothing
4242
diff = nothing
4343
else
44-
tempprev = scalarfield(setup)
44+
tempstart = scalarfield(setup)
4545
ktemp = map(i -> scalarfield(setup), 1:ns)
4646
diff = vectorfield(setup)
4747
end
48-
(; uprev, ku, p, tempprev, ktemp, diff)
48+
(; ustart, ku, p, tempstart, ktemp, diff)
4949
end
5050

5151
function ode_method_cache(method::ImplicitRungeKuttaMethod{T}, setup, V, p) where {T}

0 commit comments

Comments
 (0)