scivianna.coupling package

Scivianna Coupling Module

The coupling module provides integration with the C3PO coupling platform and implements the ICOCO interface for code-to-code coupling in simulation workflows.

Files

File

Description

__init__.py

Package initialization file

icoco.py

ICOCO-compatible interface implementation for coupling with C3PO

problem_server.py

Server-side problem definition for coupled simulations

visualizer.py

Visualizer-specific coupling utilities and helpers

Purpose

This module enables Scivianna to participate in multi-physics coupling scenarios where multiple simulation codes exchange data during runtime. It implements the ICOCO standard interface used by the C3PO coupling tool.

Key Classes

LayoutProblem

Main class implementing the ICOCO Problem interface:

  • Manages visualization panels during coupling

  • Handles time stepping synchronization

  • Transfers field data between codes

  • Supports stationary and transient modes

ICoCo Interface Methods

Method

Purpose

initialize()

Initialize the visualizer server

terminate()

Clean up resources and save state

presentTime()

Return current simulation time

computeTimeStep()

Suggest next time step

initTimeStep(dt)

Set time step for computation

solveTimeStep()

Perform visualization update

validateTimeStep()

Confirm time step completion

setInputMEDDoubleField()

Receive field data from coupling

Usage Example

An example of working coupling is available in the scivianna_example module, c3po_coupling

Field Naming Convention

Fields are identified using the format: panel_name@field_name

Example: "main_view@temperature"

Update Policies

Supported update policies for coupled fields:

  • UPDATE_DATA: Update and replaces field values on existing mesh

  • UPDATE_MESH: Update and replaces both mesh and field values

  • APPEND_DATA: Add new time-step data

  • APPEND_MESH: Add new time-step with new mesh

Dependencies

  • ICOCO library (~=2.0.0)

  • MEDCoupling (for MED field handling)

  • C3PO coupling platform (runtime)

References

  • ICOCO API: https://github.com/cea-trust-platform/icoco-coupling

  • C3PO: https://github.com/code-coupling/c3po

Submodules

scivianna.coupling.icoco module

scivianna.coupling.problem_server module

This module contains a functional client-server implementation of ICoCo Problem. It helps moving scivianna on another process to prevent it to slow down the ongoing simulation.

Warning

This is an experimental module.

class scivianna.coupling.problem_server.ProblemClient(typeid: str, *args, **kwargs)

Bases: Problem

Server-Client implementation of ICoCo problem.

GetICoCoMajorVersion(*args, **kwargs)

Return ICoCo interface major version number.

Returns:

ICoCo interface major version number (icoco.ICOCO_MAJOR_VERSION)

Return type:

int

abortTimeStep(*args, **kwargs)

(Optional) Abort the computation on the current time step.

Can be called whenever the computation time step is defined, instead of validateTimeStep(). After this call, the present time is left unchanged, and the computation time step is undefined (the code leaves the TIME_STEP_DEFINED context).

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called outside the TIME_STEP_DEFINED context (see Problem documentation).

computeTimeStep(*args, **kwargs)

(Mandatory) Return the next preferred time step (time increment) for this code, and whether the code wants to stop.

Both data are only indicative, the supervisor is not required to take them into account. This method is however marked as mandatory, since most of the coupling schemes expect the code to provide this information (those schemes then typically compute the minimum of the time steps of all the codes being coupled). Hence a possible implementation is to return a huge value, if a precise figure can not be computed.

Can be called whenever the code is outside the TIME_STEP_DEFINED context (see Problem documentation).

Returns:

  • the preferred time step for this code (only valid if stop is false).

  • stop set to true if the code wants to stop. It can be used for example to indicate that, according to a certain criterion, the end of the transient computation is reached from the code point of view.

Return type:

Tuple[float, bool]

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called inside the TIME_STEP_DEFINED context (see Problem documentation).

forget(*args, **kwargs)

(Optional) Discard a previously saved state of the code.

