Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
EquationSolver.h
Go to the documentation of this file.
1
#ifndef EQUATION_SOLVER_H
2
#define EQUATION_SOLVER_H
3
4
#include "
Oges.h
"
5
6
// base class for equations solvers such as yale, harwell, slap, petsc etc.
7
class
EquationSolver
8
{
9
public
:
10
EquationSolver
(
Oges
& oges_);
11
virtual
~EquationSolver
();
12
virtual
int
solve
(
realCompositeGridFunction
& u,
13
realCompositeGridFunction
& f)=0;
14
15
virtual
int
saveBinaryMatrix
(
aString
filename00,
16
realCompositeGridFunction
& u,
17
realCompositeGridFunction
& f);
18
19
// new way to set coefficients:
20
virtual
int
setCoefficientsAndBoundaryConditions
(
realCompositeGridFunction
& coeff,
21
const
IntegerArray
& boundaryConditions,
22
const
RealArray
& bcData );
23
// old way to set coefficients:
24
virtual
int
setCoefficientArray
(
realCompositeGridFunction
& coeff,
25
const
IntegerArray
& boundaryConditions=
Overture::nullIntArray
(),
26
const
RealArray
& bcData=
Overture::nullRealArray
() );
27
28
virtual
int
setEquationAndBoundaryConditions
(
OgesParameters::EquationEnum
equation,
29
CompositeGridOperators
& op,
const
IntegerArray
& boundaryConditions,
30
const
RealArray
& bcData,
31
RealArray
& constantCoeff =
Overture::nullRealArray
(),
32
realCompositeGridFunction
*variableCoeff=
NULL
);
33
34
// call this function when the grid changes (and before setCoefficientsAndBoundaryConditions)
35
virtual
int
setGrid
(
CompositeGrid
& cg );
36
37
// Set the MultigridCompositeGrid to use: (for use with Ogmg)
38
virtual
int
set
(
MultigridCompositeGrid
& mgcg );
39
40
const
aString
&
getName
()
const
;
41
42
virtual
real
getMaximumResidual
();
43
44
virtual
int
printStatistics
( FILE *file = stdout )
const
;
// output any relevant statistics
45
46
// assign values to rhs for the the extra equations
47
virtual
int
setExtraEquationValues
(
realCompositeGridFunction
& f,
real
*value );
48
49
// return solution values from the extra equations
50
virtual
int
getExtraEquationValues
(
const
realCompositeGridFunction
& u,
real
*value );
51
52
// evaluate the dot product of an extra equation times u
53
virtual
int
evaluateExtraEquation
(
const
realCompositeGridFunction
& u,
real
& value,
int
extraEquation=0 );
54
55
virtual
int
evaluateExtraEquation
(
const
realCompositeGridFunction
& u,
real
& value,
56
real
& sumOfExtraEquationCoefficients,
int
extraEquation=0 );
57
58
virtual
int
allocateMatrix
(
int
,
int
,
int
,
int
);
59
virtual
int
setMatrixElement
(
int
,
int
,
int
,
real
);
60
virtual
int
displayMatrix
();
61
62
// So far a common data structure is used by all vector types, so there is no need to have these:
63
// virtual void setRHSVectorElement(int,real);
64
// virtual void setSolVectorElement(int,real);
65
66
virtual
real
sizeOf
( FILE *file=
NULL
);
// return number of bytes allocated
67
68
protected
:
69
70
Oges
&
oges
;
71
OgesParameters
&
parameters
;
72
73
aString
name
;
74
int
numberOfEquations
;
75
int
numberOfNonzeros
;
76
real
maximumResidual
;
// after solve, this is the maximumResidual (if computed)
77
int
numberOfIterations
;
// number of iterations required for the solve.
78
79
// here we save the values of the current state so we can compare for any changes
80
// with oges.parameters
81
int
solverMethod
;
82
int
preconditioner
;
83
int
matrixOrdering
;
84
int
numberOfIncompleteLULevels
;
85
int
gmresRestartLength
;
86
};
87
88
89
#endif
Generated on Fri Jan 4 2013 10:17:51 for Overture by
1.8.3