FemProcess
The GeMA Fem Process Plugin
Loading...
Searching...
No Matches
gmpFemStaticNonLinearSolver.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_STATICNONLINEARSOLVER_H_
25#define _GEMA_PLUGIN_FEM_STATICNONLINEARSOLVER_H_
26
28#include "gmpFemSolverOptions.h"
29
31class GmRunProgress;
32
34class GMP_FEM_PROCESS_API_EXPORT GmpFemStaticNonLinearSolver : public GmpFemNonLinearSolver
35{
36public:
37 //constructor
39 const GmpFemSolverOptions&, const GmLogCategory&);
40
41 //destructor
43
44 void enableFastUpdate(bool mode) { _fastUpdate = mode; }
45
46 // initializing Fem NL Solver
47 //virtual bool init();
48
49
50 //virtual bool step(double dt, double* newt);
51 virtual bool runStep(double dt, double* newt, bool* conv, double* err, int* niter, bool eval=false);
52
53protected:
54 virtual bool addStateItemsToGroup (GmStateDump* state, int groupId);
55 virtual bool fillStateControlMapData (QVariantMap* map);
56 virtual bool stateControlMapDataLoaded(QVariantMap* map);
58
60 virtual bool fillStateControlMapDataStaticSolver(QVariantMap* map);
62 virtual bool stateControlMapDataLoadedStaticSolver(QVariantMap* map);
64 virtual bool fillStateControlMapDataTransientSolver(QVariantMap* map);
66 virtual bool stateControlMapDataLoadedTransientSolver(QVariantMap* map);
67
68//private:
69 // general
70 virtual bool initElementSets(GmNumSolver*);
71 virtual void setElementSets(bool, bool, bool, bool, bool);
72 virtual bool applyFixedBoundaryConditions(int*);
73
75 //virtual bool convergence() const;
76 virtual bool convergenceN (GmVector& erL, GmRunProgress* rp = NULL) const;
77 //virtual bool convergenceDC(GmVector& er) const;
78 virtual void update();
79
81 virtual bool maxVal(GmVector& array, const GmVector&) const;
83 //virtual bool adaptativeTimeAbqs(bool conv, unsigned iter, double dt, double& newdt, double errmax, unsigned inc, bool iter4);
85 //virtual bool adaptativeTime(bool conv, int iter, double dt, double& newdt, double err, double tol);
87 virtual void saveInternalForceAttributes(GmVector& dv);
88
89 virtual void setLoad();
90 //virtual void setTime();
91 virtual void setState();
92
97
98 // Strategies of continuation methods adopted by static solver
100 virtual double loadPredictor();
102 virtual double loadCorrector();
103
104 // Solvers
105 virtual bool staticLinearSolver(double step, double* newt, bool* conv, double* err, int* niter, bool eval);
106 virtual bool staticSolver(double step, double* newt, bool* conv, double* err, int* niter, bool eval);
107
108 // atributtes
109 double _dl;
110 double _ddl;
111 double _tin;
112
113#if 0
114 // atributtes
115
116 double _dl0;
117
118 double _Lold;
119
120 // double _ts;
121 double _dt;
122 double _oldIter;
123 double _hlast;
124
125 // controls time incrementation
126 unsigned _attempt = 0;
127 unsigned _ninc = 0;
128 unsigned _incT = 0;
129 bool _iter4old = false;
130
131
132
133 GmVector _v;
134 GmVector _dx;
135 GmVector _dv;
136 GmVector _xold;
137 GmVector _vold;
138 GmVector _dxt;
139 GmVector _ddx;
140 GmVector _ddxt;
141 GmVector _ddxr;
142 GmVector _FeGs;
143 GmVector _r0;
144 // controls fluxe
145 GmVector _qta;
147
148
149 QVector<int> _fixedDof;
150
151 bool _fastUpdate;
152 bool _hasUnanamedDofs;
153
154 struct TrackItemState
155 {
156 bool _geostatic = false; // Is this a geostatic step?
157 int _femItem = -1;
158 int _femNlItem = -1;
159 int _solverItem = -1;
160
161 int _incAttr = -1;
162 int _attemptAttr = -1;
163 int _convAttr = -1;
164 int _nlIterAttr = -1;
165 int _simTimeAttr = -1;
166 int _simStepAttr = -1;
167 int _solverCallsAttr = -1;
168
169 int _nlErrorAttr = -1;
170
171 int _solverFemExecTimeAttr = -1;
172 int _solverFemNumIterAttr = -1;
173 int _prepareExecTimeAttr = -1;
174 };
175
177
178#endif // 0
179
180};
181
182#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
GmVector _qtamax
The time-averaged value of the largest flux corresponding to the field αduring this step,...
Definition gmpFemNonLinearSolver.h:221
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 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 applyFixedBoundaryConditions(int *)
Apply Dirichlet (fixed) boundary conditions to the global equation system.
Definition gmpFemNonLinearSolver.cpp:795
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 bool stateControlMapDataLoaded(QVariantMap *map)
Method called when the state dump control registered in addStateItemsToGroup() has been loaded.
Definition gmpFemNonLinearSolver.cpp:3787
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 gmpFemStaticNonLinearSolver.h:35
arma::vec GmVector
Declaration of the GmpFemNonLinearSolver class.
Declaration of the GmpFemSolverOptions class.
Definition gmpFemNonLinearSolver.h:231