4.4.1. pde.solvers.base module
Package that contains base classes for solvers.
Beside the abstract base class defining the interfaces, we also provide
AdaptiveSolverBase, which contains methods for implementing adaptive solvers.
- class AdaptiveSolverBase(pde, *, backend='auto', adaptive=True, tolerance=0.0001)[source]
Bases:
SolverBasebase class for adaptive time steppers
- Parameters:
pde (
PDEBase) – The instance describing the pde that needs to be solvedadaptive (bool) – When enabled, the time step is adjusted during the simulation using the error tolerance set with tolerance.
tolerance (float) – The error tolerance used in adaptive time stepping. This is used in adaptive time stepping to choose a time step which is small enough so the truncation error of a single step is below tolerance.
backend (str) –
- class SolverBase(pde, *, backend='auto')[source]
Bases:
objectbase class for solvers
- Parameters:
- classmethod from_name(name, pde, **kwargs)[source]
create solver class based on its name
Solver classes are automatically registered when they inherit from
SolverBase. Note that this also requires that the respective python module containing the solver has been loaded before it is attempted to be used.- Parameters:
- Returns:
An instance of a subclass of
SolverBase- Return type:
- make_stepper(state, dt=None)[source]
return a stepper function using an explicit scheme
- Parameters:
- Returns:
Function that can be called to advance the state from time t_start to time t_end. The function call signature is (state: numpy.ndarray, t_start: float, t_end: float)
- Return type:
- registered_solvers = ['AdaptiveSolverBase', 'ExplicitMPISolver', 'ExplicitSolver', 'ImplicitSolver', 'ScipySolver', 'explicit', 'explicit_mpi', 'implicit', 'scipy']