NeoPZ
tpzdohrsubstruct.h
Go to the documentation of this file.
1 
6 #ifndef TPZDOHRSUBSTRUCT_H
7 #define TPZDOHRSUBSTRUCT_H
8 
9 #include "pzfmatrix.h"
10 #include "tpzautopointer.h"
11 #include "pzstepsolver.h"
12 
18 #ifndef MAKEINTERNAL
19 #define MAKEINTERNAL
20 #endif
21 
27 template<class TVar>
28 class TPZDohrSubstruct : public TPZSavable {
29  // @TODO implement the interface to make the substruct class actually saveable
30 public:
32 
34 
36 
37  int ClassId() const override {
38  return Hash("TPZDohrSubstruct") ^ ClassIdOrHash<TVar>() << 1;
39  }
40 
42 
44  void ReallocMatRed() {};
45 
56 
57  void ContributeTestV1(TPZFMatrix<TVar> &testV1, int NumCoarse);
62  void LoadWeightedResidual(const TPZFMatrix<TVar> &r_global);
63 
66  void AdjustResidual(TPZFMatrix<TVar> &r_global);
72  void Contribute_rc_local(TPZFMatrix<TVar> &residual_local, TPZFMatrix<TVar> &rc_local) const;
74  void Contribute_Kc(TPZMatrix<TVar> &Kc, TPZVec<int> &coarseindex);
81  void Contribute_v1(TPZFMatrix<TVar> &v1, TPZFMatrix<TVar> &invKc_rc);
88  void Contribute_v1_local(TPZFMatrix<TVar> &v1_local, TPZFMatrix<TVar> &invKc_rc) const;
92  void Contribute_v2_local(TPZFMatrix<TVar> &residual_local, TPZFMatrix<TVar> &v2_local);
99  void Contribute_v3(TPZFMatrix<TVar> &v3, const TPZFMatrix<TVar> &r, TPZFMatrix<TVar> &v1Plusv2) const;
105  void Contribute_v3_local(TPZFMatrix<TVar> &v3, TPZFMatrix<TVar> &v1Plusv2) const;
106 
107  void Print(std::ostream &out) const;
111  void ContributeKU(const TVar alpha, const TPZFMatrix<TVar> &uglobal, TPZFMatrix<TVar> &z) const;
112 
114  void ContributeKULocal(const TVar alpha, const TPZFMatrix<TVar> &u, TPZFMatrix<TVar> &z) const;
119  void ContributeGlobalDiagonal(TPZFMatrix<TVar> &StiffnessDiag);
124  void ContributeDiagonalLocal(TPZFMatrix<TVar> &StiffnessDiag);
129  void ComputeWeights(TPZFMatrix<TVar> &StiffnessDiag);
134  void ComputeWeightsLocal(TPZFMatrix<TVar> &StiffnessDiagLocal);
138  void Initialize();
139 
140  //Daqui pra baixo são funcões cujos nomes foram dados pelo Phil
144  void GetCoarseResidual(TPZFMatrix<TVar> &rc, TPZVec<int> &indices);
145 
149  void GetCoarseStiffness(TPZMatrix<TVar> &stiff, TPZVec<int> &indices);
150 public:
154  void PrepareSystems();
157  void SolveSystemPhi();
160  void SolveSystemZi();
162  void ComputeCoarseStiffness();
165 
168  TPZFMatrix<TVar> fKeC_star; //K_star_inv*C_star_trans
171 
174 
175  int NumEquations() const
176  {
177  return fNEquations;
178  }
183 
191 
197  TPZManVector<TVar> fWeights; //W(i) = diagonal(fWeights)
207 
208 
216  mutable TPZStepSolver<TVar> fInvertedInternalStiffness; //R(Ii)*K(i)*R(Ii)invertida
219  TPZStepSolver<TVar> fKCInvert; //K(c) invertida
227  TPZFMatrix<TVar> fLocalLoad; //F(i) - Actually it's a vector
229  TPZFMatrix<TVar> fLocalWeightedResidual; //W(i)*R(i)*r - Actually it's a vector
232 
236 
237 };
238 
239 #endif
TPZVec< int > fCoarseNodes
void ComputeWeightsLocal(TPZFMatrix< TVar > &StiffnessDiagLocal)
Computes the weight matrix.
void GetCoarseResidual(TPZFMatrix< TVar > &rc, TPZVec< int > &indices)
Assembles the contribution to the coarse residual.
void Contribute_Kc(TPZMatrix< TVar > &Kc, TPZVec< int > &coarseindex)
It computes the local contribution to K(c)
TPZFMatrix< TVar > fLocalWeightedResidual
Local weighted residual - .
void Contribute_v1(TPZFMatrix< TVar > &v1, TPZFMatrix< TVar > &invKc_rc)
It computes the local contribution to v1.
TPZFMatrix< TVar > fPhiC_Weighted_Condensed
Phi * W matrix and condensed to the equations which are part of the global system.
TPZVec< int > fGlobalIndex
Global vector indices of the equations/degrees of freedom.
TPZVec< int > fInternalEqs
Internal nodes.
void Contribute_v3(TPZFMatrix< TVar > &v3, const TPZFMatrix< TVar > &r, TPZFMatrix< TVar > &v1Plusv2) const
It computes the local contribution to v(3)
void ContributeKU(const TVar alpha, const TPZFMatrix< TVar > &uglobal, TPZFMatrix< TVar > &z) const
Contribute to the global matrix vector multiplication. It&#39;s needed to the MultAdd method of TPZDohrMa...
int NumEquations() const
void SolveSystemPhi()
Solves the system for Phi and for v2.
void ContributeTestV1(TPZFMatrix< TVar > &testV1, int NumCoarse)
TPZVec< int > fCoarseIndex
Global index associated with each coarse degree of freedom.
TPZFMatrix< TVar > fLocalLoad
Local load vector.
TPZStepSolver< TVar > fInvertedStiffness
Inverted (LU or Cholesky) stiffness matrix.
Defines step solvers class. Solver.
Definition: pzmganalysis.h:17
void PrepareSystems()
It prepares the datas for solving systems for phi and zi.
void ComputeWeights(TPZFMatrix< TVar > &StiffnessDiag)
Computes the weight matrix.
void ContributeResidual(TPZFMatrix< TVar > &u, TPZFMatrix< TVar > &r)
ContributeResidual.
void Contribute_v2(TPZFMatrix< TVar > &v2)
It computes the local contribution to v2.
Implements sub structure matrices using Dohrman algorithm. Sub Structure.
void GetCoarseStiffness(TPZMatrix< TVar > &stiff, TPZVec< int > &indices)
Assembles the coarse dof stiffness matrix.
void ContributeKULocal(const TVar alpha, const TPZFMatrix< TVar > &u, TPZFMatrix< TVar > &z) const
Compute the multiplication of the local stiffness matrix with the vector u.
TPZFMatrix< TVar > fzi
Needed to compute v2. Is the solution of a system.
void AdjustResidual(TPZFMatrix< TVar > &r_global)
Adjust the residual to reflect a static condensation.
void SolveSystemZi()
Solves the system for zi.
TPZFMatrix< TVar > fC
Constraint definition associated with this substructure.
TPZFMatrix< TVar > fKCi
Stiffness matrix associated with the constraints.
void Contribute_rc(TPZFMatrix< TVar > &rc)
It computes the local contribution to r(c).
int ClassId() const override
Define the class id associated with the class.
Contains TPZMatrixclass which implements full matrix (using column major representation).
void ComputeCoarseStiffness()
Computes K(ci) and stores it in fKCi.
TPZVec< std::pair< int, int > > fGlobalEqs
Indices of the equations in the global system corresponding to the local equations.
TPZAutoPointer< TPZMatrix< TVar > > fStiffness
Stiffness matrix associated with the substructure.
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
int fNEquations
Number of equations of the substructure.
void ContributeGlobalDiagonal(TPZFMatrix< TVar > &StiffnessDiag)
Computes the contribution of each substructure node to global Stiffness diagonal (or something like t...
Full matrix class. Matrix.
Definition: pzfmatrix.h:32
TPZManVector< TVar > fWeights
Weights associated with each variable/equation.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
static EWeightType fWeightType
void LoadWeightedResidual(const TPZFMatrix< TVar > &r_global)
It computes W(i)*R(i)*r and stores it in fLocalWeightedResidual;.
TPZFMatrix< TVar > fC_star
Variables needed to solve the systems for phi and zi.
void Print(std::ostream &out) const
TPZFMatrix< TVar > fKeC_star
void Contribute_v1_local(TPZFMatrix< TVar > &v1_local, TPZFMatrix< TVar > &invKc_rc) const
It computes the local contribution to v1.
TPZFMatrix< TVar > fNullPivots
void AddInternalSolution(TPZFMatrix< TVar > &sol)
Add the internal solution to the final result.
TPZVec< int > fBoundaryEqs
Equations corresponding to boundary of the substructure.
void ContributeDiagonalLocal(TPZFMatrix< TVar > &StiffnessDiag)
Computes the contribution of each substructure node to global Stiffness diagonal (or something like t...
Contains TPZStepSolver class which defines step solvers class.
TPZStepSolver< TVar > fKCInvert
Inverted restraint matrix.
TPZStepSolver< TVar > fInvertedInternalStiffness
Inverted (LU or Cholesky or LDLt) stiffness matrix for the internal degrees of freedom.
void Contribute_v2_local(TPZFMatrix< TVar > &residual_local, TPZFMatrix< TVar > &v2_local)
It computes the local contribution to v2.
TPZFMatrix< TVar > fAdjustSolution
Solution vector which needs to be added to the converged system solution.
TPZFMatrix< TVar > fPhiC
Vectors associated with each constraint.
void Initialize()
Initializes the substructure.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Definition: TPZSavable.h:67
TPZStepSolver< TVar > finv
void Contribute_v3_local(TPZFMatrix< TVar > &v3, TPZFMatrix< TVar > &v1Plusv2) const
It computes the local contribution to v(3)
Root matrix class (abstract). Matrix.
Definition: pzmatrix.h:60
void Contribute_rc_local(TPZFMatrix< TVar > &residual_local, TPZFMatrix< TVar > &rc_local) const
It computes the local contribution to r(c).
This class implements a reference counter mechanism to administer a dynamically allocated object...