File syscCouplingInterface.h
Last update: 17.07.2025Location: syscCouplingInterface.h
Classes
Includes
- SystemCouplingParticipant/LibraryType.hpp
- SystemCouplingParticipant/syscCommonTypes.h
- SystemCouplingParticipant/syscDataTransfer.h
- SystemCouplingParticipant/syscRegion.h
- <stddef.h>
graph LR
4["SystemCouplingParticipant/syscDataTransfer.h"]
3["SystemCouplingParticipant/syscCommonTypes.h"]
1["syscCouplingInterface.h"]
click 1 "syscCouplingInterface_8h.md#syscCouplingInterface_8h"
1 --> 2
1 --> 3
1 --> 4
1 --> 5
1 --> 6
6["stddef.h"]
2["SystemCouplingParticipant/LibraryType.hpp"]
5["SystemCouplingParticipant/syscRegion.h"]
Typedefs
Typedef SyscCouplingInterface
Definition: syscCouplingInterface.h (line 47)
typedef struct SyscCouplingInterface SyscCouplingInterface
Provide a struct for a coupling interface.
Coupling interface can be used to set up the transfers of data between different regions within the same participant solver. Interface contains two sides and each side can contain one or more regions. Data transfers are automatically defined: 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 opposide side of the interface, then it will be mapped from the former side to the latter side.
All regions on one side of the interface must have the same topology.
To create and/or initialize the SyscCouplingInterface struct, it is highly recommended to use the syscGetCouplingInterface function. This function will initialize all members to the correct values and will help to avoid back-compatibility issues in the future. For example:
SyscCouplingInterface reg = syscGetCouplingInterface("FSI");
Return type: struct SyscCouplingInterface
Functions
Function syscGetCouplingInterface
SyscCouplingInterface syscGetCouplingInterface(const char *name)
Create a coupling interface.
Parameters:
- name: - Unique name for this interface. String length should not exceed SYSC_STRING_LENGTH.
Parameters:
- const char * name
Return type: SyscCouplingInterface
Function syscAddSideOneRegion
SyscError syscAddSideOneRegion(const SyscCouplingInterface couplingInterface, const SyscRegion region)
Add region to side one of the interface.
If this region has already been added to the interface on side one, then this call will have no effect.
If a different region with the same name has already been added to the interface on side one, then a runtime error will be thrown.
If a region with the same name has already been added to the interface on side two, then a runtime error will be thrown.
If the region name contains invalid characters, a runtime error will be thrown.
Parameters:
- couplingInterface: Coupling interface to which the output variable is to be added.
- region: Region to be added to side one of the interface.
Parameters:
- const SyscCouplingInterface couplingInterface
- const SyscRegion region
Return type: SyscError
Function syscAddSideTwoRegion
SyscError syscAddSideTwoRegion(const SyscCouplingInterface couplingInterface, const SyscRegion region)
Add region to side two of the interface.
If this region has already been added to the interface on side two, then this call will have no effect.
If a different region with the same name has already been added to the interface on side two, then a runtime error will be thrown.
If a region with the same name has already been added to the interface on side one, then a runtime error will be thrown.
If the region name contains invalid characters, a runtime error will be thrown.
Parameters:
- couplingInterface: Coupling interface to which the output variable is to be added.
- region: Region to be added to side two of the interface.
Parameters:
- const SyscCouplingInterface couplingInterface
- const SyscRegion region
Return type: SyscError
Function syscAddDataTransfer
SyscError syscAddDataTransfer(SyscCouplingInterface couplingInterface, SyscDataTransfer dataTransfer)
Add the data transfer to the coupling interface.
Parameters:
- SyscCouplingInterface couplingInterface
- SyscDataTransfer dataTransfer
Return type: SyscError
Function syscCouplingInterfaceGetNumDataTransfers
size_t syscCouplingInterfaceGetNumDataTransfers(SyscCouplingInterface couplingInterface)
Get number of data transfer for a given coupling interface.
Parameters:
- SyscCouplingInterface couplingInterface
Return type: size_t
Function syscCouplingInterfaceGetNumSideOneRegions
size_t syscCouplingInterfaceGetNumSideOneRegions(SyscCouplingInterface couplingInterface)
Get number of side one regions for a given coupling interface.
Parameters:
- SyscCouplingInterface couplingInterface
Return type: size_t
Function syscCouplingInterfaceGetNumSideTwoRegions
size_t syscCouplingInterfaceGetNumSideTwoRegions(SyscCouplingInterface couplingInterface)
Get number of side two regions for a given coupling interface.
Parameters:
- SyscCouplingInterface couplingInterface
Return type: size_t
Function syscCouplingInterfaceGetDataTransfer
SyscDataTransfer syscCouplingInterfaceGetDataTransfer(SyscCouplingInterface couplingInterface, size_t index)
Get the data transfer at specified index for a given coupling interface.
Parameters:
- SyscCouplingInterface couplingInterface
- size_t index
Return type: SyscDataTransfer
Function syscCouplingInterfaceGetSideOneRegion
SyscRegion syscCouplingInterfaceGetSideOneRegion(SyscCouplingInterface couplingInterface, size_t index)
Get the side one region at specified index for a given coupling interface.
Parameters:
- SyscCouplingInterface couplingInterface
- size_t index
Return type: SyscRegion
Function syscCouplingInterfaceGetSideTwoRegion
SyscRegion syscCouplingInterfaceGetSideTwoRegion(SyscCouplingInterface couplingInterface, size_t index)
Get the side two region at specified index for a given coupling interface.
Parameters:
- SyscCouplingInterface couplingInterface
- size_t index
Return type: SyscRegion
Source
/*
* Copyright ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
*/
#pragma once
#include "SystemCouplingParticipant/LibraryType.hpp"
#include "SystemCouplingParticipant/syscCommonTypes.h"
#include "SystemCouplingParticipant/syscDataTransfer.h"
#include "SystemCouplingParticipant/syscRegion.h"
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SyscCouplingInterface {
char name[SYSC_STRING_LENGTH];
} SyscCouplingInterface;
SyscCouplingInterface syscGetCouplingInterface(const char* name);
SyscError syscAddSideOneRegion(
const SyscCouplingInterface couplingInterface,
const SyscRegion region);
SyscError syscAddSideTwoRegion(
const SyscCouplingInterface couplingInterface,
const SyscRegion region);
SyscError syscAddDataTransfer(
SyscCouplingInterface couplingInterface,
SyscDataTransfer dataTransfer);
size_t syscCouplingInterfaceGetNumDataTransfers(
SyscCouplingInterface couplingInterface);
size_t syscCouplingInterfaceGetNumSideOneRegions(
SyscCouplingInterface couplingInterface);
size_t syscCouplingInterfaceGetNumSideTwoRegions(
SyscCouplingInterface couplingInterface);
SyscDataTransfer syscCouplingInterfaceGetDataTransfer(
SyscCouplingInterface couplingInterface,
size_t index);
SyscRegion syscCouplingInterfaceGetSideOneRegion(
SyscCouplingInterface couplingInterface,
size_t index);
SyscRegion syscCouplingInterfaceGetSideTwoRegion(
SyscCouplingInterface couplingInterface,
size_t index);
#ifdef __cplusplus
}
#endif