After this call, the save-point cannot be restored anymore. This method can be used to free the space occupied by unused saved states. This method is const indicating that forgeting a previous state of the code should not change its behaviour with respect to all other ICoCo methods. Implementation may rely on a mutable attribute (e.g. if saving to memory is desired).

Parameters:
  • label (int) – a user- (or code-) defined value identifying the state.

  • method (str) – a string specifying which method is used to save the state of the code. A code can provide different methods (for example in memory, on disk, etc.).

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the method or label argument is invalid.

getFieldType(*args, **kwargs)

(Optional) Get the type of a field managed by the code (input or output)

The three possible types are int, double and string, as defined in the ValueType enum.

Parameters:

name (str) – field name

Returns:

one of ValueType.Double, ValueType.Int or ValueType.String

Return type:

ValueType

Raises:
  • WrongArgument – exception if the field name is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

getFieldUnit(*args, **kwargs)

(Optional) Get the physical unit used for a given field.

Parameters:

name (str) – field name

Returns:

unit in which the field values should be understood (e.g. “W”, “J”, “Pa”, …)

Return type:

str

Raises:
  • WrongArgument – exception if the field name is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

getInputFieldsNames(*args, **kwargs)

(Optional) Get the list of input fields accepted by the code.

Returns:

the list of field names that represent inputs of the code

Return type:

List[str]

Raises:

WrongContext – exception if called before initialize() or after terminate().

getInputMEDDoubleFieldTemplate(*args, **kwargs)

(Optional) Retrieve an empty shell for an input field. This shell can be filled by the caller and then be given to the code via setInputField(). The field has the MEDDoubleField format.

The code uses this method to populate ‘afield’ with all the data that represents the context of the field (i.e. its support mesh, its discretization – on nodes, on elements, …). The remaining job for the caller of this method is to fill the actual values of the field itself. When this is done the field can be sent back to the code through the method setInputField(). This method is not mandatory but is useful to know the mesh, discretization… on which an input field is expected.

See Problem documentation for more details on the time semantic of a field.

Parameters:

name (str) – name of the field for which we would like the empty shell

Returns:

field object (in MEDDoubleField format) that will be populated with all the contextual information. Any previous information in this object will be discarded.

Return type:

medcoupling.MEDCouplingFieldDouble

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name is invalid.

getInputMEDIntFieldTemplate(*args, **kwargs)

Similar to getInputMEDDoubleFieldTemplate() but for MEDIntField.

Parameters:

name (str) – name of the field for which we would like the empty shell

Returns:

object

Return type:

medcoupling.MEDCouplingFieldInt

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name is invalid.

getInputMEDStringFieldTemplate(*args, **kwargs)

Similar to getInputMEDDoubleFieldTemplate() but for MEDStringField.

Warning

at the time of writing, MEDStringField are not yet implemented anywhere.

Parameters:

name (str) – name of the field for which we would like the empty shell

Returns:

field object

Return type:

medcoupling.MEDCouplingField

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name is invalid.

getInputValuesNames(*args, **kwargs)

(Optional) Get the list of input scalars accepted by the code.

Returns:

the list of scalar names that represent inputs of the code

Return type:

List[str]

Raises:

WrongContext – exception if called before initialize() or after terminate().

getMEDCouplingMajorVersion(*args, **kwargs)

(Optional) Get MEDCoupling major version, if the code was 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:

int

getMeshUnit(*args, **kwargs)

(Optional) Get the (length) unit used to define the meshes supporting the fields.

Returns:

length unit in which the mesh coordinates should be understood (e.g. “m”, “cm”, …)

Return type:

str

Raises:

WrongContext – exception if called before initialize() or after terminate().

getOutputDoubleValue(*args, **kwargs)

(Optional) Retrieve a scalar double value from the code.

See Problem documentation for more details on the time semantic of a scalar value.

Parameters:

name (str) – name of the scalar value to be read from the code.

Returns:

the double value read from the code.

