Skip to content

Commit

Permalink
Merge #105
Browse files Browse the repository at this point in the history
105: Remove old and unused imex ark algo r=charleskawczynski a=charleskawczynski

This PR does a bit of house cleaning and removes some of the old imex ark algorithm pieces

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
  • Loading branch information
bors[bot] and charleskawczynski authored Dec 16, 2022
2 parents aa6677c + 5a35a2b commit 54aeeb6
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 824 deletions.
4 changes: 2 additions & 2 deletions docs/src/algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ ForwardEulerODEFunction
## IMEX ARK methods

```@docs
OldIMEXARKAlgorithm
Oldmake_IMEXARKTableau
IMEXARKAlgorithm
IMEXARKTableau
```

The convergence orders of the provided methods are verified using test cases from [ARKode](http://runge.math.smu.edu/ARKode_example.pdf). Plots of the solutions to these test cases, the errors of these solutions, and the convergence orders with respect to `dt` are shown below.
Expand Down
12 changes: 6 additions & 6 deletions perf/flame.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ end
(s, parsed_args) = parse_commandline()
cts = joinpath(dirname(@__DIR__));
include(joinpath(cts, "test", "problems.jl"))
function do_work!(integrator, not_generated_cache)
function do_work!(integrator, cache)
for _ in 1:100_000
CTS.not_generated_step_u!(integrator, not_generated_cache)
CTS.step_u!(integrator, cache)
end
end
problem_str = parsed_args["problem"]
Expand All @@ -30,16 +30,16 @@ elseif problem_str=="fe"
else
error("Bad option")
end
algorithm = CTS.OldIMEXARKAlgorithm(OldARS343(), NewtonsMethod(; max_iters = 2))
algorithm = CTS.IMEXARKAlgorithm(ARS343(), NewtonsMethod(; max_iters = 2))
dt = 0.01
integrator = DiffEqBase.init(prob, algorithm; dt)
not_generated_cache = CTS.not_generated_cache(prob, algorithm)
do_work!(integrator, not_generated_cache) # compile first
cache = CTS.cache(prob, algorithm)
do_work!(integrator, cache) # compile first
import Profile
Profile.clear_malloc_data()
Profile.clear()
prof = Profile.@profile begin
do_work!(integrator, not_generated_cache)
do_work!(integrator, cache)
end

import ProfileCanvas
Expand Down
11 changes: 4 additions & 7 deletions perf/jet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ end
cts = joinpath(dirname(@__DIR__));
include(joinpath(cts, "test", "problems.jl"))
function config_integrators(problem)
algorithm = CTS.OldIMEXARKAlgorithm(OldARS343(), NewtonsMethod(; linsolve = linsolve_direct, max_iters = 2))
algorithm = CTS.IMEXARKAlgorithm(ARS343(), NewtonsMethod(; linsolve = linsolve_direct, max_iters = 2))
dt = 0.01
integrator = DiffEqBase.init(problem, algorithm; dt)
not_generated_integrator = DiffEqBase.init(problem, algorithm; dt)
integrator.cache = CTS.cache(problem, algorithm)
not_generated_integrator.cache = CTS.not_generated_cache(problem, algorithm)
return (; integrator_generated=integrator, not_generated_integrator)
return (; integrator)
end
prob = if parsed_args["problem"]=="ode_fun"
split_linear_prob_wfact_split()
Expand All @@ -30,8 +28,7 @@ elseif parsed_args["problem"]=="fe"
else
error("Bad option")
end
(; not_generated_integrator) = config_integrators(prob)
integrator = not_generated_integrator
(; integrator) = config_integrators(prob)

JET.@test_opt CTS.not_generated_step_u!(integrator, integrator.cache)
JET.@test_opt CTS.step_u!(integrator, integrator.cache)

3 changes: 1 addition & 2 deletions src/ClimaTimeSteppers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ include("solvers/update_signal_handler.jl")
include("solvers/convergence_condition.jl")
include("solvers/convergence_checker.jl")
include("solvers/newtons_method.jl")
include("solvers/imex_ark.jl")
include("solvers/imex_ark_tableaus.jl")
include("solvers/imex_ark2.jl")

# Include concrete implementations
include("solvers/imex_ark_tableaus.jl")
include("solvers/multirate.jl")
include("solvers/lsrk.jl")
include("solvers/ssprk.jl")
Expand Down
1 change: 0 additions & 1 deletion src/convergence_orders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const second_order_tableau = [
#####
const third_order_tableau = [
ARS233,
OldARS343,
ARS343,
ARS443,
IMKG342a,
Expand Down
Loading

0 comments on commit 54aeeb6

Please sign in to comment.