    

 ## On this page

  

 

 # sysc::Variable Class Reference

 Last update: 17.07.2025 

Provide a class for a System Coupling variable. [More...](classsysc_1_1Variable.xhtml#details)

`#include <<a class="el" href="Variable_8hpp_source.xhtml">Variable.hpp</a>>`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

 [Variable](classsysc_1_1Variable.xhtml#a8c63f1c834c6dee8663b8917764af438) (const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;name) Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.   
  [Variable](classsysc_1_1Variable.xhtml#a297f20a1e01064edb71c7ba7581ef585) (const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;name, enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) tensorType, bool isExtensive, enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location) Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.   
  [Variable](classsysc_1_1Variable.xhtml#a3146070b07403f263b1bed17cc129764) (const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;name, enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) tensorType, bool isExtensive, enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location, enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3) dataType) Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.   
  [Variable](classsysc_1_1Variable.xhtml#a4597bf22a4bb216398210ee89160ccb4) (const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;name, const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) &amp;displayName, enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) tensorType, bool isExtensive, enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location, enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) quantityType) Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.   
  [Variable](classsysc_1_1Variable.xhtml#a38976d25f9a99d85c88154d8d30ed5a4) (const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;name, const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) &amp;displayName, enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) tensorType, bool isExtensive, enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location, enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) quantityType, enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3) dataType) Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.   
  [Variable](classsysc_1_1Variable.xhtml#a3a0892d10b1044b7efa30988b251d32c) (const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;name, enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) quantityType, enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) location=Node, const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) &amp;displayName=[DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f)()) Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.   
 const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp; [getName](classsysc_1_1Variable.xhtml#a2c37366f85390886d8ee750b4f7259cd) () const noexcept Get the variable's name.   
 enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) [getTensorType](classsysc_1_1Variable.xhtml#a3c019c1e2e4741e8ab87c8a8cd4f6d80) () const noexcept Get the variable's tensor type.   
 bool [getIsExtensive](classsysc_1_1Variable.xhtml#a2ecc01f958aa92f721ab45546581bb26) () const noexcept The the is extensive boolean for this variable.   
 enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) [getQuantityType](classsysc_1_1Variable.xhtml#a2fc80063d66ac8c7ed567e2e6ed3e568) () const noexcept Get the variable's quantity type.   
 enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) [getLocation](classsysc_1_1Variable.xhtml#a3655299cf3b151d9fc30b4f5a47ca8fb) () const noexcept Get the variable's location.   
 const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) &amp; [getDisplayName](classsysc_1_1Variable.xhtml#a71d5ce55a120a9caf354f0a090310630) () const noexcept Get the variable's display name.   
 enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3) [getDataType](classsysc_1_1Variable.xhtml#aa65c2a0ffe7c327972721faf2bffc5b7) () const noexcept Get the variable's data type.   
 <a id="ab296b04988b750113600bcc4e302ae3c" name="ab296b04988b750113600bcc4e302ae3c"></a>void **addRealAttribute** (const [RealAttribute](classsysc_1_1RealAttribute.xhtml) &amp;attribute) Add a real-valued attribute.   
 <a id="ae6fed92c7d5f748b3e26898af932eb46" name="ae6fed92c7d5f748b3e26898af932eb46"></a>void **addIntegerAttribute** (const [IntegerAttribute](classsysc_1_1IntegerAttribute.xhtml) &amp;attribute) Add an integer-valued attribute.   
 <a id="ae04462134077986b650ee9c6df9e5151" name="ae04462134077986b650ee9c6df9e5151"></a>std::size\_t **getNumRealAttributes** () const noexcept Returns the number of real-valued attributes.   
 <a id="a9a427e97dd6a88dae5e89ca7e640eba7" name="a9a427e97dd6a88dae5e89ca7e640eba7"></a>std::size\_t **getNumIntegerAttributes** () const noexcept Returns the number of integer-valued attributes.   
 <a id="a728789ac00c9d84c838f952d3d5c73b8" name="a728789ac00c9d84c838f952d3d5c73b8"></a>const [RealAttribute](classsysc_1_1RealAttribute.xhtml) &amp; **getRealAttribute** (std::size\_t index) const Return the real-valued attribute at the given index.   
 <a id="add13bbb2a118b3ccc422064306d0f699" name="add13bbb2a118b3ccc422064306d0f699"></a>const [IntegerAttribute](classsysc_1_1IntegerAttribute.xhtml) &amp; **getIntegerAttribute** (std::size\_t index) const Return the integer-valued attribute at the given index.   
 <a id="details" name="details"></a>## Detailed Description

Provide a class for a System Coupling variable.

Definition at line [21](Variable_8hpp_source.xhtml#l00021) of file [Variable.hpp](Variable_8hpp_source.xhtml).



## Constructor &amp; Destructor Documentation

<a id="a8c63f1c834c6dee8663b8917764af438" name="a8c63f1c834c6dee8663b8917764af438"></a>## [◆ ](#a8c63f1c834c6dee8663b8917764af438)Variable() \[1/6\]

 sysc::Variable::Variable  ( const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;  *name*)   explicit 

Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.

Parameters nameUnique name for this variable.Display name will default to the same as name.

Tensor type will default to scalar.

Is extensive flag will default to false (to non-extensive).

Location will default to nodes.

Quantity type will default to unspecified.

DataType will default to real.





<a id="a297f20a1e01064edb71c7ba7581ef585" name="a297f20a1e01064edb71c7ba7581ef585"></a>## [◆ ](#a297f20a1e01064edb71c7ba7581ef585)Variable() \[2/6\]

 sysc::Variable::Variable  ( const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;  *name*,    enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7)  *tensorType*,    bool  *isExtensive*,    enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a)  *location*   ) 

Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.

Parameters name- Unique name for this variable. String length should not exceed SYSC\_STRING\_LENGTH. tensorType- variable tensor type. isExtensive- flag indicating if it's an extensive property. location- variable location (e.g element or node).Display name will default to the same as name.

Quantity type will default to unspecified.

DataType will default to real.





<a id="a3146070b07403f263b1bed17cc129764" name="a3146070b07403f263b1bed17cc129764"></a>## [◆ ](#a3146070b07403f263b1bed17cc129764)Variable() \[3/6\]

 sysc::Variable::Variable  ( const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;  *name*,    enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7)  *tensorType*,    bool  *isExtensive*,    enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a)  *location*,    enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3)  *dataType*   ) 

Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.

Parameters name- Unique name for this variable. String length should not exceed SYSC\_STRING\_LENGTH. tensorType- variable tensor type. isExtensive- flag indicating if it's an extensive property. location- variable location (e.g element or node). dataType- dataTypeDisplay name will default to the same as name.

Quantity type will default to unspecified.





<a id="a4597bf22a4bb216398210ee89160ccb4" name="a4597bf22a4bb216398210ee89160ccb4"></a>## [◆ ](#a4597bf22a4bb216398210ee89160ccb4)Variable() \[4/6\]

 sysc::Variable::Variable  ( const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;  *name*,    const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) &amp;  *displayName*,    enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7)  *tensorType*,    bool  *isExtensive*,    enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a)  *location*,    enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b)  *quantityType*   ) 

Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.

Parameters name- Unique name for this variable. displayName- variable display name. tensorType- variable tensor type. isExtensive- flag indicating if it's an extensive property. location- variable location (e.g element or node). quantityType- Quantity type of this variable.DataType will default to real.





<a id="a38976d25f9a99d85c88154d8d30ed5a4" name="a38976d25f9a99d85c88154d8d30ed5a4"></a>## [◆ ](#a38976d25f9a99d85c88154d8d30ed5a4)Variable() \[5/6\]

 sysc::Variable::Variable  ( const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;  *name*,    const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) &amp;  *displayName*,    enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7)  *tensorType*,    bool  *isExtensive*,    enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a)  *location*,    enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b)  *quantityType*,    enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3)  *dataType*   ) 

Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.

