FemProcess
The GeMA Fem Process Plugin
gmpFemNLSolver.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_NLSOLVER_H_
25 #define _GEMA_PLUGIN_FEM_NLSOLVER_H_
26 
27 #include "gmpFemSolver.h"
28 #include "gmpFemSolverOptions.h"
29 
31 class GMP_FEM_PROCESS_API_EXPORT GmpFemNLSolver : public GmpFemSolver
32 {
33 public:
34  //constructor
36  const GmpFemSolverOptions&, const GmLogCategory&);
37 
38  //destructor
39  virtual ~GmpFemNLSolver();
40 
41  void enableFastUpdate(bool mode) { _fastUpdate = mode; }
42 
43  // initializing Fem NL Solver
44  virtual bool init();
45 
46 
47  //virtual bool step(double dt, double* newt);
48  virtual bool runStep(double dt, double* newt, bool* conv, double* err, int* niter, bool eval=false);
49  // Geostatic procedure
50  virtual bool geostatic(QString svId = "u", QString gaId = "Em");
51 
52 protected:
53  virtual bool addStateItemsToGroup (GmStateDump* state, int groupId);
54  virtual bool fillStateControlMapData (QVariantMap* map);
55  virtual bool stateControlMapDataLoaded(QVariantMap* map);
57 
59  virtual bool fillStateControlMapDataStaticSolver(QVariantMap* map);
61  virtual bool stateControlMapDataLoadedStaticSolver(QVariantMap* map);
63  virtual bool fillStateControlMapDataTransientSolver(QVariantMap* map);
65  virtual bool stateControlMapDataLoadedTransientSolver(QVariantMap* map);
66 
67 //private:
68  // general
69  virtual bool initElementSets(GmNumSolver*);
70  virtual void setElementSets(bool, bool, bool, bool, bool);
71  virtual bool applyFixedBoundaryConditions(int*);
72  virtual bool IntialFixedBoundaryConditions(int*);
73  virtual bool applyNonzeroFixedBCsbyModification(int*);
74  virtual bool isDynamic() const;
75  virtual bool isNonlinear() const;
76 
78  virtual bool convergence() const;
79  virtual bool convergenceN(GmVector& _erL, GmVector& _erD) const;
80  virtual bool convergenceDC(GmVector& _er) const;
81  virtual void update();
82  virtual void restore();
83 
84  //Corrector
85  //virtual bool corrector(GmVector& _er, GmVector) const;
86 
87  //Iterative Error
88  virtual bool LoadError(GmVector& _er)const;
89  virtual bool DispError(GmVector& _er) const;
90  virtual bool VelocityError(GmVector& _er)const;
91  virtual bool FluxError(GmVector& _er) const;
92  virtual bool FluxMagnitude(GmVector& _qa) const;
93 
95  virtual bool MaxErr(GmVector, double& ermax, double &tolmax);
97  virtual bool MaxVal(GmVector& array, GmVector) const;
99  virtual bool PhygroupName(int & kgroup, QString var) const;
101  virtual bool divergingIncrement(double ermax, double& ermax_1, double& ermax_2);
103  virtual bool adaptativeTimeAbqs(bool conv, int iter, double dt, double& newdt, double errmax, int inc, bool iter4);
105  virtual bool adaptativeTime(bool conv, int iter, double dt, double& newdt, double err, double tol);
107  virtual void saveInternalForceAttributes(GmVector& dv);
108 
109  virtual void setLoad();
110  virtual void setTime();
111  virtual void setState();
113  virtual void setTransientSystem(double);
114  virtual void setTransientSystem2(double);
115 
117  virtual GmpFemPhysics::FemResultType updateResidualForceAndStiffnessMatrix(double l);
119  virtual GmpFemPhysics::FemResultType fillStiffnessMatrixBroyden();
121  virtual GmpFemPhysics::FemResultType fillStiffnessMatrixBFGS();
122 
124  virtual double evalLocalError(GmVector, GmVector);
125 
127  virtual double evalTimeIncrementSize(int, double, double, GmVector&);
128 
129  // Strategies of continuation methods adopted by static solver
131  virtual double loadPredictor();
133  virtual double loadCorrector();
134 
135  // Solvers
136  virtual bool staticLinearSolver(double step, double* newt, bool* conv, double* err, int* niter, bool eval);
137  virtual bool staticSolver(double step, double* newt, bool* conv, double* err, int* niter, bool eval);
138  virtual bool transientSolver(double dt, double* newt, bool* conv, double* err, int* niter, bool eval);
139  virtual bool transientLinearSolver(double);
140  virtual bool iterativeSolver(double dt, double* newt, bool* conv, double* err, int* niter, bool eval);
141 
142  // To check
143  virtual bool stepStandardDc(double dt, double* newt, bool* conv, double* err, int* niter, bool eval);
144  virtual bool stepTransientNonlinearAut(double dt, double* newt);
145  virtual bool stepNonlinearAut(double dt, double* newt);
146 
147  // atributtes
148  double _dl;
149  double _dl0;
150  double _ddl;
151  double _Lold;
152  double _tin;
153  double _attempt = 0.0;
154  // double _ts;
155  double _dt;
156  double _oldIter;
157  double _hlast;
158 
159  // controls time incrementation
160  int _ninc = 0;
161  int _incT = 0;
162  bool _iter4old = false;
163 
164 
165 
166  GmVector _v;
167  GmVector _a;
168  GmVector _dx;
169  GmVector _dv;
170  GmVector _xold;
171  GmVector _vold;
172  GmVector _dxt;
173  GmVector _ddx;
174  GmVector _ddv;
175  GmVector _ddxt;
176  GmVector _ddxr;
177  GmVector _FeGs;
178  GmVector _erL;
179  GmVector _erD;
180  GmVector _r0;
181  // controls fluxe
184 
185 
186  QList<int> _fixedDof;
187 
188  bool _fastUpdate;
189 
190  private:
191  //GmVector _FeGs;
192 
193 };
194 
195 #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
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
virtual bool stateControlMapDataLoaded(QVariantMap *map)
Method called when the state dump control registered in addStateItemsToGroup() has been loaded.
Definition: gmpFemSolver.cpp:1985
virtual bool applyFixedBoundaryConditions(int *numFixed)
Apply Dirichlet (fixed) boundary conditions to the global equation system.
Definition: gmpFemSolver.cpp:1561
Basic class for solving Non linear FEM problems.
Definition: gmpFemNLSolver.h:31
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
GmVector _qta
An overall time-averaged value of the typical flux for field α so far during this step including the ...
Definition: gmpFemNLSolver.h:182
GmVector _qtamax
The time-averaged value of the largest flux corresponding to the field αduring this step,...
Definition: gmpFemNLSolver.h:183