Skip to main content
Definition: SystemCoupling.hpp (line 48) Provide the main class for interacting with the System Coupling participant library. For co-simulation, this class maintains the socket connection to the System Coupling solver. The coupling participant will need to provide host and port information for existing System Coupling server, as well as the name of this coupling participant. For mapping, an instance of this class should be created to perform mapping. There should only be one instance of this System Coupling class.

Members

Public functions

Function SystemCoupling

Provide a (default) constructor for the SystemCoupling class for non-cosimulation mode. This is a default constructor that will initialize the participant library in standalone (non-cosimulation) mode. When running in parallel MPI environment, the parallel communication within the participant library will use MPI_COMM_WORLD communicator. Return type: Referenced by:

Function SystemCoupling

Provide a constructor for the SystemCoupling class for non-cosimulation mode with a custom MPI communicator. Parameters:
  • mpiCommunicator: MPI communicator cast to std::size_t.
This will initialize the participant library in standalone mode and will use the provided MPI communicator for all parallel communication. Parameters:
  • std::size_t mpiCommunicator
Return type:

Function SystemCoupling

Provide a constructor for the SystemCoupling class with a custom struct representing the default input parameters. Parameters:
  • participantInfo: The struct containing the attributes needed to connect to System Coupling: scHost, scPort, participantName, etc.
Parameters: Return type:

Function SystemCoupling

Provide a constructor for the SystemCoupling class with an mpiCommunicator object set to non default. Parameters:
  • participantInfo: The struct containing the attributes needed to connect to System Coupling: scHost, scPort, participantName, etc.
  • mpiCommunicator: MPI communicator cast to std::size_t.
Parameters: Return type:

Function SystemCoupling

Provide a constructor for the SystemCoupling class for cosimulation mode. Initializes the participant library in cosimulation mode. It establishes the connection to the System Coupling solver. The participant solver must have obtained the host and port information from System Coupling prior to creating this object (e.g. via an input argument when participant application was started). Copy constructor and assignment operators are disabled to avoid copying the created object. Parameters:
  • scHost: Name of the host on which System Coupling is running.
  • scPort: Port number on which System Coupling is listening for participant connections.
  • participantName: Name of this participant (e.g. “MAPDL-1”)
  • buildInformation: Information about the build of this participant solver. This parameter is optional - default is “Unknown”.
Parameters:
  • const std::string & scHost
  • unsigned short scPort
  • const std::string & participantName
  • const std::string & buildInformation = “Unknown”
Return type:

Function SystemCoupling

Provide a constructor for the SystemCoupling class for cosimulation mode with a custom MPI communicator. This constructor works the same way as the one above (see above), but it takes in one additional argument, which is the MPI communicator, cast as std::size_t. Parameters:
  • scHost: Name of the host on which System Coupling is running.
  • scPort: Port number on which System Coupling is listening for participant connections.
  • participantName: Name of this participant (e.g. “MAPDL-1”)
  • mpiCommunicator: MPI communicator cast to std::size_t.
  • buildInformation: Information about the build of this participant solver. This parameter is optional - default is “Unknown”.
Parameters:
  • const std::string & scHost
  • unsigned short scPort
  • const std::string & participantName
  • std::size_t mpiCommunicator
  • const std::string & buildInformation
Return type: References:

Function ~SystemCoupling

Return type:

Function completeSetup

Provide a function to notify System Coupling that setup can be completed. After this function is called, coupled analysis setup can no longer be updated, i.e. regions and variables cannot be changed. Participant should also pass in sysc::SetupInfo struct to provide additional information about the setup, such as whether steady or transient analysis is to be performed. Once the setup is complete, any subsequent call to complete the setup will have no effect. Parameters: Return type: void

Function initializeAnalysis

Provide a function to notify System Coupling that analysis initialization can be completed. This function must be called after registering mesh and variable data access and prior to entering the coupled analysis loop. If this function is called before the coupled analysis is complete, it will automatically complete the coupled analysis and assume steady analysis type. Return type: void

Function getCurrentTimeStep

