Public Member Functions | |
PluggableFunction () | |
virtual | ~PluggableFunction () |
virtual bool | initParams (openfluid::core::ParamsMap Params)=0 |
virtual bool | prepareData ()=0 |
virtual bool | checkConsistency ()=0 |
virtual bool | initializeRun (const SimulationInfo *SimInfo)=0 |
virtual bool | runStep (const SimulationStatus *SimStatus)=0 |
virtual bool | finalizeRun (const SimulationInfo *SimInfo)=0 |
Protected Member Functions | |
bool | OPENFLUID_GetVariable (openfluid::core::HydroObject *HO, wxString VarName, int Step, openfluid::core::ScalarValue *Value) |
bool | OPENFLUID_GetVariable (openfluid::core::HydroObject *HO, wxString VarName, int Step, openfluid::core::VectorValue *&Value) |
bool | OPENFLUID_GetProperty (openfluid::core::HydroObject *HO, wxString PropName, openfluid::core::ScalarValue *Value) |
bool | OPENFLUID_IsPropertyExists (openfluid::core::HydroObject *HO, wxString PropName) |
bool | OPENFLUID_SetProperty (openfluid::core::HydroObject *HO, wxString PropName, openfluid::core::ScalarValue Value) |
bool | OPENFLUID_GetIniCondition (openfluid::core::HydroObject *HO, wxString IniCondName, openfluid::core::ScalarValue *Value) |
bool | OPENFLUID_IsIniConditionExists (openfluid::core::HydroObject *HO, wxString IniCondName) |
bool | OPENFLUID_IsVariableExists (openfluid::core::HydroObject *HO, wxString VarName) |
bool | OPENFLUID_IsScalarVariableExists (openfluid::core::HydroObject *HO, wxString VarName) |
bool | OPENFLUID_IsVectorVariableExists (openfluid::core::HydroObject *HO, wxString VarName) |
bool | OPENFLUID_IsVariableExists (openfluid::core::HydroObject *HO, wxString VarName, int Step) |
bool | OPENFLUID_IsScalarVariableExists (openfluid::core::HydroObject *HO, wxString VarName, int Step) |
bool | OPENFLUID_IsVectorVariableExists (openfluid::core::HydroObject *HO, wxString VarName, int Step) |
bool | OPENFLUID_AppendVariable (openfluid::core::HydroObject *HO, wxString VarName, openfluid::core::ScalarValue Value) |
bool | OPENFLUID_AppendVariable (openfluid::core::HydroObject *HO, wxString VarName, openfluid::core::VectorValue &Value) |
bool | OPENFLUID_SetVariable (openfluid::core::HydroObject *HO, wxString VarName, int Step, openfluid::core::ScalarValue Value) |
bool | OPENFLUID_SetVariable (openfluid::core::HydroObject *HO, wxString VarName, int Step, openfluid::core::VectorValue Value) |
bool | OPENFLUID_GetFunctionParameter (openfluid::core::ParamsMap Params, wxString ParamName, double *Value) |
bool | OPENFLUID_GetFunctionParameter (openfluid::core::ParamsMap Params, wxString ParamName, long *Value) |
bool | OPENFLUID_GetFunctionParameter (openfluid::core::ParamsMap Params, wxString ParamName, float *Value) |
bool | OPENFLUID_GetFunctionParameter (openfluid::core::ParamsMap Params, wxString ParamName, int *Value) |
bool | OPENFLUID_GetFunctionParameter (openfluid::core::ParamsMap Params, wxString ParamName, wxString *Value) |
bool | OPENFLUID_GetFunctionParameter (openfluid::core::ParamsMap Params, wxString ParamName, std::vector< wxString > *Values) |
bool | OPENFLUID_GetFunctionParameter (openfluid::core::ParamsMap Params, wxString ParamName, std::vector< double > *Values) |
bool | OPENFLUID_GetFunctionParameter (openfluid::core::ParamsMap Params, wxString ParamName, std::vector< long > *Values) |
bool | OPENFLUID_GetEvents (openfluid::core::HydroObject *HO, openfluid::core::DateTime BeginDate, openfluid::core::DateTime EndDate, openfluid::core::EventCollection *EventColl) |
void | OPENFLUID_RaiseWarning (wxString Sender, int TimeStep, wxString Msg) |
void | OPENFLUID_RaiseWarning (wxString Sender, wxString Msg) |
void | OPENFLUID_RaiseError (wxString Sender, int TimeStep, wxString Msg) |
void | OPENFLUID_RaiseError (wxString Sender, wxString Msg) |
void | OPENFLUID_GetRunEnvironment (wxString Key, wxString *Value) |
void | OPENFLUID_GetRunEnvironment (wxString Key, bool *Value) |
Protected Attributes | |
const openfluid::core::CoreRepository * | mp_CoreData |
Abstract class for plugin interface, defining the minimal structure for a simulation function
All simulation functions must inherit from this class.
openfluid::base::PluggableFunction::PluggableFunction | ( | ) |
Constructor
virtual openfluid::base::PluggableFunction::~PluggableFunction | ( | ) | [virtual] |
Virtual destructor
bool openfluid::base::PluggableFunction::OPENFLUID_GetVariable | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
int | Step, | |||
openfluid::core::ScalarValue * | Value | |||
) | [protected] |
Gets the distributed variable value for a unit at a time step
[in] | HO | the spatial object, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the requested variable |
[in] | Step | the time step for the value of the requested variable |
[out] | Value | the value of the requested variable (scalar) |
bool openfluid::base::PluggableFunction::OPENFLUID_GetVariable | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
int | Step, | |||
openfluid::core::VectorValue *& | Value | |||
) | [protected] |
Gets the distributed variable value for a unit at a time step
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the requested variable |
[in] | Step | the time step for the value of the requested variable |
[out] | Value | the value of the requested variable (vector) |
bool openfluid::base::PluggableFunction::OPENFLUID_GetProperty | ( | openfluid::core::HydroObject * | HO, | |
wxString | PropName, | |||
openfluid::core::ScalarValue * | Value | |||
) | [protected] |
Gets a distributed property for a unit
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | PropName | the name of the requested property |
[out] | Value | the value of the requested property |
bool openfluid::base::PluggableFunction::OPENFLUID_IsPropertyExists | ( | openfluid::core::HydroObject * | HO, | |
wxString | PropName | |||
) | [protected] |
Returns true if a distributed property exists, false otherwise
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | PropName | the name of the queried variable |
bool openfluid::base::PluggableFunction::OPENFLUID_SetProperty | ( | openfluid::core::HydroObject * | HO, | |
wxString | PropName, | |||
openfluid::core::ScalarValue | Value | |||
) | [protected] |
Sets a distributed property for a unit
[in] | HO | the unit |
[in] | PropName | the name of the property to modify |
[in] | Value | the new value of the property |
bool openfluid::base::PluggableFunction::OPENFLUID_GetIniCondition | ( | openfluid::core::HydroObject * | HO, | |
wxString | IniCondName, | |||
openfluid::core::ScalarValue * | Value | |||
) | [protected] |
Gets an initial condition for a unit
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | IniCondName | the name of the requested initial condition |
[out] | Value | the value of the requested initial condition |
bool openfluid::base::PluggableFunction::OPENFLUID_IsIniConditionExists | ( | openfluid::core::HydroObject * | HO, | |
wxString | IniCondName | |||
) | [protected] |
Returns true if a distributed initial condition exists, false otherwise
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | IniCondName | the name of the queried variable |
bool openfluid::base::PluggableFunction::OPENFLUID_IsVariableExists | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName | |||
) | [protected] |
Returns true if a distributed variable exists, false otherwise (searches both scalar and vector variables)
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the requested variable |
bool openfluid::base::PluggableFunction::OPENFLUID_IsScalarVariableExists | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName | |||
) | [protected] |
Returns true if a distributed scalar variable exists, false otherwise
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the requested variable |
bool openfluid::base::PluggableFunction::OPENFLUID_IsVectorVariableExists | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName | |||
) | [protected] |
Returns true if a distributed vector variable exists, false otherwise
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the requested variable |
bool openfluid::base::PluggableFunction::OPENFLUID_IsVariableExists | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
int | Step | |||
) | [protected] |
Returns true if a distributed variable exists and if a value has been set for the given step, false otherwise (searches both scalar and vector variables)
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the requested variable |
[in] | Step | the time step for the value of the variable |
bool openfluid::base::PluggableFunction::OPENFLUID_IsScalarVariableExists | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
int | Step | |||
) | [protected] |
Returns true if a distributed scalar variable exists and if a value has been set for the given step, false otherwise
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the requested variable |
[in] | Step | the time step for the value of the variable |
bool openfluid::base::PluggableFunction::OPENFLUID_IsVectorVariableExists | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
int | Step | |||
) | [protected] |
Returns true if a distributed vector variable exists and if a value has been set for the given step, false otherwise
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the requested variable |
[in] | Step | the time step for the value of the variable |
bool openfluid::base::PluggableFunction::OPENFLUID_AppendVariable | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
openfluid::core::ScalarValue | Value | |||
) | [protected] |
Appends a distributed scalar variable value for a unit at the end of the previously added values for this variable
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the variable |
[in] | Value | the added value of the variable |
bool openfluid::base::PluggableFunction::OPENFLUID_AppendVariable | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
openfluid::core::VectorValue & | Value | |||
) | [protected] |
Appends a distributed vector variable value for a unit at the end of the previously added values for this variable
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the variable |
[in] | Value | the added value of the variable |
bool openfluid::base::PluggableFunction::OPENFLUID_SetVariable | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
int | Step, | |||
openfluid::core::ScalarValue | Value | |||
) | [protected] |
Sets a distributed scalar variable value for a unit at a time step
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the variable |
[in] | Step | the time step for the value of the variable |
[in] | Value | the added value of the variable |
bool openfluid::base::PluggableFunction::OPENFLUID_SetVariable | ( | openfluid::core::HydroObject * | HO, | |
wxString | VarName, | |||
int | Step, | |||
openfluid::core::VectorValue | Value | |||
) | [protected] |
Sets a distributed vector variable value for a unit at a time step
[in] | HO | the unit, can be SurfaceUnit, ReachSegment or GroundwaterUnit |
[in] | VarName | the name of the variable |
[in] | Step | the time step for the value of the variable |
[in] | Value | the added value of the variable |
bool openfluid::base::PluggableFunction::OPENFLUID_GetFunctionParameter | ( | openfluid::core::ParamsMap | Params, | |
wxString | ParamName, | |||
double * | Value | |||
) | [protected] |
Gets a function parameter from the parameters set, as a double
[in] | Params | the parameters set for the simulation function |
[in] | ParamName | the name of the requested parameter |
[out] | Value | the value of the requested parameter |
bool openfluid::base::PluggableFunction::OPENFLUID_GetFunctionParameter | ( | openfluid::core::ParamsMap | Params, | |
wxString | ParamName, | |||
long * | Value | |||
) | [protected] |
Gets a function parameter value from the parameters set, as a long int
[in] | Params | the parameters set for the simulation function |
[in] | ParamName | the name of the requested parameter |
[out] | Value | the value of the requested parameter |
bool openfluid::base::PluggableFunction::OPENFLUID_GetFunctionParameter | ( | openfluid::core::ParamsMap | Params, | |
wxString | ParamName, | |||
float * | Value | |||
) | [protected] |
Gets a function parameter from the parameters set, as a float
[in] | Params | the parameters set for the simulation function |
[in] | ParamName | the name of the requested parameter |
[out] | Value | the value of the requested parameter |
bool openfluid::base::PluggableFunction::OPENFLUID_GetFunctionParameter | ( | openfluid::core::ParamsMap | Params, | |
wxString | ParamName, | |||
int * | Value | |||
) | [protected] |
Gets a function parameter value from the parameters set, as an int
[in] | Params | the parameters set for the simulation function |
[in] | ParamName | the name of the requested parameter |
[out] | Value | the value of the requested parameter |
bool openfluid::base::PluggableFunction::OPENFLUID_GetFunctionParameter | ( | openfluid::core::ParamsMap | Params, | |
wxString | ParamName, | |||
wxString * | Value | |||
) | [protected] |
Gets a function parameter value from the parameters set, as a string
[in] | Params | the parameters set for the simulation function |
[in] | ParamName | the name of the requested parameter |
[out] | Value | the value of the requested parameter |
bool openfluid::base::PluggableFunction::OPENFLUID_GetFunctionParameter | ( | openfluid::core::ParamsMap | Params, | |
wxString | ParamName, | |||
std::vector< wxString > * | Values | |||
) | [protected] |
Gets a function parameter vector of values from the parameters set, as a vector of strings
[in] | Params | the parameters set for the simulation function |
[in] | ParamName | the name of the requested parameter |
[out] | Values | the vector of values of the requested parameter |
bool openfluid::base::PluggableFunction::OPENFLUID_GetFunctionParameter | ( | openfluid::core::ParamsMap | Params, | |
wxString | ParamName, | |||
std::vector< double > * | Values | |||
) | [protected] |
Gets a function parameter vector of values from the parameters set, as a vector of doubles
[in] | Params | the parameters set for the simulation function |
[in] | ParamName | the name of the requested parameter |
[out] | Values | the vector of values of the requested parameter |
bool openfluid::base::PluggableFunction::OPENFLUID_GetFunctionParameter | ( | openfluid::core::ParamsMap | Params, | |
wxString | ParamName, | |||
std::vector< long > * | Values | |||
) | [protected] |
Gets a function parameter vector of values from the parameters set, as a vector of long ints
[in] | Params | the parameters set for the simulation function |
[in] | ParamName | the name of the requested parameter |
[out] | Values | the vector of values of the requested parameter |
bool openfluid::base::PluggableFunction::OPENFLUID_GetEvents | ( | openfluid::core::HydroObject * | HO, | |
openfluid::core::DateTime | BeginDate, | |||
openfluid::core::DateTime | EndDate, | |||
openfluid::core::EventCollection * | EventColl | |||
) | [protected] |
Gets discrete events happening on a unit during a time period
[in] | HO | the unit |
[in] | BeginDate | the beginning of the time period |
[in] | EndDate | the ending of the time period |
[out] | EventColl | the collection of event corresponding to the request |
void openfluid::base::PluggableFunction::OPENFLUID_RaiseWarning | ( | wxString | Sender, | |
int | TimeStep, | |||
wxString | Msg | |||
) | [protected] |
Raises a time-marked warning message to the kernel. This do not stops the simulation
[in] | Sender | the sender of the message |
[in] | TimeStep | the time step number when the message occurred |
[in] | Msg | the content of the message |
void openfluid::base::PluggableFunction::OPENFLUID_RaiseWarning | ( | wxString | Sender, | |
wxString | Msg | |||
) | [protected] |
Raises a warning message to the kernel. This do not stops the simulation
[in] | Sender | the sender of the message |
[in] | Msg | the content of the message |
void openfluid::base::PluggableFunction::OPENFLUID_RaiseError | ( | wxString | Sender, | |
int | TimeStep, | |||
wxString | Msg | |||
) | [protected] |
Raises a time-marked error message to the kernel. This stops the simulation the next time the kernel has the control
[in] | Sender | the sender of the message |
[in] | TimeStep | the time step number when the message occurred |
[in] | Msg | the content of the message |
void openfluid::base::PluggableFunction::OPENFLUID_RaiseError | ( | wxString | Sender, | |
wxString | Msg | |||
) | [protected] |
Raises an error message to the kernel. This stops the simulation the next time the kernel has the control
[in] | Sender | the sender of the message |
[in] | Msg | the content of the message |
void openfluid::base::PluggableFunction::OPENFLUID_GetRunEnvironment | ( | wxString | Key, | |
wxString * | Value | |||
) | [protected] |
Gets an environment string value associated to a Key
[in] | Key | the sender of the message |
[out] | Value | the value associated with the environment key |
void openfluid::base::PluggableFunction::OPENFLUID_GetRunEnvironment | ( | wxString | Key, | |
bool * | Value | |||
) | [protected] |
Gets an environment boolean value associated to a Key
[in] | Key | the sender of the message |
[out] | Value | the value associated with the environment key |
virtual bool openfluid::base::PluggableFunction::initParams | ( | openfluid::core::ParamsMap | Params | ) | [pure virtual] |
Initializes function parameters of the function, given as a hash map. Called by the kernel.
virtual bool openfluid::base::PluggableFunction::prepareData | ( | ) | [pure virtual] |
Prepares data. Called by the kernel.
virtual bool openfluid::base::PluggableFunction::checkConsistency | ( | ) | [pure virtual] |
Checks the function consistency. Called by the kernel.
virtual bool openfluid::base::PluggableFunction::initializeRun | ( | const SimulationInfo * | SimInfo | ) | [pure virtual] |
Called by the kernel.
virtual bool openfluid::base::PluggableFunction::runStep | ( | const SimulationStatus * | SimStatus | ) | [pure virtual] |
Called by the kernel.
virtual bool openfluid::base::PluggableFunction::finalizeRun | ( | const SimulationInfo * | SimInfo | ) | [pure virtual] |
Called by the kernel.
const openfluid::core::CoreRepository* openfluid::base::PluggableFunction::mp_CoreData [protected] |
Pointer to the core repository (const). It should be used with care. Prefer to use the OPENFLUID_Xxxx methods.