Return type:

float

Raises:
  • WrongArgument – exception if the scalar name (‘name’ parameter) is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

getOutputFieldsNames(*args, **kwargs)

(Optional) Get the list of output fields that can be provided by the code.

Returns:

the list of field names that can be produced by the code

Return type:

List[str]

Raises:

WrongContext – exception if called before initialize() or after terminate().

getOutputIntValue(*args, **kwargs)

(Optional) Retrieve a int value from the code.

See Problem documentation for more details on the time semantic of a int value.

Parameters:

name (str) – name of the int value to be read from the code.

Returns:

the double value read from the code.

Return type:

int

Raises:
  • WrongArgument – exception if the int name (‘name’ parameter) is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

getOutputMEDDoubleField(*args, **kwargs)

(Optional) Retrieve output data from the code in the form of a MEDDoubleField.

Gets the output field corresponding to name from the code into the afield argument.

See Problem documentation for more details on the time semantic of a field.

Parameters:

name (str) – name of the field that the caller requests from the code.

Returns:

field object (in MEDDoubleField format) populated with the data read by the code. The name and time properties of the field should be set in accordance with the ‘name’ parameter and with the current time step being computed. Any previous information in this object will be discarded.

Return type:

medcoupling.MEDCouplingFieldDouble

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid.

getOutputMEDIntField(*args, **kwargs)

Similar to getOutputMEDDoubleField() but for MEDIntField.

Parameters:

name (str) – name of the field that the caller requests from the code.

Returns:

field object

Return type:

medcoupling.MEDCouplingFieldInt

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid.

getOutputMEDStringField(*args, **kwargs)

Similar to getOutputMEDDoubleField() but for MEDStringField.

Warning

at the time of writing, MEDStringField are not yet implemented anywhere.

Parameters:

name (str) – name of the field that the caller requests from the code.

Returns:

field object

Return type:

medcoupling.MEDCouplingField

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid.

getOutputStringValue(*args, **kwargs)

(Optional) Retrieve a string value from the code.

See Problem documentation for more details on the time semantic of a string value.

Parameters:

name (str) – name of the string value to be read from the code.

Returns:

the string value read from the code.

Return type:

str

Raises:
  • WrongArgument – exception if the string name (‘name’ parameter) is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

getOutputValuesNames(*args, **kwargs)

(Optional) Get the list of output scalars that can be provided by the code.

Returns:

the list of scalars names that can be produced by the code

Return type:

List[str]

Raises:

WrongContext – exception if called before initialize() or after terminate().

getStationaryMode(*args, **kwargs)

(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_DEFINED context (see Problem documentation).

Returns:

true if the code has been set to compute a stationary solution.

Return type:

bool

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called inside the TIME_STEP_DEFINED context (see Problem documentation).

getValueType(*args, **kwargs)

(Optional) Get the type of a scalar managed by the code (input or output)

The three possible types are int, double and string, as defined in the ValueType enum.

Parameters:

name (str) – scalar value name

Returns:

one of ValueType.Double, ValueType.Int or ValueType.String

Return type:

ValueType

Raises:
  • WrongArgument – exception if the field name is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

getValueUnit(*args, **kwargs)

(Optional) Get the physical unit used for a given value.

Parameters:

name (str) – scalar value name

Returns:

unit in which the field values should be understood (e.g. “W”, “J”, “Pa”, …)

Return type:

str

Raises:
  • WrongArgument – exception if the field name is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

initTimeStep(*args, **kwargs)

(Mandatory) Provide the next time step (time increment) to be used by the code.

After this call (if successful), the computation time step is defined to ]t, t + dt] where t is the value returned by presentTime(). The code enters the TIME_STEP_DEFINED context.

A time step = 0.0 may be used when the stationaryMode is set to true for codes solving directly for the steady-state.

Parameters:

dt (float) – dt the time step to be used by the code

Returns:

false means that given time step is not compatible with the code time scheme.

Return type:

