Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
OgesParameters.h
Go to the documentation of this file.
1
#ifndef OGES_PARAMETERS_H
2
#define OGES_PARAMETERS_H
3
4
// This class holds parameters used by Oges.
5
// You can save commonly used parameter values in an object of this class.
6
// You can interactively update parameter values.
7
// To make these parameters known to a particular Oges object, use the
8
// setOgesParameters function.
9
10
#include "
Overture.h
"
11
#include "
ShowFileParameter.h
"
12
13
class
Oges
;
// forward declaration
14
class
GenericGraphicsInterface
;
15
class
Ogmg
;
16
class
OgmgParameters
;
17
18
class
OgesParameters
19
{
20
public
:
21
22
enum
EquationEnum
23
{
24
userDefined
,
25
laplaceEquation
,
26
divScalarGradOperator
,
// div( s(x) grad )
27
heatEquationOperator
,
// I + c0*Delta
28
variableHeatEquationOperator
,
// I + s(x)*Delta
29
divScalarGradHeatEquationOperator
,
// I + div( s(x) grad )
30
secondOrderConstantCoefficients
31
};
32
33
enum
BoundaryConditionEnum
// these are possible boundary conditions for pre-defined equations.
34
{
// **The first few entries should match those in OgmgParameters.h**
35
dirichlet
=1,
36
neumann
=2,
37
mixed
=3,
38
equation
=4,
// for ogmg
39
extrapolate
=5,
40
combination
=6,
// for ogmg
41
axisymmetric
,
42
dirichletAndEvenSymmetry
,
43
dirichletAndOddSymmetry
44
};
45
46
47
enum
OptionEnum
// ** remember to change the documentation if you change this list.
48
{
49
THEabsoluteTolerance
,
50
THEisAxisymmetric
,
// for predefined equations
51
THEbestIterativeSolver
,
// choose the 'best' iterative solver and options.
52
THEbestDirectSolver
,
// choose the 'best' direct solver and options.
53
THEcompatibilityConstraint
,
54
THEexternalSolver
,
55
THEfillinRatio
,
56
THEfillinRatio2
,
57
THEfixupRightHandSide
,
58
THEgmresRestartLength
,
59
THEharwellPivotingTolerance
,
60
THEincompleteLUExpectedFill
,
61
THEincompleteLUDropTolerance
,
// =dt for ILUT(dt), ILUTK(dt,k) (from DH preconditioners)
62
THEincompleteLUSparseACoefficient
,
// =sparseA for sparsifying matrix prior to ILU (from DH)
63
THEincompleteLUSparseFCoefficient
,
// =sparseF for sparsifying factorization after ILU (from DH)
64
THEincompleteLUTypeInDH
,
// =ilu_type in DH preconditioners
65
THEiterativeImprovement
,
66
THEkeepCoefficientGridFunction
,
// keep a reference to the user's coeff grid function
67
THEkeepSparseMatrix
,
// keep ia,ja,a sparse matrix even it not needed by the solver
68
THEmatrixCutoff
,
69
THEmatrixOrdering
,
70
THEmaximumInterpolationWidth
,
71
THEmaximumNumberOfIterations
,
72
THEminimumNumberOfIterations
,
73
THEnullVectorScaling
,
74
THEnumberOfIncompleteLULevels
,
75
THEorderOfExtrapolation
,
// for predefined equation ghost points
76
THEpreconditioner
,
77
THEparallelExternalSolver
,
78
THEparallelPreconditioner
,
79
THEparallelSolverMethod
,
80
THErelativeTolerance
,
81
THEremoveSolutionAndRHSVector
,
// de-allocate sol and rhs vector after every solve
82
THEremoveSparseMatrixFactorization
,
// de-allocate any factorization info after every solve.
83
THErescaleRowNorms
,
84
THEsolveForTranspose
,
85
THEsolverMethod
,
86
THEsolverType
,
87
THEtolerance
,
88
THEuserSuppliedCompatibilityConstraint
,
89
THEzeroRatio
90
};
91
92
enum
SolverEnum
93
{
94
defaultSolver
,
95
sor
,
96
yale
,
97
harwell
,
98
SLAP
,
99
PETSc
,
100
multigrid
,
101
PETScNew
,
// new parallel solver
102
userSolver1
,
// these are reserved for new user defined solvers.
103
userSolver2
,
104
userSolver3
,
105
userSolver4
,
106
userSolver5
107
};
108
109
110
enum
SolverMethodEnum
111
{
112
defaultSolverMethod
,
113
richardson
,
114
chebychev
,
115
conjugateGradient
,
116
cg
=
conjugateGradient
,
// cg= short PETSc name
117
biConjugateGradient
,
118
bicg
=
biConjugateGradient
,
119
biConjugateGradientSquared
,
120
conjugateGradientSquared
,
121
cgs
=
conjugateGradientSquared
,
122
biConjugateGradientStabilized
,
123
bcgs
=
biConjugateGradientStabilized
,
124
generalizedMinimalResidual
,
125
gmres
=
generalizedMinimalResidual
,
126
transposeFreeQuasiMinimalResidual
,
127
tfqmr
=
transposeFreeQuasiMinimalResidual
,
128
transposeFreeQuasiMinimalResidual2
,
// tcqmr Tony Chan's version
129
tcqmr
=
transposeFreeQuasiMinimalResidual2
,
130
conjugateResidual
,
131
cr
=
conjugateResidual
,
132
leastSquares
,
133
lsqr
=
leastSquares
,
134
preonly
,
135
qcg
// minimize a quadratic function
136
};
137
138
enum
PreconditionerEnum
139
{
140
defaultPreconditioner
,
141
noPreconditioner
,
142
jacobiPreconditioner
,
143
sorPreconditioner
,
144
luPreconditioner
,
145
shellPreconditioner
,
146
DHILUPreconditioner
,
147
blockJacobiPreconditioner
,
148
multigridPreconditioner
,
149
eisenstatPreconditioner
,
150
incompleteCholeskyPreconditioner
,
151
incompleteLUPreconditioner
,
152
additiveSchwarzPreconditioner
,
153
kspPreconditioner
,
// was slesPreconditioner
154
compositePreconditioner
,
155
redundantPreconditioner
,
156
diagonalPreconditioner
,
157
ssorPreconditioner
,
158
sparseApproximateInversePreconditioner
,
159
neumannNeumannPreconditioner
,
160
chloleskyPreconditioner
,
161
samgPreconditioner
,
162
pointBlockJacobiPreconditioner
,
163
matrixPreconditioner
,
164
hyprePreconditioner
,
165
fieldSplitPreconditioner
,
166
tfsPreconditioner
,
167
mlPreconditioner
,
168
prometheusPreconditioner
169
};
170
171
172
173
enum
MatrixOrderingEnum
174
{
175
defaultMatrixOrdering
,
176
naturalOrdering
,
177
nestedDisectionOrdering
,
178
oneWayDisectionOrdering
,
179
reverseCuthillMcKeeOrdering
,
180
quotientMinimumDegreeOrdering
,
181
rowlengthOrdering
182
};
183
184
185
// there are different options we can use for the external solver with PETSc
186
enum
ExternalSolverEnum
187
{
188
defaultExternalSolver
,
189
superlu
,
190
superlu_dist
,
191
superlu_mp
,
192
mumps
,
193
hypre
194
};
195
196
197
OgesParameters
();
198
~OgesParameters
();
199
OgesParameters
&
operator=
(
const
OgesParameters
& x);
200
201
aString
getSolverName
()
const
;
// return the name (composite of solver, preconditioner,...)
202
aString
getSolverTypeName
(
SolverEnum
solverType =
defaultSolver
)
const
;
203
aString
getSolverMethodName
(
SolverMethodEnum
solverMethod
=
defaultSolverMethod
)
const
;
204
aString
getPreconditionerName
(
PreconditionerEnum
preconditioner
=
defaultPreconditioner
)
const
;
205
aString
getMatrixOrderingName
(
MatrixOrderingEnum
matrixOrdering
=
defaultMatrixOrdering
)
const
;
206
207
int
setParameters
(
const
Oges
& oges);
// set all parameters equal to those values found in oges.
208
int
update
(
GenericGraphicsInterface
& gi,
CompositeGrid
&
cg
);
// update parameters interactively
209
210
// ----------------Functions to set parameters -----------------------------
211
int
set
(
SolverEnum
option );
212
int
set
(
SolverMethodEnum
option );
213
int
set
(
MatrixOrderingEnum
option );
214
int
set
(
PreconditionerEnum
option );
215
216
int
set
(
OptionEnum
option,
int
value=0 );
217
int
set
(
OptionEnum
option,
float
value );
218
int
set
(
OptionEnum
option,
double
value );
219
220
// set a PETSc option
221
int
setPetscOption
(
const
aString
& name,
const
aString
& value );
222
bool
getPetscOption
(
const
aString
& name,
aString
& value )
const
;
223
224
225
SolverEnum
getSolverType
()
const
;
226
227
int
get
(
OptionEnum
option,
int
& value )
const
;
228
int
get
(
OptionEnum
option,
real
& value )
const
;
229
230
OgmgParameters
*
getOgmgParameters
()
const
;
231
OgmgParameters
&
buildOgmgParameters
();
232
233
int
get
(
const
GenericDataBase
& dir,
const
aString
& name);
234
int
put
(
GenericDataBase
& dir,
const
aString
& name)
const
;
235
236
int
isAvailable
(
SolverEnum
solverType );
237
238
// print out current values of parameters
239
int
display
(FILE *file = stdout);
240
241
ListOfShowFileParameters
petscOptions
;
// holds options for PETSc
242
243
protected
:
244
245
int
set
(
OptionEnum
option,
int
value,
real
rvalue );
246
int
get
(
OptionEnum
option,
int
& value,
real
& rvalue )
const
;
247
248
SolverEnum
solver
;
249
aString
solverName
;
250
251
SolverMethodEnum
solverMethod
,
parallelSolverMethod
;
252
PreconditionerEnum
preconditioner
,
parallelPreconditioner
;
253
MatrixOrderingEnum
matrixOrdering
;
254
ExternalSolverEnum
externalSolver
,
parallelExternalSolver
;
255
256
real
relativeTolerance
;
// relative tolerance. if <=0. routine should choose a value.
257
real
absoluteTolerance
;
258
real
maximumAllowableIncreaseInResidual
;
// stop iterations if residual increases greater than this value.
259
260
bool
compatibilityConstraint
;
261
bool
userSuppliedCompatibilityConstraint
;
// set to true if the user has supplied a right null vector
262
263
int
gmresRestartLength
;
264
int
numberOfIncompleteLULevels
;
265
real
incompleteLUExpectedFill
;
266
int
minimumNumberOfIterations
;
267
int
maximumNumberOfIterations
;
268
int
solveForTranspose
;
269
int
rescaleRowNorms
;
270
271
int
blockSize
;
// block size for block matrices (e.g. for systems of equations)
272
273
real
matrixCutoff
;
// epsz
274
bool
fixupRightHandSide
;
// zero out rhs at interp., extrap and periodic Points?
275
276
real
zeroRatio
;
// zratio
277
real
fillinRatio
;
// fratio
278
real
fillinRatio2
;
// fratio2
279
real
harwellPivotingTolerance
;
// tolerance for harwell pivoting
280
real
nullVectorScaling
;
281
282
int
preconditionBoundary
;
283
int
preconditionRightHandSide
;
284
int
maximumInterpolationWidth
;
285
int
iterativeImprovement
;
286
287
int
orderOfExtrapolation
;
// for predefined equations (-1: use default)
288
289
real
sorOmega
;
// omega
290
291
int
isAxisymmetric
;
// is this problem axisymmetric (for predefined equations)
292
293
// parameters for experimental DH preconditioner, used with PETSc **pf**
294
real
incompleteLUDropTolerance
;
// =dt for ILUT(dt), ILUTK(dt,k) (from DH preconditioners)
295
real
incompleteLUSparseACoefficient
;
// =sparseA for sparsifying matrix prior to ILU (from DH)
296
real
incompleteLUSparseFCoefficient
;
// =sparseF for sparsifying factorization after ILU (from DH)
297
int
incompleteLUTypeInDH
;
// =ilu_type in DH preconditioners: 1=iluk with sparsify
298
299
// parameters for memory management: These are all false by default.
300
bool
keepCoefficientGridFunction
;
// keep a reference to the user's coeff grid function
301
bool
keepSparseMatrix
;
// keep ia,ja,a sparse matrix even it not needed by the solver
302
bool
removeSolutionAndRHSVector
;
// de-allocate sol and rhs vector after every solve
303
bool
removeSparseMatrixFactorization
;
// de-allocate sparse matrix factorization after solving.
304
305
OgmgParameters
*
ogmgParameters
;
306
307
friend
class
Oges
;
308
friend
class
EquationSolver
;
309
friend
class
PETScEquationSolver
;
310
friend
class
YaleEquationSolver
;
311
friend
class
HarwellEquationSolver
;
312
friend
class
SlapEquationSolver
;
313
friend
class
Ogmg
;
314
friend
class
PETScSolver
;
315
316
};
317
318
#endif
Generated on Fri Jan 4 2013 10:17:56 for Overture by
1.8.3