AddParticipant()

Adds a coupling participant to the data model. When executed, this commands adds the new participant to the analysis without removing any coupling interfaces or data transfers created previously.

Cannot be run after participants have started.

Returns the name of the coupling participant object added.

For more detailed information on the object, see CouplingParticipant.

There are several options that can be selected to add the participant: a file, a participant executable, or a Python script. Some of these options may be combined. For example, sometimes it is useful to use an input file while at the same time providing a custom participant executable or Python script.

Using a Participant Setup File

Given an input file containing the participant's coupling setup information, reads the specified file and pushes the participant's information to the data model.

Using a Participant Executable

Given the path to the executable for this participant (and optionally, additional arguments and/or working directory), starts the participant executable, connects to the participant using the socket connection, and adds the participant's information to the data model. This path is stored to the Executable setting in the data model.

Using a Python Script

This is a special case of using an executable file, but instead of an executable, a Python script is used. System Coupling will invoke a specialized script to set up the environment so that the Python script can more easily interact with System Coupling.

Optional Keyword Arguments

ParticipantType : string

Specifies the participant type of the participant to be added.

To retrieve a list of supported participant types, use the GetSupportedParticipantTypes() command.

If unspecified, AddParticipant() will attempt to deduce the participant type from the InputFile argument.

InputFile : ReadableFile

Name of the input file to be read.

Currently supported formats are System Coupling Participant (*.scp) setup files, Forte input (*.ftsim) files, Mechanical server (*.rst) files, CFD server (*.csv) files, FMU (*.fmu) files, and System Coupling data server (*.scdt/axdt/csv) files.

Executable : ValidFileName

Sets the path to the executable file for the participant to be added.

AdditionalArguments : string

Specifies any additional arguments to be passed to the participant's executable.

WorkingDirectory : ValidDirectoryName

Sets the path to the working directory for the participant to be added.

PythonScript : ReadableFile

Instead of the executable, uses a Python script and wraps it with System Coupling-provided *.bat/.sh scripts to set up the environment correctly before calling this Python script.

Return Type

String

Examples

Example 14: Add a participant to using an input file


AddParticipant(InputFile = 'cfx.scp')

'CFX-1'


Example 15: Add a participant to using an executable file


AddParticipant(Executable = 'maxwellSolver.bat')

'AEDT-1'


Example 16: Add a participant to a coupled analysis using a Python script

AddParticipant(PythonScript = "participantSolver.py")

Example 17: Add a participant to a coupled analysis using a Python script and an SCP file

AddParticipant(InputFile = "setup.scp",
                PythonScript = "participantSolver.py")