    

 ## On this page

  

 

 # Variable

 Last update: 17.07.2025 

<a name="l00001"></a> 1 /\*

<a name="l00002"></a> 2  \* Copyright ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.

<a name="l00003"></a> 3  \*/

<a name="l00004"></a> 4 

<a name="l00005"></a> 5 \#pragma once

<a name="l00006"></a> 6 

<a name="l00007"></a> 7 \#include "SystemCouplingParticipant/LibraryType.hpp"

<a name="l00008"></a> 8 

<a name="l00009"></a> 9 \#include "SystemCouplingParticipant/Attribute.hpp"

<a name="l00010"></a> 10 \#include "SystemCouplingParticipant/CommonTypes.hpp"

<a name="l00011"></a> 11 

<a name="l00012"></a> 12 \#include "vector"

<a name="l00013"></a> 13 

<a name="l00014"></a> 14 namespace sysc {

<a name="l00015"></a> 15 

<a name="l00021"></a>[ 21](classsysc_1_1Variable.xhtml) class SYSTEM_COUPLING_PARTICIPANT_DLL [Variable](classsysc_1_1Variable.xhtml) {

<a name="l00022"></a> 22 public:

<a name="l00040"></a>[ 40](classsysc_1_1Variable.xhtml#a8c63f1c834c6dee8663b8917764af438) explicit [Variable](classsysc_1_1Variable.xhtml#a8c63f1c834c6dee8663b8917764af438)(const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266)&amp; name);

<a name="l00041"></a> 41 

<a name="l00057"></a>[ 57](classsysc_1_1Variable.xhtml#a297f20a1e01064edb71c7ba7581ef585) [Variable](classsysc_1_1Variable.xhtml#a297f20a1e01064edb71c7ba7581ef585)(const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266)&amp; name,

<a name="l00058"></a> 58 enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) tensorType,

<a name="l00059"></a> 59 bool isExtensive,

<a name="l00060"></a> 60 enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location);

<a name="l00061"></a> 61 

<a name="l00076"></a>[ 76](classsysc_1_1Variable.xhtml#a3146070b07403f263b1bed17cc129764) [Variable](classsysc_1_1Variable.xhtml#a3146070b07403f263b1bed17cc129764)(const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266)&amp; name,

<a name="l00077"></a> 77 enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) tensorType,

<a name="l00078"></a> 78 bool isExtensive,

<a name="l00079"></a> 79 enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location,

<a name="l00080"></a> 80 enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3) dataType);

<a name="l00081"></a> 81 

<a name="l00094"></a>[ 94](classsysc_1_1Variable.xhtml#a4597bf22a4bb216398210ee89160ccb4) [Variable](classsysc_1_1Variable.xhtml#a4597bf22a4bb216398210ee89160ccb4)(const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266)&amp; name,

<a name="l00095"></a> 95 const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f)&amp; displayName,

<a name="l00096"></a> 96 enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) tensorType,

<a name="l00097"></a> 97 bool isExtensive,

<a name="l00098"></a> 98 enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location,

<a name="l00099"></a> 99 enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) quantityType);

<a name="l00100"></a> 100 

<a name="l00112"></a>[ 112](classsysc_1_1Variable.xhtml#a38976d25f9a99d85c88154d8d30ed5a4) [Variable](classsysc_1_1Variable.xhtml#a38976d25f9a99d85c88154d8d30ed5a4)(const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266)&amp; name,

<a name="l00113"></a> 113 const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f)&amp; displayName,

<a name="l00114"></a> 114 enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) tensorType,

<a name="l00115"></a> 115 bool isExtensive,

<a name="l00116"></a> 116 enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location,

<a name="l00117"></a> 117 enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) quantityType,

<a name="l00118"></a> 118 enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3) dataType);

<a name="l00119"></a> 119 

