NeoPZ
pzelmat.h
Go to the documentation of this file.
1 
6 #ifndef ELMATHPP
7 #define ELMATHPP
8 
9 
10 #include "pzmatrix.h"
11 #include "pzblock.h"
12 #include "pzconnect.h"
13 #include "pzfmatrix.h"
14 #include "pzmanvector.h"
15 #include "pzstack.h"
16 #include "TPZOneShapeRestraint.h"
17 
18 
19 
20 
31 
32  enum MType{Unknown = 0, EF = 1, EK = 2};
33 
35 
37 
47  //TPZFNMatrix<1000> fConstrMat;
50  //TPZBlock<REAL> fConstrBlock;
52 
54 
56  std::list<TPZOneShapeRestraint> fOneRestraints;
57 
59  void Reset(TPZCompMesh *mesh = NULL, MType type=Unknown)
60  {
61  fMesh = mesh;
62  fType = type;
63  fConnect.Resize(0);
64  fMat.Resize(0,0);
65  fBlock.SetNBlocks(0);
66  fConstrConnect.Resize(0);
67  fConstrMat.Resize(0,0);
68  fConstrBlock.SetNBlocks(0);
69  }
70 
71  TPZElementMatrix(TPZCompMesh *mesh, MType type) : fType(type), fMesh(mesh), fConnect(), fMat(0,0), fBlock(), fConstrConnect(), fConstrMat(0,0), fConstrBlock()
72  {
73  fBlock.SetMatrix(&fMat);
74  fConstrBlock.SetMatrix(&fConstrMat);
75  }
76 
77  TPZElementMatrix() : fType(Unknown), fMesh(NULL), fConnect(), fMat(0,0), fBlock(&fMat), fConstrConnect(),
78  fConstrMat(0,0), fConstrBlock(&fConstrMat)
79  {}
80 
82 
84  }
85 
87  int NConnects(){
88  return fConnect.NElements();
89  }
90 
92  int64_t ConnectIndex(int i)const{
93  return fConnect[i];
94  }
95 
96  void Print(std::ostream &out);
97 
98  void SetMatrixSize(short NumBli, short NumBlj, short BlSizei, short BlSizej);
99 
100  void SetMatrixMinSize(short NumBli, short NumBlj, short BlMinSizei, short BlMinSizej);
101 
103 
105  void PermuteGather(TPZVec<int64_t> &permute);
106 
107 
109  bool HasDependency();
110 
112  void ApplyConstraints();
113 
115  void ApplyOneShapeConstraints(int constraintindex);
116 
118  void BuildDependencyOrder(TPZVec<int64_t> &connectlist, TPZVec<int> &DependenceOrder, TPZCompMesh &mesh);
119 
120 };
121 
122 #endif
void SetMatrixMinSize(short NumBli, short NumBlj, short BlMinSizei, short BlMinSizej)
Definition: pzelmat.cpp:27
TPZBlock< STATE > fConstrBlock
Block structure associated with fConstrMat.
Definition: pzelmat.h:51
void BuildDependencyOrder(TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder, TPZCompMesh &mesh)
Compute the dependency order of the connects, considering the one shape restraints.
Definition: pzelmat.cpp:551
TPZStack< int64_t > fConnect
Vector of pointers to TPZConnect objects.
Definition: pzelmat.h:39
void ApplyOneShapeConstraints(int constraintindex)
Apply the constraint of the one shape restraints.
Definition: pzelmat.cpp:390
TPZFNMatrix< 1000, STATE > fMat
Pointer to a blocked matrix object.
Definition: pzelmat.h:41
std::list< TPZOneShapeRestraint > fOneRestraints
list of one degree of freedom restraints
Definition: pzelmat.h:56
TPZBlock< STATE > fBlock
Block structure associated with fMat.
Definition: pzelmat.h:43
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Definition: pzmanvector.h:426
TPZManVector< int64_t > fDestinationIndex
Definition: pzelmat.h:53
void ComputeDestinationIndices()
Definition: pzelmat.cpp:126
TPZElementMatrix(TPZCompMesh *mesh, MType type)
Definition: pzelmat.h:71
int64_t ConnectIndex(int i) const
Returns the pointer to the ith node of the element.
Definition: pzelmat.h:92
void Print(std::ostream &out)
Definition: pzelmat.cpp:47
int NConnects()
Returns the number of nodes of TElementMatrix.
Definition: pzelmat.h:87
void SetMatrixSize(short NumBli, short NumBlj, short BlSizei, short BlSizej)
Definition: pzelmat.cpp:18
Contains TPZMatrixclass which implements full matrix (using column major representation).
Contains declaration of TPZConnect class which represents a set of shape functions associated with a ...
TPZStack< int64_t > fConstrConnect
Vector of all nodes connected to the element.
Definition: pzelmat.h:45
Free store vector implementation.
TPZCompMesh * fMesh
Definition: pzelmat.h:36
TPZManVector< int64_t > fSourceIndex
Definition: pzelmat.h:53
int SetNBlocks(const int num_of_blocks)
Sets number of blocks on diagonal matrix.
Definition: pzblock.cpp:91
A simple stack.
Contains TPZMatrix<TVar>class, root matrix class.
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
Definition: pzelmat.h:30
TPZFNMatrix< 1000, STATE > fConstrMat
Pointer to the constrained matrix object.
Definition: pzelmat.h:48
void ApplyConstraints()
Apply the constraints applied to the nodes by transforming the tangent matrix and right hand side...
Definition: pzelmat.cpp:186
void PermuteGather(TPZVec< int64_t > &permute)
permute the order of the connects
Definition: pzelmat.cpp:502
void Reset(TPZCompMesh *mesh=NULL, MType type=Unknown)
Reset the data structure.
Definition: pzelmat.h:59
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
void SetMatrix(TPZMatrix< TVar > *const other)
Changes pointer to other.
Definition: pzblock.h:51
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Definition: pzfmatrix.cpp:1016
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
bool HasDependency()
Returns true if the element has at least one dependent node. Returns false otherwise.
Definition: pzelmat.cpp:482