Verbosity Control

Verbosity Specification with SciMLLogging.jl

BoundaryValueDiffEq.jl uses SciMLLogging.jl to provide users with fine-grained control over logging and diagnostic output during BVP solving. The BVPVerbosity struct allows you to customize which messages are displayed, from deprecation warnings to detailed debugging information about solver convergence, linear algebra issues, and internal NonlinearSolve.jl/Optimization.jl solver diagnostics.

Basic Usage

Pass a BVPVerbosity object to solve or init using the verbose keyword argument:

using BoundaryValueDiffEq

# Define a boundary value problem
function f!(du, u, p, t)
    du[1] = u[2]
    du[2] = -u[1]
end

function bc!(res, u, p, t)
    res[1] = u[1][1]
    res[2] = u[end][1] - 1
end

u0 = [0.0, 1.0]
tspan = (0.0, 1.0)
prob = BVProblem(f!, bc!, u0, tspan)

# Solve with detailed verbosity to see convergence info
verbose = BVPVerbosity(Detailed())
sol = solve(prob, MIRK4(), dt = 0.1, verbose = verbose)

# Solve with completely silent output (no warnings or deprecations)
sol = solve(prob, MIRK4(), dt = 0.1, verbose = BVPVerbosity(None()))

# Solve with default verbosity (standard preset)
sol = solve(prob, MIRK4(), dt = 0.1)  # equivalent to verbose = BVPVerbosity()

Controlling Internal Solver Verbosity

BoundaryValueDiffEq.jl solvers internally use NonlinearSolve.jl (for nonlinear systems) or Optimization.jl (when using optimization-based methods). You can control the verbosity of these internal solvers independently:

# Silence BVP messages but show all NonlinearSolve convergence info
verbose = BVPVerbosity(
    None(),
    nonlinear_verbosity = All()
)
sol = solve(prob, MIRK4(), dt = 0.1, verbose = verbose)

# Show standard BVP messages but silence NonlinearSolve output
verbose = BVPVerbosity(
    Standard(),
    nonlinear_verbosity = None()
)
sol = solve(prob, MIRK4(), dt = 0.1, verbose = verbose)

# Control Optimization.jl verbosity when using optimization-based methods
using Optimization, OptimizationOptimJL

verbose = BVPVerbosity(
    Standard(),
    optimization_verbosity = Detailed()
)
sol = solve(prob, MIRK4(optimize = OptimizationOptimJL.BFGS()), dt = 0.1, verbose = verbose)

API Reference

BoundaryValueDiffEqCore.BVPVerbosityType
BVPVerbosity

Verbosity specifier for controlling logging output in BoundaryValueDiffEq.jl.

Toggles

Fine-grained toggles for specific message categories:

BVPSOL Solver:

  • :bvpsol_convergence - Convergence failures (Gauss Newton, iterative refinement)
  • :bvpsol_integrator - Integrator trajectory failures
  • :bvpsol_linear_solver - Linear solver failures (sparse solver, condensing algorithm, rank reduction)
  • :bvpsol_resources - Resource exhaustion (workspace limits)
  • :bvpsol_bc_inconsistent - Boundary condition inconsistencies

COLNEW Solver:

  • :colnew_convergence - Nonlinear iteration convergence failures
  • :colnew_matrix - Collocation matrix singularity
  • :colnew_resources - Subinterval storage exhaustion
  • :colnew_input - Input data errors

Shooting Methods:

  • :shooting_initial_guess - Single shooting initial guess warnings
  • :multiple_shooting_initial_guess - Multiple shooting initial guess warnings

General:

  • :nonlinear_verbosity - Controls verbosity of the underlying NonlinearSolve.jl solver (uses SciMLLogging presets)
  • :optimization_verbosity - Controls verbosity of the underlying Optimization.jl solver (uses SciMLLogging presets)
  • :type_inference - Type stability warnings
  • :initialization - ODE solver initialization failures
  • :adaptivity - Mesh refinement and adaptivity messages
  • :convergence_result - Final solve status with residuals
  • :deprecations - Deprecation warnings

Presets

BVPVerbosity supports five predefined SciMLLogging presets:

  • None() - No output (best for production/batch operations)
  • Minimal() - Only solver failures and deprecations
  • Standard() - Adds input validation warnings (default, recommended)
  • Detailed() - Adds initialization and convergence info
  • All() - Maximum verbosity (includes mesh adaptivity)

Usage

Using Presets

# Standard preset (default)
solve(prob, MIRK4(); verbose = BVPVerbosity())
solve(prob, MIRK4(); verbose = BVPVerbosity(Standard()))

# Completely silent
solve(prob, MIRK4(); verbose = BVPVerbosity(None()))

# Only solver failures
solve(prob, MIRK4(); verbose = BVPVerbosity(Minimal()))

# Detailed debugging
solve(prob, MIRK4(); verbose = BVPVerbosity(Detailed()))

# Maximum verbosity
solve(prob, MIRK4(); verbose = BVPVerbosity(All()))

Setting Individual Toggles

# Show only BVPSOL convergence issues
solve(prob, BVPSOL(); verbose = BVPVerbosity(
    bvpsol_convergence = WarnLevel(),
    # All others default to Silent in None preset
))

# Silence initial guess warnings but keep solver failures
solve(prob, MultipleShooting(10); verbose = BVPVerbosity(
    Standard(),
    multiple_shooting_initial_guess = Silent()
))

# Only show linear algebra issues
solve(prob, BVPSOL(); verbose = BVPVerbosity(
    None(),
    bvpsol_linear_solver = WarnLevel(),
    colnew_matrix = WarnLevel()
))

# Control NonlinearSolve verbosity independently
solve(prob, MIRK4(); verbose = BVPVerbosity(
    None(),  # Silence BVP messages
    nonlinear_verbosity = All()  # Show all NonlinearSolve convergence info
))

# Silence NonlinearSolve but keep BVP messages
solve(prob, MIRK4(); verbose = BVPVerbosity(
    Standard(),  # Standard BVP messages
    nonlinear_verbosity = None()  # No NonlinearSolve output
))

# Control Optimization.jl verbosity independently
solve(prob, MIRK4(optimize = NLopt.LN_NELDERMEAD()); verbose = BVPVerbosity(
    None(),  # Silence BVP messages
    optimization_verbosity = All()  # Show all Optimization.jl convergence info
))

Using Groups

Groups provide convenient access to related toggles:

# All BVPSOL messages
solve(prob, BVPSOL(); verbose = BVPVerbosity(bvpsol = WarnLevel()))

# All COLNEW messages
solve(prob, COLNEW(); verbose = BVPVerbosity(colnew = WarnLevel()))

# All shooting method warnings
solve(prob, Shooting(); verbose = BVPVerbosity(shooting = WarnLevel()))

# All convergence-related failures
solve(prob, alg; verbose = BVPVerbosity(convergence = WarnLevel()))

# All linear algebra issues
solve(prob, alg; verbose = BVPVerbosity(linear_algebra = WarnLevel()))

# All resource exhaustion issues
solve(prob, alg; verbose = BVPVerbosity(resources = WarnLevel()))

# All input validation warnings
solve(prob, alg; verbose = BVPVerbosity(input_validation = WarnLevel()))

# All solver failures (equivalent to Minimal preset failures)
solve(prob, alg; verbose = BVPVerbosity(solver_failures = WarnLevel()))

Backward Compatibility

# Boolean verbose still works (true → Standard, false → None)
solve(prob, MIRK4(); verbose = true)   # Uses Standard preset
solve(prob, MIRK4(); verbose = false)  # Uses None preset

Groups

Groups for convenient toggle control:

  • bvpsol - All BVPSOL toggles
  • colnew - All COLNEW toggles
  • shooting - All shooting method toggles
  • convergence - Convergence failures across solvers
  • linear_algebra - Linear algebra failures
  • resources - Resource exhaustion issues
  • input_validation - Input validation warnings
  • solver_failures - All solver failure toggles
  • progress - Initialization, adaptivity, and convergence results

Preset Details

None

  • nonlinear_verbosityNone() (no NonlinearSolve output)
  • optimization_verbosityNone() (no Optimization.jl output)
  • All toggles: Silent()

Minimal

  • nonlinear_verbosityMinimal() (minimal NonlinearSolve output)
  • optimization_verbosityMinimal() (minimal Optimization.jl output)
  • All solver failure toggles → WarnLevel()
  • deprecationsWarnLevel()
  • All others → Silent()

Standard (Default)

  • nonlinear_verbosityStandard() (standard NonlinearSolve output)
  • optimization_verbosityStandard() (standard Optimization.jl output)
  • All solver failure toggles → WarnLevel()
  • All shooting and input validation toggles → WarnLevel()
  • All others → Silent()

Detailed

  • nonlinear_verbosityDetailed() (detailed NonlinearSolve convergence info)
  • optimization_verbosityDetailed() (detailed Optimization.jl convergence info)
  • All solver failure toggles → WarnLevel()
  • All shooting and input validation toggles → WarnLevel()
  • initializationInfoLevel()
  • convergence_resultInfoLevel()
  • adaptivitySilent() (still off, can be very verbose)

All

  • nonlinear_verbosityAll() (maximum NonlinearSolve verbosity)
  • optimization_verbosityAll() (maximum Optimization.jl verbosity)
  • All toggles → InfoLevel() (including adaptivity)
  • deprecationsWarnLevel()
source