Provide a function to get current time step. Returns: Returns a time step struct, which contains time step number, start time, and time step size for the current coupling time step. A default value (time step number 0, start time 0.0, time step size 0.0) is returned if this function is called outside the coupled analysis loop or if the analysis is steady. Return type: sysc::TimeStep

Function doIteration

Provide a function to check whether to do a coupling iteration. This function returns true if another coupling iteration is required, otherwise it returns false. Return type: bool

Function doTimeStep

Provide a function to check whether to do a coupling time step. This function returns true if another coupling time step is required, otherwise it returns false. This function should be called to check if another coupling time step should be done. If the previous coupling time step is finished and another time step should be performed, then calling this function will tell System Coupling that the coupling participant is going to advance to the next time step (i.e. calling doTimeStep() will cause doIteration() to change from returning false to returning true, under the conditions described above). This function only makes sense for transient analysis. It will always return false for steady analysis. Return type: bool

Function updateInputs

Provide a function to update the participants input variables. Solution data for all input variables will be updated. Depending on the defined interfaces, data will be transferred from another coupling participant solver, or from the opposite side of the same-participant coupling interface. When doing cosimulation, this function must be called from inside the coupled analysis loop. It tells System Coupling that the participant is about to begin its solver iterations. All input variable data will be up-to-date after returning from this function. If any local coupling interfaces are defined, all corresponding input variable data will also be updated. When doing same-participant mapping only (without cosimulation), this function should be called whenever input data needs to be brought up-to-date. Return type: void

Function updateOutputs

Provide a function to update the participants output variables. This function must be called from inside the coupled analysis loop. It tells System Coupling that the participant has finished performing its solver iterations. Parameters:
  • status: Status of participant solver after its solver iteration(s). See ConvergenceStatus for details
Parameters: Return type: void

Function disconnect

Provide a function to end the analysis and disconnect from System Coupling. Return type: void

Function fatalError

Provide a function to notify System Coupling about a fatal error. Parameters:
  • const std::string & errorMessage
Return type: void

Function addRegion

Provide a function to add a region that could be used in a coupled analysis. Parameters:
  • region: - Region to be added.
If this region has already been added, then this call will have no effect. If a different region with the same has already been added, then a runtime error will be thrown. If the region name contains invalid characters, then a runtime error will be thrown. Parameters: Return type: void

Function addInputParameter

Provide a method to add an input parameter that could be used in a coupled analysis. If this parameter has already been added as an input solver parameter, then this call will have no effect. If a different parameter with the same name has already been added as an input parameter, then a runtime error will be thrown. If a parameter with the same name has already been added as an output parameter, then a runtime error will be thrown. If the parameter name contains invalid characters, a runtime error will be thrown. Parameters:
  • parameter: Parameter whose values are provided by System Coupling and consumed by the participant.
Parameters: Return type: void

Function addOutputParameter

Provide a method to add an output parameter that could be used in a coupled analysis. If this parameter has already been added as an output solver parameter, then this call will have no effect. If a different parameter with the same name has already been added as an output parameter, then a runtime error will be thrown. If a parameter with the same name has already been added as an input parameter, then a runtime error will be thrown. If the parameter name contains invalid characters, a runtime error will be thrown. Parameters:
  • parameter: Parameter whose values are provided by System Coupling and consumed by the participant.
Parameters: Return type: void

Function addRealAttribute

Provide a method to add a real attribute that could be used in a coupled analysis. If this attribute has already been added as a real attribute, then this call will have no effect. If a different real attribute with the same name has already been added as a real attribute, then a runtime error will be thrown. If the real attribute name contains invalid characters, a runtime error will be thrown. Parameters:
  • realAttribute: real attribute whose values are provided by System Coupling and consumed by the participant.
Parameters: Return type: void

Function addIntegerAttribute

Provide a method to add an integer attribute that could be used in a coupled analysis. If this attribute has already been added as an integer attribute, then this call will have no effect. If a different integer attribute with the same name has already been added as an integer attribute, then a runtime error will be thrown. If the integer attribute name contains invalid characters, a runtime error will be thrown. Parameters:
  • integerAttribute: integer attribute whose values are provided by System Coupling and consumed by the participant.
