4.4.2. pde.solvers.controller module¶
Controller class for solving pdes.
- class Controller(solver: SolverBase, t_range: Union[float, Tuple[float, float]], tracker: Optional[Union[Sequence[Union[TrackerBase, str]], TrackerBase, str]] = 'auto')¶
class controlling a simulation
SolverBase) – Solver instance that is used to advance the simulation in time
tracker – Defines a tracker that process the state of the simulation at specified time intervals. A tracker is either an instance of
TrackerBaseor a string, which identifies a tracker. All possible identifiers can be obtained by calling
get_named_trackers(). Multiple trackers can be specified as a list. The default value auto checks the state for consistency (tracker ‘consistency’) and displays a progress bar (tracker ‘progress’) when
tqdmis installed. More general trackers are defined in
trackers, where all options are explained in detail. In particular, the interval at which the tracker is evaluated can be chosen when creating a tracker object explicitly.
process_time() -> float
Process time for profiling: sum of the kernel and user-space CPU time.
- run(state: TState, dt: float = None) TState ¶
run the simulation
Diagnostic information about the solver procedure are available in the diagnostics property of the instance after this function has been called.
state – The initial state of the simulation. This state will be copied and thus not modified by the simulation. Instead, the final state will be returned and trackers can be used to record intermediate states.
dt (float) – Time step of the chosen stepping scheme. If None, a default value based on the stepper will be chosen.
The state at the final time point.