Skip to main content

Class sysc::Variable

Definition: Variable.hpp (line 21)

Provide a class for a System Coupling variable.

Members​

Private attributes​

Variable m_name​

Definition: Variable.hpp (line 236)

VariableName sysc::Variable::m_name

Unique name for this variable.

Type: VariableName

Variable m_quantityType​

Definition: Variable.hpp (line 237)

QuantityType sysc::Variable::m_quantityType

Quantity type (e.g. temperature)

Type: QuantityType

Variable m_location​

Definition: Variable.hpp (line 238)

Location sysc::Variable::m_location

Location (e.g element or node).

Type: Location

Variable m_displayName​

Definition: Variable.hpp (line 239)

DisplayName sysc::Variable::m_displayName

User-friendly name.

Type: DisplayName

Variable m_tensorType​

Definition: Variable.hpp (line 240)

TensorType sysc::Variable::m_tensorType

Tensor type (e.g. scalar, vector).

Type: TensorType

Variable m_isExtensive​

Definition: Variable.hpp (line 241)

bool sysc::Variable::m_isExtensive

Extensive property flag.

Type: bool

Variable m_dataType​

Definition: Variable.hpp (line 242)

DataType sysc::Variable::m_dataType

Data type (e.g. real, complex).

Type: DataType

Variable m_realAttributes​

Definition: Variable.hpp (line 244)

std::vector`<RealAttribute>` sysc::Variable::m_realAttributes

Type: std::vector< RealAttribute >

Variable m_integerAttributes​

Definition: Variable.hpp (line 245)

std::vector`<IntegerAttribute>` sysc::Variable::m_integerAttributes

Type: std::vector< IntegerAttribute >

Variable m_stringAttributes​

Definition: Variable.hpp (line 246)

std::vector`<StringAttribute>` sysc::Variable::m_stringAttributes

Type: std::vector< StringAttribute >

Public functions​

Function Variable​

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

Provide a constructor for the Variable class.

Parameters:

  • name: Unique 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.

Parameters:

Return type:

Function Variable​

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.

Parameters:

Return type:

Function Variable​

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.

Parameters:

Return type:

Function Variable​

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.

Parameters:

Return type:

Function Variable​

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.

Parameters:

Return type:

Function Variable​

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.

Parameters:

Return type:

Function getName​

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

Get the variable's name.

Returns:

Return is the name of this variable (string).

Return type: const VariableName &

Function getTensorType​

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

Get the variable's tensor type.

Returns:

Return is the TensorType enum.

Return type: enum TensorType

Function 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.

Return type: bool

Function getQuantityType​

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

Get the variable's quantity type.

Returns:

Return is the QuantityType struct of this variable.

Return type: enum QuantityType

Function getLocation​

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

Get the variable's location.

Returns:

Return is Location of this variable.

Return type: enum Location

Function getDisplayName​

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

Get the variable's display name.

Returns:

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

Return type: const DisplayName &

Function getDataType​

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

Get the variable's data type.

Returns:

Return is the DataType enum.

Return type: enum DataType

Function addRealAttribute​

void sysc::Variable::addRealAttribute(const RealAttribute &attribute)

Add a real-valued attribute.

Parameters:

Return type: void

Function addIntegerAttribute​

void sysc::Variable::addIntegerAttribute(const IntegerAttribute &attribute)

Add an integer-valued attribute.

Parameters:

Return type: void

Function addStringAttribute​

void sysc::Variable::addStringAttribute(const StringAttribute &attribute)

Add a string-valued attribute.

Parameters:

Return type: void

Function getNumRealAttributes​

std::size_t sysc::Variable::getNumRealAttributes() const noexcept

Returns the number of real-valued attributes.

Return type: std::size_t

Function getNumIntegerAttributes​

std::size_t sysc::Variable::getNumIntegerAttributes() const noexcept

Returns the number of integer-valued attributes.

Return type: std::size_t

Function getNumStringAttributes​

std::size_t sysc::Variable::getNumStringAttributes() const noexcept

Returns the number of string-valued attributes.

Return type: std::size_t

Function getRealAttribute​

const RealAttribute& sysc::Variable::getRealAttribute(std::size_t index) const

Return the real-valued attribute at the given index.

Parameters:

  • std::size_t index

Return type: const RealAttribute &

Function getIntegerAttribute​

const IntegerAttribute& sysc::Variable::getIntegerAttribute(std::size_t index) const

Return the integer-valued attribute at the given index.

Parameters:

  • std::size_t index

Return type: const IntegerAttribute &

Function getStringAttribute​

const StringAttribute& sysc::Variable::getStringAttribute(std::size_t index) const

Return the string-valued attribute at the given index.

Parameters:

  • std::size_t index

Return type: const StringAttribute &