<a name="l00154"></a>[ 154](classsysc_1_1Variable.xhtml#a3a0892d10b1044b7efa30988b251d32c) [Variable](classsysc_1_1Variable.xhtml#a3a0892d10b1044b7efa30988b251d32c)(const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266)&amp; name,

<a name="l00155"></a> 155 enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) quantityType,

<a name="l00156"></a> 156 enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location = Node,

<a name="l00157"></a> 157 const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f)&amp; displayName = [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f)());

<a name="l00158"></a> 158 

<a name="l00164"></a>[ 164](classsysc_1_1Variable.xhtml#a3c019c1e2e4741e8ab87c8a8cd4f6d80) const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266)&amp; getName() const noexcept;

<a name="l00165"></a> 165 

<a name="l00171"></a> 171 enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) getTensorType() const noexcept;

<a name="l00172"></a> 172 

<a name="l00178"></a>[ 178](classsysc_1_1Variable.xhtml#a2fc80063d66ac8c7ed567e2e6ed3e568) bool getIsExtensive() const noexcept;

<a name="l00179"></a> 179 

<a name="l00185"></a> 185 enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) getQuantityType() const noexcept;

<a name="l00186"></a> 186 

<a name="l00192"></a> 192 enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) getLocation() const noexcept;

<a name="l00193"></a> 193 

<a name="l00199"></a>[ 199](classsysc_1_1Variable.xhtml#a37a842b3aa77535ddf81b3fb09c557e6) const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f)&amp; getDisplayName() const noexcept;

<a name="l00200"></a> 200 

<a name="l00206"></a> 206 enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3) getDataType() const noexcept;

<a name="l00207"></a> 207 

