StoreThermalQuantity
Returns a true or false value that indicates whether the storing operation is successful. When the operation is successful, the function saves the intermediate values that are retrieved with the GetThermalQuantity
method during the run.
Calling convention:
bool StoreThermalQuantity (char* name, int label, double val)
Note:
To access this method, you must use the GetTMGFunction method and include the AdditionalFunctions.h file located in the [installation_path]\tmg\include\maya\expeval_utils folder in the beginning of your source file.
Argument | Data type | Description |
---|---|---|
name | char* | User defined array name. |
label | int | User defined integer value for a label, such as an element number. |
val | double | Value associated with the label. |
Example:
#include <ITMGFuncService.h>
#ifdef _WIN32
extern "C" __declspec(dllexport) void TMGUserInitialize(void* pGetTMGFunc)
#else
extern "C" void TMGUserInitialize(void* pGetTMGFunc)
#endif
{
// Generic function to get access to solver function
pGetTMGFunction = (GETTMGFUNCTION_FTYPE)pGetTMGFunc;
// initialize ITMGFuncService interface
if (pGetTMGFuncServicePointer != nullptr)
{
pTMGFuncService = pGetTMGFuncServicePointer();
}
int label = 1001;
double val = 1234.56;
const char* name = "ThermalQuantity";
if ((pTMGFuncService->StoreThermalQuantity(name, label, val) == true)
std::cout << "Succesfully stored value " << val << " associated with label " << label << " in named array " << name << std::endl;
else
std::cout << "Cannot store value" << std::endl;
int label = 1001;
double val = 0.0;
const char* name = "ThermalQuantity";
if (pTMGFuncService->GetThermalQuantity(name, label, &val) == true)
std::cout << "Succesfully got value " << val << " associated with label " << label << " in named array " << name << std::endl;
else
std::cout << "Cannot get value" << std::endl;
}