    

 ## On this page

  

 

 # Variable

 Last update: 17.07.2025 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<a id="l00040" 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 id="l00041" name="l00041"></a> 41 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



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

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

[sysc::IntegerAttribute](classsysc_1_1IntegerAttribute.xhtml)

Provide a class for an integer-valued attribute.

**Definition** [Attribute.hpp:61](Attribute_8hpp_source.xhtml#l00061)



[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::getName](classsysc_1_1Variable.xhtml#a2c37366f85390886d8ee750b4f7259cd)

const VariableName &amp; getName() const noexcept

Get the variable's name.



[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:231](CommonTypes_8hpp_source.xhtml#l00231)



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

std::string DisplayName

**Definition** [CommonTypes.hpp:234](CommonTypes_8hpp_source.xhtml#l00234)



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

DataType

Provide enum for variable data types.

**Definition** [CommonTypes.hpp:35](CommonTypes_8hpp_source.xhtml#l00035)



[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)