bool

Raises:
  • WrongContext – exception if called before initialize() or after terminate(). exception if called inside the TIME_STEP_DEFINED context (see Problem documentation). exception if called several times without resolution.

  • WrongArgument – exception if dt is invalid (dt < 0.0).

initialize(*args, **kwargs)

(Mandatory) Initialize the current problem instance.

In this method the code should allocate all its internal structures and be ready to execute. File reads, memory allocations, and other operations likely to fail should be performed here, and not in the constructor (and not in the setDataFile() or in the setMPIComm() methods either). This method must be called only once (after a potential call to setMPIComm() and/or setDataFile()) and cannot be called again before terminate() has been performed.

Returns:

true if all OK, otherwise false.

Return type:

bool

Raises:

WrongContext – exception if called multiple times or after initialize().

isMEDCoupling64Bits(*args, **kwargs)

(Optional) (Optional) Indicate whether the code was built with a 64-bits version of MEDCoupling.

Implemented if the code was built with MEDCoupling support. This can be used to assess compatibility between codes when coupling them.

Returns:

True if it is 64-bits

Return type:

bool

isStationary(*args, **kwargs)

(Optional) Return whether the solution is constant on the computation time step.

Used to know if the steady-state has been reached. This method can be called whenever the computation time step is not defined.

Returns:

true if the solution is constant on the computation time step.

Return type:

bool

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called inside the TIME_STEP_DEFINED context (see Problem documentation), meaning we shouldn’t request this information while the computation of a new time step is in progress.

iterateTimeStep(*args, **kwargs)

(Optional) Perform a single iteration of computation inside the time step.

This method is relevant for codes having inner iterations for the computation of a single time step. Calling iterateTimeStep() until converged is true is equivalent to calling solveTimeStep(), within the code’s convergence threshold.

Can be called (potentially several times) inside the TIME_STEP_DEFINED context (see Problem documentation).

Returns:

  • false if the computation failed.

  • true if the solution is not evolving any more.

Return type:

Tuple[bool, bool]

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called outside the TIME_STEP_DEFINED context (see Problem documentation)

presentTime(*args, **kwargs)

(Mandatory) Return the current time of the simulation.

Can be called any time between initialize() and terminate(). The current time can only change during a call to validateTimeStep() or to resetTime().

Returns:

the current (physical) time of the simulation

Return type:

float

Raises:

WrongContext – exception if called before initialize() or after terminate().

resetTime(*args, **kwargs)

(Optional) Reset the current time of the Problem to 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_DEFINED context (see Problem documentation).

Parameters:

time (float) – the new current time.

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called inside the TIME_STEP_DEFINED context (see Problem documentation)

restore(*args, **kwargs)

(Optional) Restore the state of the code.

After restore, the code should behave exactly like after the corresponding call to save (except of course for save/restore methods, since the list of saved states may have changed). The state to be restored is identified by the combination of label and method arguments. The save() method must have been called at some point or in some previous run with this combination.

Parameters:
  • label (int) – a user- (or code-) defined value identifying the state.

  • method (str) – a string specifying which method is used to save the state of the code. A code can provide different methods (for example in memory, on disk, etc.).

Raises:
  • WrongContext – exception if called before initialize() or after terminate(). exception if called inside the TIME_STEP_DEFINED context (see Problem documentation) meaning we shouldn’t restore while the computation of a new time step is in progress.

  • WrongArgument – exception if the method or label argument is invalid.

save(*args, **kwargs)

(Optional) Save the state of the code.

The saved state is identified by the combination of label and method arguments. If save() has already been called with the same two arguments, the saved state is overwritten. This method is const indicating that saving the state of the code should not change its behaviour with respect to all other ICoCo methods. Implementation may rely on a mutable attribute (e.g. if saving to memory is desired).

Parameters:
  • label (int) – a user- (or code-) defined value identifying the state.

  • method (str) – a string specifying which method is used to save the state of the code. A code can provide different methods (for example in memory, on disk, etc.).

