Skip to main content

System Coupling C++ library 2025 R1

Variable

Last update: 17.07.2025
1 /*
2  * Copyright ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
3  */
4 
5 #pragma once
6 
7 #include "SystemCouplingParticipant/LibraryType.hpp"
8 
9 #include "SystemCouplingParticipant/Attribute.hpp"
10 #include "SystemCouplingParticipant/CommonTypes.hpp"
11 
12 #include "vector"
13 
14 namespace sysc {
15 
21 class SYSTEM_COUPLING_PARTICIPANT_DLL Variable {
22 public:
40  explicit Variable(const VariableName& name);
41 
57  Variable(const VariableName& name,
58  enum TensorType tensorType,
59  bool isExtensive,
60  enum Location location);
61 
76  Variable(const VariableName& name,
77  enum TensorType tensorType,
78  bool isExtensive,
79  enum Location location,
80  enum DataType dataType);
81 
94  Variable(const VariableName& name,
95  const DisplayName& displayName,
96  enum TensorType tensorType,
97  bool isExtensive,
98  enum Location location,
99  enum QuantityType quantityType);
100 
112  Variable(const VariableName& name,
113  const DisplayName& displayName,
114  enum TensorType tensorType,
115  bool isExtensive,
116  enum Location location,
117  enum QuantityType quantityType,
118  enum DataType dataType);
119 
154  Variable(const VariableName& name,
155  enum QuantityType quantityType,
156  enum Location location = Node,
157  const DisplayName& displayName = DisplayName());
158 
164  const VariableName& getName() const noexcept;
165 
171  enum TensorType getTensorType() const noexcept;
172 
178  bool getIsExtensive() const noexcept;
179 
185  enum QuantityType getQuantityType() const noexcept;
186 
192  enum Location getLocation() const noexcept;
193 
199  const DisplayName& getDisplayName() const noexcept;
200 
206  enum DataType getDataType() const noexcept;
207 
209  void addRealAttribute(const RealAttribute& attribute);
210 
212  void addIntegerAttribute(const IntegerAttribute& attribute);
213 
215  std::size_t getNumRealAttributes() const noexcept;
216 
218  std::size_t getNumIntegerAttributes() const noexcept;
219 
221  const RealAttribute& getRealAttribute(std::size_t index) const;
222 
224  const IntegerAttribute& getIntegerAttribute(std::size_t index) const;
225 
226 private:
227  VariableName m_name;
228  QuantityType m_quantityType;
229  Location m_location;
230  DisplayName m_displayName;
231  TensorType m_tensorType;
232  bool m_isExtensive;
233  DataType m_dataType;
235  std::vector<RealAttribute> m_realAttributes;
236  std::vector<IntegerAttribute> m_integerAttributes;
237 };
238 
239 } // namespace sysc
Provide a class for an integer-valued attribute.
Definition: Attribute.hpp:82
Provide a class for a real-valued attribute.
Definition: Attribute.hpp:23
Provide a class for a System Coupling variable.
Definition: Variable.hpp:21
Variable(const VariableName &name, enum TensorType tensorType, bool isExtensive, enum Location location)
Provide a constructor for the Variable class.
Variable(const VariableName &name, enum TensorType tensorType, bool isExtensive, enum Location location, enum DataType dataType)
Provide a constructor for the Variable class.
Variable(const VariableName &name, const DisplayName &displayName, enum TensorType tensorType, bool isExtensive, enum Location location, enum QuantityType quantityType, enum DataType dataType)
Provide a constructor for the Variable class.
Variable(const VariableName &name, enum QuantityType quantityType, enum Location location=Node, const DisplayName &displayName=DisplayName())
Provide a constructor for the Variable class.
Variable(const VariableName &name, const DisplayName &displayName, enum TensorType tensorType, bool isExtensive, enum Location location, enum QuantityType quantityType)
Provide a constructor for the Variable class.
Variable(const VariableName &name)
Provide a constructor for the Variable class.
std::string VariableName
std::string DisplayName
DataType
Provide enum for variable data types.
Definition: CommonTypes.hpp:36
TensorType
Provide enum for variable tensor types.
QuantityType
Provide an enum for variable quantity types.
Location
Provide enum for variable mesh locations.

Connect with Ansys