NeoPZ
TPZParFrontMatrix.h
Go to the documentation of this file.
1 
6 #ifndef TPZPARFRONTMATRIX_H
7 #define TPZPARFRONTMATRIX_H
8 #include "TPZFrontMatrix.h"
9 #include "TPZFront.h"
10 #include "TPZFrontNonSym.h"
11 #include "TPZFrontSym.h"
12 
13 #include "pz_pthread.h"
14 
15 #include "TPZStackEqnStorage.h"
16 #include "pzvec.h"
17 #include "pzstack.h"
18 #include "TPZFileEqnStorage.h"
19 #include "pzmatrix.h"
20 #include "pzfmatrix.h"
21 
22 struct TPZElementMatrix;
23 class TPZCompMesh;
24 
25 template<class TVar>
26 class TPZEqnArray;
27 
28 
38 template <class TVar, class store, class front>
39 class TPZParFrontMatrix : public TPZFrontMatrix<TVar, store, front>
40 {
41  public:
42 int ClassId() const override;
44  static void * WriteFile(void *t);
45 
54  TPZParFrontMatrix(int64_t globalsize);
55 
57  TPZFrontMatrix<TVar, store,front>(cp), fFinish(0)
58  {
59  fEqnStack.Resize(0);
60  pthread_mutex_t mlocal = PTHREAD_MUTEX_INITIALIZER;
61  fwritelock = mlocal;
62  pthread_cond_t clocal = PTHREAD_COND_INITIALIZER;
63  fwritecond = clocal;
64  }
65 
66  //CLONEDEF(TPZParFrontMatrix)
67  virtual TPZMatrix<TVar>*Clone() const override { return new TPZParFrontMatrix(*this); }
68 
75  virtual void AddKel(TPZFMatrix<TVar> & elmat, TPZVec < int64_t > & sourceindex, TPZVec < int64_t > & destinationindex) override;
76 
82  virtual void AddKel(TPZFMatrix<TVar> & elmat, TPZVec < int64_t > & destinationindex) override;
83 
85  void FinishWriting();
86 
87 private:
91  int fFinish;
93  pthread_mutex_t fwritelock;
95  pthread_cond_t fwritecond;
96 
98  /*# TPZFrontNonSym lnkTPZFrontNonSym; */
99 
101  /*# TPZFrontSym lnkTPZFrontSym; */
102 };
103 
104 template <class TVar, class store, class front>
106  return Hash("TPZParFrontMatrix") ^ TPZFrontMatrix<TVar, store, front>::ClassId() << 1;
107 }
108 #endif //TPZPARFRONTMATRIX_H
Contains the TPZFrontSym class which implements decomposition process of the frontal matrix (case sym...
TPZParFrontMatrix()
Simple Constructor.
FrontMatrix with parallel techniques included. Frontal.
Responsible for the frontal method as a whole. Frontal.
int fFinish
Boolean responsibility. Assumes values 0 and 1.
It is an equation array, generally in its decomposed form. Frontal.
Definition: tpzeqnarray.h:36
Contains the TPZFront class which implements decomposition process of the frontal matrix...
virtual TPZMatrix< TVar > * Clone() const override
Templated vector implementation.
TPZParFrontMatrix(const TPZParFrontMatrix &cp)
Contains the TPZFrontNonSym class which implements storage and decomposition process of the frontal m...
static void * WriteFile(void *t)
Used in an independent thread to write decomposed equations to a binary file.
TPZStack< TPZEqnArray< TVar > * > fEqnStack
Buffer of pointers to decomposed equations. Stored in a Stack.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Definition: pzmanvector.h:426
pthread_cond_t fwritecond
Condition variable used in management of writeing to disk and decomposition.
Contains TPZMatrixclass which implements full matrix (using column major representation).
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 void AddKel(TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &sourceindex, TPZVec< int64_t > &destinationindex) override
Add a contribution of a stiffness matrix.
A simple stack.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
Contains TPZMatrix<TVar>class, root matrix class.
~TPZParFrontMatrix()
Simple Destructor.
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
Definition: pzelmat.h:30
This class implements a stack object. Utility.
Definition: pzcheckmesh.h:14
Contains the TPZStackEqnStorage class responsible for storing arrays of equations.
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
Contains the TPZAbstractFrontMatrix class which implements a matrix stored in a frontal decomposition...
void FinishWriting()
Sets the flag fFinish to its true value.
pthread_mutex_t fwritelock
Mutual exclusion locks used in management of writeing to disk and decomposition.
int ClassId() const override
Define the class id associated with the class.
Root matrix class (abstract). Matrix.
Definition: pzmatrix.h:60