Skip to main content

System Coupling C++ library 2023 R2

sysc::Variable Class Reference

Last update: 17.07.2025

Provide a class for a System Coupling variable. More...

#include <Variable.hpp>

Public Member Functions

 Variable (const VariableName &name)
 Provide a constructor for the Variable class. More...
 
 Variable (const VariableName &name, enum TensorType tensorType, bool isExtensive, enum Location location)
 Provide a constructor for the Variable class. More...
 
 Variable (const VariableName &name, enum TensorType tensorType, bool isExtensive, enum Location location, enum DataType dataType)
 Provide a constructor for the Variable class. More...
 
 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. More...
 
 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. More...
 
 Variable (const VariableName &name, enum QuantityType quantityType, enum Location location=Node, const DisplayName &displayName=DisplayName())
 Provide a constructor for the Variable class. More...
 
const VariableNamegetName () const noexcept
 Get the variable's name. More...
 
enum TensorType getTensorType () const noexcept
 Get the variable's tensor type. More...
 
bool getIsExtensive () const noexcept
 The the is extensive boolean for this variable. More...
 
enum QuantityType getQuantityType () const noexcept
 Get the variable's quantity type. More...
 
enum Location getLocation () const noexcept
 Get the variable's location. More...
 
const DisplayNamegetDisplayName () const noexcept
 Get the variable's display name. More...
 
enum DataType getDataType () const noexcept
 Get the variable's data type. More...
 
void addRealAttribute (const RealAttribute &attribute)
 Add a real-valued attribute.
 
void addIntegerAttribute (const IntegerAttribute &attribute)
 Add an integer-valued attribute.
 
std::size_t getNumRealAttributes () const noexcept
 Returns the number of real-valued attributes.
 
std::size_t getNumIntegerAttributes () const noexcept
 Returns the number of integer-valued attributes.
 
const RealAttributegetRealAttribute (std::size_t index) const
 Return the real-valued attribute at the given index.
 
const IntegerAttributegetIntegerAttribute (std::size_t index) const
 Return the integer-valued attribute at the given index.
 

Detailed Description

Provide a class for a System Coupling variable.

Definition at line 21 of file Variable.hpp.

Constructor & Destructor Documentation

◆ Variable() [1/6]

sysc::Variable::Variable ( const VariableName name)
explicit

Provide a constructor for the 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.

◆ Variable() [2/6]

sysc::Variable::Variable ( const VariableName name,
enum TensorType  tensorType,
bool  isExtensive,
enum Location  location 
)

Provide a constructor for the 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.

◆ Variable() [3/6]

sysc::Variable::Variable ( const VariableName name,
enum TensorType  tensorType,
bool  isExtensive,
enum Location  location,
enum DataType  dataType 
)

Provide a constructor for the 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- dataType

Display name will default to the same as name.

Quantity type will default to unspecified.

◆ Variable() [4/6]

sysc::Variable::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.

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.

◆ Variable() [5/6]

sysc::Variable::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.

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.

◆ Variable() [6/6]

sysc::Variable::Variable ( const VariableName name,
enum QuantityType  quantityType,
enum Location  location = Node,
const DisplayName displayName = DisplayName() 
)

Provide a constructor for the 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

◆ getDataType()

enum DataType sysc::Variable::getDataType ( ) const
noexcept

Get the variable's data type.

Returns
Return is the DataType enum.

◆ getDisplayName()

const DisplayName & sysc::Variable::getDisplayName ( ) const
noexcept

Get the variable's display name.

Returns
Return is the display name of this variable (string).

◆ getIsExtensive()

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

The the is extensive boolean for this variable.

Returns
Return is the boolean, true if variable is extensive, false otherwise.

◆ getLocation()

enum Location sysc::Variable::getLocation ( ) const
noexcept

Get the variable's location.

Returns
Return is Location of this variable.

◆ getName()

const VariableName & sysc::Variable::getName ( ) const
noexcept

Get the variable's name.

Returns
Return is the name of this variable (string).

◆ getQuantityType()

enum QuantityType sysc::Variable::getQuantityType ( ) const
noexcept

Get the variable's quantity type.

Returns
Return is the QuantityType struct of this variable.

◆ getTensorType()

enum TensorType sysc::Variable::getTensorType ( ) const
noexcept

Get the variable's tensor type.

Returns
Return is the TensorType enum.

Connect with Ansys