#include <variable.h>
Collaboration diagram for SPARK::TVariable:
Public Types | |
enum | FlagTypes { FlagType_BREAK = 0, FlagType_RESIDUAL, FlagType_DYNAMIC, FlagType_INPUT_FROM_LINK, FlagType_PREDICT_FROM_LINK, FlagType_REPORT, FLAGTYPES_L } |
Describes internal properties of the variable as specified by setupcpp. More... | |
Public Member Functions | |
TVariable () | |
Default constructor used when loading the problem at runtime. | |
TVariable (unsigned handle, const char *name, const char *unit, SPARK::VariableTypes type, double initVal, double minVal, double maxVal, double atol, unsigned fromLinkId, const char *rd_url, const char *wr_url) | |
Constructor used with compiled "problem.cpp" file. | |
Access methods for the current numerical value of the variable | |
double | GetValue () const |
Returns the curent value as a double. | |
operator double () const | |
Enables implicit conversion to (double). | |
void | SetValue (double scalar) |
Sets the current value to scalar. | |
SPARK::TVariable & | operator= (double scalar) |
Sets the current value to scalar with operator=(double ). | |
double | GetArgument () const |
Returns value for argument variable in an object. | |
void | SetTarget (double scalar) |
Sets the target value for the matched object. | |
double | GetTarget () const |
Returns value from evaluating the matched object (used by TEquationSystem and TJacobian internally). | |
double | Predict () const |
Predicts value for current time based on past values only. | |
Access methods for past and inner values | |
unsigned | GetNumPastValues () const |
Returns the number of past values that are being kept track of. | |
double | GetPastValue (unsigned pastStep) const |
Returns the past value from idx steps ago. | |
double | operator[] (unsigned pastStep) const |
Returns the past value from idx steps ago. | |
double | GetInnerValue (unsigned innerStep) const |
Access the intermediate values over the currrent step. | |
double | operator() (unsigned innerStep) const |
Access the intermediate values over the currrent step. | |
Updating methods | |
void | SetFromLinkId (unsigned var_id) |
Set INPUT_FROM_LINK=FromLink or PREDICT_FROM_LINK=FromLink. | |
unsigned | GetFromLinkId () const |
Get var_id of FromLink variables, SPARK::NotAssigned if not specified. | |
Access operations for the internal properties | |
TObject * | GetMatchedObject () |
const TObject * | GetMatchedObject () const |
Access operations for the LINK properties | |
unsigned | GetHandle () const |
Returns the unique handle as unsigned int. | |
SPARK::VariableTypes | GetType () const |
Returns the variable type as SPARK::VariableTypes. | |
unsigned long | GetFlag () const |
Returns the variable flag as an unsigned int. | |
const std::string & | GetName () const |
Returns the variable name as a const char*. | |
const std::string & | GetUnit () const |
Returns the unit string as const char*. | |
void | SetUnit (const char *unit) |
Sets the unit string to unit. | |
double | GetInit () const |
Returns the initial value as double. | |
void | SetInit (double init) |
Sets the initial value to init. | |
double | GetMin () const |
Returns the mimimum value as double. | |
void | SetMin (double min) |
Sets the minimum value to min. | |
double | GetMax () const |
Returns the maximum value as double. | |
void | SetMax (double max) |
Sets the maximum value to max. | |
double | GetAbsTolerance () const |
Returns the absolute tolerance as double. | |
void | SetAbsTolerance (double atol) |
Sets the absolute tolerance to atol. | |
double | GetScale () const |
Returns the current scale. | |
void | SetScale (double scalar) |
Sets the current scale to scalar. | |
Predicate methods | |
bool | IsFlag (FlagTypes flag) const |
Returns if flag is set for this variable, false otherwise. | |
IO operations | |
void | Write (std::ostream &os, unsigned width, unsigned precision) const |
R/W URL methods | |
| |
const char * | GetReadUrlString () const |
void | SetReadUrlString (const char *url) |
int | GetReadUrlHandle () const |
void | SetReadUrlHandle (int s) |
const char * | GetWriteUrlString () const |
void | SetWriteUrlString (const char *url) |
int | GetWriteUrlHandle () const |
void | SetWriteUrlHandle (int s) |
This class is the building block of the SPARK solver framework. It is used to represent all problem variables at the problem and component levels.
The low-level numerical solution methods do not operate directly on the SPARK::TVariable instances but on arrays of fundamental types (i.e., double, unsigned...).
Eventually, the numerical values in the SPARK::TVariable objects are updated with the solution of the nonlinear solver.
|
|
Default constructor used when loading the problem at runtime.
|
|
Constructor used with compiled "problem.cpp" file.
|
|
Returns the curent value as a double.
|
|
Enables implicit conversion to (double).
|
|
Sets the current value to scalar.
|
|
Sets the current value to scalar with operator=(double ).
|
|
Returns value for argument variable in an object.
|
|
Sets the target value for the matched object.
|
|
Returns value from evaluating the matched object (used by TEquationSystem and TJacobian internally).
|
|
Predicts value for current time based on past values only. Returns an estimate of the solution at the current time using the explicit Euler scheme to calculate the extrapolatation from past values
|
|
Returns the number of past values that are being kept track of.
|
|
Returns the past value from idx steps ago.
|
|
Returns the past value from idx steps ago.
|
|
Access the intermediate values over the currrent step.
|
|
Access the intermediate values over the currrent step.
|
|
Set INPUT_FROM_LINK=FromLink or PREDICT_FROM_LINK=FromLink.
|
|
Get var_id of FromLink variables, SPARK::NotAssigned if not specified.
|
|
Returns the pointer to the object this variable is matched with
|
|
Returns the const pointer to the object this variable is matched with
|
|
Returns the unique handle as unsigned int.
|
|
Returns the variable type as SPARK::VariableTypes.
|
|
Returns the variable flag as an unsigned int.
|
|
Returns the variable name as a const char*.
|
|
Returns the unit string as const char*.
|
|
Sets the unit string to unit.
|
|
Returns the initial value as double.
|
|
Sets the initial value to init.
|
|
Returns the mimimum value as double.
|
|
Sets the minimum value to min.
|
Here is the call graph for this function:
|
Returns the maximum value as double.
|
|
Sets the maximum value to max.
|
Here is the call graph for this function:
|
Returns the absolute tolerance as double.
|
|
Sets the absolute tolerance to atol.
|
|
Returns the current scale.
|
|
Sets the current scale to scalar.
|
|
Returns if flag is set for this variable, false otherwise.
|
|
Pretty printing of the variable name, its numerical value and its unit string to the output stream os |