Parameters: Return type: void

Function addStringAttribute

Provide a method to add a string attribute that could be used in a coupled analysis. If this attribute has already been added as an string attribute, then this call will have no effect. If a different string attribute with the same name has already been added as an string attribute, then a runtime error will be thrown. If the string attribute name contains invalid characters, a runtime error will be thrown. Parameters:
  • stringAttribute: string attribute whose values are provided by System Coupling and consumed by the participant.
Parameters: Return type: void

Function addCouplingInterface

Provide a function to add a coupling interface. Parameters:
  • couplingInterface: - coupling interface to be added.
Data transfers will be automatically created. If a variable is defined as an output on all regions on one side of the interface and as an input on all regions on the opposite side of the interface, then the data transfer will be added for this variable. If this coupling interface has already been added, then this call will have no effect. If a different coupling interface with the same has already been added, then a runtime error will be thrown. If the coupling interface name contains invalid characters, then a runtime error will be thrown. See sysc::CouplingInterface for more details. Parameters: Return type: void

Function addCouplingInterface

Provide a function to add a coupling interface. Parameters:
  • couplingInterface: - coupling interface to be added.
  • autoGenerateTransfers: - flag whether to automatically create data transfers.
If this coupling interface has already been added, then this call will have no effect. If a different coupling interface with the same has already been added, then a runtime error will be thrown. If the coupling interface name contains invalid characters, then a runtime error will be thrown. If autoGenerateTransfers is true, then the data transfers are generated automatically according to the following rule: if a variable is defined as an output on all regions on one side of the interface and as an input on all regions on the opposite side of the interface, then the data transfer will be added for this variable. See sysc::CouplingInterface for more details. Parameters: Return type: void

Function getParameterValue

Provide a function to get a Parameter value. Parameters:
  • parameterName: - name of the parameter.
Parameters: Return type: double

Function setParameterValue

Provide a function to set a Parameter value. Parameters:
  • parameterName: - name of the parameter.
  • value: - value of the parameter.
Parameters: Return type: void

Function getRealAttributeValue

Provide a function to get a RealAttribute value. Parameters:
  • attributeName: - name of the real attribute.
Parameters: Return type: double

Function getIntegerAttributeValue

Provide a function to get an IntegerAttribute value. Parameters:
  • attributeName: - name of the integer attribute.
Parameters: Return type: int64_t

Function getStringAttributeValue

Provide a function to get a StringAttribute value. Parameters:
  • attributeName: - name of the string attribute.
Parameters: Return type: std::string

Function registerInputScalarDataAccess

Provide a function to register input scalar data access. Parameters: Parameters: Return type: void Referenced by:

Function registerInputScalarDataAccess

Provide a function to register input scalar data access. Parameters: Parameters: Return type: void

Function registerInputVectorDataAccess

Provide a function to register input vector data access. Parameters: Parameters: Return type: void Referenced by:

Function registerInputVectorDataAccess

Provide a function to register input vector data access. Parameters: Parameters: Return type: void

Function registerOutputScalarDataAccess

Provide a function to register output scalar data access. Parameters: Parameters: Return type: void Referenced by:

Function registerOutputScalarDataAccess

Provide a function to register output scalar data access. Parameters: Parameters: Return type: void

Function registerOutputVectorDataAccess

Provide a function to register output vector data access. Parameters: Parameters: Return type: void

Function registerOutputVectorDataAccess

Provide a function to register output vector data access. Parameters: Parameters: Return type: void

Function registerInputComplexScalarDataAccess

Provide a function to register input complex scalar data access. Parameters: Parameters: Return type: void

Function registerInputComplexScalarDataAccess

Provide a function to register input complex scalar data access. Parameters:
  • opaqueDataAccess: - a pointer that is passed into the callback function.
  • dataAccess: - a pointer to the function that conforms to sysc::InputComplexScalarDataAccess prototype.
Parameters: Return type: void

Function registerInputComplexVectorDataAccess

Provide a function to register input complex vector data access. Parameters: Parameters: Return type: void

