Time Steppers

Time stepping integration schemes.

Explicit Time Stepping

ExplicitFixed

class onscale.timesteppers.ExplicitFixed(num_steps: int, step_size: float)

Fixed timesteps with explicit integration

Parameters:
  • num_steps – Number of time steps to take

  • step_size – Size of each time step (in global time units)

static from_dict(data: Dict[str, Any], sim: Simulation | None = None) Node

Construct this node from serialized dictionary data

to_json() str

Convert this node into JSON representation

property uuid: str

Get the UUID associated with this node.

ExplicitCFL

class onscale.timesteppers.ExplicitCFL(end_time: float, cfl: float = 0.8, max_steps: int = 5000)

Courant-Friedrichs-Lewy timesteps with explicit integration

Parameters:
  • end_time – Final time of the simulation (starting at 0) in global time units

  • cfl – CFL factor to compute adapative time steps

  • max_steps – Maximum number of steps to take. Used to prevent long running simulations if adaptive step grows small.

static from_dict(data: Dict[str, Any], sim: Simulation | None = None) Node

Construct this node from serialized dictionary data

to_json() str

Convert this node into JSON representation

property uuid: str

Get the UUID associated with this node.

ExplicitAuto

class onscale.timesteppers.ExplicitAuto(end_time: float)

Fixed simulation runtime with explicit integration

Time step size will be automatically determined by the solver.

Parameters:

end_time – Final time of the simulation (starting at 0) in global time units

static from_dict(data: Dict[str, Any], sim: Simulation | None = None) Node

Construct this node from serialized dictionary data

to_json() str

Convert this node into JSON representation

property uuid: str

Get the UUID associated with this node.

Implicit Time Stepping

ImplicitFixed

class onscale.timesteppers.ImplicitFixed(num_steps: int, step_size: float, scheme: str | None = None, **scheme_args: Any)

Fixed timesteps with implicit integration

Parameters:
  • num_steps – Number of time steps to take

  • step_size – Size of each time step (in global time units)

  • scheme – Implicit integration scheme to use. If not specified, will default to solver selection.

  • scheme_args

    Additional optional arguments for the scheme used. Arguments supported are:

    • ’generalized_alpha’

      • ’rho’ (float): Spectral radius [0, 1]

    • ’theta’

      • ’theta’ (float): Value in [0, 1]. If ‘theta=0.0’, then is equivalent to forward Euler. If ‘theta=1.0’, then is equivalent to backward Euler. If ‘theta=0.5’, then is equivalent to the mid-point implicit rule (default).

static from_dict(data: Dict[str, Any], sim: Simulation | None = None) Node

Construct this node from serialized dictionary data

to_json() str

Convert this node into JSON representation

property uuid: str

Get the UUID associated with this node.

ImplicitAdaptive

class onscale.timesteppers.ImplicitAdaptive(end_time: float, max_dt: float | None = None, max_steps: int = 5000, scheme: str | None = None, **scheme_args: Any)

Adaptive timesteps with implicit integration

Parameters:
  • end_time – Final time of the simulation (starting at 0) in global time units

  • max_dt – If specified, will limit the time step size

  • max_steps – Maximum number of steps to take. Used to prevent long running simulations if adaptive step grows small.

  • scheme – Implicit integration scheme to use. If not specified, will default to solver selection.

  • scheme_args

    Additional optional arguments for the scheme used. Arguments supported are:

    • ’generalized_alpha’

      • ’rho’ (float): Spectral radius [0, 1]

    • ’theta’

      • ’theta’ (float): Value in [0, 1]. If ‘theta=0.0’, then is equivalent to forward Euler. If ‘theta=1.0’, then is equivalent to backward Euler. If ‘theta=0.5’, then is equivalent to the mid-point implicit rule (default).

static from_dict(data: Dict[str, Any], sim: Simulation | None = None) Node

Construct this node from serialized dictionary data

to_json() str

Convert this node into JSON representation

property uuid: str

Get the UUID associated with this node.