LuaProxyFemPhysics
The GeMA Lua Proxy FEM Physics Plugin
Loading...
Searching...
No Matches
GmpLuaProxyFemPhysics Class Reference

Basic class for the Lua Proxy physics plugin object. More...

#include <gmpLuaProxyFemPhysics.h>

Inheritance diagram for GmpLuaProxyFemPhysics:
Collaboration diagram for GmpLuaProxyFemPhysics:

Public Member Functions

 GmpLuaProxyFemPhysics (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor. Will be called by the plugin loading code.
 
virtual ~GmpLuaProxyFemPhysics ()
 Destructor.
 
virtual const char * pluginName () const
 
virtual const char * pluginType () const
 
virtual const GmElementDofdofMapping (GmCellType type) const
 See comments on the base class.
 
virtual Unit dofUnit (int dof) const
 See comments on the base class.
 
virtual Unit timeUnit () const
 
virtual bool supportsCellType (GmCellType type) const
 See comments on the base class.
 
virtual bool beforeElementStiffnessLoop (const GmpFemMatrixSet &elemMatrices, const GmpFemVectorSet &elemVectors)
 See comments on base class.
 
virtual void afterElementStiffnessLoop ()
 See comments on base class.
 
virtual FemResultType fillElementData (const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
 See comments on base class.
 
virtual const QStringListsupportedBcTypes () const
 See comments on the base class.
 
virtual bool bcAffectsCalc (const GmBoundaryCondition *bc) const
 See comments on the base class.
 
virtual FemResultType fillElementDataForBc (const GmElement *e, const GmBoundaryCondition *bc, int bcIndex, int bcListIndex, int border, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
 See comments on base class.
 
virtual bool fixedNodalForcesBc (QVector< int > &nodes, QVector< int > &dof, QVector< double > &values) const
 See comments on base class.
 
virtual bool fixedNodalDofsBc (QVector< int > &nodes, QVector< int > &dof, QVector< double > &values, bool *constantValues) const
 See comments on base class.
 
virtual bool calcDerivedResults (bool nonLinearSolver)
 See comments on base class.
 

Protected Member Functions

virtual bool checkMeshDimension (int ndim)
 See comments on the base class.
 
virtual bool checkAndLoadPrivateData (LuaTable &table)
 This is the first function called by the Fem physics infrastructure, so it is its responsability to get a reference for the appropriate user table containing the needed Lua functions.
 
virtual bool checkAndLoadDofMapping (LuaTable &table)
 See comments on the base class.
 
virtual bool checkAndLoadPropertyAccessors (LuaTable &table)
 See comments on the base class.
 
virtual bool checkAndLoadAttributeAccessors (LuaTable &nodeTable, LuaTable &cellTable, LuaTable &gaussTable)
 
virtual bool checkAndLoadExternalLoadAccessors (LuaTable &loadsTable)
 
virtual bool checkAndLoadBcAccessors ()
 See comments on the base class.
 
virtual bool checkAndLoadContactBcAccessors ()
 
virtual bool checkAndLoadDiscontinuitySetAccessors (LuaTable &table)
 

Private Member Functions

bool prepareCallMethod (const char *name, bool optional) const
 Prepares the call for a table method, puting the function and self on the stack top.
 
bool callStdMethod (int npar, int nresults=1) const
 Call a standard method (which either doesn't return anything or returns a boolean + extra results)
 
bool parseAccessors (LuaTable &table, LuaTable &transTable, GmValueSetKind acType, const GmBoundaryCondition *bc=NULL)
 Parses entries from the given table creating accessors for them, subject to the given restrictions.
 
bool fillBcLists (const char *fname, QVector< int > &nodes, QVector< int > &dof, QVector< double > &values, bool *constantValues) const
 Calls the function fname and fills the given lists with the returned tables (constantValues should be NULL if the called function does not returns this parameter)
 

Private Attributes

LuaTable_methodTable
 The Lua method table.
 
GmElementDof_dofMap [GM_NUM_CELL_TYPES]
 The list with maps of dof per element type.
 
QVector< int > _dofList
 Dof list for the physics.
 
QMap< int, QString_dofUnitMap
 List with dof units.
 
QList< const GmBoundaryCondition * > _bcList
 A list of the supported Bcs.
 
QStringList _bcTypes
 A list with the supported bc types.
 

Detailed Description

Basic class for the Lua Proxy physics plugin object.

Member Function Documentation

◆ afterElementStiffnessLoop()

void GmpLuaProxyFemPhysics::afterElementStiffnessLoop ( )
virtual

See comments on base class.

Proxy function: afterElementStiffnessLoop(), optional

◆ bcAffectsCalc()

bool GmpLuaProxyFemPhysics::bcAffectsCalc ( const GmBoundaryCondition * bc) const
virtual

See comments on the base class.

Returns info based on the _bcList created on checkAndLoadBcAccessors

◆ beforeElementStiffnessLoop()

bool GmpLuaProxyFemPhysics::beforeElementStiffnessLoop ( const GmpFemMatrixSet & elemMatrices,
const GmpFemVectorSet & elemVectors )
virtual

See comments on base class.

Proxy function: beforeElementStiffnessLoop(), optional

TODO: Add support for multiple matrices and vectors

◆ calcDerivedResults()

bool GmpLuaProxyFemPhysics::calcDerivedResults ( bool nonLinearSolver)
virtual

See comments on base class.

Proxy function: calcDerivedResults(), optional

◆ callStdMethod()

bool GmpLuaProxyFemPhysics::callStdMethod ( int npar,
int nresults = 1 ) const
private

Call a standard method (which either doesn't return anything or returns a boolean + extra results)

Receives as parameter the number of parameters pushed on the stack. This number should NOT include the self parameter pushed by prepareCallMethod().

IMPORTANT: Results are left on the stack

On call error, logs the message and returns false.

◆ checkAndLoadBcAccessors()

bool GmpLuaProxyFemPhysics::checkAndLoadBcAccessors ( )
protectedvirtual

See comments on the base class.

Proxy attribute: bc. Check boundary condition availability and type and get accessors for all the properties in the list. After that, calls the optional function checkBc()

◆ checkAndLoadDofMapping()

bool GmpLuaProxyFemPhysics::checkAndLoadDofMapping ( LuaTable & table)
protectedvirtual

See comments on the base class.

Proxy attribute: stateVars. Check dof availability and get an accessor for all the stateVars in the list. After that, calls the optional function checkStateVars()

◆ checkAndLoadPrivateData()

bool GmpLuaProxyFemPhysics::checkAndLoadPrivateData ( LuaTable & table)
protectedvirtual

This is the first function called by the Fem physics infrastructure, so it is its responsability to get a reference for the appropriate user table containing the needed Lua functions.

Proxy function: checkPrivateData(physicsTable), optional

◆ checkAndLoadPropertyAccessors()

bool GmpLuaProxyFemPhysics::checkAndLoadPropertyAccessors ( LuaTable & table)
protectedvirtual

See comments on the base class.

Proxy attribute: properties. Check property availability and get an accessor for all the properties in the list. After that, calls the optional function checkProperties()

◆ checkMeshDimension()

bool GmpLuaProxyFemPhysics::checkMeshDimension ( int ndim)
protectedvirtual

See comments on the base class.

Proxy attribute: dimension. Should be a value or a table with a dimension range. If missing, accepts any dimension.

◆ dofMapping()

const GmElementDof * GmpLuaProxyFemPhysics::dofMapping ( GmCellType type) const
virtual

See comments on the base class.

Returns mapping based on the dofList cretaed on checkAndLoadDofMapping

◆ dofUnit()

Unit GmpLuaProxyFemPhysics::dofUnit ( int dof) const
virtual

See comments on the base class.

Returns mapping based on the unit map cretaed on checkAndLoadDofMapping

◆ fillElementData()

GmpFemPhysics::FemResultType GmpLuaProxyFemPhysics::fillElementData ( const GmElement * e,
GmpFemMatrixSet & elemMatrices,
GmpFemVectorSet & elemVectors )
virtual

See comments on base class.

Proxy function: fillElementData(e, matrix, vector), required. Returns a boolean for success followed by a second boolean defining if the matrix is symmetric.

TODO: Add support for multiple matrices and vectors

◆ fillElementDataForBc()

GmpFemPhysics::FemResultType GmpLuaProxyFemPhysics::fillElementDataForBc ( const GmElement * e,
const GmBoundaryCondition * bc,
int bcIndex,
int bcListIndex,
int border,
GmpFemMatrixSet & elemMatrices,
GmpFemVectorSet & elemVectors )
virtual

See comments on base class.

Proxy function: fillElementDataForBc(e, bc, bcIndex, bcListIndex, border, matrix, vector), optional. Returns a boolean for success followed by a second boolean defining if the matrix is symmetric.

TODO: Add support for multiple matrices and vectors

◆ fixedNodalDofsBc()

bool GmpLuaProxyFemPhysics::fixedNodalDofsBc ( QVector< int > & nodes,
QVector< int > & dof,
QVector< double > & values,
bool * constantValues ) const
virtual

See comments on base class.

Proxy function: fixedNodalDofsBc(), optional. Should return tables with nodes, dof and values

◆ fixedNodalForcesBc()

bool GmpLuaProxyFemPhysics::fixedNodalForcesBc ( QVector< int > & nodes,
QVector< int > & dof,
QVector< double > & values ) const
virtual

See comments on base class.

Proxy function: fixedNodalForcesBc(), optional. Should return tables with nodes, dof and values

◆ parseAccessors()

bool GmpLuaProxyFemPhysics::parseAccessors ( LuaTable & table,
LuaTable & transTable,
GmValueSetKind acType,
const GmBoundaryCondition * bc = NULL )
private

Parses entries from the given table creating accessors for them, subject to the given restrictions.

Accessors are added to the accessors table.

Parameters
tableThe table with accessor definitions
transTableA table used to translate accessor names
acTypeThe type of accessor
bcThe boundary condition, used only if acType == GM_BC_BOUNDARY_PROPERTY

◆ prepareCallMethod()

bool GmpLuaProxyFemPhysics::prepareCallMethod ( const char * name,
bool optional ) const
private

Prepares the call for a table method, puting the function and self on the stack top.

If the function doesn't exists, returns false. In that case, if optional == false, emmits an error message.

◆ supportedBcTypes()

const QStringList & GmpLuaProxyFemPhysics::supportedBcTypes ( ) const
virtual

See comments on the base class.

Returns ithe type list created on checkAndLoadBcAccessors

◆ supportsCellType()

bool GmpLuaProxyFemPhysics::supportsCellType ( GmCellType type) const
virtual

See comments on the base class.

Proxy attribute: elementType. Should be a table with supported element name. If missing, accepts any type.


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