NeoPZ
TPZFrontMatrix.h
Go to the documentation of this file.
1 
6 #ifndef TPZFRONTMATRIX_H
7 #define TPZFRONTMATRIX_H
8 
9 
10 #include "TPZFront.h"
11 #include "TPZFrontNonSym.h"
12 #include "TPZFrontSym.h"
13 
14 
15 #include "TPZStackEqnStorage.h"
16 #include "pzvec.h"
17 #include "TPZFileEqnStorage.h"
18 #include "pzmatrix.h"
19 #include "pzfmatrix.h"
20 #include "pzlog.h"
21 
29 template<class TVar>
30 class TPZAbstractFrontMatrix : public TPZMatrix<TVar>
31 {
32 public:
33 
35  {
36  }
37 
38  TPZAbstractFrontMatrix(int64_t ieq, int64_t jeq) : TPZMatrix<TVar>(ieq,jeq)
39  {
40  }
41 
42  virtual TPZFront<TVar> & GetFront() = 0;
43 
44 int ClassId() const override;
45 };
46 
47 template<class TVar>
49  return Hash("TPZAbstractFrontMatrix") ^ TPZMatrix<TVar>::ClassId() << 1;
50 }
51 
58 template <class TVar, class store, class front>
59 class TPZFrontMatrix : public TPZAbstractFrontMatrix<TVar> {
60 protected:
61 
63  store fStorage;
64 
66  front fFront;
67 public:
68  int Work();
70  void FinishWriting();
72  void ReOpen();
73 
75  virtual int Zero() override;
77  void AllocData();
78 
80  TPZFront<TVar> &GetFront() override { return fFront;}
83  void CheckCompress();
85  static void main();
87  void Print(const char * name, std::ostream & out ,const MatrixOutputFormat form = EFormatted) const override;
89  ~TPZFrontMatrix();
90 int ClassId() const override;
97  TPZFrontMatrix(int64_t globalsize);
98 
99  TPZFrontMatrix(const TPZFrontMatrix &cp) : TPZRegisterClassId(&TPZFrontMatrix::ClassId),TPZAbstractFrontMatrix<TVar>(cp), fStorage(cp.fStorage),
100  fFront(cp.fFront),fNumEq(cp.fNumEq),fLastDecomposed(cp.fLastDecomposed), fNumElConnected(cp.fNumElConnected),fNumElConnectedBackup(cp.fNumElConnectedBackup)
101  {
102  }
103 
104  // CLONEDEF(TPZFrontMatrix)
105  virtual TPZMatrix<TVar>*Clone() const override { return new TPZFrontMatrix(*this); }
112  void EquationsToDecompose(TPZVec<int64_t> &destinationindex, int64_t &lower_eq, int64_t &upper_eq);
113 
114 
116  // void AssembleMatrix(TPZVec < int > & eqnumbers, TPZFMatrix<REAL> & ek, TPZFMatrix<REAL> & ef);
117 
122  void SetNumElConnected(TPZVec < int > &numelconnected);
123 
129  virtual void AddKel(TPZFMatrix<TVar> & elmat, TPZVec < int64_t > & destinationindex) override;
130 
135  void SymbolicAddKel(TPZVec < int64_t > & destinationindex);
136 
143  virtual void AddKel(TPZFMatrix<TVar> & elmat, TPZVec < int64_t > & sourceindex, TPZVec < int64_t > & destinationindex) override ;
144 
145  virtual int SolveDirect(TPZFMatrix<TVar> &B ,const DecomposeType dt, std::list<int64_t> &singular) override;
150  int Subst_Forward(TPZFMatrix<TVar> *b) const override;
151 
153  int Subst_Backward(TPZFMatrix<TVar> *b) const override;
156  int Substitution(TPZFMatrix<TVar> *) const override;
157  /*
158  void SetFileName(
159  const char *name = SetTempFileName() //! Name of the file
160  );
161  */
162 
168  void SetFileName(char option, const char *name);
169 
170 protected:
172  int64_t fNumEq;
175 
177  // TPZFront fFront;
178 
180  //TPZStackEqnStorage fStorage;
181 
184 
190 
194  //TPZFileEqnStorage fFileEqnStorage;
195 };
196 
199 #endif //TPZFRONTMATRIX_H
Contains the TPZFrontSym class which implements decomposition process of the frontal matrix (case sym...
int64_t fNumEq
Indicates number of equations.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
Responsible for the frontal method as a whole. Frontal.
Contains the TPZFront class which implements decomposition process of the frontal matrix...
TPZFront< TVar > & GetFront() override
returns a pointer to the front matrix
Templated vector implementation.
Implements a matrix stored in a frontal decomposition scheme. Frontal.
virtual int Zero()
Zeroes the matrix.
Definition: pzmatrix.h:296
store fStorage
Indicates storage schema. Assumes values TPZFileEqnStorage for binary file and TPZStackEqnStorage for...
MatrixOutputFormat
Defines output format.
Definition: pzmatrix.h:55
Contains the TPZFrontNonSym class which implements storage and decomposition process of the frontal m...
virtual int Subst_Forward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is lower triangular.
Definition: pzmatrix.cpp:1284
TPZVec< int > fNumElConnectedBackup
Contains the number of elements which still need to contribute to a given equation.
Abstract class implements storage and decomposition process of the frontal matrix. Frontal.
Contains TPZMatrixclass which implements full matrix (using column major representation).
int64_t fLastDecomposed
Indicates last decomposed equation.
virtual void AddKel(TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &destinationindex)
Add a contribution of a stiffness matrix.
Definition: pzmatrix.cpp:506
front fFront
Indicates Front matrix type. Assumes values TPZFrontSym for symmetric front and TPZFrontNonSym for no...
int ClassId() const override
Define the class id associated with the class.
Full matrix class. Matrix.
Definition: pzfmatrix.h:32
Contains the TPZFileEqnStorage class which implements an equation array and stores the EqnArrays...
virtual TPZFront< TVar > & GetFront()=0
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
Contains TPZMatrix<TVar>class, root matrix class.
TPZVec< int > fNumElConnected
Contains the number of elements which still need to contribute to a given equation.
Contains the TPZStackEqnStorage class responsible for storing arrays of equations.
virtual void Print(std::ostream &out) const
Definition: pzmatrix.h:253
TPZFrontMatrix(const TPZFrontMatrix &cp)
virtual int Substitution(TPZFMatrix< TVar > *B) const
Computes Forward and Backward substitution for a "LU" decomposed matrix.
Definition: pzmatrix.cpp:1151
TPZAbstractFrontMatrix(int64_t ieq, int64_t jeq)
int main()
Definition: benchadolc.cc:42
virtual TPZMatrix< TVar > * Clone() const override
virtual int SolveDirect(TPZFMatrix< TVar > &F, const DecomposeType dt, std::list< int64_t > &singular)
Solves the linear system using Direct methods.
Definition: pzmatrix.cpp:710
int ClassId() const override
Define the class id associated with the class.
Definition: pzmatrix.h:957
DecomposeType
Defines decomposition type for any matrix classes.
Definition: pzmatrix.h:52
virtual int Subst_Backward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is upper triangular.
Definition: pzmatrix.cpp:1309
Root matrix class (abstract). Matrix.
Definition: pzmatrix.h:60