Skip to content

Commit

Permalink
Update stats field
Browse files Browse the repository at this point in the history
This includes the fields     nfpiter::Int nfpconvfail::Int from DDE
  • Loading branch information
Harry Saxton authored Feb 22, 2024
1 parent db0d386 commit 17ac37d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/solutions/ode_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ mutable struct DEStats
njacs::Int
nnonliniter::Int
nnonlinconvfail::Int
nfpiter::Int
nfpconvfail::Int
ncondition::Int
naccept::Int
nreject::Int
maxeig::Float64
end

DEStats(x::Int = -1) = DEStats(x, x, x, x, x, x, x, x, x, x, 0.0)
DEStats(x::Int = -1) = DEStats(x, x, x, x, x, x, x, x, x, x, x, x, 0.0)

function Base.show(io::IO, ::MIME"text/plain", s::DEStats)
println(io, summary(s))
Expand All @@ -49,6 +51,8 @@ function Base.show(io::IO, ::MIME"text/plain", s::DEStats)
@printf io "%-50s %-d\n" "Number of Jacobians created:" s.njacs
@printf io "%-50s %-d\n" "Number of nonlinear solver iterations:" s.nnonliniter
@printf io "%-50s %-d\n" "Number of nonlinear solver convergence failures:" s.nnonlinconvfail
@printf io "%-60s %-d\n" "Number of fixed-point solver iterations:" s.nfpiter
@printf io "%-60s %-d\n" "Number of fixed-point solver convergence failures:" s.nfpconvfail

Check warning on line 55 in src/solutions/ode_solutions.jl

View check run for this annotation

Codecov / codecov/patch

src/solutions/ode_solutions.jl#L54-L55

Added lines #L54 - L55 were not covered by tests
@printf io "%-50s %-d\n" "Number of rootfind condition calls:" s.ncondition
@printf io "%-50s %-d\n" "Number of accepted steps:" s.naccept
@printf io "%-50s %-d" "Number of rejected steps:" s.nreject
Expand All @@ -64,6 +68,8 @@ function Base.merge(a::DEStats, b::DEStats)
a.njacs + b.njacs,
a.nnonliniter + b.nnonliniter,
a.nnonlinconvfail + b.nnonlinconvfail,
a.nfpiter + b.nfpiter,
a.nfpconvfail + b.nfpconvfail,
a.ncondition + b.ncondition,
a.naccept + b.naccept,
a.nreject + b.nreject,
Expand Down

0 comments on commit 17ac37d

Please sign in to comment.