Parameters name- Unique name for this variable. displayName- variable display name. tensorType- variable tensor type. isExtensive- flag indicating if it's an extensive property. location- variable location (e.g element or node). quantityType- Quantity type of this variable. dataType- Data type of this variable. 



<a id="a3a0892d10b1044b7efa30988b251d32c" name="a3a0892d10b1044b7efa30988b251d32c"></a>## [◆ ](#a3a0892d10b1044b7efa30988b251d32c)Variable() \[6/6\]

 sysc::Variable::Variable  ( const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp;  *name*,    enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b)  *quantityType*,    enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a)  *location* = `Node`,    const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) &amp;  *displayName* = `<a class="el" href="group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f">DisplayName</a>()`   ) 

Provide a constructor for the [Variable](classsysc_1_1Variable.xhtml "Provide a class for a System Coupling variable.") class.

Parameters name- Unique name for this variable.quantityType- Quantity type of this variable. Supported quantity types are defined above in this header file.location- variable location (e.g element or node). This parameter is optional - the default value is node.displayName- variable display name. This parameter is optional - it will default to the same value as the variable's name.Note that provided quantity type will determine the value of the tensor type and is extensive parameters. The values will be inferred according to the following rules:

Quantity Type Tensor Type Is Extensive

----------------------------------------------------------------

