3.1.13. c3po.Coupler module
Contain the class Coupler.
- class c3po.Coupler.Coupler(physics, exchangers, dataManagers=[])
Bases:
PhysicsDriverCoupleris the base class for the definition of a coupling.A coupling is defined using
PhysicsDriver,DataManagerandExchangerobjects. A user needs to define his own class inheriting fromCouplerand to define itssolveTimeStep()method. It may also be necessary to overload the I/O methods (for fields and/or of scalars) inherited fromPhysicsDriver.Note
Couplerinherits fromPhysicsDriver, it is therefore possible to couple ofCouplerobjects!- __init__(physics, exchangers, dataManagers=[])
Build an
Couplerobject.- Parameters:
physics (list[PhysicsDriver], dict) – A list (or dictionary) of
PhysicsDriverobjects to be coupled.exchangers (list[Exchanger], dict) – A list (or dictionary) of
Exchangerfor the coupling.dataManagers (list[DataManager], dict) – A list (or dictionary) of
DataManagerused in the coupling.
- abortTimeStep()
- computeTimeStep()
- denormalizeData(norms)
Multiply the
DataManagerobjects by the scalar values provided.- Parameters:
norms (list) – List of scalar values. The
DataManagerare multiplied by these scalars.
- getIterateStatus()
- getMEDCouplingMajorVersion()
- getNorm(data)
Return the norm choosen by
setNormChoice()ofdata(aDataManager).- Parameters:
data (DataManager) – A
DataManagerobject.- Return type:
The asked norm of data.
- getSolveStatus()
- getStationaryMode()
- initTimeStep(dt)
- initialize()
- isMEDCoupling64Bits()
- isStationary()
- normalizeData(norms)
Divide the
DataManagerobjects by the scalar values provided.- Parameters:
norms (list) – List of scalar values. The
DataManagerare divided by these scalars.
- presentTime()
- readNormData()
Return a list of the norms of the
DataManagerobjects hold byself.- Returns:
List of the norm of the
DataManagerobjects.- Return type:
- resetTime(time_)
- setNormChoice(choice)
Choose a norm for future use.
- Parameters:
choice (
NormChoice.normMax,NormChoice.norm2) –To be choosen between :
NormChoice.normMax: infinite norm. This is the default choice.NormChoice.norm2: norm 2 (sqrt(sum_i(val[i] * val[i]))).
- setStationaryMode(stationaryMode)
- terminate()
- validateTimeStep()