FemProcess
The GeMA Fem Process Plugin
Loading...
Searching...
No Matches
GmpFemProcess Class Reference

Basic class for the FEM Process plugin object. More...

#include <gmpFemProcess.h>

Inheritance diagram for GmpFemProcess:
Collaboration diagram for GmpFemProcess:

Public Member Functions

 GmpFemProcess (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor. Will be called by the plugin loading code.
 
virtual ~GmpFemProcess ()
 Destructor.
 
virtual const char * pluginName () const
 
virtual const char * pluginType () const
 
virtual void loadFunctions (LuaTable &table)
 
virtual QStringList functionList () const
 
- Public Member Functions inherited from GmProcess
 GmProcess (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 
virtual const char * pluginCategory () const
 
virtual bool loadPrivateData (LuaTable &table)
 
virtual void printParameters (const GmLogCategory &logger)
 
int createProgressStatsItem (GmRunProgressStats *ps, const char *name)
 
- Public Member Functions inherited from GmPluginObject
 GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 
QString id () const
 
QString description () const
 
QString pluginTypeName () const
 

Static Public Member Functions

static int parseSolverParameters (lua_State *L, GmSimulationData *simData, QString fname, GmElementMesh *&emesh, QVector< GmpFemPhysics * > &physics, GmNumSolver *&solver, GmpFemSolverOptions *solverOptions)
 Parses the set of user parameters, detailed in the solve() method documentation, filling the supplied parameters. On errors, this function calls luaL_error and does not return. On success it returns 0.
 

Private Member Functions

GmProcessMethodRedirector< GmpFemProcess >::MethodRegistry * processMethodTable () const
 Returns the table storing the process exported function names / methods.
 
int solve (lua_State *L)
 The fem.solve() process implementation.
 
int initLinearSolver (lua_State *L)
 Creates and initializes a linear fem solver, intended to be used on a loop as described below. Receives the same set of parameters of the solve() call. On success, returns an opaque solver object.
 
int linearStep (lua_State *L)
 Runs a new step of the linear solver created by the call to initLinearSolver(). See comments o that function for the intended use case.
 
int linearResidual (lua_State *L)
 Calculates the error residual associated with the last linear step calculated by a call to linearStep(). See comments on initLinearSolver() for the intended use case.
 
int runSolver (lua_State *L)
 
int initSolver (lua_State *L)
 
int stepSolver (lua_State *L)
 
int geostatic (lua_State *L)
 Runs a Geostatic step to initialize the in-situ conditions.

 
int NLInitSolver (lua_State *L)
 Creates and initializes a nonlinear static fem solver, intended to be used on a loop as described below. Receives the same set of parameters of the solve() call plus a parameter defining if the problem is nonlinear or not. On success, returns a opaque solver object.
 
int NLStepSolver (lua_State *L)
 Runs a new step of the nonLinearSolver created by the call to init(). See comments on that function for the intended use case.
 
int NLGeostatic (lua_State *L)
 Runs a Geostatic step to initialize the in-situ conditions.
 
int initTransientSolver (lua_State *L)
 Creates and initializes a transient fem solver, intended to be used on a loop as described below. Receives the same set of parameters of the solve() call plus a parameter defining if the problem is nonlinear or not. On success, returns a opaque solver object.
 
int transientStep (lua_State *L)
 Runs a new step of the transient solver created by the call to initTransientSolver(). See comments on that function for the intended use case.
 
int transientLinearStep (lua_State *L)
 Runs a new step of the transient solver created by the call to initTransientSolver(). See comments on that function for the intended use case.
 
int transientLinearResidual (lua_State *L)
 Calculates the error residual associated with the last linear step calculated by a call to transientLinearStep(). See comments on initTransientSolver() for the intended use case.
 
int release (lua_State *L)
 Releases the fem object created by any of the init functions.
 
int update (lua_State *L)
 Updates the fem assembler. Expects as parameters the fem object plus either a string with a single update flag or a table with multiple update flags. If the second parameter is empty, a full update will be done. Accepted flags are: 'nodesAdded', 'dofsAdded', 'dofsRemoved', 'elementsAdded', 'elementsRemoved', 'fixedBcsUpdate', 'fixedBcsChanged', 'fixedBcsAll', 'fixedBcsKeepold'.
 

Additional Inherited Members

- Protected Member Functions inherited from GmProcess
void registerFunctions (LuaTable &table, typename GmProcessMethodRedirector< T >::MethodRegistry *methods, bool noProgressStats=false)
 
QStringList buildFunctionList (typename GmProcessMethodRedirector< T >::MethodRegistry *methods) const
 
- Protected Member Functions inherited from GmPluginObject
virtual const GmLogCategorylogger () const
 
GmSimulationDatasimulationData () const
 

Detailed Description

Basic class for the FEM Process plugin object.

Member Function Documentation

◆ functionList()

virtual QStringList GmpFemProcess::functionList ( ) const
inlinevirtual

Implements GmProcess.

◆ initLinearSolver()

int GmpFemProcess::initLinearSolver ( lua_State * L)
private

Creates and initializes a linear fem solver, intended to be used on a loop as described below. Receives the same set of parameters of the solve() call. On success, returns an opaque solver object.

Intended use:

local solver = fem.initLinearSolver({'physics'}, 'numeric_solver', solverOptions)
while convergence_condition do
fem.linearStep(solver)
local r, max, avg = fem.linearResidual(solver, true)
end

◆ initTransientSolver()

int GmpFemProcess::initTransientSolver ( lua_State * L)
private

Creates and initializes a transient fem solver, intended to be used on a loop as described below. Receives the same set of parameters of the solve() call plus a parameter defining if the problem is nonlinear or not. On success, returns a opaque solver object.

Intended use:

-- Usage for linear problems
local solver = fem.initTransientSolver({'physics'}, 'numeric_solver', solverOptions)
while time < last_time do
fem.transientStep(solver, dt, [updateDof])
end
-- Usage for non linear problems
local solver = fem.initTransientSolver({'physics'}, 'numeric_solver', solverOptions, true)
while time < last_time do
local iter = 1
while convergence_condition do
fem.transientLinearStep(solver, dt, iter, [updateDof])
...
local r, max, avg = fem.transientLinearResidual(solver, true)
iter = iter + 1
end
end

◆ linearResidual()

int GmpFemProcess::linearResidual ( lua_State * L)
private

Calculates the error residual associated with the last linear step calculated by a call to linearStep(). See comments on initLinearSolver() for the intended use case.

Expects to receive as first parameter the solver created by initLinearSolver().

This function returns the L2 norm of the residual vector. If a second parameter is present and true, it also returns the maximum and the average values among each of the values in the residual vector. The default is false since this option only makes sense if all degrees of freedom in the result space are comparable.

◆ linearStep()

int GmpFemProcess::linearStep ( lua_State * L)
private

Runs a new step of the linear solver created by the call to initLinearSolver(). See comments o that function for the intended use case.

Expects to receive as parameter the solver created by initLinearSolver().

◆ loadFunctions()

virtual void GmpFemProcess::loadFunctions ( LuaTable & table)
inlinevirtual

Implements GmProcess.

◆ NLInitSolver()

int GmpFemProcess::NLInitSolver ( lua_State * L)
private

Creates and initializes a nonlinear static fem solver, intended to be used on a loop as described below. Receives the same set of parameters of the solve() call plus a parameter defining if the problem is nonlinear or not. On success, returns a opaque solver object.

Intended use:

-- Usage for nonlinear static problems
local solver = fem.init({'physics'}, 'numeric_solver', solverOptions)
while time < last_time do
fem.step(solver, dt, [updateDof])
end

◆ NLStepSolver()

int GmpFemProcess::NLStepSolver ( lua_State * L)
private

Runs a new step of the nonLinearSolver created by the call to init(). See comments on that function for the intended use case.

Expects to receive as parameter the solver created by init() + the time step For solvers created with nonlinear = false only.

◆ pluginName()

virtual const char * GmpFemProcess::pluginName ( ) const
inlinevirtual

Implements GmPluginObject.

◆ pluginType()

virtual const char * GmpFemProcess::pluginType ( ) const
inlinevirtual

Implements GmPluginObject.

◆ solve()

int GmpFemProcess::solve ( lua_State * L)
private

The fem.solve() process implementation.

This function expects to receive as parameters in the Lua stack:

1) A string with the physical method id or a table with multiple method ids. All methods must share the same mesh 2) A string with the solver id that will be used to solve the linear system 3) An optional table with several different solver options regarding printing intermediate matrices and the mode used to handle dofs

◆ transientLinearResidual()

int GmpFemProcess::transientLinearResidual ( lua_State * L)
private

Calculates the error residual associated with the last linear step calculated by a call to transientLinearStep(). See comments on initTransientSolver() for the intended use case.

Expects to receive as first parameter the solver created by initTransientSolver().

This function returns the L2 norm of the residual vector. If a second parameter is present and true, it also returns the maximum and the average values among each of the values in the residual vector. The default is false since this option only makes sense if all degrees of freedom in the result space are comparable.

◆ transientLinearStep()

int GmpFemProcess::transientLinearStep ( lua_State * L)
private

Runs a new step of the transient solver created by the call to initTransientSolver(). See comments on that function for the intended use case.

Expects to receive as parameter the solver created by initTransientSolver() + the time step + the current nonlinear iteration number. For solvers created with nonlinear = true only.

◆ transientStep()

int GmpFemProcess::transientStep ( lua_State * L)
private

Runs a new step of the transient solver created by the call to initTransientSolver(). See comments on that function for the intended use case.

Expects to receive as parameter the solver created by initTransientSolver() + the time step For solvers created with nonlinear = false only.


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