Force Vector True

Incremental Displacement Vector False

Temperature Scalar False

Heat Rate Scalar True

Heat Transfer Coefficient Scalar False

Convection Reference Temperature Scalar False



For a more explicit control of tensor type and is extensive values, consider using another constructor.

DataType will default to real.





## Member Function Documentation

<a id="aa65c2a0ffe7c327972721faf2bffc5b7" name="aa65c2a0ffe7c327972721faf2bffc5b7"></a>## [◆ ](#aa65c2a0ffe7c327972721faf2bffc5b7)getDataType()

 enum [DataType](group__SystemCouplingParticipantAPIs.xhtml#ga8c2b9557240fd9b2f908c98e3b1b27d3) sysc::Variable::getDataType  ( )  const  noexcept 

Get the variable's data type.

ReturnsReturn is the DataType enum. 



<a id="a71d5ce55a120a9caf354f0a090310630" name="a71d5ce55a120a9caf354f0a090310630"></a>## [◆ ](#a71d5ce55a120a9caf354f0a090310630)getDisplayName()

 const [DisplayName](group__SystemCouplingParticipantAPIs.xhtml#ga708d69b0e949d6a42b6a0d7885eed90f) &amp; sysc::Variable::getDisplayName  ( )  const  noexcept 

Get the variable's display name.

ReturnsReturn is the display name of this variable (string). 



<a id="a2ecc01f958aa92f721ab45546581bb26" name="a2ecc01f958aa92f721ab45546581bb26"></a>## [◆ ](#a2ecc01f958aa92f721ab45546581bb26)getIsExtensive()

 bool sysc::Variable::getIsExtensive  ( )  const  noexcept 

The the is extensive boolean for this variable.

ReturnsReturn is the boolean, true if variable is extensive, false otherwise. 



<a id="a3655299cf3b151d9fc30b4f5a47ca8fb" name="a3655299cf3b151d9fc30b4f5a47ca8fb"></a>## [◆ ](#a3655299cf3b151d9fc30b4f5a47ca8fb)getLocation()

 enum [Location](group__SystemCouplingParticipantAPIs.xhtml#gaced2664a481a6250f46140266dd38c2a) sysc::Variable::getLocation  ( )  const  noexcept 

Get the variable's location.

ReturnsReturn is Location of this variable. 



<a id="a2c37366f85390886d8ee750b4f7259cd" name="a2c37366f85390886d8ee750b4f7259cd"></a>## [◆ ](#a2c37366f85390886d8ee750b4f7259cd)getName()

 const [VariableName](group__SystemCouplingParticipantAPIs.xhtml#ga500337cdc8405b3e819ca3623bb44266) &amp; sysc::Variable::getName  ( )  const  noexcept 

Get the variable's name.

ReturnsReturn is the name of this variable (string). 



<a id="a2fc80063d66ac8c7ed567e2e6ed3e568" name="a2fc80063d66ac8c7ed567e2e6ed3e568"></a>## [◆ ](#a2fc80063d66ac8c7ed567e2e6ed3e568)getQuantityType()

 enum [QuantityType](group__SystemCouplingParticipantAPIs.xhtml#gab4cbdd3230a1cb38956f5b93f941f89b) sysc::Variable::getQuantityType  ( )  const  noexcept 

Get the variable's quantity type.

ReturnsReturn is the QuantityType struct of this variable. 



<a id="a3c019c1e2e4741e8ab87c8a8cd4f6d80" name="a3c019c1e2e4741e8ab87c8a8cd4f6d80"></a>## [◆ ](#a3c019c1e2e4741e8ab87c8a8cd4f6d80)getTensorType()

 enum [TensorType](group__SystemCouplingParticipantAPIs.xhtml#ga8f85e1fca4e3c3d086644ea6fb4b8fb7) sysc::Variable::getTensorType  ( )  const  noexcept 

Get the variable's tensor type.

ReturnsReturn is the TensorType enum.