3.1.8.5. c3po.services.TransientLogger module
Contains the class TransientLogger and its daughters Timekeeper and FortuneTeller.
- class c3po.services.TransientLogger.FortuneTeller(relaxation=0.3)
Bases:
TimekeeperTimekeeperwhich estimates in addition the duration of the transient with Exponential Moving Average.- __init__(relaxation=0.3)
Build a
FortuneTellerobject.- Parameters:
relaxation (float) – Relaxation factor for the Exponential Moving Average. Default: 0.3.
- initTransient(driver, tmax, finishAtTmax, stopIfStationary, presentTime)
- logValidate(dt, presentTime)
- class c3po.services.TransientLogger.Timekeeper
Bases:
TransientLoggerTransientLoggerwhich provides information about transient progress.- __init__()
- initTransient(driver, tmax, finishAtTmax, stopIfStationary, presentTime)
- logAbort(dt, presentTime)
- logValidate(dt, presentTime)
- terminateTransient(presentTime, stop, isStationary)
- class c3po.services.TransientLogger.TransientLogger
Bases:
objectTransientLoggeris 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) –
tmaxargument given to solveTransient().finishAtTmax (bool) –
finishAtTmaxargument given to solveTransient().stopIfStationary (bool) –
stopIfStationaryargument given to solveTransient().presentTime (float) – Present time when calling solveTransient().
- abstractmethod logAbort(dt, presentTime)
Method called when time step is aborted.
- abstractmethod logValidate(dt, presentTime)
Method called when time step is validated.
- abstractmethod terminateTransient(presentTime, stop, isStationary)
Method called after the transient ends.
- class c3po.services.TransientLogger.TransientPrinter(transientLogger)
Bases:
objectINTERNAL.
TransientPrinterwrites information about transient in the standard output.- __init__(transientLogger)
Build a
TransientPrinterobject.- Parameters:
transientLogger (c3po.services.TransientLogger.TransientLogger) – The
TransientLoggerobject to use.
- getLogger()
Return the
TransientLoggerobject used.- Returns:
The used
TransientLoggerobject.- Return type:
- initTransient(driver, tmax, finishAtTmax, stopIfStationary, presentTime)
- logAbort(dt, presentTime)
- logValidate(dt, presentTime)
- setLogger(transientLogger)
Set a new
TransientLoggerobject.- Parameters:
transientLogger (c3po.services.TransientLogger.TransientLogger) – The
TransientLoggerobject to use.
- terminateTransient(presentTime, stop, isStationary)