FemProcess
The GeMA Fem Process Plugin
gmpFemNonLinearSolver.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_NONLINEARSOLVER_H_
25 #define _GEMA_PLUGIN_FEM_NONLINEARSOLVER_H_
26 
27 #include "gmpFemSolver.h"
28 #include "gmpFemSolverOptions.h"
29 
31 class GMP_FEM_PROCESS_API_EXPORT GmpFemNonLinearSolver : public GmpFemSolver
32 {
33 public:
36  const GmpFemSolverOptions&, const GmLogCategory&);
37 
39  virtual ~GmpFemNonLinearSolver();
40 
42  void enableFastUpdate(bool mode) { _fastUpdate = mode; }
43 
45  virtual bool init();
46 
48  virtual bool step(double dt, double* newt, bool* conv, double* err, int* niter, bool eval);
49 
51  virtual bool geostatic();
52 
54  virtual bool pos();
55 
57  virtual bool crackDetection();
58 
60  virtual bool crackPropagation();
61 
63  virtual bool updateBC(double dt, int iter, bool updateBc);
64 
65 protected:
67  virtual bool initElementSets(GmNumSolver* solver);
68 
70  virtual void setElementSets(bool, bool, bool, bool, bool);
71 
73  virtual bool isNonLinear() const;
74 
76  virtual bool isTransient() const
77  {
78  return _solverOptions._type == GmpFemSolverOptions::transientSolver;
79  }
80 
82  virtual bool convergence() const;
83  virtual bool convergenceNew() const;
84 
86  virtual void saveInternalForceAttributes();
87 
89  virtual void update();
90 
92  virtual void restore();
93 
95  virtual void setLoad();
96 
98  virtual void setTime();
99 
101  virtual void setState();
102 
104  virtual double loadPredictor();
105 
107  virtual double loadCorrector();
108 
110  virtual double calcLocalError(GmVector x, GmVector dx);
111 
113  virtual bool stepStaticNonlinear(double, double* newt);
114 
116  virtual GmpFemPhysics::FemResultType updateResidualForceAndStiffnessMatrix(double l);
117 
119  virtual GmpFemPhysics::FemResultType fillStiffnessMatrixBroyden();
120 
122  virtual GmpFemPhysics::FemResultType fillStiffnessMatrixBFGS();
123 
125  bool solveLinearSystem(GmSolverMatrix* Keq, GmVector& Feq, GmVector& x);
126 
128  virtual bool stepTransientNonLinear(double, double* newt);
129 
131  virtual bool stepTransientNonlinearAut(double, double* newt);
132 
133  //bool prepareTransientSystem(double dt);
134  GmpFemPhysics::FemResultType prepareTransientSystem(double dt);
135  GmpFemPhysics::FemResultType prepareTransientSystemPredict(double dt);
136 
137  void vectorTreatment(GmVector& fint);
138  bool timeIncrementAdjustment(double dt, int iter, GmVector& X1, GmVector& X0);
139  // Dump methods
140  virtual bool addStateItemsToGroup(GmStateDump* state, int groupId);
141  virtual bool fillStateControlMapData(QVariantMap* map);
142  virtual bool stateControlMapDataLoaded(QVariantMap* map);
144 
146  virtual bool fillStateControlMapDataStaticSolver(QVariantMap* map);
147 
149  virtual bool fillStateControlMapDataTransientSolver(QVariantMap* map);
150 
151  //atributtes
152  int _dofIndex;
153  double _dl;
154  double _dl0;
155  double _ddl;
156  double _arc;
157  double _Lold;
158  double _tin;
159  double _dt;
160  double _oldIter;
161  double _hlast;
162  int _It;
163 
164  GmVector _v;
165  GmVector _a;
166  GmVector _dx;
167  GmVector _dv;
168  GmVector _xold;
169  GmVector _vold;
170  GmVector _dxt;
171  GmVector _ddx;
172  GmVector _ddv;
173  GmVector _ddxt;
174  GmVector _ddxr;
175  GmVector _FeGs;
176  GmVector _feLcs;
177  GmVector _fiLcs;
178  GmVector _r0;
179 
180  QList<int> _fixedDof;
181 
182  bool _fastUpdate;
183 private:
184  bool _nonlinear;
185 
186 };
187 
188 #endif
virtual bool fillStateControlMapData(QVariantMap *map)
Method called for filling the state dump control regustered in addStateItemsToGroup()
Definition: gmpFemSolver.cpp:1964
Definition: gmpFemSolverOptions.h:38
virtual bool stateLoadedCalcDerivedResultsNonLinear()
Returns the value of the "nonLinearSolver" parameter that will be passed to the calcDerivedResults() ...
Definition: gmpFemSolver.h:115
FemResultType
Result type for local matrix calculation methods.
Definition: gmpFemPhysics.h:49
Basic class for the FEM solving process.
Definition: gmpFemSolver.h:51
Basic class for solving Non linear FEM problems.
Definition: gmpFemNonLinearSolver.h:31
bool _nonlinear
Is this a non linear problem ?
Definition: gmpFemNonLinearSolver.h:184
virtual bool init()
Prepares the solver for assembling matrices by creating the assembler object and allocating the neede...
Definition: gmpFemSolver.cpp:137
Declaration of the GmpFemSolver class.
virtual bool initElementSets(GmNumSolver *solver)
Helpper function used to initialize the matrix / vector sets with the definition of the needed types ...
Definition: gmpFemSolver.cpp:450
Declaration of the GmpFemSolverOptions class.
bool update(int mode, QString &err)
Informs the solver of an external change in model dofs, elements or BCs that must be forwarded to the...
Definition: gmpFemSolver.cpp:346
bool solveLinearSystem(bool xFilled)
Solves the linear system K.x = f taking K and f from the single equivalent matrix/vector or from matr...
Definition: gmpFemSolver.cpp:744
virtual bool stateControlMapDataLoaded(QVariantMap *map)
Method called when the state dump control registered in addStateItemsToGroup() has been loaded.
Definition: gmpFemSolver.cpp:1985
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: gmpFemSolver.cpp:1885
arma::vec GmVector
void enableFastUpdate(bool mode)
Sets fastUpdate option.
Definition: gmpFemNonLinearSolver.h:42
virtual bool isTransient() const
Checks transient analysis.
Definition: gmpFemNonLinearSolver.h:76