<a name="l00209"></a>[ 209](classsysc_1_1Variable.xhtml#ab296b04988b750113600bcc4e302ae3c) void addRealAttribute(const [RealAttribute](classsysc_1_1RealAttribute.xhtml)&amp; attribute);

<a name="l00210"></a> 210 

<a name="l00212"></a>[ 212](classsysc_1_1Variable.xhtml#ae6fed92c7d5f748b3e26898af932eb46) void addIntegerAttribute(const [IntegerAttribute](classsysc_1_1IntegerAttribute.xhtml)&amp; attribute);

<a name="l00213"></a> 213 

<a name="l00215"></a>[ 215](classsysc_1_1Variable.xhtml#ae04462134077986b650ee9c6df9e5151) std::size\_t getNumRealAttributes() const noexcept;

<a name="l00216"></a> 216 

<a name="l00218"></a>[ 218](classsysc_1_1Variable.xhtml#a9a427e97dd6a88dae5e89ca7e640eba7) std::size\_t getNumIntegerAttributes() const noexcept;

<a name="l00219"></a> 219 

<a name="l00221"></a>[ 221](classsysc_1_1Variable.xhtml#adcebefb4b9e4c203ab09ee1114daad33) const [RealAttribute](classsysc_1_1RealAttribute.xhtml)&amp; getRealAttribute(std::size\_t index) const;

<a name="l00222"></a> 222 

<a name="l00224"></a>[ 224](classsysc_1_1Variable.xhtml#a7cbb6bced0257ebb7da8d709dbd05a30) const [IntegerAttribute](classsysc_1_1IntegerAttribute.xhtml)&amp; getIntegerAttribute(std::size\_t index) const;

<a name="l00225"></a> 225 

<a name="l00226"></a> 226 private:

<a name="l00227"></a> 227 [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) m_name; 

<a name="l00228"></a> 228 [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) m_quantityType; 

<a name="l00229"></a> 229 [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) m_location; 

<a name="l00230"></a> 230 [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) m_displayName; 

<a name="l00231"></a> 231 [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) m_tensorType; 

<a name="l00232"></a> 232 bool m_isExtensive; 

<a name="l00233"></a> 233 [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3) m_dataType; 

<a name="l00235"></a> 235 std::vector&lt;[RealAttribute](classsysc_1_1RealAttribute.xhtml)&gt; m_realAttributes;

<a name="l00236"></a> 236 std::vector&lt;[IntegerAttribute](classsysc_1_1IntegerAttribute.xhtml)&gt; m_integerAttributes;

<a name="l00237"></a> 237 };

<a name="l00238"></a> 238 

<a name="l00239"></a> 239 } // namespace sysc

[sysc::IntegerAttribute](classsysc_1_1IntegerAttribute.xhtml)

Provide a class for an integer-valued attribute.

**Definition:** [Attribute.hpp:82](Attribute_8hpp_source.xhtml#l00082)



[sysc::RealAttribute](classsysc_1_1RealAttribute.xhtml)

Provide a class for a real-valued attribute.

**Definition:** [Attribute.hpp:23](Attribute_8hpp_source.xhtml#l00023)



[sysc::Variable](classsysc_1_1Variable.xhtml)

Provide a class for a System Coupling variable.

**Definition:** [Variable.hpp:21](Variable_8hpp_source.xhtml#l00021)



[sysc::Variable::Variable](classsysc_1_1Variable.xhtml#a297f20a1e01064edb71c7ba7581ef585)

Variable(const VariableName &amp;name, enum TensorType tensorType, bool isExtensive, enum Location location)

Provide a constructor for the Variable class.



[sysc::Variable::Variable](classsysc_1_1Variable.xhtml#a3146070b07403f263b1bed17cc129764)

Variable(const VariableName &amp;name, enum TensorType tensorType, bool isExtensive, enum Location location, enum DataType dataType)

Provide a constructor for the Variable class.



[sysc::Variable::Variable](classsysc_1_1Variable.xhtml#a38976d25f9a99d85c88154d8d30ed5a4)

Variable(const VariableName &amp;name, const DisplayName &amp;displayName, enum TensorType tensorType, bool isExtensive, enum Location location, enum QuantityType quantityType, enum DataType dataType)

Provide a constructor for the Variable class.



[sysc::Variable::Variable](classsysc_1_1Variable.xhtml#a3a0892d10b1044b7efa30988b251d32c)

Variable(const VariableName &amp;name, enum QuantityType quantityType, enum Location location=Node, const DisplayName &amp;displayName=DisplayName())

Provide a constructor for the Variable class.



[sysc::Variable::Variable](classsysc_1_1Variable.xhtml#a4597bf22a4bb216398210ee89160ccb4)

Variable(const VariableName &amp;name, const DisplayName &amp;displayName, enum TensorType tensorType, bool isExtensive, enum Location location, enum QuantityType quantityType)

Provide a constructor for the Variable class.



[sysc::Variable::Variable](classsysc_1_1Variable.xhtml#a8c63f1c834c6dee8663b8917764af438)

Variable(const VariableName &amp;name)

Provide a constructor for the Variable class.



[sysc::VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266)

std::string VariableName

**Definition:** [CommonTypes.hpp:232](CommonTypes_8hpp_source.xhtml#l00232)



[sysc::DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f)

std::string DisplayName

**Definition:** [CommonTypes.hpp:236](CommonTypes_8hpp_source.xhtml#l00236)



[sysc::DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3)

DataType

Provide enum for variable data types.

**Definition:** [CommonTypes.hpp:36](CommonTypes_8hpp_source.xhtml#l00036)



[sysc::TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7)

TensorType

Provide enum for variable tensor types.

**Definition:** [CommonSettings.hpp:32](CommonSettings_8hpp_source.xhtml#l00032)



[sysc::QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b)

QuantityType

Provide an enum for variable quantity types.

**Definition:** [CommonSettings.hpp:63](CommonSettings_8hpp_source.xhtml#l00063)



[sysc::Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a)

Location

Provide enum for variable mesh locations.

**Definition:** [CommonSettings.hpp:50](CommonSettings_8hpp_source.xhtml#l00050)