Raises:
  • WrongContext – exception if called before initialize() or after terminate(). exception if called inside the TIME_STEP_DEFINED context (see Problem documentation) meaning we shouldn’t save a previous time step while the computation of a new time step is in progress.

  • WrongArgument – exception if the method or label argument is invalid.

setDataFile(*args, **kwargs)

(Optional) Provide the relative path of a data file to be used by the code.

This method must be called before initialize().

Parameters:

datafile (str) – relative path to the data file.

Raises:
  • WrongContext – exception if called multiple times or after initialize().

  • WrongArgument – exception if an invalid path is provided.

setInputDoubleValue(*args, **kwargs)

(Optional) Provide the code with a scalar double data.

See Problem documentation for more details on the time semantic of a scalar value.

Parameters:
  • name (str) – name of the scalar value that is given to the code.

  • val (float) – value passed to the code.

Raises:
  • WrongArgument – exception if the scalar name (‘name’ parameter) is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

setInputIntValue(*args, **kwargs)

(Optional) Provide the code with a int data.

See Problem documentation for more details on the time semantic of a int value.

Parameters:
  • name (str) – name of the int value that is given to the code.

  • val (int) – value passed to the code.

Raises:
  • WrongArgument – exception if the int name (‘name’ parameter) is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

setInputMEDDoubleField(*args, **kwargs)

(Optional) Provide the code with input data in the form of a MEDDoubleField.

The method getInputFieldTemplate(), if implemented, may be used first to prepare an empty shell of the field to pass to the code.

See Problem documentation for more details on the time semantic of a field.

Parameters:
  • name (str) – name of the field that is given to the code.

  • afield (medcoupling.MEDCouplingFieldDouble) – field object (in MEDDoubleField format) containing the input data to be read by the code. The name of the field set on this instance (with the Field::setName() method) should not be checked. However its time value should be to ensure it is within the proper time interval ]t, t+dt].

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid. exception if the time property of ‘afield’ does not belong to the currently computed time step ]t, t + dt]

setInputMEDIntField(*args, **kwargs)

Similar to setInputMEDDoubleField() but for MEDIntField.

Parameters:
  • name (str) – name of the field that is given to the code.

  • afield (medcoupling.MEDCouplingFieldInt) – field object

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid. exception if the time property of ‘afield’ does not belong to the currently computed time step ]t, t + dt]

setInputMEDStringField(*args, **kwargs)

Similar to setInputMEDDoubleField() but for MEDStringField.

Warning

at the time of writing, MEDStringField are not yet implemented anywhere.

Parameters:
  • name (str) – name of the field that is given to the code.

  • afield (medcoupling.MEDCouplingField) – field object

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid. exception if the time property of ‘afield’ does not belong to the currently computed time step ]t, t + dt]

setInputStringValue(*args, **kwargs)

(Optional) Provide the code with a string data.

See Problem documentation for more details on the time semantic of a string value.

Parameters:
  • name (str) – name of the string value that is given to the code.

  • val (str) – value passed to the code.

Raises:
  • WrongArgument – exception if the string name (‘name’ parameter) is invalid.

  • WrongContext – exception if called before initialize() or after terminate().

setMPIComm(*args, **kwargs)

(Optional) Provide the MPI communicator to be used by the code for parallel computations.

This method must be called before initialize(). The communicator should include all the processes to be used by the code. For a sequential code, the call to setMPIComm is optional or mpicomm should be None.

Parameters:

mpicomm (MPIComm) – MPI communicator. Dummy type for codes without mpi4py.

Raises:
  • WrongContext – exception if called multiple times or after initialize().

  • WrongArgument – exception if an invalid path is provided.

setStationaryMode(*args, **kwargs)

