Skip to content

Opportunities for improving efficiency #64

@ranocha

Description

@ranocha

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

krylov_tol_abs::Float64
impact the use of other floating point types?

Is it better to use

fill!(integrator.u_tmp, zero(eltype(integrator.u_tmp)))
or
@. integrator.u_tmp = 0
, @vchuravy?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions