|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Singleton class for user-defined functions plugins. More...
#include <FFaUserFuncPlugin.H>


Public Member Functions | |
| bool | validate (const std::string &lib, int nchar=0, char *sign=NULL) |
| Checks if the named library can be loaded as a plugin. More... | |
| bool | getSign (int nchar, char *sign) const |
| Returns the signature string of the loaded plugin. More... | |
| int | getFuncs (int maxUF, int *funcId, bool silence=false) const |
| Returns a list of function types defined in the plugin. More... | |
| int | getFuncName (int id, int nchar=0, char *name=NULL) const |
| Returns a function type name. More... | |
| int | getParName (int id, int ipar=1, int nchar=0, char *name=NULL) const |
| Returns a function parameter name for a given function type. More... | |
| double | getDefaultParVal (int id, int ipar) const |
| Returns a default parameter value for a given function type. More... | |
| const char ** | getPixmap (int id) const |
| Returns a pointer to a pixmap to display in the property panel. More... | |
| int | getFlag (int id) const |
| Returns the function flag for a given function type, id. More... | |
| double | getValue (int bId, int fId, const double *params, double x, int &err) const |
| Evaluates single-argument user-defined functions. More... | |
| double | getValue (int bId, int fId, const double *params, const double *args, int &err) const |
| Evaluates multi-argument user-defined functions. More... | |
| double | getDiff (int bId, int fId, int ia, const double *params, const double *args, int &err) const |
| Evaluates a derivative of multi-argument user-defined functions. More... | |
| int | wave (int bId, int fId, double d, double g, const double *params, const double *args, double &h, double *u, double *du) const |
| Evaluates user-defined wave functions. More... | |
Public Member Functions inherited from FFaDynamicLibraryBase | |
| bool | load (const std::string &libName, bool silence=false) |
| Loads the library named libName. More... | |
| bool | unload (const std::string &libName, bool silence=false) |
| Unloads the library named libName. More... | |
| void | unloadAll () |
| Unloads all libraries and clears the function cache. More... | |
| bool | areLibsLoaded () const |
| Returns whether dynamics libraries have been loaded or not. More... | |
| const char * | getLibrary (size_t idx=1) const |
| Returns the file name of the dynamic library, if loaded. More... | |
Friends | |
| class | FFaSingelton< FFaUserFuncPlugin > |
Additional Inherited Members | |
Static Public Member Functions inherited from FFaSingelton< FFaUserFuncPlugin > | |
| static FFaUserFuncPlugin * | instance () |
| Returns the actual instance of this class. More... | |
| static void | removeInstance () |
| Deletes the dynamically allocated instance. More... | |
| static bool | allocated () |
| Returns true, if the instance has been allocated. More... | |
Protected Types inherited from FFaDynamicLibraryBase | |
| enum | LanguageBinding { Undefined , C , Fortran } |
| Enums defining the supported language bindings. More... | |
Protected Member Functions inherited from FFaDynamicLibraryBase | |
| FFaDynamicLibraryBase () | |
| Default constructor. More... | |
| virtual | ~FFaDynamicLibraryBase () |
| The destructor unloads all dynamically loaded libraries. More... | |
| DLPROC | getProcAddr (const std::string &fName, bool silence=false) const |
| Returns the function pointer for the named function. More... | |
| DLPROC | getProcAddr (const std::string &cName, const std::string &fName, LanguageBinding &lang, bool silence=false) const |
| Returns the function pointer for the named function. More... | |
| DLPROC | getProcAddress (const std::string &fName, size_t procID) const |
| Returns the function pointer for the given function. More... | |
| DLPROC | getProcAddress (const std::string &cName, const std::string &fName, LanguageBinding &lang, size_t procID) const |
| Returns the function pointer for the given function. More... | |
Protected Member Functions inherited from FFaSingelton< FFaUserFuncPlugin > | |
| FFaSingelton () | |
| The constructor is protected to allow objects of sub-classes only. More... | |
| FFaSingelton (const FFaSingelton &)=delete | |
| Disable default copy constructor. More... | |
| FFaSingelton & | operator= (const FFaSingelton &)=delete |
| Disable default assignment operator. More... | |
Singleton class for user-defined functions plugins.
| double FFaUserFuncPlugin::getDefaultParVal | ( | int | id, |
| int | ipar | ||
| ) | const |
Returns a default parameter value for a given function type.
| [in] | id | Unique id identifying the function type |
| [in] | ipar | Function parameter index |
| double FFaUserFuncPlugin::getDiff | ( | int | bId, |
| int | fId, | ||
| int | ia, | ||
| const double * | params, | ||
| const double * | args, | ||
| int & | err | ||
| ) | const |
Evaluates a derivative of multi-argument user-defined functions.
| [in] | bId | Base id of the function instance |
| [in] | fId | Unique id identifying the function type |
| [in] | ia | Index of the argument of differentiate with respect to |
| [in] | params | Array of constant function parameters |
| [in] | args | Function arguments |
| [in] | err | Error indicator |
| int FFaUserFuncPlugin::getFlag | ( | int | id | ) | const |
Returns the function flag for a given function type, id.
This flag is used to trigger different handling of the user-defined function in the Fedem dynamics solver:
0 : No particular treatment, the function is evaluated only when needed
1 : (Pre)evaluate this function in the beginning of each increment
2 : Evaluate this function at the end og each time increment
4 : This is a user-defined wave function
| int FFaUserFuncPlugin::getFuncName | ( | int | id, |
| int | nchar = 0, |
||
| char * | name = NULL |
||
| ) | const |
Returns a function type name.
| [in] | id | Unique id identifying the function type |
| [in] | nchar | Max length of the function type name |
| [out] | name | The function type name corresponding to id |
| int FFaUserFuncPlugin::getFuncs | ( | int | maxUF, |
| int * | funcId, | ||
| bool | silence = false |
||
| ) | const |
Returns a list of function types defined in the plugin.
| [in] | maxUF | Max number of user-defined function types |
| [out] | funcId | List of unique ids identifying each function type |
| [in] | silence | If true, suppress error messages |
| int FFaUserFuncPlugin::getParName | ( | int | id, |
| int | ipar = 1, |
||
| int | nchar = 0, |
||
| char * | name = NULL |
||
| ) | const |
Returns a function parameter name for a given function type.
| [in] | id | Unique id identifying the function type |
| [in] | ipar | Function parameter index |
| [in] | nchar | Max length of the function parameter name |
| [out] | name | The name of the parameter |
| const char ** FFaUserFuncPlugin::getPixmap | ( | int | id | ) | const |
Returns a pointer to a pixmap to display in the property panel.
| bool FFaUserFuncPlugin::getSign | ( | int | nchar, |
| char * | sign | ||
| ) | const |
Returns the signature string of the loaded plugin.
| [in] | nchar | Max length of the signature string |
| [out] | sign | A signature string describing the loaded plugin |
| double FFaUserFuncPlugin::getValue | ( | int | bId, |
| int | fId, | ||
| const double * | params, | ||
| const double * | args, | ||
| int & | err | ||
| ) | const |
Evaluates multi-argument user-defined functions.
| [in] | bId | Base id of the function instance |
| [in] | fId | Unique id identifying the function type |
| [in] | params | Array of constant function parameters |
| [in] | args | Function arguments |
| [in] | err | Error indicator |
| double FFaUserFuncPlugin::getValue | ( | int | bId, |
| int | fId, | ||
| const double * | params, | ||
| double | x, | ||
| int & | err | ||
| ) | const |
Evaluates single-argument user-defined functions.
| [in] | bId | Base id of the function instance |
| [in] | fId | Unique id identifying the function type |
| [in] | params | Array of constant function parameters |
| [in] | x | Function argument |
| [in] | err | Error indicator |
| bool FFaUserFuncPlugin::validate | ( | const std::string & | lib, |
| int | nchar = 0, |
||
| char * | sign = NULL |
||
| ) |
Checks if the named library can be loaded as a plugin.
| [in] | lib | Full path to the dynamic library |
| [in] | nchar | Max length of the signature string |
| [out] | sign | A signature string describing the loaded plugin |
This method is only used to detect whether the name shared object library lib is a plugin containing user-defined function types or not. The method returns true if that is the case, otherwise false.

| int FFaUserFuncPlugin::wave | ( | int | bId, |
| int | fId, | ||
| double | d, | ||
| double | g, | ||
| const double * | params, | ||
| const double * | args, | ||
| double & | h, | ||
| double * | u, | ||
| double * | du | ||
| ) | const |
Evaluates user-defined wave functions.
| [in] | bId | Base id of the function instance |
| [in] | fId | Unique id identifying the function type |
| [in] | d | Water depth |
| [in] | g | Gravity constant |
| [in] | params | Array of constant function parameters |
| [in] | args | Function arguments |
| [out] | h | Wave elevation |
| [out] | u | Particle velocity |
| [out] | du | Particle acceleration |
|
friend |