BaseStepController
- class cubie.integrators.step_control.base_step_controller.BaseStepController(precision: type[float16] | type[float32] | type[float64] | dtype[float16] | dtype[float32] | dtype[float64], dt: float = None, n_states: int = 1, **kwargs)[source]
Bases:
CUDAFactoryFactory interface for compiling CUDA step-size controllers.
- __init__(precision: type[float16] | type[float32] | type[float64] | dtype[float16] | dtype[float32] | dtype[float64], dt: float = None, n_states: int = 1, **kwargs) None[source]
Initialise the step controller.
- Parameters:
precision – Precision used for controller calculations.
dt – Step size or initial step size.
n_states – Number of state variables.
**kwargs – Additional parameters passed to the config class.
- _apply_filter_coefficients(params: dict) set[str][source]
Translate
filter_coefficientsinparamsinto gains.- Parameters:
params – Mutable settings mapping; modified in place.
- Returns:
The consumed keys.
- Return type:
- Raises:
ValueError – On mixed gain and filter input, or an unsupported gain.
- _update(updates: dict[str, object], silent: bool) set[str][source]
Apply the settings; accept other controllers’ parameters.
- Parameters:
updates – Setting names to new values.
silent – Suppress the other-controller parameter warning.
- Returns:
Recognised names, including other controllers’ parameters.
- Return type:
Notes
Filter coefficient aliases are translated first. Unapplied names in
ALL_STEP_CONTROLLER_PARAMETERScount as recognised and warn.
- build() ControllerCache[source]
Compile the controller and record its bounds and tolerances.
- Returns:
The compiled controller with its products filled in.
- Return type:
ControllerCache
- abstractmethod compile_controller() ControllerCache[source]
Compile the controller device function.
- Returns:
The compiled controller.
- Return type:
ControllerCache
- register_buffers() None[source]
Register controller buffers with the central buffer registry.
Registers the
timestep_bufferat_timestep_buffer_elementshistory slots in the location given bycompile_settings.timestep_memory_location. Controllers that keep no history (_timestep_buffer_elements == 0) register nothing, so the registry owns the size like every other buffer-registered class.
- settings_keys: frozenset | None = frozenset({'algorithm_order', 'atol', 'deadband_max', 'deadband_min', 'derivative_gain', 'dt', 'dt_max', 'dt_min', 'filter_coefficients', 'integral_gain', 'mass_flags', 'max_step_growth', 'min_step_shrink', 'n_states', 'newton_target_iters', 'precision', 'proportional_gain', 'rtol', 'safety', 'step_controller', 'timestep_memory_location'})
Loose keys the factory accepts;
Noneaccepts every field.