Function registerInputComplexVectorDataAccess

Provide a function to register input complex vector data access. Parameters:
  • opaqueDataAccess: - a pointer that is passed into the callback function.
  • dataAccess: - a pointer to the function that conforms to InputComplexVectorDataAccess prototype.
Parameters: Return type: void

Function registerOutputComplexScalarDataAccess

Provide a function to register output complex scalar data access. Parameters: Parameters: Return type: void

Function registerOutputComplexScalarDataAccess

Provide a function to register output complex scalar data access. Parameters:
  • opaqueDataAccess: - a pointer that is passed into the callback function.
  • dataAccess: - a pointer to the function that conforms to OutputComplexScalarDataAccess prototype.
Parameters: Return type: void

Function registerOutputComplexVectorDataAccess

Provide a function to register output complex vector data access. Parameters: Parameters: Return type: void

Function registerOutputComplexVectorDataAccess

Provide a function to register output complex vector data access. Parameters:
  • opaqueDataAccess: - a pointer that is passed into the callback function.
  • dataAccess: - a pointer to the function that conforms to OutputComplexVectorDataAccess prototype.
Parameters: Return type: void

Function registerSurfaceMeshAccess

Provide a function to register surface mesh access. Parameters: Parameters: Return type: void Referenced by:

Function registerSurfaceMeshAccess

Provide a function to register surface mesh access. Parameters: Parameters: Return type: void References:

Function registerZoneCountAccess

Parameters: Return type: void

Function registerSurfaceMeshAccess

Parameters: Return type: void

Function registerVolumeMeshAccess

Parameters: Return type: void

Function registerInputScalarDataAccess

Parameters: Return type: void

Function registerOutputScalarDataAccess

Parameters: Return type: void

Function registerInputVectorDataAccess

Parameters: Return type: void

Function registerOutputVectorDataAccess

Provide a function to register output vector data access. Parameters: Parameters: Return type: void

Function registerVolumeMeshAccess

Provide a function to register volume mesh access. Parameters: Parameters: Return type: void

Function registerVolumeMeshAccess

Provide a function to register volume mesh access. Parameters: Parameters: Return type: void

Function registerPointCloudAccess

Provide a function to register point cloud access. Parameters: Parameters: Return type: void

Function registerPointCloudAccess

Provide a function to register point cloud access. Parameters:
  • opaqueDataAccess: - a pointer that is passed into the callback function.
  • pointCloudAccess: - a pointer to the function that conforms to PointCloudAccessWithPointer function prototype.
Parameters: Return type: void

Function registerPointCloudAccess

Provide a function to register point cloud access. Parameters:
  • opaqueDataAccess: - a pointer that is passed into the callback function.
  • pointCloudAccess: - a pointer to the function that conforms to PointCloudMultiZoneAccess function prototype.
Parameters: Return type: void

Function registerRestartPointCreation

Provide a function to register a restart point creation callback. Parameters: Parameters: Return type: void

Function registerTargetDataCreation

Provide a function to register a target data creation callback. Parameters: Parameters: Return type: void

Function registerTargetDataCreation

Provide a function to register a target data creation callback. Parameters:
  • opaqueDataAccess: a pointer that is passed into the callback function.
  • targetDataCreation: a pointer to the function that conforms to TargetDataCreationWithPointer function prototype.
Parameters: Return type: void

Function registerDoesTargetDataExist

Provide a function to register a does target data exist callback. Parameters:
  • doesTargetDataExist: a pointer to the function that conforms to DoesTargetDataExist function prototype. See DoesTargetDataExist for details.
Parameters: Return type: void

Function registerDoesTargetDataExist

Provide a function to register a does target data exist callback. Parameters:
  • opaqueDataAccess: a pointer that is passed into the callback function.
  • doesTargetDataExist: a pointer to the function that conforms to DoesTargetDataExistWithPointer function prototype.
Parameters: Return type: void

Function writeSetupFile

Provide a function to write the setup file. This function can be used to generate a System Coupling setup file, which contains participant’s setup information. It should be called after calling completeSetup. Parameters:
  • setupFileInfo: - struct containing the setup file info.
