FemProcess
The GeMA Fem Process Plugin
gmpFemSolverOptions.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_SOLVER_OPTIONS_H_
25 #define _GEMA_PLUGIN_FEM_SOLVER_OPTIONS_H_
26 
27 #include <QString>
28 #include <QVector>
29 
30 #include "gmpFemProcessConfig.h"
31 
32 #include <gmTaskManager.h>
33 #include <luaEnv.h>
34 
35 class LuaTable;
36 class GmSimulationData;
37 
38 class GMP_FEM_PROCESS_API_EXPORT GmpFemSolverOptions
39 {
40 public:
41 
44  {
45  automatic,
46  noDofHandling,
47  removeDof,
48  //-----------------------------------
49  // IMPORTANT: When adding entries or CHANGING enum order, please remember
50  // to also change assemblerModeOptions()
51  };
52 
55  {
56  staticLinear,
57  staticSolver,
58  transientLinear,
59  transientSolver,
60  transientNonlinearDc,
61  transientAutomaticTimeStep,
62  staticAutomaticStep,
63  hydraulicFract,
64  transientIterative,
65  dynamicLinear,
66  dynamicSolver,
67  state,
68  //-----------------------------------
69  // IMPORTANT: When adding entries or CHANGING enum order, please remember
70  // to also change solverTypeOptions()
71  };
72 
75  {
76  load,
77  displacement,
78  velocity,
79  flux,
80  //-----------------------------------
81  // IMPORTANT: When adding entries or CHANGING enum order, please remember
82  // to also change convergenceCriterionOptions()
83  };
84 
87  {
88  loadControlIncrement,
89  displacementControlIncrement,
90  cylindricalArcLengthIncrement,
91  sphericalArcLengthIncrement,
92  dissipatedEnergyIncrement,
93  combinedArcDissipatedEnergyIncrement,
94  strainControlIncrement,
95  elementControlIncrement,
96  externalWorkIncrement,
97  prescribedDisplacementIncrement,
98  //-----------------------------------
99  // IMPORTANT: When adding entries or CHANGING enum order, please remember
100  // to also change incrementStrategyOptions()
101  };
102 
105  {
106  loadControl,
107  displacementControl,
108  linearArcLength,
109  cylindricalArcLength,
110  sphericalArcLength,
111  dissipatedEnergy,
112  combinedArcDissipatedEnergy,
113  elementControl,
114  strainControl,
115  minimalNorm,
116  orthogonalResidue,
117  prescribedDisplacement,
118  //-----------------------------------
119  // IMPORTANT: When adding entries or CHANGING enum order, please remember
120  // to also change iterationStrategyOptions()
121  };
122 
125  {
126  full,
127  modified,
128  broyden,
129  bfgs,
130 
131  //-----------------------------------
132  // IMPORTANT: When adding entries or CHANGING enum order, please remember
133  // to also change newtonRaphsonModeOptions()
134  };
135 
138  {
139  none,
140  fixedNode,
141  selfWeight,
142  //-----------------------------------
143  // IMPORTANT: When adding entries or CHANGING enum order, please remember
144  // to also change geostaticTypeOptions()
145  };
146 
149  {
150  fully,
151  iterative,
152 
153  //-----------------------------------
154  // IMPORTANT: When adding entries or CHANGING enum order, please remember
155  // to also change couplingStrategyOptions()
156  };
157 
158 
159  /* Linear Transient Methods Type*/
160  enum LinearTransientMethods {
161  Implicit,
162  RK2,
163  RK4,
164  RK6,
165  };
166 
167  enum ReductionMethod {
168  NoReduction,
169  GuyanReduction,
170  };
171 
172  enum TimeIncrementMethod {
173  userDefined,
174  rate_based,
175  maxIncrementTransientVar,
176  };
177 
179  saveIteration = 0x0001,
180  savePhysicsId = 0x0002,
181  savePhysicsHeader = 0x0004,
182  saveDofMap = 0x0008,
183  saveDofValues = 0x0010,
184  saveFeVector = 0x0020,
185  saveFiVector = 0x0040,
186  saveKMatrix = 0x0080,
187  saveCMatrix = 0x0100,
188  saveMMatrix = 0x0200,
189  };
190 
191  enum AccurateMethod {
192  firstOrder,
193  secondOrder,
194  //-----------------------------------
195  // IMPORTANT: When adding entries or CHANGING enum order, please remember
196  // to also change AccurateMethodOptions()
197  };
198 
200 
201  void loadFromTable(LuaTable& optionsTable, GmSimulationData* simData);
202 
203  // Print options
204  unsigned _printOptions;
208 
209  // Multi threaded options used when traversing elements
211  int _mtnTasks;
213 
214  // Assembler option.
216 
217  // User defined prefix for result attributes
219 
220  // Analysis type and other strategy definitions
222  IncrementStrategy _incrementStrategy;
223  IterationStrategy _iterationStrategy;
224  NewtonRaphsonMode _newtonRaphsonMode;
225  GeostaticType _geostaticType;
226  CouplingStrategy _couplingStrategy;
227  ReductionMethod _reductionMethod;
228  LinearTransientMethods _linearTransientMethod;
229  TimeIncrementMethod _timeIncrementMethod;
230  AccurateMethod _Order;
231 
232  // Load step and iteration options
233  unsigned _stepsMax;
234  unsigned _attemptsMax;
235  unsigned _iterationsMax;
237 
238  // Tolerances & convergence criteria
239  unsigned _convergenceCriterion;
241 
242  // displacement control Data & dof index
244 
245  // Static solver options
246  double _loadOld;
247  double _loadNew;
248  double _loadMax;
249  double _loadIncrement;
255  bool _normalFlow;
257 
258  // Transient solver options
259  double _timeOld;
260  double _timeNew;
261  double _timeMax;
262  double _timeIncrement;
266  bool _timeAdjustStep;
272  // controls time incrementation
273  unsigned _iterationsL;
274  unsigned _iterationsG;
276  unsigned _incrementsT;
277  double _DeltaG;
278  double _DeltaM;
279  double _DeltaB;
280  double _DeltaF;
281  // Element saving options
285 
286 private:
287  const char** asssemblerModeOptions();
288  const char** solverTypeOptions();
289  const char** newtonRaphsonModeOptions();
290  const char** incrementStrategyOptions();
291  const char** iterationStrategyOptions();
292  const char** integrationSchemeOptions();
293  const char** geostaticTypeOptions();
294  const char** couplingStrategyOptions();
295  const char** convergenceCriterionOptions();
296  const char** transientLinearOptions();
297  const char** reductionMethodOptions();
298  const char** timeIncrementAdaptativeOptions();
299  const char** AccurateMethodOptions();
300 
301 
302  void setAsssemblerMode (int index) { _assemblerDofMode = (AssemblerMode)index; }
303  void setSolverType (int index) { _type = (SolverType)index; }
304  void setNewtonRaphsonMode(int index) { _newtonRaphsonMode = (NewtonRaphsonMode)index; }
305  void setIncrementStrategy(int index) { _incrementStrategy = (IncrementStrategy)index; }
306  void setIterationStrategy(int index) { _iterationStrategy = (IterationStrategy)index; }
307  void setIntegrationScheme(int index);
308  void setGeostaticType (int index) { _geostaticType = (GeostaticType)index; }
309  void setCouplingStrategy (int index) { _couplingStrategy = (CouplingStrategy)index; }
310  void setLinearTransient (int index) {_linearTransientMethod = (LinearTransientMethods)index;}
311  void setReductionMethod (int index) {_reductionMethod = (ReductionMethod)index; }
312  void setTimeIncrementStrategy(int index) { _timeIncrementMethod = (TimeIncrementMethod)index; }
313  void setAccurateMethod (int index) { _Order = (AccurateMethod)index; }
314 };
315 
316 #endif
double _initialEnergyIncrement
Solver option defining the initial energy increment.
Definition: gmpFemSolverOptions.h:254
double _timeMinIncrement
Solver option defining the minimum time increment.
Definition: gmpFemSolverOptions.h:263
Definition: gmpFemSolverOptions.h:38
double _DeltaG
Solver option defining time increment factor for proposed new time.
Definition: gmpFemSolverOptions.h:277
unsigned _attemptsMax
Solver option defining the maximum number of attempts.
Definition: gmpFemSolverOptions.h:234
SolverType _type
Solver option defining the analysis type.
Definition: gmpFemSolverOptions.h:221
int _printFieldWidth
Format parameter used together with _printOptions: The matrix column minimum width.
Definition: gmpFemSolverOptions.h:205
double _timeIncrement
Solver option defining the initial time increment.
Definition: gmpFemSolverOptions.h:262
GeostaticType
Geostatic type options.
Definition: gmpFemSolverOptions.h:137
bool _skipLocalError
Solver option defining the local integration error control (yes/no)
Definition: gmpFemSolverOptions.h:270
double _integrationScheme
Solver option defining the time integration scheme.
Definition: gmpFemSolverOptions.h:265
unsigned _incrementsT
Solver option defining consecutive increments if no cut-back has occurred to allow a time increment i...
Definition: gmpFemSolverOptions.h:276
ElementSaveOptions
Definition: gmpFemSolverOptions.h:178
double _DeltaF
Solver option defining Cutback factor if the solution seems to diverge.
Definition: gmpFemSolverOptions.h:280
double _minDissipatedEnergy
Solver option defining the minimum dissipated energy.
Definition: gmpFemSolverOptions.h:253
int _printPrecision
Format parameter used together with _printOptions: The number of decimal places.
Definition: gmpFemSolverOptions.h:207
unsigned _iterationsMax
Solver option defining the maximum number of iterations.
Definition: gmpFemSolverOptions.h:235
int _mtnTasks
The number of tasks. See GmTaskManager::runParallelCellLoop()
Definition: gmpFemSolverOptions.h:211
QVector< double > _tolerance
Solver option defining the tolerance.
Definition: gmpFemSolverOptions.h:240
unsigned _printOptions
Print options flags defining what information should be logged by the solver.
Definition: gmpFemSolverOptions.h:204
QVector< int > _dispControlData
Solver option defining the node, degree of fredom.
Definition: gmpFemSolverOptions.h:243
unsigned _saveElementOptions
An or of ElementSaveOptions values defining which data should be saved for each element.
Definition: gmpFemSolverOptions.h:284
IterationStrategy
Iteration strategy options - NL static solver.
Definition: gmpFemSolverOptions.h:104
bool _normalFlow
Solver option defining the normal flow technique.
Definition: gmpFemSolverOptions.h:255
IncrementStrategy
Increment strategy options - NL static solver.
Definition: gmpFemSolverOptions.h:86
double _loadMinIncrement
Solver option defining the minimum load increment.
Definition: gmpFemSolverOptions.h:250
double _loadMax
Solver option defining the maximum load factor.
Definition: gmpFemSolverOptions.h:248
bool _resetDisplacement
Solver option defining the reset displacement (yes/no)
Definition: gmpFemSolverOptions.h:271
double _timeMax
Solver option defining the total time of analisys.
Definition: gmpFemSolverOptions.h:261
double _integrationTolerance
Solver option defining the time integration tolerance.
Definition: gmpFemSolverOptions.h:268
double _timeMaxIncrement
Solver option defining the maximum time increment.
Definition: gmpFemSolverOptions.h:264
double _loadMaxIncrement
Solver option defining the maximum load increment.
Definition: gmpFemSolverOptions.h:251
double _loadNew
Solver option defining the new load factor.
Definition: gmpFemSolverOptions.h:247
ConvergenceCriterion
Convergence criterion options.
Definition: gmpFemSolverOptions.h:74
char _printFormat
Format parameter used together with _printOptions: The format type f' or 'g'.
Definition: gmpFemSolverOptions.h:206
double _loadIncrement
Solver option defining the load increment.
Definition: gmpFemSolverOptions.h:249
double _iterationTolerance
Solver option defining the iteration tolerance.
Definition: gmpFemSolverOptions.h:267
AssemblerMode _assemblerDofMode
Dof handling mode for the assembler.
Definition: gmpFemSolverOptions.h:215
unsigned _stepsMax
Solver option defining the maximum step number.
Definition: gmpFemSolverOptions.h:233
bool _crackTracking
Solver option defining the crack tracking algorithm.
Definition: gmpFemSolverOptions.h:256
double _DeltaM
Solver option defining time increment factor for current time.
Definition: gmpFemSolverOptions.h:278
double _DeltaB
Solver option defining Cutback factor for the next increment if more than IL iterations were needed i...
Definition: gmpFemSolverOptions.h:279
bool _timeControl
Solver option defining the time increment control (yes/no)
Definition: gmpFemSolverOptions.h:275
QString _saveElementDataFileMask
The mask with the save element data file name. If it contains a XXXXXX substring, it will be replaced...
Definition: gmpFemSolverOptions.h:283
unsigned _iterationsL
Solver option defining number of iterations after which the size of the subsequent increment will be ...
Definition: gmpFemSolverOptions.h:273
NewtonRaphsonMode
Newton Raphson optios.
Definition: gmpFemSolverOptions.h:124
unsigned _iterationsDesired
Solver option defining the desired number of iterations.
Definition: gmpFemSolverOptions.h:236
QString _resultAttributePrefix
The prefix used for result attributes reistered by the solver.
Definition: gmpFemSolverOptions.h:218
SolverType
Solver type.
Definition: gmpFemSolverOptions.h:54
Declaration of usefull configuration definitions for the plugin library.
bool _loadAdjustStep
Solver option defining the adaptative load increment.
Definition: gmpFemSolverOptions.h:252
unsigned _iterationsG
Solver option defining number of maximum number of iterations allowed in two consecutive increments f...
Definition: gmpFemSolverOptions.h:274
double _transientVariableChange
Solver option defining the máx allowable transient variable change per increment.
Definition: gmpFemSolverOptions.h:269
GmTaskManager::CellPartitionStrategy _mtStrategy
The cell partitioning strategy. See GmTaskManager::runParallelCellLoop()
Definition: gmpFemSolverOptions.h:212
bool _saveElementData
Should we save element data to an aux file?
Definition: gmpFemSolverOptions.h:282
AssemblerMode
Assembler mode.
Definition: gmpFemSolverOptions.h:43
int _mtnWorkers
The number of worker threads. See GmTaskManager::runParallelCellLoop()
Definition: gmpFemSolverOptions.h:210
CouplingStrategy
Coupling strategy options.
Definition: gmpFemSolverOptions.h:148
double _loadOld
Solver option defining the old load factor.
Definition: gmpFemSolverOptions.h:246