NeoPZ
TPZStructMatrixBase.h
Go to the documentation of this file.
1 #ifndef TPZSTRUCTMATRIXBASE_H
2 #define TPZSTRUCTMATRIXBASE_H
3 
4 #include "TPZEquationFilter.h"
5 #include "tpzautopointer.h"
6 
7 class TPZCompMesh;
8 
9 template <class T> class TPZMatrix;
10 
11 template <class T> class TPZFMatrix;
12 
13 class TPZGuiInterface;
14 
16 public:
17  virtual void SetMesh(TPZCompMesh *);
18 
20 
21  virtual TPZStructMatrixBase *Clone() = 0;
22 
23  virtual TPZMatrix<STATE> * Create() = 0;
24 
25  virtual void Assemble(TPZMatrix<STATE> &stiffness, TPZFMatrix<STATE> &rhs,
26  TPZAutoPointer<TPZGuiInterface> guiInterface) = 0;
27 
28  virtual void Assemble(TPZFMatrix<STATE> &rhs,
29  TPZAutoPointer<TPZGuiInterface> guiInterface) = 0;
30 
31  virtual TPZMatrix<STATE> *
33  TPZAutoPointer<TPZGuiInterface> guiInterface);
34 
36  virtual void FilterEquations(TPZVec<int64_t> &origindex, TPZVec<int64_t> &destindex) const;
37 
39  virtual void SetMaterialIds(const std::set<int> &materialids);
40 
41  inline virtual void SetNumThreads(int n) {
42  this->fNumThreads = n;
43  }
44 
45  inline virtual int GetNumThreads() const {
46  return this->fNumThreads;
47  }
48 
49  inline virtual void SetEquationRange(int64_t mineq, int64_t maxeq) {
51  fEquationFilter.SetMinMaxEq(mineq, maxeq);
52  }
53 
55  inline virtual bool HasRange() const {
56  return fEquationFilter.IsActive();
57  }
58 
60  inline virtual TPZEquationFilter &EquationFilter() {
61  return fEquationFilter;
62  }
63 
65  inline virtual int64_t NReducedEquations() const {
67  }
68 
70  inline virtual TPZCompMesh *Mesh() const {
71  return fMesh;
72  }
73 
75  virtual bool ShouldCompute(int matid) const
76  {
77  const unsigned int size = fMaterialIds.size();
78  return size == 0 || fMaterialIds.find(matid) != fMaterialIds.end();
79  }
81  virtual const std::set<int> &MaterialIds()
82  {
83  return fMaterialIds;
84  }
85 
86  public:
87  int ClassId() const override;
88  void Read(TPZStream& buf, void* context) override;
89  void Write(TPZStream& buf, int withclassid) const override;
90  virtual ~TPZStructMatrixBase() {}
91  protected:
96 
97  protected:
108  std::set<int> fMaterialIds;
111 };
112 
113 
115 #include "pzstrmatrix.h"
117 
119 //#include "pzstrmatrixst.h"
120 //typedef TPZStructMatrixST TPZStructMatrix;
121 
123 //#include "pzstrmatrixcs.h"
124 //typedef TPZStructMatrixCS TPZStructMatrix;
125 
127 //#include "pzstrmatrixgc.h"
128 //typedef TPZStructMatrixGC TPZStructMatrix;
129 
132 //#include "pzstrmatrixot.h"
133 //typedef TPZStructMatrixOT TPZStructMatrix;
134 
137 //#include "TPZStrMatrixGCTP.h"
138 //typedef TPZStructMatrixGCTP TPZStructMatrix;
139 
141 //https://trac.macports.org/wiki/MigrationTBB
142 //#include "pzstrmatrixtbb.h"
143 //typedef TPZStructMatrixTBB TPZStructMatrix;
144 
148 //#include "pzstrmatrixflowtbb.h"
149 //typedef TPZStructMatrixTBBFlow TPZStructMatrix;
150 
151 #endif // TPZSTRUCTMATRIXBASE_H
int fNumThreads
Number of threads in Assemble process.
virtual TPZMatrix< STATE > * CreateAssemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
virtual void SetMesh(TPZCompMesh *)
virtual void SetEquationRange(int64_t mineq, int64_t maxeq)
virtual TPZCompMesh * Mesh() const
Access method for the mesh pointer.
virtual TPZEquationFilter & EquationFilter()
access method for the equation filter
virtual TPZStructMatrixBase * Clone()=0
TPZEquationFilter fEquationFilter
Object which will determine which equations will be assembled.
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
int ClassId() const override
Define the class id associated with the class.
Refines geometrical mesh (all the elements) num times.
Definition: pzstrmatrix.h:35
virtual void Assemble(TPZMatrix< STATE > &stiffness, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)=0
TPZCompMesh * fMesh
Pointer to the computational mesh from which the matrix will be generated.
virtual const std::set< int > & MaterialIds()
Returns the material ids.
int64_t NActiveEquations() const
Retorna o numero de equacoes ativas do sistema.
virtual void SetNumThreads(int n)
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
virtual bool ShouldCompute(int matid) const
Establish whether the element should be computed.
std::set< int > fMaterialIds
Set of material ids to be considered. It is a private attribute.
Full matrix class. Matrix.
Definition: pzfmatrix.h:32
virtual TPZMatrix< STATE > * Create()=0
virtual void SetMaterialIds(const std::set< int > &materialids)
Set the set of material ids which will be considered when assembling the system.
This class implements a very simple interface from PZ kernel to GUI. Module: Common.
void SetMinMaxEq(int64_t mineq, int64_t maxeq)
Define as equacoes ativas de [mineq, maxeq)
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
virtual int GetNumThreads() const
virtual void FilterEquations(TPZVec< int64_t > &origindex, TPZVec< int64_t > &destindex) const
Filter out the equations which are out of the range.
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
virtual int64_t NReducedEquations() const
number of equations after applying the filter
TPZStructMatrixOR TPZStructMatrix
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Definition: TPZSavable.h:67
virtual bool HasRange() const
Verify if a range has been specified.
void Read(TPZStream &buf, void *context) override
read objects from the stream
TPZAutoPointer< TPZCompMesh > fCompMesh
Autopointer control of the computational mesh.
void Reset()
Reset method.
Root matrix class (abstract). Matrix.
Definition: pzmatrix.h:60