(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 with initTimeStep() (whose call is always needed). The stationary mode status of the code can only be modified by this method (or by a call to terminate() followed by initialize()).

Parameters:

stationaryMode (bool) – true if the code should compute a stationary solution.

Raises:

WrongContext – called inside the TIME_STEP_DEFINED context (see Problem documentation). called before initialize() or after terminate().

solveTimeStep(*args, **kwargs)

(Mandatory) Perform the computation on the current time interval.

Can be called whenever the code is inside the TIME_STEP_DEFINED context (see Problem documentation).

Returns:

true if computation was successful, false otherwise.

Return type:

bool

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called outside the TIME_STEP_DEFINED context (see Problem documentation). exception exception if called several times without a call to validateTimeStep() or to abortTimeStep().

terminate(*args, **kwargs)

(Mandatory) Terminate the current problem instance and release all allocated resources.

Terminate the computation, free the memory and save whatever needs to be saved. This method is called once at the end of the computation or after a non-recoverable error. No other ICoCo method except setDataFile(), setMPIComm() and initialize() may be called after this.

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called inside the TIME_STEP_DEFINED context (see Problem documentation).

updateOutputMEDDoubleField(*args, **kwargs)

(Optional) Update a previously retrieved output field.

(New in version 2) This methods allows the code to implement a more efficient update of a given output field, thus avoiding the caller to invoke getOutputMEDDoubleField() each time. A previous call to getOutputMEDDoubleField() with the same name must have been done prior to this call. The code should check the consistency of the field object with the requested data (same support mesh, discretization – on nodes, on elements, etc.).

See Problem documentation for more details on the time semantic of a field.

Parameters:
  • name (str) – name of the field that the caller requests from the code.

  • afield (medcoupling.MEDCouplingFieldDouble) – field object (in MEDDoubleField format) updated with the data read from the code. Notably the time indicated in the field should be updated to be within the current time step being computed.

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid. exception if the field object is inconsistent with the field being requested.

updateOutputMEDIntField(*args, **kwargs)

Similar to getInputMEDDoubleFieldTemplate() but for MEDStringField.

Parameters:
  • name (str) – name of the field that the caller requests from the code.

  • afield (medcoupling.MEDCouplingFieldInt) – field object

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid. exception if the field object is inconsistent with the field being requested.

updateOutputMEDStringField(*args, **kwargs)

Similar to getInputMEDDoubleFieldTemplate() but for MEDStringField.

Warning

at the time of writing, MEDStringField are not yet implemented anywhere.

Parameters:
  • name (str) – name of the field that the caller requests from the code.

  • afield (medcoupling.MEDCouplingField) – field object

Raises:
  • WrongContext – exception if called before initialize() or after terminate().

  • WrongArgument – exception if the field name (‘name’ parameter) is invalid. exception if the field object is inconsistent with the field being requested.

validateTimeStep(*args, **kwargs)

(Mandatory) Validate the computation performed by solveTimeStep.

Can be called whenever the code is inside the TIME_STEP_DEFINED context (see Problem documentation).

After this call: - the present time has been advanced to the end of the computation time step - the computation time step is undefined (the code leaves the TIME_STEP_DEFINED context).

Raises:

WrongContext – exception if called before initialize() or after terminate(). exception if called outside the TIME_STEP_DEFINED context (see Problem documentation). exception if called before the solveTimeStep() method.

exception scivianna.coupling.problem_server.RemoteException

Bases: Exception

Exception raised when remote process fails.

class scivianna.coupling.problem_server.ServerManager(address=None, authkey=None, serializer='pickle', ctx=None, *, shutdown_timeout=1.0)

Bases: BaseManager

Class to register remote Problem.

classmethod register(class_type: Type, *args, **kwargs) str

Register a remote class.

Parameters:

class_type (Type) – Class to use on server side.

Returns:

typeid to use as the ProblemClient argument.

Return type:

str

Raises:

ValueError – if class is already registerd

scivianna.coupling.problem_server.redirect_icoco_to_server(cls)

Redirect ICoCo methods to server.

scivianna.coupling.visualizer module

Module contents