3.1.6.5. c3po.physicsDrivers.CRONOS2Driver module
Contain the class CRONOS2Driver.
- class c3po.physicsDrivers.CRONOS2Driver.CRONOS2Driver
Bases:
PhysicsDriverThis is the implementation of
PhysicsDriverfor CRONOS2.- __init__()
Build a
CRONOS2Driverobject.
- abortTimeStep()
- computeTimeStep()
See
PhysicsDriver.computeTimeStep().Description of the expected outputs for the
ICOCO_COMPUTE_TIME_STEPgibiane subroutine:The time step (floating-point number) must be output in the variable
T_C3PO.'DT'The stop flag (boolean) must be output in the variable
T_C3PO.'STOP'
- getInputMEDDoubleFieldTemplate(name)
See
PhysicsDriver.getInputMEDDoubleFieldTemplate().The gibiane subroutine
ICOCO_GET_INPUT_MEDFIELD_TEMPLATE:takes as input the name of the MED field template in the string
T_C3PO.'name';returns the required MED field template in the variable
T_C3PO.'field_out'of type MEDFIELD.
- getMEDCouplingMajorVersion()
(Optional) Get MEDCoupling major version, if the code was built with MEDCoupling support.
Mandatory if the code is built with MEDCoupling support. This can be used to assess compatibility between codes when coupling them.
- Returns:
The MEDCoupling major version number (typically 7, 8, 9, …).
- Return type:
- getOutputDoubleValue(name)
See
PhysicsDriver.getOutputDoubleValue().The gibiane subroutine
ICOCO_GET_VALUE:takes as input the name of the value in the string
T_C3PO.'name';returns the required floating number value in the table
T_C3PO.'value'at the index name.
- getOutputMEDDoubleField(name)
See
PhysicsDriver.getOutputMEDDoubleField().The gibiane subroutine
ICOCO_GET_OUTPUT_MEDFIELD:takes as input the name of the MED field in the string
T_C3PO.'name';returns the required MED field in the variable
T_C3PO.'field_out'of type MEDFIELD.
- getStationaryMode()
(Mandatory) Indicate whether the code should compute a stationary solution or a transient one.
See also
setStationaryMode().Can be called whenever the code is outside the
TIME_STEP_DEFINEDcontext (seePhysicsDriverdocumentation).- Returns:
True if the code has been set to compute a stationary solution.
- Return type:
- Raises:
AssertionError – If called inside the
TIME_STEP_DEFINEDcontext (seePhysicsDriverdocumentation).AssertionError – If called before
initialize()or afterterminate().
- initTimeStep(dt)
- initialize()
- isMEDCoupling64Bits()
(Optional) Indicate whether the code was built with a 64-bits version of MEDCoupling.
Mandatory if the code is built with MEDCoupling support. This can be used to assess compatibility between codes when coupling them.
- Returns:
True if the code was built with a 64-bits version of MEDCoupling.
- Return type:
- presentTime()
- resetTime(time_)
(Optional) Reset the current time of the
PhysicsDriverto a given value.New in version 2 of ICoCo. Particularly useful for the initialization of complex transients: the starting point of the transient of interest is computed first, the time is reset to 0, and then the actual transient of interest starts with proper initial conditions, and global time 0.
Can be called outside the
TIME_STEP_DEFINEDcontext (seePhysicsDriverdocumentation).- Parameters:
time_ (float) – The new current time.
- Raises:
AssertionError – If called inside the
TIME_STEP_DEFINEDcontext (seePhysicsDriverdocumentation).AssertionError – If called before
initialize()or afterterminate().
- setDataFile(datafile)
- setInputDoubleValue(name, value)
See
PhysicsDriver.setInputDoubleValue().The gibiane subroutine
ICOCO_SET_VALUE:takes as input the name of the value in the string
T_C3PO.'name';takes as input the value stored in the table
T_C3PO.'value'with the index name ;sorts away the value in the appropriate data structures of CRONOS2.
- setInputMEDDoubleField(name, field)
See
PhysicsDriver.setInputMEDDoubleField().The gibiane subroutine
ICOCO_SET_INPUT_MEDFIELD:takes as input the name of the MED field in the string
T_C3PO.'name';takes as input the name of the gibiane variable holding the MED field in the string
T_C3PO.'FSaph';sorts away the MED field in the appropriate PARAM structures of CRONOS2.
- setParamDict(paramDict)
Set a new dictionary of names of CRONOS2 parameters in PARAM structures.
This function is reserved for advanced use only ; do not use it unless you know exactly what you are doing.
- setStationaryMode(stationaryMode)
(Mandatory) Set whether the code should compute a stationary solution or a transient one.
New in version 2 of ICoCo. By default the code is assumed to be in stationary mode False (i.e. set up for a transient computation). If set to True,
solveTimeStep()can be used either to solve a time step in view of an asymptotic solution, or to solve directly for the steady-state. In this last case, a time step = 0. can be used withinitTimeStep()(whose call is always needed). The stationary mode status of the code can only be modified by this method (or by a call toterminate()followed byinitialize()).Can be called whenever the code is outside the
TIME_STEP_DEFINEDcontext (seePhysicsDriverdocumentation).- Parameters:
stationaryMode (bool) – True if the code should compute a stationary solution.
- Raises:
AssertionError – If called outside the
TIME_STEP_DEFINEDcontext (seePhysicsDriverdocumentation).AssertionError – If called before
initialize()or afterterminate().
- solveTimeStep()
- terminate()
- validateTimeStep()