00001
00002
00003 #ifndef _SPARSEGRIDMTX_H__
00004 #define _SPARSEGRIDMTX_H__
00005
00006 #include "SparseGridColumn.h"
00007 #include "SparseMatrixF.h"
00008 #include "Ordering.h"
00009 #include "BigMatrix.h"
00010
00011 DSS_NAMESPASE_BEGIN
00012
00013
00014
00015
00016 class SparseGridMtx :
00017 public TraceableMatrix,
00018 public ILargeMatrix
00019 {
00020 public:
00021
00022
00023 SparseGridMtx(SparseMatrixF& sm,BYTE block_size,Ordering* block_order,MathTracer* eMT);
00024
00025
00026
00027 SparseGridMtx(SparseMatrixF& sm,BYTE block_size,Ordering* block_order,Ordering* node_order,MathTracer* eMT);
00028
00029 virtual ~SparseGridMtx();
00030
00031 public:
00032 long block_size;
00033
00034
00035 long block_storage;
00036
00037 DenseMatrixArithmetics* BlockArith;
00038 SparseGridColumn** Columns;
00039 Ordering* node_order;
00040
00041 Ordering* block_order;
00042
00043
00044
00045 protected:
00046 long n;
00047 long n_blocks;
00048
00049 long noDummyDOFs;
00050
00051 long nonzeros;
00052 long blocks;
00053
00054
00055 long no_multiplications;
00056
00057 public:
00058 long N() const {return n;}
00059 long Nonzeros() const {return (long)columns_data_length;}
00060
00061
00062 long Blocks() {return blocks;}
00063 long BlockSize() {return block_size;}
00064
00065
00066 long N_blocks() {return n_blocks;}
00067
00068
00069 long No_Multiplications() {return no_multiplications;}
00070
00071
00072 long columns_data_length;
00073
00074
00075 void ComputeBlocks();
00076 double GetWaste();
00077
00078 void AlocateMemoryByPattern(IConectMatrix* bskl);
00079
00080
00081
00082 void WriteStatistics(long no_init_blocks,long no_nonzeros);
00083 virtual void LoadMatrixNumbers(SparseMatrixF& sm) PURE;
00084 virtual void SolveLV(const LargeVector& b, LargeVector& x) PURE;
00085 virtual void Solve(double* b, double* x) PURE;
00086 virtual void MultiplyByVector(const LargeVectorAttach& x, LargeVectorAttach& y);
00087 virtual void Factorize() PURE;
00088
00089 public:
00090
00091 virtual void SchurComplementFactorization(int fixed_blocks) = 0;
00092 virtual void SolveA11(double* x,long fixed_blocks) = 0;
00093 virtual void Sub_A21_A11inv(double* x,long fixed_blocks) = 0;
00094 virtual void Sub_A11inv_A12(double* x,long fixed_blocks) = 0;
00095 virtual void WriteCondensedMatrixA22(double* a,Ordering* mcn,IntArrayList* lncn) = 0;
00096
00097 };
00098
00099 DSS_NAMESPASE_END
00100
00101 #endif// _SPARSEGRIDMTX_H__