3.1.8.5. c3po.services.TransientLogger module

Inheritance diagram of c3po.services.TransientLogger

Contains the class TransientLogger and its daughters Timekeeper and FortuneTeller.

class c3po.services.TransientLogger.FortuneTeller(relaxation=0.3)

Bases: Timekeeper

Timekeeper which estimates in addition the duration of the transient with Exponential Moving Average.

__init__(relaxation=0.3)

Build a FortuneTeller object.

Parameters:

relaxation (float) – Relaxation factor for the Exponential Moving Average. Default: 0.3.

initTransient(driver, tmax, finishAtTmax, stopIfStationary, presentTime)

See TransientLogger.initTransient()

logValidate(dt, presentTime)

See TransientLogger.logValidate()

class c3po.services.TransientLogger.Timekeeper

Bases: TransientLogger

TransientLogger which provides information about transient progress.

__init__()
initTransient(driver, tmax, finishAtTmax, stopIfStationary, presentTime)

See TransientLogger.initTransient()

logAbort(dt, presentTime)

See TransientLogger.logAbort()

logValidate(dt, presentTime)

See TransientLogger.logValidate()

terminateTransient(presentTime, stop, isStationary)

See TransientLogger.terminateTransient()

class c3po.services.TransientLogger.TransientLogger

Bases: object

TransientLogger is the base class for the production of transient logging strings.

abstractmethod initTransient(driver, tmax, finishAtTmax, stopIfStationary, presentTime)

Method called before transient starts.

Parameters:
  • driver (c3po.PhysicsDriver.PhysicsDriver) – The caller of solveTransient().

  • tmax (float) – tmax argument given to solveTransient().

  • finishAtTmax (bool) – finishAtTmax argument given to solveTransient().

  • stopIfStationary (bool) – stopIfStationary argument given to solveTransient().

  • presentTime (float) – Present time when calling solveTransient().

abstractmethod logAbort(dt, presentTime)

Method called when time step is aborted.

Parameters:
  • dt (float) – Size of the failed time step.

  • presentTime (float) – Present time after calling abortTimeStep().

abstractmethod logValidate(dt, presentTime)

Method called when time step is validated.

Parameters:
  • dt (float) – Size of the validated time step.

  • presentTime (float) – Present time after calling validateTimeStep().

abstractmethod terminateTransient(presentTime, stop, isStationary)

Method called after the transient ends.

Parameters:
  • presentTime (float) – Present time after the transient.

  • stop (bool) – Indicate if the transient ends because of a stopping criteria.

  • isStationary (bool) – Indicate if the stopping criteria is due to isStationary().

class c3po.services.TransientLogger.TransientPrinter(transientLogger)

Bases: object

INTERNAL.

TransientPrinter writes information about transient in the standard output.

__init__(transientLogger)

Build a TransientPrinter object.

Parameters:

transientLogger (c3po.services.TransientLogger.TransientLogger) – The TransientLogger object to use.

getLogger()

Return the TransientLogger object used.

Returns:

The used TransientLogger object.

Return type:

c3po.services.TransientLogger.TransientLogger

getPrinter()

Return the Printer object used.

Returns:

the Printer object used.

Return type:

c3po.services.Printer.Printer

initTransient(driver, tmax, finishAtTmax, stopIfStationary, presentTime)

See TransientLogger.initTransient().

logAbort(dt, presentTime)

See TransientLogger.logAbort().

logValidate(dt, presentTime)

See TransientLogger.logValidate().

setLogger(transientLogger)

Set a new TransientLogger object.

Parameters:

transientLogger (c3po.services.TransientLogger.TransientLogger) – The TransientLogger object to use.

terminateTransient(presentTime, stop, isStationary)

See TransientLogger.terminateTransient().