File syscVariable.h
Last update: 17.07.2025Location: syscVariable.h
Classes
Includes
- SystemCouplingParticipant/LibraryType.hpp
- SystemCouplingParticipant/syscCommonTypes.h
- SystemCouplingParticipant/syscAttribute.h
- <stddef.h>
graph LR
1["syscVariable.h"]
click 1 "syscVariable_8h.md#syscVariable_8h"
1 --> 2
1 --> 3
1 --> 4
1 --> 5
3["SystemCouplingParticipant/syscCommonTypes.h"]
5["stddef.h"]
2["SystemCouplingParticipant/LibraryType.hpp"]
4["SystemCouplingParticipant/syscAttribute.h"]
Typedefs
Typedef SyscVariable
Definition: syscVariable.h (line 45)
typedef struct SyscVariable SyscVariable
Provide a struct for a System Coupling variable.
To create and/or initialize the SyscVariable struct, it is highly recommended to use one of the functions with names starting with syscGetVariable. These functions will initialize all members to the correct values and will help to avoid back-compatibility issues in the future. For example:
SyscVariable var = syscGetVariableTE(
"Temperature", SyscScalar, 0, SyscNode);
Return type: struct SyscVariable
Functions
Function syscGetVariable
SyscVariable syscGetVariable(const char *name)
Create variable to be used in a coupled analysis.
Parameters:
- name: - Unique name for this variable. String length should not exceed SYSC_STRING_LENGTH.
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.
Parameters:
- const char * name
Return type: SyscVariable
Function syscGetVariableDTELQD
SyscVariable syscGetVariableDTELQD(const char *name, const char *displayName, enum SyscTensorType tensorType, int isExtensive, enum SyscLocation location, enum SyscQuantityType quantityType, enum SyscDataType dataType)
Create variable to be used in a coupled analysis.
Parameters:
- name: - Unique name for this variable. String length should not exceed SYSC_STRING_LENGTH.
- displayName: - variable display name. 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).
- quantityType: - variable quantity type.
- dataType: - variable data type.
Parameters:
- const char * name
- const char * displayName
- enum SyscTensorType tensorType
- int isExtensive
- enum SyscLocation location
- enum SyscQuantityType quantityType
- enum SyscDataType dataType
Return type: SyscVariable
Function syscGetVariableTE
SyscVariable syscGetVariableTE(const char *name, enum SyscTensorType tensorType, int isExtensive, enum SyscLocation location)
Create variable to be used in a coupled analysis.
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.
Parameters:
- const char * name
- enum SyscTensorType tensorType
- int isExtensive
- enum SyscLocation location
Return type: SyscVariable
Function syscGetVariableTEQ
SyscVariable syscGetVariableTEQ(const char *name, const char *displayName, enum SyscTensorType tensorType, int isExtensive, enum SyscLocation location, enum SyscQuantityType quantityType)
Create variable to be used in a coupled analysis.
Parameters:
- name: - Unique name for this variable. String length should not exceed SYSC_STRING_LENGTH.
- displayName: - variable display name. 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).
- quantityType: - variable quantity type.
Parameters:
- const char * name
- const char * displayName
- enum SyscTensorType tensorType
- int isExtensive
- enum SyscLocation location
- enum SyscQuantityType quantityType
Return type: SyscVariable
Function syscGetVariableQ
SyscVariable syscGetVariableQ(const char *name, const char *displayName, enum SyscLocation location, enum SyscQuantityType quantityType)
Create variable to be used in a coupled analysis.
Parameters:
- name: - Unique name for this variable. String length should not exceed SYSC_STRING_LENGTH.
- displayName: - variable display name. String length should not exceed SYSC_STRING_LENGTH.
- location: - variable location (e.g element or node).
- quantityType: - variable quantity type.
The variable tensor type and is extensive properties will be inferred from the quantity type, 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
If any other quantity type is specified, tensor type will be set to scalar and is extensive will be set to false.
Parameters:
- const char * name
- const char * displayName
- enum SyscLocation location
- enum SyscQuantityType quantityType
Return type: SyscVariable
Function syscVariableAddRealAttribute
SyscError syscVariableAddRealAttribute(SyscVariable variable, SyscRealAttribute attribute)
Add real-valued attribute to the variable.
Parameters:
- SyscVariable variable
- SyscRealAttribute attribute
Return type: SyscError
Function syscVariableAddIntegerAttribute
SyscError syscVariableAddIntegerAttribute(SyscVariable variable, SyscIntegerAttribute attribute)
Add integer-valued attribute to the variable.
Parameters:
- SyscVariable variable
- SyscIntegerAttribute attribute
Return type: SyscError
Function syscVariableGetNumRealAttributes
size_t syscVariableGetNumRealAttributes(SyscVariable variable)
Get number of real-valued attributes.
Parameters:
- SyscVariable variable
Return type: size_t
Function syscVariableGetNumIntegerAttributes
size_t syscVariableGetNumIntegerAttributes(SyscVariable variable)
Get number of integer-valued attributes.
Parameters:
- SyscVariable variable
Return type: size_t
Function syscVariableGetRealAttribute
SyscRealAttribute syscVariableGetRealAttribute(SyscVariable variable, size_t index)
Return the real-valued attribute at the given index.
Parameters:
- SyscVariable variable
- size_t index
Return type: SyscRealAttribute
Function syscVariableGetIntegerAttribute
SyscIntegerAttribute syscVariableGetIntegerAttribute(SyscVariable variable, size_t index)
Return the integer-valued attribute at the given index.
Parameters:
- SyscVariable variable
- size_t index
Return type: SyscIntegerAttribute
Source
/*
* Copyright ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
*/
#pragma once
#include "SystemCouplingParticipant/LibraryType.hpp"
#include "SystemCouplingParticipant/syscCommonTypes.h"
#include "SystemCouplingParticipant/syscAttribute.h"
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SyscVariable {
char name[SYSC_STRING_LENGTH];
enum SyscQuantityType quantityType;
enum SyscLocation location;
char displayName[SYSC_STRING_LENGTH];
enum SyscTensorType tensorType;
int isExtensive;
enum SyscDataType dataType;
} SyscVariable;
SyscVariable syscGetVariable(
const char* name);
SyscVariable syscGetVariableDTELQD(
const char* name,
const char* displayName,
enum SyscTensorType tensorType,
int isExtensive,
enum SyscLocation location,
enum SyscQuantityType quantityType,
enum SyscDataType dataType);
SyscVariable syscGetVariableTE(
const char* name,
enum SyscTensorType tensorType,
int isExtensive,
enum SyscLocation location);
SyscVariable syscGetVariableTEQ(
const char* name,
const char* displayName,
enum SyscTensorType tensorType,
int isExtensive,
enum SyscLocation location,
enum SyscQuantityType quantityType);
SyscVariable syscGetVariableQ(
const char* name,
const char* displayName,
enum SyscLocation location,
enum SyscQuantityType quantityType);
SyscError syscVariableAddRealAttribute(
SyscVariable variable,
SyscRealAttribute attribute);
SyscError syscVariableAddIntegerAttribute(
SyscVariable variable,
SyscIntegerAttribute attribute);
size_t syscVariableGetNumRealAttributes(SyscVariable variable);
size_t syscVariableGetNumIntegerAttributes(SyscVariable variable);
SyscRealAttribute syscVariableGetRealAttribute(
SyscVariable variable,
size_t index);
SyscIntegerAttribute syscVariableGetIntegerAttribute(
SyscVariable variable,
size_t index);
#ifdef __cplusplus
}
#endif