FemProcess
The GeMA Fem Process Plugin
gmpFemTransientSolver.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
24 #ifndef _GEMA_PLUGIN_FEM_TRANSIENTSOLVER_H_
25 #define _GEMA_PLUGIN_FEM_TRANSIENTSOLVER_H_
26 
27 #include "gmpFemSolver.h"
28 
31 {
32 public:
34  GmNumSolver* solver, bool nonlinear, const GmpFemSolverOptions& options, const GmLogCategory& logger);
35 
36  virtual ~GmpFemTransientSolver();
37 
38  virtual bool init();
39  bool runStep(double dt, bool updateDof = false);
40  bool runLinearStep(double dt, int iter, bool updateDof = false);
41 
42  bool calcLinearResidual(double dt, double* rnorm, double* maxNodeDiff, double* avgNodeDiff);
43 
45  bool nonlinear() const { return _nonlinear; }
46 
47  virtual bool addStateItemsToGroup(GmStateDump* state, int groupId);
48 
49 protected:
50  virtual bool initElementSets(GmNumSolver* solver);
51  virtual bool cleanup();
52 
53  bool step(double dt, int iter, bool updateDof, bool updateBcs);
54  bool istep(double dt, int iter, bool updateDof, bool updateBcs);
55  bool estep(double dt, bool updateDof,bool updateBcs);
56  bool prepareLinearSystem(double dt);
57  bool prepareExplicitLinearSystem(double dt);
58  bool GuyanReductionSolve();
59 
60 private:
61  bool _implicit;
62  bool _nonlinear;
64 };
65 
66 #endif
GmVector _oldx
Previous state of the x vector used for non linear problems;.
Definition: gmpFemTransientSolver.h:63
bool calcLinearResidual(double dt, double *rnorm, double *maxNodeDiff, double *avgNodeDiff)
When solving a non linear system by repeated iterations, this function aims to calculate the residual...
Definition: gmpFemTransientSolver.cpp:415
Definition: gmpFemSolverOptions.h:38
virtual bool init()
Prepares the solver for assembling matrices by creating the assembler object and allocating the neede...
Definition: gmpFemTransientSolver.cpp:71
bool prepareLinearSystem(double dt)
Fills the matrix K and the vector Fe with the linear system resulting from applying an implicit schem...
Definition: gmpFemTransientSolver.cpp:487
bool runLinearStep(double dt, int iter, bool updateDof=false)
Execute the process. Should be used by non linear processes only.
Definition: gmpFemTransientSolver.cpp:192
GmpFemTransientSolver(GmElementMesh *mesh, GmSimulationData *simulation, const QList< GmpFemPhysics * > &physics, GmNumSolver *solver, bool nonlinear, const GmpFemSolverOptions &options, const GmLogCategory &logger)
Constructor. Expects to receive as parameters the mesh we are acting upon, the list of physics object...
Definition: gmpFemTransientSolver.cpp:54
Basic class for the FEM solving process.
Definition: gmpFemSolver.h:51
virtual bool initElementSets(GmNumSolver *solver)
Reimplements GmpFemSolver::initElementSets() to include the C matrix in the set of calculated matrice...
Definition: gmpFemTransientSolver.cpp:114
bool prepareExplicitLinearSystem(double dt)
Definition: gmpFemTransientSolver.cpp:553
virtual bool cleanup()
Dealocates memory and sets allocated resources to NULL. As a convenience, returns false.
Definition: gmpFemTransientSolver.cpp:104
bool istep(double dt, int iter, bool updateDof, bool updateBcs)
Worker function for both runStep() and runLinearStep()
Definition: gmpFemTransientSolver.cpp:221
virtual ~GmpFemTransientSolver()
Destructor.
Definition: gmpFemTransientSolver.cpp:63
Declaration of the GmpFemSolver class.
Basic class for solving a transient FEM problem.
Definition: gmpFemTransientSolver.h:30
virtual bool addStateItemsToGroup(GmStateDump *state, int groupId)
Adds to 'state' the data items that should be saved for this FEM process. Should probably be override...
Definition: gmpFemTransientSolver.cpp:694
bool runStep(double dt, bool updateDof=false)
Execute the process. Should be used by linear processes only.
Definition: gmpFemTransientSolver.cpp:162
bool nonlinear() const
Returns true if the solver is non linear.
Definition: gmpFemTransientSolver.h:45
bool _implicit
Is this a implicit or explicit scheme ?
Definition: gmpFemTransientSolver.h:61
bool _nonlinear
Is this a non linear problem ?
Definition: gmpFemTransientSolver.h:62
arma::vec GmVector