00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef EPETRAEXT_BLOCKJACOBI_LINEARPROBLEM_H
00030 #define EPETRAEXT_BLOCKJACOBI_LINEARPROBLEM_H
00031
00032 #include <EpetraExt_Transform.h>
00033
00034 #include <vector>
00035
00036 class Epetra_LinearProblem;
00037 class Epetra_VbrMatrix;
00038 class Epetra_SerialDenseSVD;
00039 class Epetra_SerialDenseMatrix;
00040
00041 namespace EpetraExt {
00042
00043 class LinearProblem_BlockJacobi : public SameTypeTransform<Epetra_LinearProblem> {
00044
00045 public:
00046
00047 ~LinearProblem_BlockJacobi();
00048
00049 LinearProblem_BlockJacobi( int verbose = 0,
00050 int thresholding = 0,
00051 double rthresh = 0.0,
00052 double athresh = 0.0,
00053 bool removeDiag = false )
00054 : NumBlocks_(0),
00055 NewProblem_(0),
00056 NewMatrix_(0),
00057 thresholding_(thresholding),
00058 rthresh_(rthresh),
00059 athresh_(athresh),
00060 removeDiag_(removeDiag),
00061 verbose_(verbose)
00062 {}
00063
00064 NewTypeRef operator()( OriginalTypeRef orig );
00065
00066 bool fwd();
00067 bool rvs();
00068
00069 void RThresh( double val ) { rthresh_ = val; }
00070
00071 private:
00072
00073 int NumBlocks_;
00074
00075 double rthresh_;
00076 double athresh_;
00077 const int thresholding_;
00078
00079 const bool removeDiag_;
00080
00081 Epetra_LinearProblem * NewProblem_;
00082 Epetra_VbrMatrix * NewMatrix_;
00083
00084 std::vector<Epetra_SerialDenseMatrix**> VbrBlocks_;
00085 std::vector<int> VbrBlockCnt_;
00086 std::vector<int> VbrBlockDim_;
00087 std::vector<int*> VbrBlockIndices_;
00088
00089 std::vector<Epetra_SerialDenseSVD*> SVDs_;
00090 std::vector<Epetra_SerialDenseMatrix*> Inverses_;
00091 std::vector<Epetra_SerialDenseMatrix*> RHSBlocks_;
00092
00093 const int verbose_;
00094 };
00095
00096 }
00097
00098 #endif //EPETRAEXT_BLOCKJACOBI_LINEARPROBLEM_H