Returns: True if the setup file was successfully written, and false otherwise. Parameters: Return type: bool

Function writeResults

Write results to a file. Parameters: Return type: void

Function getNumRegions

Provide a function to return the number of regions. Returns: Number of regions. Return type: std::size_t

Function getAddedRegion

Provide a function to return region information. Parameters:
  • index: - region index
Returns: Reference to region information at specified index. Parameters:
  • std::size_t index
Return type: const Region &

Function getSolutionControl

Get solution control. Return type: SolutionControl

Function getSetupInfo

Get SetupInfo. Return type: const SetupInfo &

Function getNumCouplingInterfaces

Provide a function to return the number of coupling interfaces. Returns: Number of coupling interfaces. Return type: std::size_t

Function getAddedCouplingInterface

Provide a function to return coupling interface. Parameters:
  • index: - coupling interface index
Returns: Reference to the coupling interface at specified index. Parameters:
  • std::size_t index
Return type: const CouplingInterface &

Function getInputParameter

Provide a function to return input parameter information. Parameters:
  • index: - input parameter index
Returns: Reference to input parameter information at specified index. Parameters:
  • std::size_t index
Return type: const Parameter &

Function getOutputParameter

Provide a function to return output parameter information. Parameters:
  • index: - output parameter index
Returns: Reference to output parameter information at specified index. Parameters:
  • std::size_t index
Return type: const Parameter &

Function getNumInputParameters

Provide a function to return the number of input parameters. Returns: Number of input parameters. Return type: std::size_t

Function getNumOutputParameters

Provide a function to return the number of output parameters. Returns: Number of output parameters. Return type: std::size_t

Function getNumRealAttributes

Provide a function to return the number of real attributes. Returns: Number of real attributes. Return type: std::size_t

Function getNumIntegerAttributes

Provide a function to return the number of integer attributes. Returns: Number of integer attributes. Return type: std::size_t

Function getNumStringAttributes

Provide a function to return the number of string attributes. Returns: Number of string attributes. Return type: std::size_t

Function getRealAttribute

Provide a function to return real attribute information. Parameters:
  • index: - real attribute index
Returns: Reference to real attribute information at specified index. Parameters:
  • std::size_t index
Return type: const RealAttribute &

Function getIntegerAttribute

Provide a function to return integer attribute information. Parameters:
  • index: - integer attribute index
Returns: Reference to integer attribute information at specified index. Parameters:
  • std::size_t index
Return type: const IntegerAttribute &

Function getStringAttribute

Provide a function to return string attribute information. Parameters:
  • index: - string attribute index
Returns: Reference to string attribute information at specified index. Parameters:
  • std::size_t index
Return type: const StringAttribute &

Function completeCouplingSetup

This function will be deprecated. Use completeSetup() instead. Return type: void

Function completeCouplingSetup

This function will be deprecated. Use completeSetup() instead. Parameters: Return type: void

Function registerInputScalarVariableAccess

Deprecated - do not use. Parameters: Return type: void

Function registerInputVectorVariableAccess

Deprecated - do not use. Parameters: Return type: void

Function registerOutputScalarVariableAccess

Deprecated - do not use. Parameters: Return type: void

Function registerOutputVectorVariableAccess

Deprecated - do not use. Parameters: Return type: void

Function checkMeshValidity

Deprecated. Use sysc::SurfaceMesh::checkValidity instead. Parameters: Return type: MeshValidityStatus

Function checkMeshValidity

Deprecated. Use sysc::SurfaceMesh::checkValidity instead. Parameters:
  • const std::string & regionName
Return type: MeshValidityStatus

Function getRegion

Deprecated. Use getAddedRegion() instead. Parameters:
  • std::size_t index
Return type: const Region &

Function SystemCoupling

Delete the copy-constructor. Parameters: Return type: References:

Function SystemCoupling

Provide the move-constructor. Parameters: Return type: References:

Function operator=

Delete the copy-assign operator. Parameters: Return type: SystemCoupling & References:

Function operator=

Provide the move-assign operator. Parameters: Return type: SystemCoupling & References: