26#ifndef _GEMA_PLUGIN_FEM_NONLINEARSOLVER_H_
27#define _GEMA_PLUGIN_FEM_NONLINEARSOLVER_H_
38 friend class XfemSolver;
49 bool _equilibrium =
false;
50 bool _iter4new =
false;
61 :_erL(ng, arma::fill::zeros), _time(t), _dt(dt)
65 void enableFastUpdate(
bool mode) { _fastUpdate = mode; }
75 virtual bool runStep(
double dt,
double* newt,
bool* conv,
double* err,
int* niter,
bool eval=
false);
79 virtual bool checkTimeStep(
double dt);
90 virtual bool fillStateControlMapDataStaticSolver(QVariantMap* map);
92 virtual bool stateControlMapDataLoadedStaticSolver(QVariantMap* map);
94 virtual bool fillStateControlMapDataTransientSolver(QVariantMap* map);
96 virtual bool stateControlMapDataLoadedTransientSolver(QVariantMap* map);
101 virtual void setElementSets(
bool,
bool,
bool,
bool,
bool);
103 virtual bool prepareNonLinearSolverStep(solverState& sS,
GmRunProgress& ps);
105 virtual bool assembleInitialSystem(
const double&);
106 virtual bool solveInitialSystem(solverState& sS,
GmRunProgress& ps);
108 virtual bool assembleIterationSystem(
const double&);
110 virtual bool solveNewtonRaphson(
GmRunProgress& ps,
double& dt,
const double& t,
double* newt);
112 virtual bool applyTimeDiscretization() {
return true; }
115 virtual bool intialFixedBoundaryConditions(
int*);
116 virtual bool applyNonzeroFixedBCsbyModification(
int*);
117 virtual bool isTransient()
const;
118 virtual bool isNonlinear()
const;
121 virtual bool convergence()
const;
123 virtual bool convergenceDC(
GmVector& er)
const;
125 virtual void restore();
130 virtual bool loadError(
GmVector& er)
const;
131 virtual bool dispError(
GmVector& er)
const;
132 virtual bool velocityError(
GmVector& er)
const;
133 virtual bool fluxError(
GmVector& er)
const;
134 virtual bool fluxMagnitude(
GmVector& qa)
const;
137 virtual bool convergenceStep(
unsigned& attempt,
unsigned& incT,
double,
double);
139 virtual bool maxErr(
GmVector,
double& ermax,
double &tolmax);
143 virtual bool phygroupName(
int & kgroup,
QString var)
const;
145 virtual bool divergingIncrement(
unsigned iter,
double tolmax,
double ermax,
double& ermax_1,
double& ermax_2);
147 virtual bool adaptativeTimeAbqs(
bool conv,
unsigned iter,
double dt,
double& newdt,
double errmax,
unsigned inc,
bool iter4);
149 virtual bool adaptativeTime(
bool conv,
int iter,
double dt,
double& newdt,
double err,
double tol);
151 virtual void saveInternalForceAttributes(
GmVector& dv);
153 virtual void setLoad();
154 virtual void setTime();
155 virtual void setState();
157 virtual void setTransientSystem(
double);
160 virtual bool getLinearSystem(
double dt);
161 virtual bool getSystemRHSVector(
double dt);
162 virtual bool getSystemResidualVector(
double dt);
164 bool applyDirichletBoundaryConditions();
176 virtual double evalTimeIncrementSize(
unsigned,
double,
double,
GmVector&);
181 virtual bool transientSolver(
double dt,
double* newt,
bool* conv,
double* err,
int* niter,
bool eval);
182 virtual bool transientLocalSolver(
double dt,
double* newt,
bool* conv,
double* err,
int* niter,
bool eval);
183 virtual bool iterativeSolver(
double dt,
double* newt,
bool* conv,
double* err,
int* niter,
bool eval);
186 virtual bool stepStandardDc(
double dt,
double* newt,
bool* conv,
double* err,
int* niter,
bool eval);
201 unsigned _attempt = 0;
204 bool _iter4old =
false;
232 bool _geostatic =
false;
235 int _solverItem = -1;
238 int _attemptAttr = -1;
240 int _nlIterAttr = -1;
241 int _simTimeAttr = -1;
242 int _simStepAttr = -1;
243 int _solverCallsAttr = -1;
245 int _nlErrorAttr = -1;
247 int _solverFemExecTimeAttr = -1;
248 int _solverFemNumIterAttr = -1;
249 int _prepareExecTimeAttr = -1;
Basic class for solving Non linear FEM problems.
Definition gmpFemNonLinearSolver.h:37
bool _hasUnanamedDofs
Set to true if there are dofs that belong to the 'unnamed' group.
Definition gmpFemNonLinearSolver.h:227
GmVector _qtamax
The time-averaged value of the largest flux corresponding to the field αduring this step,...
Definition gmpFemNonLinearSolver.h:221
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
Basic class for the FEM solving process.
Definition gmpFemSolver.h:52
virtual bool applyFixedBoundaryConditions(int *numFixed)
Apply Dirichlet (fixed) boundary conditions to the global equation system.
Definition gmpFemSolver.cpp:1791
virtual bool initResultAttributes(int fatherItemId)
Helper function used to register the set of result attributes managed by the fem solver.
Definition gmpFemSolver.cpp:487
virtual bool stateControlMapDataLoaded(QVariantMap *map)
Method called when the state dump control registered in addStateItemsToGroup() has been loaded.
Definition gmpFemSolver.cpp:2204
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:872
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:356
virtual bool stateLoadedCalcDerivedResultsNonLinear()
Returns the value of the "nonLinearSolver" parameter that will be passed to the calcDerivedResults() ...
Definition gmpFemSolver.h:102
virtual bool fillStateControlMapData(QVariantMap *map)
Method called for filling the state dump control registered in addStateItemsToGroup()
Definition gmpFemSolver.cpp:2183
virtual bool initElementSets(GmNumSolver *solver)
Helper function used to initialize the matrix / vector sets with the definition of the needed types a...
Definition gmpFemSolver.cpp:460
virtual bool init()
Prepares the solver for assembling matrices by creating the assembler object and allocating the neede...
Definition gmpFemSolver.cpp:138
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 gmpFemSolver.cpp:2104
Definition gmpFemSolverOptions.h:39
Declaration of the GmpFemSolver class.
Declaration of the GmpFemSolverOptions class.
Definition gmpFemNonLinearSolver.h:231
Definition gmpFemNonLinearSolver.h:48
double _dt
Simulation time increment.
Definition gmpFemNonLinearSolver.h:51
double _time
Total simulation time.
Definition gmpFemNonLinearSolver.h:53