3.1.20. c3po.TimeAccumulator module

Inheritance diagram of c3po.TimeAccumulator

Contain the class TimeAccumulator.

class c3po.TimeAccumulator.SaveAtInitTimeStep

Bases: object

Enum defining TimeAccumulator saving mode.

Values:
always = 1
never = 0
transient = 2
transientExceptAfterAbort = 3
class c3po.TimeAccumulator.TimeAccumulator(physics, saveParameters=None, stabilizedTransient=(False, 100.0))

Bases: PhysicsDriverWrapper

TimeAccumulator wraps a PhysicsDriver into a macro time step procedure (for transients or stationaries (through stabilized transients)).

In transient calculations, the TimeAccumulator object is driven like any PhysicsDriver, but it will use macro time steps (chosen with initTimeStep()) whereas the wraped PhysicsDriver may use smaller internal time steps (given by its own computeTimeStep() method).

In stationary calculations, if the stabilizedTransient mode is activated, when a steady-state is asked to the TimeAccumulator object (initTimeStep(0) in stationaryMode), a time loop over the wraped PhysicsDriver object is run until steady-state is reached (isStationary() return True). If the stabilizedTransient mode is not activated, steady-state calculations (initTimeStep(0) in stationaryMode) are directly asked to the wraped PhysicsDriver.

__init__(physics, saveParameters=None, stabilizedTransient=(False, 100.0))

Build a TimeAccumulator object.

Parameters:
  • physics (PhysicsDriver) – The PhysicsDriver to wrap.

  • saveParameters (tuple) – The tuple (label, method) that can be used to save / restore results in order to provide abortTimeStep() capabilities in transient. The method setSavingMode() allows to choose when saving is done.

  • stabilizedTransient (tuple) – A tuple (activated, tMax). If activated is set to True, it computes steady states (dt = 0) as stabilized transients (until physics.isStationary() returns True or the current time reaches tInit + tMax) and then uses resetTime(tInit) in order to keep time consistency (tInit is the returned value of physics.presentTime() before solving). If activated is set to False (default value), steady-states (dt = 0) are directly asked to physics. The method setStabilizedTransient() allows to modify these data.

abortTimeStep()

See PhysicsDriver.abortTimeStep().

computeTimeStep()

See PhysicsDriver.computeTimeStep().

Return the asked macro time step if set (by setValue("macrodt", dt)), the preferred time step of the PhysicsDriver otherwise.

getInputValuesNames()

See c3po.DataAccessor.DataAccessor.getInputValuesNames().

getValueType(name)

See c3po.DataAccessor.DataAccessor.getValueType().

getValueUnit(name)

See c3po.DataAccessor.DataAccessor.getValueUnit().

initTimeStep(dt)

See PhysicsDriver.initTimeStep().

initialize()

See PhysicsDriver.initialize().

presentTime()

See PhysicsDriver.presentTime().

setComputedTimeStep(dt)

Set time-step size returned by computeTimeStep().

Parameters:

dt (float) – Time-step size returned by computeTimeStep(). None can be set to use the time step recommended by the hold PhysicsDriver. Default: None.

setInputDoubleValue(name, value)

See c3po.DataAccessor.DataAccessor.setInputDoubleValue().

The value associated with the name “macrodt” can be used to set the time-step size returned by computeTimeStep().

setSavingMode(savingMode)

Set a saving mode.

Parameters:

savingMode – See SaveAtInitTimeStep documentation for available options. Default value is SaveAtInitTimeStep.transient.

setStabilizedTransient(stabilizedTransient)

Set stabilized transient data.

Parameters:

stabilizedTransient – See parameter stabilizedTransient of the __init__() method.

solveTimeStep()

Make the PhysicsDriver to reach the end of the macro time step asked to TimeAccumulator using its own time advance procedure.

terminate()

See PhysicsDriver.terminate().

validateTimeStep()

See PhysicsDriver.validateTimeStep().