FEDEM Solver  R8.0
Source code of the dynamics solver
Public Member Functions | Protected Member Functions | Friends | List of all members
FiUserElmPlugin Class Reference

Singleton class for user-defined element plugins. More...

#include <FiUserElmPlugin.H>

Inheritance diagram for FiUserElmPlugin:
Inheritance graph
[legend]
Collaboration diagram for FiUserElmPlugin:
Collaboration graph
[legend]

Public Member Functions

bool validate (const std::string &libName, int nchar=0, char *sign=NULL)
 Checks if the named library can be loaded as a plugin. More...
 
bool getSign (int nchar, char *sign, bool silence=false)
 Returns the signature string of the loaded plugin. More...
 
int getElementTypes (int maxUE, int *eType)
 Returns a list of element types defined in the plugin. More...
 
int getTypeName (int eType, int nchar, char *name)
 Returns the name of an element type. More...
 
int init (const double *gdata)
 Initializes the plugin. More...
 
int init (int eId, int eType, int nenod, int nedof, int &niwork, int &nrwork)
 Returns the required length of the work areas for a given element. More...
 
int init (int eId, int eType, int nenod, int nedof, const double *X, const double *T, int *iwork, double *rwork)
 Initializes the state-independent part of the element work areas. More...
 
int mass (int eId, int eType, int nenod, const double *X, int *iwork, double *rwork, double &mass)
 Calculates the total mass for a given user-defined element. More...
 
int update (int eId, int eType, int nenod, int nedof, const double *X, const double *T, const double *V, const double *A, int *iwork, double *rwork, double *Kt, double *Ct, double *M, double *Fs, double *Fd, double *Fi, double *Q, double t, double dt, int istep, int iter)
 Updates the state of a given user-defined element. More...
 
int origin (int eId, int eType, int nenod, const double *X, const double *T, const int *iwork, const double *rwork, double *Tlg)
 Calculates the local origin of a user-defined element. More...
 
int result (int eId, int eType, int idx, const int *iwork, const double *rwork, int nchar, char *name)
 Returns the name of a result quantity of a user-defined element. More...
 
int result (int eId, int eType, int idx, const int *iwork, const double *rwork, double &value)
 Returns the value of a result quantity of a user-defined element. 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...
 

Protected Member Functions

 FiUserElmPlugin ()
 Default constructor. More...
 
virtual ~FiUserElmPlugin ()
 Empty destructor. 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< FiUserElmPlugin >
 FFaSingelton ()
 The constructor is protected to allow objects of sub-classes only. More...
 
 FFaSingelton (const FFaSingelton &)=delete
 Disable default copy constructor. More...
 
FFaSingeltonoperator= (const FFaSingelton &)=delete
 Disable default assignment operator. More...
 

Friends

class FFaSingelton< FiUserElmPlugin >
 

Additional Inherited Members

- Static Public Member Functions inherited from FFaSingelton< FiUserElmPlugin >
static FiUserElmPlugininstance ()
 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...
 

Detailed Description

Singleton class for user-defined element plugins.

Constructor & Destructor Documentation

◆ FiUserElmPlugin()

FiUserElmPlugin::FiUserElmPlugin ( )
inlineprotected

Default constructor.

◆ ~FiUserElmPlugin()

virtual FiUserElmPlugin::~FiUserElmPlugin ( )
inlineprotectedvirtual

Empty destructor.

Member Function Documentation

◆ getElementTypes()

int FiUserElmPlugin::getElementTypes ( int  maxUE,
int *  eType 
)

Returns a list of element types defined in the plugin.

Parameters
[in]maxUEMax number of user-defined element types
[out]eTypeList of unique ids identifying each element type
Returns
Number of different element types in the plugin
Here is the call graph for this function:

◆ getSign()

bool FiUserElmPlugin::getSign ( int  nchar,
char *  sign,
bool  silence = false 
)

Returns the signature string of the loaded plugin.

Parameters
[in]ncharMax length of the signature string
[out]signA signature string describing the loaded plugin
[in]silenceIf true, suppress error messages
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTypeName()

int FiUserElmPlugin::getTypeName ( int  eType,
int  nchar,
char *  name 
)

Returns the name of an element type.

Parameters
[in]eTypeUnique id identifying the element type
[in]ncharMax length of the element type name
[out]nameThe element type name corresponding to eType
Returns
Number of nodes for the element type
Here is the call graph for this function:

◆ init() [1/3]

int FiUserElmPlugin::init ( const double *  gdata)

Initializes the plugin.

Parameters
[in]gdataGlobal parameters that applies to all elements
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init() [2/3]

int FiUserElmPlugin::init ( int  eId,
int  eType,
int  nenod,
int  nedof,
const double *  X,
const double *  T,
int *  iwork,
double *  rwork 
)

Initializes the state-independent part of the element work areas.

Parameters
[in]eIdUnique id identifying this element instance (the baseID)
[in]eTypeUnique id identifying the element type
[in]nenodNumber of element nodes
[in]nedofNumber of element degrees of freedom
[in]XGlobal initial nodal coordinates of the element
[in]TLocal initial nodal coordinate systems of the element
iworkInteger work area for this element
rworkReal work area for this element
Here is the call graph for this function:

