PETScDiffEq.jl wraps the time integrators of PETSc's TS for the SciML common interface, serially or distributed over MPI. The documentation is at docs.sciml.ai/PETScDiffEq.
using Pkg
Pkg.add("PETScDiffEq")using PETScDiffEq, SciMLBase
function lorenz(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
prob = SciMLBase.ODEProblem(lorenz, [1.0, 0.0, 0.0], (0.0, 100.0))
sol = SciMLBase.solve(prob, TSRK("5dp"); abstol = 1e-8, reltol = 1e-8)TSRK, explicit Runge-KuttaTSRosW, Rosenbrock-WTSImplicit, backward Euler, Crank-Nicolson, theta and BDFTSIRK, Gauss-Legendre implicit Runge-KuttaTSARKIMEX, additive Runge-Kutta IMEXTSDAE, implicit methods for aDAEProblemTSBasicSymplecticandTSAlpha2, for second-order problemsTSGeneric, any other PETScTSTypeby name
Every solver takes petsc_options, PETSc command-line options for that solve.
- Solver options
- Solvers
- Second-order and partitioned problems
- DAE initialization
- Number types
- Adjoint sensitivities
- MPI
- Limitations
MIT. See LICENSE.