NeoPZ
pzsmfrontalanal.cpp
Go to the documentation of this file.
1 
6 #include "pzsmfrontalanal.h"
7 #include "pzsubcmesh.h"
8 #include "pzfmatrix.h"
9 #include "TPZFrontStructMatrix.h"
10 #include "pzstrmatrix.h"
11 #include "pzsolve.h"
12 
13 using namespace std;
14 
15 // Construction/Destruction
16 
18  fMesh = mesh;
19  fFront = 0;
20 }
21 
23 {
24 
25 }
26 
27 void TPZSubMeshFrontalAnalysis::Run(std::ostream &out){
28 
29  //fReducableStiff.Print("Reducable stiff before assembled");
31  Assemble();
32  // fSolver->Solve(fRhs, fRhs);
33  if(fSolver->Matrix()->IsDecomposed() == ELU)
34  {
36  } else if(fSolver->Matrix()->IsDecomposed() == ECholesky)
37  {
39  } else if(fSolver->Matrix()->IsDecomposed() == ELDLt)
40  {
41  std::cout << "Dont know what to do...\n";
42  DebugStop();
43  }
44 }
46  // ek = fReducableStiff.K11Red();
47  // ef = fReducableStiff.F1Red();
48  //ek.Print("ek condensed");
49  if(fFront) {
51  int next = ek.Rows();
52  int neq = fRhs.Rows();
53  ef.Redim(next,1);
54  int eq;
55  for(eq=0; eq<next; eq++) {
56  ef(eq,0) = fRhs(eq+neq-next,0);
57  }
58  }
59 }
60 
62 {
63  int numinter = fMesh->NumInternalEquations();
64  int numeq = fMesh->TPZCompMesh::NEquations();
65  TPZFMatrix<STATE> soltemp(numeq,1,0.);
66  int i;
67  for(i=0;i<numinter;i++) soltemp(i,0) = fRhs(i,0);
68  for(; i<numeq; i++) {
69  soltemp(i,0) = sol.GetVal(i,0)-fReferenceSolution(i,0);
70  }
71  if(fSolver->Matrix()->IsDecomposed() == ELU)
72  {
73  fSolver->Matrix()->Subst_Backward(&soltemp);
74  } else if(fSolver->Matrix()->IsDecomposed() == ECholesky)
75  {
76  fSolver->Matrix()->Subst_Backward(&soltemp);
77  } else if(fSolver->Matrix()->IsDecomposed() == ELDLt)
78  {
79  std::cout << "Dont know what to do...\n";
80  DebugStop();
81  }
82 
83  fSolution = fReferenceSolution + soltemp;
85 }
TPZMatrixSolver< STATE > * fSolver
Type of solver to be applied.
Definition: pzanalysis.h:52
virtual ~TPZSubMeshFrontalAnalysis()
Destructor.
Definition: pzmatrix.h:52
TPZFMatrix< STATE > fSolution
Solution vector.
Definition: pzanalysis.h:50
Contains the TPZFrontStructMatrix class which responsible for a interface among Finite Element Packag...
virtual void Assemble()
Assemble the stiffness matrix and load vector.
Definition: pzanalysis.cpp:304
virtual int Subst_Forward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is lower triangular.
Definition: pzmatrix.cpp:1284
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
TPZSubMeshFrontalAnalysis(TPZSubCompMesh *mesh)
Constructor: create an object analysis from one mesh.
virtual void ExtractFrontMatrix(TPZFMatrix< TVar > &front)
Extracts the so far condensed matrix.
Definition: TPZFront.h:93
Implements the sequence of actions to perform a finite element analysis. Analysis.
Definition: pzanalysis.h:32
virtual void LoadSolution()
Load the solution into the computable grid.
Definition: pzanalysis.cpp:441
int IsDecomposed() const
Checks if current matrix is already decomposed.
Definition: pzmatrix.h:405
void Run(std::ostream &out)
Run: assemble the stiffness matrix.
Contains TPZMatrixclass which implements full matrix (using column major representation).
Implements a group of computational elements as a mesh and an element. Computational Mesh...
Definition: pzsubcmesh.h:36
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
Definition: pzmatrix.h:52
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
Definition: pzfmatrix.h:616
void CondensedSolution(TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
CondensedSolution: returns the condensed stiffness matrix - ek - and the condensed solution vector - ...
Contains declaration of TPZSubCompMesh class which implements a group of computational elements as a ...
TPZFMatrix< STATE > fReferenceSolution
Solution vector.
Contains TPZSubMeshFrontalAnalysis class which implements the analysis for substructuring.
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
TPZAutoPointer< TPZMatrix< TVar > > Matrix() const
Returns a pointer to TPZMatrix<>
Definition: pzsolve.h:138
int64_t NumInternalEquations()
Computes the number of internal equations.
TPZFront< STATE > * fFront
The decomposition process and frontal matrix.
TPZFMatrix< STATE > fRhs
Load vector.
Definition: pzanalysis.h:48
TPZSubCompMesh * fMesh
The computational sub mesh.
const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
Definition: pzfmatrix.h:566
virtual int Subst_Backward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is upper triangular.
Definition: pzmatrix.cpp:1309