-
Notifications
You must be signed in to change notification settings - Fork 9
/
BiCGstab.h
64 lines (53 loc) · 1.42 KB
/
BiCGstab.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef BICGSTAB_H
#define BICGSTAB_H
#include <bitset>
#include <fstream>
#include "Definitions.h"
#include "IntVec.h"
#include "LinearSolver.h"
#include "LaFullDirectSolver.h"
#include "LaBandedDirectSolver.h"
#include "DataCollector.h"
#include "Definitions.h"
#include "VectorNorm.h"
#include "VectorFunction.h"
#include "LinearOperator.h"
#include "Preconditioner.h"
#include "ParameterDatabase.h"
#include "Vec.h"
#include "VecOperators.h"
#include "VecBlas.h"
namespace Daetk
{
class BiCGstab : public LinearSolver
{
public:
BiCGstab();
BiCGstab(LinearOperator& linOpIn, Preconditioner& precIn,
VectorNorm& normIn,
DataCollector& dataIn,
ParameterDatabase& pd);
BiCGstab(LinearOperator& linOpIn, Preconditioner& precIn,
VectorNorm& normIn,
DataCollector& dataIn,
real tolIn=1.65e-4,
int maxIts=100,int neq=0);
virtual ~BiCGstab();
bool prepare();
void useInitialGuess();
bool solve(const Vec& bIn,Vec& xIn);
void checkTrueResidual(real resTol);
void dump(std::ostream& os);
private:
bool RESTART, CHECK_RESIDUAL,error,USE_GUESS;
int maxIterations;
real tol,trueResTol,rhoK,rhoKm1,alpha,omega,k,beta,realTemp,rNorm,xNorm,r0;
Vec r,rHat,v,p,s,unscaled_p,unscaled_s,t,vecTemp;
AttacheVec x,b;
VectorNorm* vectorNorm;
DataCollector* data;
LinearOperator* linearOperator;
Preconditioner* preconditioner;
};
} //Daetk
#endif