Skip to content

Commit c15e85b

Browse files
Merge #131
131: Rename cache method to init_cache r=charleskawczynski a=charleskawczynski This PR renames the `cache` method to `init_cache`, peeled off from #26. Co-authored-by: Charles Kawczynski <[email protected]>
2 parents 1e0e996 + b6c1593 commit c15e85b

File tree

12 files changed

+13
-13
lines changed

12 files changed

+13
-13
lines changed

perf/benchmark.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function main()
1010
for problem in (split_linear_prob_wfact_split(), split_linear_prob_wfact_split_fe())
1111
integrator = DiffEqBase.init(problem, algorithm; dt)
1212

13-
cache = CTS.cache(problem, algorithm)
13+
cache = CTS.init_cache(problem, algorithm)
1414

1515
CTS.step_u!(integrator, cache)
1616

perf/flame.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ end
3333
algorithm = CTS.IMEXARKAlgorithm(ARS343(), NewtonsMethod(; max_iters = 2))
3434
dt = 0.01
3535
integrator = DiffEqBase.init(prob, algorithm; dt)
36-
cache = CTS.cache(prob, algorithm)
36+
cache = CTS.init_cache(prob, algorithm)
3737
do_work!(integrator, cache) # compile first
3838
import Profile
3939
Profile.clear_malloc_data()

perf/jet.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function config_integrators(problem)
1818
algorithm = CTS.IMEXARKAlgorithm(ARS343(), NewtonsMethod(; max_iters = 2))
1919
dt = 0.01
2020
integrator = DiffEqBase.init(problem, algorithm; dt)
21-
integrator.cache = CTS.cache(problem, algorithm)
21+
integrator.cache = CTS.init_cache(problem, algorithm)
2222
return (; integrator)
2323
end
2424
prob = if parsed_args["problem"] == "ode_fun"

src/integrators.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function DiffEqBase.__init(
114114
callback,
115115
advance_to_tstop,
116116
false,
117-
cache(prob, alg; dt, kwargs...),
117+
init_cache(prob, alg; dt, kwargs...),
118118
sol,
119119
)
120120
DiffEqBase.initialize!(callback, u0, t0, integrator)

src/solvers/ark.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct AdditiveRungeKuttaFullCache{Nstages, RT, A, O, L}
4242
end
4343

4444

45-
function cache(
45+
function init_cache(
4646
prob::DiffEqBase.AbstractODEProblem{uType, tType, true},
4747
alg::AdditiveRungeKutta;
4848
dt,

src/solvers/imex_ark.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct IMEXARKCache{SCU, SCE, SCI, T, Γ, NMC}
4949
newtons_method_cache::NMC
5050
end
5151

52-
function cache(prob::DiffEqBase.AbstractODEProblem, alg::IMEXARKAlgorithm; kwargs...)
52+
function init_cache(prob::DiffEqBase.AbstractODEProblem, alg::IMEXARKAlgorithm; kwargs...)
5353
(; u0, f) = prob
5454
(; T_imp!) = f
5555
(; tab, newtons_method) = alg

src/solvers/lsrk.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct LowStorageRungeKutta2NIncCache{Nstages, RT, A}
3333
du::A
3434
end
3535

36-
function cache(prob::DiffEqBase.ODEProblem, alg::LowStorageRungeKutta2N; kwargs...)
36+
function init_cache(prob::DiffEqBase.ODEProblem, alg::LowStorageRungeKutta2N; kwargs...)
3737
# @assert prob.problem_type isa DiffEqBase.IncrementingODEProblem ||
3838
# prob.f isa DiffEqBase.IncrementingODEFunction
3939
du = zero(prob.u0)

src/solvers/mis.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ end
5151

5252
nstages(::MultirateInfinitesimalStepCache{Nstages}) where {Nstages} = Nstages
5353

54-
function cache(
54+
function init_cache(
5555
prob::DiffEqBase.AbstractODEProblem{uType, tType, true},
5656
alg::MultirateInfinitesimalStep;
5757
kwargs...,

src/solvers/multirate.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ struct MultirateCache{OC, II}
2424
innerinteg::II
2525
end
2626

27-
function cache(prob::DiffEqBase.AbstractODEProblem, alg::Multirate; dt, fast_dt, kwargs...)
27+
function init_cache(prob::DiffEqBase.AbstractODEProblem, alg::Multirate; dt, fast_dt, kwargs...)
2828

2929
@assert prob.f isa DiffEqBase.SplitFunction
3030

3131
# subproblems
3232
outerprob = DiffEqBase.remake(prob; f = prob.f.f2)
33-
outercache = cache(outerprob, alg.slow)
33+
outercache = init_cache(outerprob, alg.slow)
3434

3535
innerfun = init_inner(prob, outercache, dt)
3636
innerprob = DiffEqBase.remake(prob; f = innerfun)

src/solvers/rosenbrock.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct RosenbrockCache{Nstages, RT, N², A}
1818
linsolve!::Any
1919
end
2020

21-
function cache(prob::DiffEqBase.AbstractODEProblem, alg::RosenbrockAlgorithm; kwargs...)
21+
function init_cache(prob::DiffEqBase.AbstractODEProblem, alg::RosenbrockAlgorithm; kwargs...)
2222

2323
tab = tableau(alg, eltype(prob.u0))
2424
Nstages = length(tab.m)

0 commit comments

Comments
 (0)