Source code for icoco.utils

"""
ICoCo file common to several codes
Version 2 -- 02/2021

WARNING: this file is part of the official ICoCo API and should not be modified.
The official version can be found at the following URL:

https://github.com/cea-trust-platform/icoco-coupling
"""


[docs]class ICoCoMethods: # pylint: disable=too-few-public-methods """Namespace to list all ICoCo methods.""" PROBLEM = ["setDataFile", "setMPIComm", "initialize", "terminate"] """ICoco methods of section Problem""" TIME_STEP = ["presentTime", "computeTimeStep", "initTimeStep", "solveTimeStep", "validateTimeStep", "setStationaryMode", "getStationaryMode", "isStationary", "abortTimeStep", "resetTime", "iterateTimeStep"] """ICoco methods of section TimeStepManagement""" RESTORE = ["save", "restore", "forget"] """ICoco methods of section Restorable""" IO_FIELD = ["getInputFieldsNames", "getOutputFieldsNames", "getFieldType", "getMeshUnit", "getFieldUnit", "getInputMEDDoubleFieldTemplate", "setInputMEDDoubleField", "getOutputMEDDoubleField", "updateOutputMEDDoubleField", "getInputMEDIntFieldTemplate", "setInputMEDIntField", "getOutputMEDIntField", "updateOutputMEDIntField", "getInputMEDStringFieldTemplate", "setInputMEDStringField", "getOutputMEDStringField", "updateOutputMEDStringField", "getMEDCouplingMajorVersion", "isMEDCoupling64Bits" ] """ICoco methods of section Field I/O""" IO_VALUE = ["getInputValuesNames", "getOutputValuesNames", "getValueType", "getValueUnit", "setInputDoubleValue", "getOutputDoubleValue", "setInputIntValue", "getOutputIntValue", "setInputStringValue", "getOutputStringValue"] """ICoco methods of section Scalar values I/O""" ALL = ["GetICoCoMajorVersion"] + PROBLEM + TIME_STEP + RESTORE + IO_FIELD + IO_VALUE """All ICoCo methods"""
[docs]class ICoCoMethodContext: # pylint: disable=too-few-public-methods """Namespace to list all context restrictions for ICoCo methods.""" ONLY_BEFORE_INITIALIZE = ["setDataFile", "setMPIComm", "initialize"] """Methods which must be called only BEFORE ``initialize``.""" ONLY_AFTER_INITIALIZE = [name for name in ICoCoMethods.ALL if name not in ["setDataFile", "setMPIComm", "initialize", "getMEDCouplingMajorVersion", "isMEDCoupling64Bits", "GetICoCoMajorVersion"]] """Methods which must be called only AFTER ``initialize``.""" ONLY_INSIDE_TIME_STEP_DEFINED = ["solveTimeStep", "iterateTimeStep", "validateTimeStep", "abortTimeStep"] """Methods which must be called only inside TIME_STEP_DEFINED context.""" ONLY_OUTSIDE_TIME_STEP_DEFINED = [ # "getStationaryMode", FIXME norme says it should be here "terminate", "computeTimeStep", "initTimeStep", "setStationaryMode", "isStationary", "resetTime", "save", "restore"] """Methods which must be called only outside TIME_STEP_DEFINED context."""