FemProcess
The GeMA Fem Process Plugin
Loading...
Searching...
No Matches
gmpFemTransientNonLinearSolver.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_TRANSIENTNONLINEARSOLVER_H_
25#define _GEMA_PLUGIN_FEM_TRANSIENTNONLINEARSOLVER_H_
26
28#include "gmpFemSolverOptions.h"
29
31class GmRunProgress;
32
34class GMP_FEM_PROCESS_API_EXPORT GmpFemTransientNonLinearSolver : public GmpFemNonLinearSolver
35{
36public:
37 //constructor
39 const GmpFemSolverOptions&, const GmLogCategory&);
40
41 //destructor
43
44 void enableFastUpdate(bool mode) { _fastUpdate = mode; }
45
46 //virtual bool step(double dt, double* newt);
47 virtual bool runStep(double dt, double* newt, bool* conv, double* err, int* niter, bool eval=false);
48 // Geostatic procedure
49 virtual bool geostatic(QString svId = "u", QString gaId = "Em");
50
51protected:
52 virtual bool addStateItemsToGroup (GmStateDump* state, int groupId);
53 virtual bool fillStateControlMapData (QVariantMap* map);
54 virtual bool stateControlMapDataLoaded(QVariantMap* map);
56
58 virtual bool fillStateControlMapDataStaticSolver(QVariantMap* map);
60 virtual bool stateControlMapDataLoadedStaticSolver(QVariantMap* map);
62 virtual bool fillStateControlMapDataTransientSolver(QVariantMap* map);
64 virtual bool stateControlMapDataLoadedTransientSolver(QVariantMap* map);
65
66//private:
67 // general
68 virtual bool initElementSets(GmNumSolver*);
69 virtual void setElementSets(bool, bool, bool, bool, bool);
70 virtual void setElementDiscretizedSystem(bool RHS, bool LHS);
71 virtual bool applyFixedBoundaryConditions(int*);
72 virtual bool intialFixedBoundaryConditions(int*);
73 virtual bool applyNonzeroFixedBCsbyModification(int*);
74 virtual bool isTransient() const;
75 virtual bool isNonlinear() const;
76
78 virtual bool convergence() const;
79 virtual bool convergenceN (GmVector& erL, GmRunProgress* rp = NULL) const;
80 virtual bool convergenceDC(GmVector& er) const;
81 virtual void update();
82 virtual void restore();
83 //Corrector
84 //virtual bool corrector(GmVector& er, GmVector) const;
85
86 //Iterative Error
87 virtual bool loadError(GmVector& er)const;
88 virtual bool dispError(GmVector& er) const;
89 virtual bool velocityError(GmVector& er)const;
90 virtual bool fluxError(GmVector& er) const;
91 virtual bool fluxMagnitude(GmVector& qa) const;
92
94 virtual bool convergenceStep(unsigned& attempt, unsigned& incT, double, double);
96 virtual bool maxErr(GmVector, double& ermax, double &tolmax);
98 virtual bool maxVal(GmVector& array, const GmVector&) const;
100 virtual bool phygroupName(int & kgroup, QString var) const;
102 virtual bool divergingIncrement(unsigned iter, double tolmax, double ermax, double& ermax_1, double& ermax_2);
104 virtual bool adaptativeTimeAbqs(bool conv, unsigned iter, double dt, double& newdt, double errmax, unsigned inc, bool iter4);
106 virtual bool adaptativeTime(bool conv, int iter, double dt, double& newdt, double err, double tol);
108 virtual void saveInternalForceAttributes(GmVector& dv);
109
110 virtual void setLoad();
111 virtual void setTime();
112 virtual void setState();
114 virtual void setTransientSystem(double);
115
117 virtual bool getLinearSystem(double dt);
118 virtual bool getSystemRHSVector(double dt);
119 virtual bool getSystemResidualVector(double dt);
120 virtual bool solveLinearSystem();
121 bool applyDirichletBoundaryConditions();
122
127
128
130 virtual double evalLocalError(GmVector, GmVector);
131
133 virtual double evalTimeIncrementSize(unsigned, double, double, GmVector&);
134
135
136 // To check
137 virtual bool stepStandardDc(double dt, double* newt, bool* conv, double* err, int* niter, bool eval);
138 virtual bool stepTransientNonlinearAut(double dt, double* newt);
139
140
141#if 0
142 double _dl0;
143
144 double _Lold;
145
146 // double _ts;
147 double _dt;
148 double _oldIter;
149 double _hlast;
150
151 // controls time incrementation
152 unsigned _attempt = 0;
153 unsigned _ninc = 0;
154 unsigned _incT = 0;
155 bool _iter4old = false;
156
157
158 GmVector _v;
159 GmVector _dx;
160 GmVector _dv;
161 GmVector _xold;
162 GmVector _vold;
163 GmVector _dxt;
164 GmVector _ddx;
165 GmVector _ddxt;
166 GmVector _ddxr;
167 GmVector _FeGs;
168 GmVector _r0;
169 // controls fluxe
170 GmVector _qta;
172
173
174 QVector<int> _fixedDof;
175
176 bool _fastUpdate;
177 bool _hasUnanamedDofs;
178
179 struct TrackItemState
180 {
181 bool _geostatic = false; // Is this a geostatic step?
182 int _femItem = -1;
183 int _femNlItem = -1;
184 int _solverItem = -1;
185
186 int _incAttr = -1;
187 int _attemptAttr = -1;
188 int _convAttr = -1;
189 int _nlIterAttr = -1;
190 int _simTimeAttr = -1;
191 int _simStepAttr = -1;
192 int _solverCallsAttr = -1;
193
194 int _nlErrorAttr = -1;
195
196 int _solverFemExecTimeAttr = -1;
197 int _solverFemNumIterAttr = -1;
198 int _prepareExecTimeAttr = -1;
199 };
200
202
203#endif // 0
204
205};
206
207#endif
Basic class for solving Non linear FEM problems.
Definition gmpFemNonLinearSolver.h:37
virtual bool addStateItemsToGroup(GmStateDump *state, int groupId)
Adds to 'state' the data items that should be saved for this FEM process. Should probably be overridd...
Definition gmpFemNonLinearSolver.cpp:3720
bool _hasUnanamedDofs
Set to true if there are dofs that belong to the 'unnamed' group.
Definition gmpFemNonLinearSolver.h:227
virtual GmpFemPhysics::FemResultType fillStiffnessMatrixBroyden()
Evaluates the stiffness matrix using Broyden's method.
Definition gmpFemNonLinearSolver.cpp:1765
virtual bool convergenceStep(unsigned &attempt, unsigned &incT, double, double)
Step convergence.
Definition gmpFemNonLinearSolver.cpp:1005
GmVector _qtamax
The time-averaged value of the largest flux corresponding to the field αduring this step,...
Definition gmpFemNonLinearSolver.h:221
virtual bool adaptativeTimeAbqs(bool conv, unsigned iter, double dt, double &newdt, double errmax, unsigned inc, bool iter4)
Adaptative time increment based on abaqus std.
Definition gmpFemNonLinearSolver.cpp:1064
virtual bool getSystemResidualVector(double dt)
Computes the residual vector of the nonlinear system.
Definition gmpFemNonLinearSolver.cpp:2035
virtual bool solveLinearSystem()
Solve the linear system according to the adopted nonlinear scheme.
Definition gmpFemNonLinearSolver.cpp:2059
virtual bool phygroupName(int &kgroup, QString var) const
Physical group.
Definition gmpFemNonLinearSolver.cpp:987
virtual GmpFemPhysics::FemResultType updateResidualForceAndStiffnessMatrix(double l)
Updates the stiffness matrix.
Definition gmpFemNonLinearSolver.cpp:1712
virtual bool initElementSets(GmNumSolver *)
Helper function used to initialize the matrix / vector sets with the definition of the needed types a...
Definition gmpFemNonLinearSolver.cpp:468
virtual bool fillStateControlMapDataTransientSolver(QVariantMap *map)
Virtual method to load the scalar attributes needed by transient solver.
Definition gmpFemNonLinearSolver.cpp:3890
virtual bool stateControlMapDataLoadedTransientSolver(QVariantMap *map)
Virtual method to fill the map with the needed transient solver data.
Definition gmpFemNonLinearSolver.cpp:3902
virtual bool stateControlMapDataLoadedStaticSolver(QVariantMap *map)
Virtual method to Load the scalar attributes needed by continuation method.
Definition gmpFemNonLinearSolver.cpp:3853
virtual double evalLocalError(GmVector, GmVector)
calc local error
Definition gmpFemNonLinearSolver.cpp:3603
virtual bool getLinearSystem(double dt)
evaluates the linear system
Definition gmpFemNonLinearSolver.cpp:1935
virtual bool fillStateControlMapDataStaticSolver(QVariantMap *map)
Virtual method to fill the map with the needed continuation method data.
Definition gmpFemNonLinearSolver.cpp:3822
virtual void saveInternalForceAttributes(GmVector &dv)
Save internal force attibutes such as Reaction and Volume flux.
Definition gmpFemNonLinearSolver.cpp:1369
virtual bool convergence() const
analysis
Definition gmpFemNonLinearSolver.cpp:926
virtual bool applyFixedBoundaryConditions(int *)
Apply Dirichlet (fixed) boundary conditions to the global equation system.
Definition gmpFemNonLinearSolver.cpp:795
virtual bool divergingIncrement(unsigned iter, double tolmax, double ermax, double &ermax_1, double &ermax_2)
diverging Increment
Definition gmpFemNonLinearSolver.cpp:1050
virtual bool fillStateControlMapData(QVariantMap *map)
Method called for filling the state dump control registered in addStateItemsToGroup()
Definition gmpFemNonLinearSolver.cpp:3760
virtual bool maxVal(GmVector &array, const GmVector &) const
Maximun value of the array.
Definition gmpFemNonLinearSolver.cpp:971
virtual bool stateLoadedCalcDerivedResultsNonLinear()
Returns the value of the "nonLinearSolver" parameter that will be passed to the calcDerivedResults() ...
Definition gmpFemNonLinearSolver.cpp:3814
virtual void setTransientSystem(double)
evaluates transient system
Definition gmpFemNonLinearSolver.cpp:1693
virtual double evalTimeIncrementSize(unsigned, double, double, GmVector &)
calc time increment size
Definition gmpFemNonLinearSolver.cpp:3632
virtual bool getSystemRHSVector(double dt)
Computes the right-hand side vector (RHS) for the nonlinear system RHS is saved in the vector _r.
Definition gmpFemNonLinearSolver.cpp:2014
virtual bool stateControlMapDataLoaded(QVariantMap *map)
Method called when the state dump control registered in addStateItemsToGroup() has been loaded.
Definition gmpFemNonLinearSolver.cpp:3787
virtual bool geostatic(QString svId="u", QString gaId="Em")
The geostatic implementation (femNLSolver.geostatic) This function manages the geostatic process.
Definition gmpFemNonLinearSolver.cpp:1799
virtual bool adaptativeTime(bool conv, int iter, double dt, double &newdt, double err, double tol)
Adaptative time increment.
Definition gmpFemNonLinearSolver.cpp:1088
virtual bool stepStandardDc(double dt, double *newt, bool *conv, double *err, int *niter, bool eval)
The transient nonlinear implementation (femNLSolver.transient) This function manages the transient st...
Definition gmpFemNonLinearSolver.cpp:2928
virtual bool maxErr(GmVector, double &ermax, double &tolmax)
Maximun erro in the current itarion.
Definition gmpFemNonLinearSolver.cpp:1029
GmVector _qta
An overall time-averaged value of the typical flux for field α so far during this step including the ...
Definition gmpFemNonLinearSolver.h:220
TrackItemState _td
The "track data" object, controlling time & simulation progress tracking.
Definition gmpFemNonLinearSolver.h:252
FemResultType
Result type for local matrix calculation methods.
Definition gmpFemPhysics.h:50
Definition gmpFemSolverOptions.h:39
Basic class for solving Non linear FEM problems.
Definition gmpFemTransientNonLinearSolver.h:35
arma::vec GmVector
Declaration of the GmpFemNonLinearSolver class.
Declaration of the GmpFemSolverOptions class.
Definition gmpFemNonLinearSolver.h:231