Skip to content

Commit 3ce2033

Browse files
Remove redundant function solve( for relaxation integrators (#2509)
1 parent 52606cc commit 3ce2033

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

src/time_integration/relaxation_methods/methods_subdiagonal.jl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ For details on the relaxation procedure, see
5151
Currently implemented are the third-order, three-stage method by Ralston [`Ralston3`](@ref)
5252
and the canonical fourth-order, four-stage method by Kutta [`RK44`](@ref).
5353
"""
54-
abstract type SubDiagonalRelaxationAlgorithm <: AbstractTimeIntegrationAlgorithm end
54+
abstract type SubDiagonalRelaxationAlgorithm <:
55+
AbstractRelaxationTimeIntegrationAlgorithm end
5556

5657
"""
5758
Ralston3()
@@ -196,16 +197,6 @@ function init(ode::ODEProblem, alg::SubDiagonalRelaxationAlgorithm;
196197
return integrator
197198
end
198199

199-
# Fakes `solve`: https://diffeq.sciml.ai/v6.8/basics/overview/#Solving-the-Problems-1
200-
function solve(ode::ODEProblem,
201-
alg::SubDiagonalRelaxationAlgorithm;
202-
dt, callback = nothing, kwargs...)
203-
integrator = init(ode, alg, dt = dt, callback = callback; kwargs...)
204-
205-
# Start actual solve
206-
solve!(integrator)
207-
end
208-
209200
function step!(integrator::SubDiagonalRelaxationIntegrator)
210201
@unpack prob = integrator.sol
211202
@unpack alg = integrator

src/time_integration/relaxation_methods/methods_vanderHouwen.jl

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Currently implemented methods are the Carpenter-Kennedy-Lewis 4-stage, 3rd-order
3030
and the Carpenter-Kennedy-Lewis 5-stage, 4th-order method [`CKL54`](@ref) which are optimized for the
3131
compressible Navier-Stokes equations.
3232
"""
33-
abstract type vanderHouwenAlgorithm end
33+
abstract type vanderHouwenAlgorithm <: AbstractTimeIntegrationAlgorithm end
3434

3535
"""
3636
vanderHouwenRelaxationAlgorithm
@@ -53,7 +53,8 @@ Currently implemented methods are the Carpenter-Kennedy-Lewis 4-stage, 3rd-order
5353
and the Carpenter-Kennedy-Lewis 5-stage, 4th-order method [`RelaxationCKL54`](@ref) which are optimized for the
5454
compressible Navier-Stokes equations.
5555
"""
56-
abstract type vanderHouwenRelaxationAlgorithm end
56+
abstract type vanderHouwenRelaxationAlgorithm <:
57+
AbstractRelaxationTimeIntegrationAlgorithm end
5758

5859
"""
5960
CKL43()
@@ -233,16 +234,6 @@ function init(ode::ODEProblem, alg::vanderHouwenRelaxationAlgorithm;
233234
return integrator
234235
end
235236

236-
# Fakes `solve`: https://diffeq.sciml.ai/v6.8/basics/overview/#Solving-the-Problems-1
237-
function solve(ode::ODEProblem,
238-
alg::vanderHouwenRelaxationAlgorithm;
239-
dt, callback = nothing, kwargs...)
240-
integrator = init(ode, alg, dt = dt, callback = callback; kwargs...)
241-
242-
# Start actual solve
243-
solve!(integrator)
244-
end
245-
246237
function step!(integrator::vanderHouwenRelaxationIntegrator)
247238
@unpack prob = integrator.sol
248239
@unpack alg = integrator
@@ -301,7 +292,7 @@ function step!(integrator::vanderHouwenRelaxationIntegrator)
301292

302293
bsminus1_minus_as = alg.b[stage - 1] - alg.a[stage]
303294
@threaded for i in eachindex(integrator.u)
304-
# Try to enable optimizations due to `muladd` by avoidin `+=`
295+
# Try to enable optimizations due to `muladd` by avoiding `+=`
305296
# https://github.com/trixi-framework/Trixi.jl/pull/2480#discussion_r2224531702
306297
integrator.direction[i] = integrator.direction[i] +
307298
bs_dt * integrator.du[i]

src/time_integration/relaxation_methods/relaxation_methods.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
abstract type AbstractRelaxationTimeIntegrationAlgorithm <: AbstractTimeIntegrationAlgorithm end
2+
13
abstract type RelaxationIntegrator <: AbstractTimeIntegrator end
24

35
get_tmp_cache(integrator::RelaxationIntegrator) = (integrator.u_tmp,)

0 commit comments

Comments
 (0)