◆ init() [3/3]

int FiUserElmPlugin::init ( int  eId,
int  eType,
int  nenod,
int  nedof,
int &  niwork,
int &  nrwork 
)

Returns the required length of the work areas for a given element.

Parameters
[in]eIdUnique id identifying this element instance (the baseID)
[in]eTypeUnique id identifying the element type
[in]nenodNumber of element nodes
[in]nedofNumber of element degrees of freedom
[out]niworkRequired size of the integer work area for this element
[out]nrworkRequired size of the real work area for this element
Here is the call graph for this function:

◆ mass()

int FiUserElmPlugin::mass ( int  eId,
int  eType,
int  nenod,
const double *  X,
int *  iwork,
double *  rwork,
double &  mass 
)

Calculates the total mass for a given user-defined element.

Parameters
[in]eIdUnique id identifying this element instance (the baseID)
[in]eTypeUnique id identifying the element type
[in]nenodNumber of element nodes
[in]XGlobal initial nodal coordinates of the element
iworkInteger work area for this element
rworkReal work area for this element
[out]massMass of the element
Here is the call graph for this function:
Here is the caller graph for this function:

◆ origin()

int FiUserElmPlugin::origin ( int  eId,
int  eType,
int  nenod,
const double *  X,
const double *  T,
const int *  iwork,
const double *  rwork,
double *  Tlg 
)

Calculates the local origin of a user-defined element.

Parameters
[in]eIdUnique id identifying this element instance (the baseID)
[in]eTypeUnique id identifying the element type
[in]nenodNumber of element nodes
[in]XGlobal nodal coordinates of the element
[in]TLocal nodal coordinate systems of the element
[in]iworkInteger work area for this element
[in]rworkReal work area for this element
[out]TlgLocal-to-global transformation matrix for this element

This function is invoked once per element in pre- and post-processing tasks, requiring the position of current element. It does not affect the response simulation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ result() [1/2]

int FiUserElmPlugin::result ( int  eId,
int  eType,
int  idx,
const int *  iwork,
const double *  rwork,
double &  value 
)

Returns the value of a result quantity of a user-defined element.

Parameters
[in]eIdUnique id identifying this element instance (the baseID)
[in]eTypeUnique id identifying the element type
[in]idxResult quantity index
[in]iworkInteger work area for this element
[in]rworkReal work area for this element
[out]valueThe result quantity
Returns
Total number of result quantities for this element
Zero, if idx is out of range

This function is invoked once per element as a pre-processing task, when saving results to file.

Here is the call graph for this function:

◆ result() [2/2]

int FiUserElmPlugin::result ( int  eId,
int  eType,
int  idx,
const int *  iwork,
const double *  rwork,
int  nchar,
char *  name 
)

Returns the name of a result quantity of a user-defined element.

Parameters
[in]eIdUnique id identifying this element instance (the baseID)
[in]eTypeUnique id identifying the element type
[in]idxResult quantity index
[in]iworkInteger work area for this element
[in]rworkReal work area for this element
[in]ncharMaximum length of the result quantity name
[out]nameName of result quantity
Returns
Total number of result quantities for this element
Zero, if idx is out of range

This function is invoked once as per element as a post-processing task after each time increment, when saving results to file.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

int FiUserElmPlugin::update ( int  eId,
int  eType,
int  nenod,
int  nedof,
const double *  X,
const double *  T,
const double *  V,
const double *  A,
int *  iwork,
double *  rwork,
double *  Kt,
double *  Ct,
double *  M,
double *  Fs,
double *  Fd,
double *  Fi,
double *  Q,
double  t,
double  dt,
int  istep,
int  iter 
)

Updates the state of a given user-defined element.

Parameters
[in]eIdUnique id identifying this element instance (the baseID)
[in]eTypeUnique id identifying the element type
[in]nenodNumber of element nodes
[in]nedofNumber of element degrees of freedom
[in]XGlobal nodal coordinates of the element
[in]TLocal nodal coordinate systems of the element
[in]VGlobal nodal velocities of the element
[in]AGlobal nodal accelerations of the element
iworkInteger work area for this element
rworkReal work area for this element
[out]KtTangent stiffness matrix
[out]CtDamping matrix
[out]MMass matrix
[out]FsInternal elastic forces
[out]FdDamping forces
[out]FiIntertia forces
[out]QExternal forces
[in]tCurrent time
[in]dtTime step size
[in]istepTime step number
[in]iterIteration number

This function is invoked once per element within the Newton iteration loop. It evaluates the updated tangent matrices and associated force vectors of the current linearized dynamic equilibrium equation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate()

bool FiUserElmPlugin::validate ( const std::string &  libName,
int  nchar = 0,
char *  sign = NULL 
)

Checks if the named library can be loaded as a plugin.

Parameters
[in]libNameFull path to the dynamic library.
[in]ncharMax length of the signature string
[out]signA signature string describing the loaded plugin return true if the named plugin contains user-defined element types.
Here is the call graph for this function:

Friends And Related Function Documentation

◆ FFaSingelton< FiUserElmPlugin >

friend class FFaSingelton< FiUserElmPlugin >
friend

The documentation for this class was generated from the following files: