Skip to main content

System Coupling C++ library 2023 R2

CommonTypes

Last update: 17.07.2025
1/*
2* Copyright 2023 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
3*/
4
5#pragma once
6
7#include "SystemCouplingParticipant/CommonSettings.hpp"
8#include "SystemCouplingParticipant/ElementTypes.hpp"
9
10#include <string>
11
12namespace sysc {
13
26 Diverging = -1,
27 NotYetConverged = 0,
28 Converged = 1,
29 Complete = 2,
30 NotEvaluated = 3
31};
32
34enum class DataType {
35 Real = 0,
36 Complex = 1
37};
38
40struct TimeStep {
42 double startTime{0.0};
43 double timeStepSize{0.0};
46 TimeStep() = default;
47
49 TimeStep(const TimeStep&) = default;
50
52 TimeStep(TimeStep&&) = default;
53
55 TimeStep& operator=(const TimeStep&) = default;
56
59
65};
66
71};
72
74struct SetupInfo {
75 /* \brief Provide a constructor for SetupInfo. */
76 SetupInfo() = default;
77
86
95 bool restartsSupported) :
98
109 enum Dimension dimension) :
113
116 bool restartsSupported{false};
117 Dimension dimension{Dimension::D3};
118};
119
122 std::string setupFileName;
131 restartsSupported(false){};
132
140 SetupFileInfo(const std::string& setupFileName) :
142 restartsSupported(false){};
143
153};
154
157 std::string baseFileName;
160 ResultsInfo(const std::string& baseFileName) :
162};
163
166 Surface = 2,
167 Volume = 3
168};
169
172 bool isValid;
173 std::string message;
175 /* \brief Provide a default constructor for ValidityStatus */
177 isValid(true){};
178
185 ValidityStatus(bool isValid, const std::string& message) :
187 message(message){};
188};
189
193 std::string message;
195 /* \brief Provide a default constructor for MeshValidityStatus */
197 isInvalid(false){};
198
205 MeshValidityStatus(bool isInvalid, const std::string& message) :
207 message(message){};
208};
209
212 Float = 0,
213 Double = 1,
214 Int32 = 2,
215 Int64 = 3,
217 UnsignedInt64 = 5
219
220using OpaqueDataAccess = void*;
222using RegionName = std::string;
223using VariableName = std::string;
224using CouplingInterfaceName = std::string;
225using RestartPoint = std::string;
226using DisplayName = std::string;
227using AttributeName = std::string;
250 std::string scHost;
251 unsigned short scPort{0};
252 std::string participantName;
253 bool isCosimulation{false};
254 std::string buildInformation;
255 std::string transcriptFilename;
256
258 ParticipantInfo() = default;
259
262
265
268
271
274 const std::string& scHost,
275 unsigned short scPort,
276 const std::string& participantName) :
277 scHost(scHost),
278 scPort(scPort),
279 participantName(participantName),
280 isCosimulation(true)
281 {
282 }
283
286 const std::string& scHost,
287 unsigned short scPort,
288 const std::string& participantName,
289 const std::string& buildInformation) :
290 scHost(scHost),
291 scPort(scPort),
292 participantName(participantName),
293 isCosimulation(true),
294 buildInformation(buildInformation)
295 {
296 }
297
300 const std::string& scHost,
301 unsigned short scPort,
302 const std::string& participantName,
303 const std::string& buildInformation,
304 const std::string& transcriptFilename) :
305 scHost(scHost),
306 scPort(scPort),
307 participantName(participantName),
308 isCosimulation(true),
309 buildInformation(buildInformation),
310 transcriptFilename(transcriptFilename)
311 {
312 }
313};
314
315} // namespace sysc
ConvergenceStatus
Provide enum for participant's solver convergence status.
Definition: CommonTypes.hpp:25
void * OpaqueDataAccess
Dimension
Provide an enum for participant dimension.
std::string VariableName
std::string DisplayName
std::string CouplingInterfaceName
DataType
Provide enum for variable data types.
Definition: CommonTypes.hpp:34
PrimitiveType
Provide enum for supported primitive types.
std::string RegionName
std::string AttributeName
Topology
Provide enum for region topologies.
std::string RestartPoint
AnalysisType
Provide an enum for coupled analysis type.
@ UnsignedInt64
@ UnsignedInt16
Provide a struct that contains information about mesh validity.
MeshValidityStatus(bool isInvalid, const std::string &message)
Provide a non-default constructor for MeshValidityStatus.
provide a structure for the participant information needed to connect to a System Coupling object
ParticipantInfo(const std::string &scHost, unsigned short scPort, const std::string &participantName, const std::string &buildInformation, const std::string &transcriptFilename)
Provide a non-default constructor.
ParticipantInfo(const std::string &scHost, unsigned short scPort, const std::string &participantName, const std::string &buildInformation)
Provide a non-default constructor.
ParticipantInfo & operator=(ParticipantInfo &&)=default
Provide a move-assign operator.
ParticipantInfo()=default
Provide a default constructor.
ParticipantInfo(const std::string &scHost, unsigned short scPort, const std::string &participantName)
Provide a non-default constructor.
ParticipantInfo(ParticipantInfo &&)=default
Provide a move-constructor.
ParticipantInfo & operator=(const ParticipantInfo &)=default
Provide a copy-assign operator.
ParticipantInfo(const ParticipantInfo &)=default
Provide a copy-constructor.
Provide a structure for writing System Coupling results files.
ResultsInfo(const std::string &baseFileName)
Create results file info struct, given a base file name.
std::string baseFileName
Provide a structure for writing System Coupling setup files.
SetupFileInfo(const std::string &setupFileName, bool restartsSupported)
Provide a non-default constructor for SetupFileInfo.
SetupFileInfo(const std::string &setupFileName)
Provide a non-default constructor for SetupFileInfo.
std::string setupFileName
SetupFileInfo()
Provide a default constructor for SetupFileInfo.
Provide a structure for System Coupling setup information.
Definition: CommonTypes.hpp:74
SetupInfo(enum AnalysisType analysisType, bool restartsSupported, enum Dimension dimension)
Provide a constructor for SetupInfo.
SetupInfo(enum AnalysisType analysisType)
Provide a constructor for SetupInfo.
Definition: CommonTypes.hpp:83
AnalysisType analysisType
Dimension dimension
SetupInfo(enum AnalysisType analysisType, bool restartsSupported)
Provide a constructor for SetupInfo.
Definition: CommonTypes.hpp:93
Provide a structure containing solution control.
Definition: CommonTypes.hpp:68
Provide a struct for time step.
Definition: CommonTypes.hpp:40
TimeStep(const TimeStep &)=default
Provide a copy-constructor.
TimeStep & operator=(TimeStep &&)=default
Provide a move-assign operator.
double timeStepSize
Definition: CommonTypes.hpp:43
TimeStep()=default
Provide a default constructor for TimeStep.
TimeStep(int timeStepNumber, double startTime, double timeStepSize)
Provide a non-default constructor for TimeStep.
Definition: CommonTypes.hpp:61
TimeStep(TimeStep &&)=default
Provide a move-constructor.
TimeStep & operator=(const TimeStep &)=default
Provide a copy-assign operator.
Provide a struct that contains information about validity.
ValidityStatus(bool isValid, const std::string &message)
Provide a non-default constructor for ValidityStatus.

Connect with Ansys