This may not be crucial right now, but we should think about the following options:
In code like
|
function (::RKIMEX{N})(res, uₙ, Δt, f1!, du, du_tmp, u, p, t, stages_ex, stages_im, stage, RK) where {N} |
|
@. res = u |
|
for j in 1:(stage - 1) |
|
@. res = res - RK.a_ex[stage, j] * stages_ex[j] - RK.a_im[stage, j] * stages_im[j] |
|
end |
|
@. du = u * Δt + uₙ |
|
f1!(du_tmp, du, p, t + RK.c_im[stage] * Δt) |
|
@. res = res - RK.a_im[stage, stage] * du_tmp |
|
return res |
|
end |
, adding the previous equations could be done once before calling the nonlinear solver.
We could use muladd for many of the updates, e.g.,
|
function (::RKIMEX{N})(res, uₙ, Δt, f1!, du, du_tmp, u, p, t, stages_ex, stages_im, stage, RK) where {N} |
|
@. res = u |
|
for j in 1:(stage - 1) |
|
@. res = res - RK.a_ex[stage, j] * stages_ex[j] - RK.a_im[stage, j] * stages_im[j] |
|
end |
|
@. du = u * Δt + uₙ |
|
f1!(du_tmp, du, p, t + RK.c_im[stage] * Δt) |
|
@. res = res - RK.a_im[stage, stage] * du_tmp |
|
return res |
|
end |
.
Does something like
impact the use of other floating point types?
Is it better to use
|
fill!(integrator.u_tmp, zero(eltype(integrator.u_tmp))) |
or
,
@vchuravy?
This may not be crucial right now, but we should think about the following options:
In code like
Ariadne.jl/libs/Theseus/src/imex/imex.jl
Lines 30 to 39 in 8f0fff3
We could use
muladdfor many of the updates, e.g.,Ariadne.jl/libs/Theseus/src/imex/imex.jl
Lines 30 to 39 in 8f0fff3
Does something like
Ariadne.jl/libs/Theseus/src/imex/imex.jl
Line 53 in 8f0fff3
Is it better to use
Ariadne.jl/libs/Theseus/src/imex/imex.jl
Line 300 in 8f0fff3
Ariadne.jl/libs/Theseus/src/imex/imex.jl
Line 218 in 8f0fff3