NeoPZ
TPZFrontSym.cpp
Go to the documentation of this file.
1 
6 #include "TPZFrontSym.h"
7 #include <math.h>
8 #include <iostream>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <fstream>
12 #include "tpzeqnarray.h"
13 #include "TPZThreadTools.h"
14 
15 using namespace std;
16 
17 // #ifdef USING_BLAS
18 // #include "cblas.h"
19 // #endif
20 
21 
22 // #ifdef USING_ATLAS
23 // void cblas_dspr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
24 // const int N, const double alpha, const double *X,
25 // const int incX, double *Ap);
26 // #endif
27 template<class TVar>
29 {
30  return this->fDecomposeType;
31 }
32 template<class TVar>
33 void TPZFrontSym<TVar>::PrintGlobal(const char *name, std::ostream& out){
34  int64_t i, j;
35  out << name << endl;
36  for(i=0;i<this->fLocal.NElements();i++){
37  if(this->fLocal[i]!=-1) out << i << " ";
38  }
39  out << endl;
40  for(i=0;i<this->fLocal.NElements();i++){
41  if(this->fLocal[i]==-1) continue;
42  for(j=0;j<this->fLocal.NElements();j++){
43  if(this->fLocal[j]==-1) continue;
44  out << Element(this->fLocal[i],this->fLocal[j]) << " ";
45  }
46  out << endl;
47  }
48  out << endl;
49 }
50 template<class TVar>
51 void TPZFrontSym<TVar>::Print(const char *name, std::ostream& out) const
52 {
53  if(name) out << name << endl;
54  int64_t i,j,loop_limit;
55 
56 
57  out << "Frontal Matrix Size "<< this->fFront << endl;
58  out << "Maximum Frontal Matrix Size "<< this->fMaxFront << endl;
59 
60  out << endl;
61  out << "Local Indexation "<< endl;
62  out << "Position "<<" Local index"<< endl;
63  for(i=0;i<this->fLocal.NElements();i++){
64  out << i << " " << this->fLocal[i] << endl;
65  }
66 
67  out << endl;
68  out << "Global Indexation "<< endl;
69  out << "Position "<<" Global index"<< endl;
70 
71  for(i=0;i<this->fGlobal.NElements();i++){
72  out << i << " "<< this->fGlobal[i] << endl;
73  }
74 
75  out << endl;
76  out << "Local Freed Equatoins "<< this->fFree.NElements() << endl;
77  out << "position "<< "Local Equation "<<endl;
78  loop_limit=this->fFree.NElements();
79  for(i=0;i<loop_limit;i++){
80  out << i << " " << this->fFree[i] << endl;
81  }
82  out << "Frontal Matrix "<< endl;
83  if(this->fData.NElements() > 0) {
84  for(i=0;i<this->fFront;i++){
85  for(j=0;j<this->fFront;j++) out << ((i<j) ? Element(i,j) : Element(j,i)) << " ";
86  out << endl;
87  }
88  }
89 }
90 template<class TVar>
92 {
93  this->fData.Resize(this->fMaxFront*(this->fMaxFront+1)/2);
94  this->fGlobal.Fill(-1);
95  this->fData.Fill(0.);
96  this->fFront=0;
97  //this->fLocal.Fill(-1);
98 }
99 template<class TVar>
100 void TPZFrontSym<TVar>::Reset(int64_t GlobalSize)
101 {
102  this->fData.Resize(0);
103  this->fFree.Resize(0);
104  this->fFront=0;
105  this->fGlobal.Resize(0);
106  this->fLocal.Resize(GlobalSize);
107  this->fLocal.Fill(-1);
108  this->fMaxFront=0;
109 }
110 template<class TVar>
112 {
113  return this->fFree.NElements();
114 }
115 
116 template<class TVar>
117 int TPZFrontSym<TVar>::Local(int64_t global){
118  int64_t index;
119  if(this->fLocal[global]!=-1) return this->fLocal[global];
120  if(this->fFree.NElements()){
121  index=this->fFree.Pop();
122  }else{
123  index=this->fFront++;
124  }
125  this->fLocal[global]=index;
126  // At this point we extend the frontmatrix
127  if(index >= this->fMaxFront) {
128  // cout << endl;
129  // cout << "Dynamically expanding the front size to " << index+fExpandRatio << endl;
130  Expand(index+this->fExpandRatio);
131  }
132  if(this->fGlobal.NElements()<=index) this->fGlobal.Resize(index+1);
133  this->fGlobal[index]=global;
134  return index;
135 }
136 template<class TVar>
137 void TPZFrontSym<TVar>::FreeGlobal(int64_t global)
138 {
139  if(this->fLocal[global]==-1){
140  cout << "TPZFront FreeGlobal was called with wrong parameters !" << endl;
141  return;
142  }
143  int64_t index;
144  index=this->fLocal[global];
145  this->fGlobal[index]=-1;
146  this->fLocal[global]=-1;
147  this->fFree.Push(index);
148 }
149 
150 template<>
151 void TPZFrontSym<std::complex<float> >::DecomposeOneEquation(int64_t ieq, TPZEqnArray<std::complex<float> > &eqnarray)
152 {
153  DebugStop();
154 }
155 template<>
156 void TPZFrontSym<std::complex<double> >::DecomposeOneEquation(int64_t ieq, TPZEqnArray<std::complex<double> > &eqnarray)
157 {
158  DebugStop();
159 }
160 template<>
161 void TPZFrontSym<std::complex<long double> >::DecomposeOneEquation(int64_t ieq, TPZEqnArray<std::complex<long double> > &eqnarray)
162 {
163  DebugStop();
164 }
165 
166 template<class TVar>
168 {
169  //eqnarray.SetSymmetric();
170 
171  int64_t i, ilocal;
172  ilocal = Local(ieq);
173  TPZManVector<TVar> AuxVec(this->fFront);
174 
175  for(i=0;i<ilocal;i++) AuxVec[i]=Element(i,ilocal);
176  for(i=ilocal;i<this->fFront;i++) AuxVec[i]=Element(ilocal,i);
177 
178  if(AuxVec[ilocal]<0 && this->fDecomposeType == ECholesky) {
179  cout << "TPZFront::DecomposeOneEquation AuxVec[ilocal] < 0 " << AuxVec[ilocal] << " ilocal=" << ilocal << " fGlobal=" << this->fGlobal[ilocal] << endl;
180  }
181  TVar diag;
182  if (this->fDecomposeType == ECholesky) {
183  diag = sqrt(AuxVec[ilocal]);
184  for(i=0;i<this->fFront;i++) AuxVec[i]/=diag;
185  }
186  else
187  {
188  diag = AuxVec[ilocal];
189  for(i=0;i<this->fFront;i++) AuxVec[i]/=diag;
190  }
191 
192  eqnarray.BeginEquation(ieq);
193  eqnarray.AddTerm(ieq, diag);
194 
195  //Blas utilizatioin
196  // #ifdef USING_BLAS
197  // CBLAS_ORDER order = CblasColMajor;
198  // CBLAS_UPLO up_lo = CblasUpper;
199  // int sz = fFront;
200  // int64_t incx = 1;
201  // double db = -1.;//AuxVec[ilocal];
202  // cblas_dspr(order, up_lo,sz,db,&AuxVec[0],incx,&Element(0,0));
203  //
204  // #endif
205  // #ifdef USING_ATLAS
206  // CBLAS_ORDER order = CblasColMajor;
207  // CBLAS_UPLO up_lo = CblasUpper;
208  // int sz = fFront;
209  // int64_t incx = 1;
210  // double db = -1.;//AuxVec[ilocal];
211  // cblas_dspr(order, up_lo,sz,db,&AuxVec[0],incx,&Element(0,0));
212  // //cout << "Using ATLAS" << endl;
213  // #endif
214  // #ifndef USING_BLAS
215  // #ifndef USING_ATLAS
216 
217 // int64_t j=0; METODOLOGIA ANTIGA QUE PERCORRE A MATRIZ MAIS LENTAMENTE
218 // for(i=0;i<this->fFront;i++){
219 // for(j=i;j<this->fFront;j++){
220 // Element(i,j)-=AuxVec[i]*AuxVec[j];
221 // }
222 // }
223 
224  if (this->fDecomposeType == ECholesky)
225  {
226  if(this->fProductMTData){
227  this->ProductTensorMT( AuxVec, AuxVec );
228  }
229  else {
230  for(int64_t j=0;j<this->fFront;j++){
231  for(int64_t i=0;i<=j;i++){
232  Element(i,j)-=AuxVec[i]*AuxVec[j];
233  }
234  }
235  }
236 
237  }
238  else
239  {
240  if(this->fProductMTData){
241  this->fProductMTData->fDiagonal = diag;
242  this->ProductTensorMT( AuxVec, AuxVec );
243  }
244  else {
245  for(int64_t j=0;j<this->fFront;j++){
246  for(int64_t i=0;i<=j;i++){
247  Element(i,j)-=AuxVec[i]*AuxVec[j]*diag;
248  }
249  }
250  }
251 
252  }
253  // #endif
254  // #endif
255 
256  for(i=0;i<this->fFront;i++) {
257  if(i!=ilocal && this->fGlobal[i]!= -1 && AuxVec[i] != 0.) eqnarray.AddTerm(this->fGlobal[i],AuxVec[i]);
258  }
259  eqnarray.EndEquation();
260 
261  for(i=0;i<ilocal;i++)Element(i,ilocal)=0.;
262  for(i=ilocal;i<this->fFront;i++) Element(ilocal,i)=0.;
263 
264  FreeGlobal(ieq);
265  // PrintGlobal("After", output);
266 }
267 
268 
269 template <class TVar>
271  if(!data) DebugStop();
272 #ifdef PZDEBUG
273  TPZFrontSym<TVar> * matrix = dynamic_cast<TPZFrontSym<TVar> * > (data->fMat);
274  if(matrix != this) DebugStop();
275 #endif
276  while(data->fRunning){
277  tht::SemaphoreWait(data->fWorkSem[ ithread ]);
278  if(!data->fRunning) break;
279  const int n = data->fAuxVecCol->NElements();
280  const int Nthreads = data->NThreads();
281 
282  if (data->fMat->GetDecomposeType() == ELDLt) {
283  for(int j = 0+ithread; j < n; j += Nthreads){
284  int i = 0;
285  const TVar RowVal = data->fAuxVecRow->operator[](j)*data->fDiagonal;
286  TVar * ColValPtr = &(data->fAuxVecCol->operator[](i));
287  TVar * elemPtr = &this->Element4JGreatEqualI(i,j);
288  for( ; i <= j; i++, ColValPtr++, elemPtr++ ){
289  (*elemPtr) -= (*ColValPtr) * RowVal;
290  }
291  }
292 
293  }
294  else if(data->fMat->GetDecomposeType() == ECholesky)
295  {
296  for(int j = 0+ithread; j < n; j += Nthreads){
297  int i = 0;
298  const TVar RowVal = data->fAuxVecRow->operator[](j);
299  TVar * ColValPtr = &(data->fAuxVecCol->operator[](i));
300  TVar * elemPtr = &this->Element4JGreatEqualI(i,j);
301  for( ; i <= j; i++, ColValPtr++, elemPtr++ ){
302  (*elemPtr) -= (*ColValPtr) * RowVal;
303  }
304  }
305  }
306  data->WorkDone();
307  }
308 }
309 
310 
311 template<class TVar>
312 void TPZFrontSym<TVar>::AddKel(TPZFMatrix<TVar> &elmat, TPZVec<int64_t> &sourceindex, TPZVec<int64_t> &destinationindex)
313 {
314  int64_t i, j, ilocal, jlocal, nel;
315  nel=sourceindex.NElements();
316  for (i = 0; i < nel; i++) {
317  // message #1.1.1 to this:TPZFront
318  ilocal = this->Local(destinationindex[i]);
319  for (j = i; j < nel; j++) {
320  // message #1.1.2.1 to this:TPZFront
321  jlocal = this->Local(destinationindex[j]);
322 
323  // message #1.1.2.2 to this:TPZFront
324  this->Element(ilocal, jlocal)+=elmat(sourceindex[i],sourceindex[j]);
325  }
326  }
327 }
328 template<class TVar>
330 {
331  int64_t i, j, ilocal, jlocal, nel;
332  nel = destinationindex.NElements();
333  for(i=0;i<nel;i++){
334  ilocal = this->Local(destinationindex[i]);
335  for(j=i;j<nel;j++) {
336  jlocal=this->Local(destinationindex[j]);
337  this->Element(ilocal, jlocal)+=elmat(i,j);
338  }
339  }
340  /*
341  output << "Dest Index " ;
342  for(i=0;i<nel;i++) output << destinationindex[i] << " ";
343  output << endl;
344  elmat.Print("Element matrix ",output);
345  PrintGlobal("After Assemb..." , output);
346  */
347 }
348 /*TVar & TPZFrontSym<TVar>::Element(int i, int j){
349  if(i>j){
350  int i_temp=i;
351  i=j;
352  j=i_temp;
353  //cout << "Changing row column indexes !"<<endl;
354  }
355  return fData[(j*(j+1))/2+i];
356  }
357  */
358 template<class TVar>
359 void TPZFrontSym<TVar>::Expand(int larger) {
360  this->fData.Resize(larger*(larger+1)/2,0.);
361  this->fMaxFront = larger;
362 }
363 template<class TVar>
365  // PrintGlobal("Before COmpress",output);
366  // Print("Before Compress", cout);
367  TPZStack <int64_t> from;
368  int64_t nfound;
369  int64_t i, j;
370  for(i = 0; i < this->fFront; i++){
371  if(this->fGlobal[i] != -1) from.Push(i);
372  }
373 
378  nfound = from.NElements();
379  for(i=0;i<nfound;i++) {
380  this->fGlobal[i]=this->fGlobal[from[i]];
381  //fGlobal[from[i]] = -1;
382  this->fLocal[this->fGlobal[i]] = i;
383  }
384  for(;i<this->fGlobal.NElements();i++) this->fGlobal[i] = -1;
385 
386  if(nfound+this->fFree.NElements()!=this->fFront) cout << "TPZFront.Compress inconsistent data structure\n";
387  int frontold = this->fFront;
388  this->fFront = nfound;
389  this->fFree.Resize(0);
390  this->fGlobal.Resize(this->fFront);
391  if(this->fData.NElements()==0) return;
392 
393  for(j = 0; j < nfound; j++){
394  for(i = 0; i <= j; i++){
395  Element(i,j) = Element(from[i], from[j]);
396  }
397  // fGlobal[i] = fGlobal[from[i]];
398  // this->fLocal[fGlobal[i]] = i;
399  }
400  for(;j<frontold;j++) {
401  for(i=0;i<= j; i++) Element(i,j) = 0.;
402  }
403 
404  // Print("After Compress", cout);
405  // PrintGlobal("After Compress",output);
406 }
407 template<class TVar>
409 {
410  int64_t i, loop_limit, aux;
411  loop_limit=destinationindex.NElements();
412  for(i=0;i<loop_limit;i++){
413  aux=destinationindex[i];
414  Local(aux);
415  this->fFront = this->fGlobal.NElements();
416  }
417  this->fMaxFront=(this->fFront<this->fMaxFront)?this->fMaxFront:this->fFront;
418 
419 }
420 template<class TVar>
421 void TPZFrontSym<TVar>::SymbolicDecomposeEquations(int64_t mineq, int64_t maxeq)
422 {
423  int64_t i;
424  for(i=mineq;i<=maxeq;i++) FreeGlobal(i);
425 }
426 template<class TVar>
427 void TPZFrontSym<TVar>::DecomposeEquations(int64_t mineq, int64_t maxeq, TPZEqnArray<TVar> & eqnarray){
428  // message #1.1 to eqnarray:TPZEqnArray
429  int64_t ieq;
430  eqnarray.Reset();
431  eqnarray.SetSymmetric();
432  //cout << "Decomposing from " << mineq << " to " << maxeq << "\n";
433  //cout.flush();
434  for (ieq = mineq; ieq <= maxeq; ieq++) {
435  // message #1.2.1 to this:TPZFront
436  this->DecomposeOneEquation(ieq, eqnarray);
437  // this->Print("Teste.txt",output);
438  }
439 }
440 template<class TVar>
441 TPZFrontSym<TVar>::TPZFrontSym(int64_t GlobalSize) : TPZRegisterClassId(&TPZFrontSym<TVar>::ClassId),
442 TPZFront<TVar>(GlobalSize)
443 {
445 }
446 template<class TVar>
449 }
450 
451 
452 template<class TVar>
454 
455 template<class TVar>
457 {
458  int i, j;
462  int matsize=6;
463  TPZFMatrix<TVar> TestMatrix(matsize,matsize);
464  for(i=0;i<matsize;i++) {
465  for(j=i;j<matsize;j++) {
466  int random = rand();
467  double rnd = (random*matsize)/0x7fff;
468  TestMatrix(i,j)=rnd;
469  TestMatrix(j,i)=TestMatrix(i,j);
470  if(i==j) TestMatrix(i,j)=6000.;
471  }
472  }
473 
474  TPZFMatrix<TVar> Prova;
475  Prova=TestMatrix;
476 
477  // Prova.Decompose_Cholesky();
478  Prova.Print("TPZFMatrix<TVar> Cholesky");
479 
480  TPZFrontSym TestFront(matsize);
481 
482 
483  TPZVec<int64_t> DestIndex(matsize);
484  for(i=0;i<matsize;i++) DestIndex[i]=i;
485 
486  TestFront.SymbolicAddKel(DestIndex);
487  TestFront.SymbolicDecomposeEquations(0,matsize-1);
488 
489  std::string OutFile;
490  OutFile = "TPZFrontSymTest.txt";
491 
492  ofstream output(OutFile.c_str(),ios::app);
493 
494  TestFront.Compress();
495 
496  TestFront.AllocData();
497 
498  TestFront.AddKel(TestMatrix, DestIndex);
499  TPZEqnArray<TVar> Result;
500 
501  /*TestFront.DecomposeEquations(0,0,Result);
502 
503  TestFront.Print(OutFile, output);
504 
505  ofstream outeqn("TestEQNArray.txt",ios::app);
506  Result.Print("TestEQNArray.txt",outeqn);
507 
508  TestFront.Compress();
509 
510  TestFront.Print(OutFile, output);
511  */
512  TestFront.DecomposeEquations(0,matsize-1,Result);
513  ofstream outeqn("TestEQNArray.txt",ios::app);
514 
515  Result.Print("TestEQNArray.txt",outeqn);
516 
517 
518  TPZFMatrix<TVar> Load(matsize);
519 
520  for(i=0;i<matsize;i++) {
521  int random = rand();
522  double rnd = (random*matsize)/0x7fff;
523  Load(i,0)=rnd;
524  }
525 
526  TPZFMatrix<TVar> Load_2(matsize);
527  Load_2=Load;
528 
529  // Prova.Subst_Forward(&Load);
530  // Prova.Subst_Backward(&Load);
531 
532 
533  DecomposeType decType = ECholesky;
534  Prova.SolveDirect(Load, decType);
535 
536  Load.Print("load");
537  //TestFront.Print(OutFile, output);
538 
539  Result.EqnForward(Load_2, decType);
540  Result.EqnBackward(Load_2, decType);
541 
542  Load_2.Print("Eqn");
543 
544 
545 
546 }
547 
548 template<class TVar>
550  return "Symmetric matrix";
551 }
552 
553 template<class TVar>
555 {
556  int64_t maxeq = this->fLocal.NElements();
557  int64_t mineq = 0;
558  for(mineq=0; mineq<maxeq; mineq++) if(this->fLocal[mineq] != -1) break;
559  int64_t numeq = maxeq-mineq;
560  front.Redim(numeq,numeq);
561  int64_t ieq,jeq;
562  for(ieq=mineq;ieq<maxeq;ieq++) {
563  if(this->fLocal[ieq] == -1) continue;
564  int64_t il = ieq-mineq;
565  for(jeq=ieq;jeq<maxeq;jeq++) {
566  if(this->fLocal[jeq] == -1) continue;
567  int64_t jl = jeq-mineq;
568  front(il,jl) = this->Element(this->fLocal[ieq],this->fLocal[jeq]);
569  front(jl,il) = front(il,jl);
570  }
571  }
572 
573 }
574 
575 template<class TVar>
577  return Hash("TPZFrontSym") ^ TPZFront<TVar>::ClassId() << 1;
578 }
579 
580 template class TPZFrontSym<float>;
581 template class TPZFrontSym<std::complex<float> >;
582 
583 template class TPZFrontSym<double>;
584 template class TPZFrontSym<std::complex<double> >;
585 
586 template class TPZFrontSym<long double>;
Contains the TPZFrontSym class which implements decomposition process of the frontal matrix (case sym...
void Expand(int largefrontsize)
Expand the front matrix.
void Reset(int64_t GlobalSize=0)
Resets data structure.
void EqnForward(TPZFMatrix< TVar > &F, DecomposeType dec)
Forward substitution on equations stored in EqnArray.
Definition: pzmatrix.h:52
int Local(int64_t global)
return a local index corresponding to a global equation number
void SymbolicDecomposeEquations(int64_t mineq, int64_t maxeq)
Decompose these equations in a symbolic way and store freed indexes in fFree.
It is an equation array, generally in its decomposed form. Frontal.
Definition: tpzeqnarray.h:36
TPZVec< int64_t > fLocal
Front equation to each global equation.
Definition: TPZFront.h:152
TVar fDiagonal
valor da diagonal
Definition: TPZFront.h:199
TPZVec< TVar > * fAuxVecCol
vetores de operacao
Definition: TPZFront.h:196
TPZVec< TVar > * fAuxVecRow
Definition: TPZFront.h:196
void AddKel(TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &destinationindex)
Add a contribution of a stiffness matrix.
struct para paralelizar a decomposicao da matriz
Definition: TPZFront.h:178
void SymbolicAddKel(TPZVec< int64_t > &destinationindex)
Add a contribution of a stiffness matrix using the indexes to compute the frontwidth.
~TPZFrontSym()
Simple destructor.
Abstract class implements storage and decomposition process of the frontal matrix involving simmetry ...
int NThreads()
num threads
Definition: TPZFront.h:202
void BeginEquation(int eq)
It starts an equation storage.
Definition: tpzeqnarray.cpp:75
Contains the TPZEqnArray class which implements an equation array.
void Print(const char *name, std::ostream &out)
It prints all terms stored in TPZEqnArray.
Definition: tpzeqnarray.cpp:42
TPZVec< pz_semaphore_t > fWorkSem
semaforos para sincronizar os threads de calculo
Definition: TPZFront.h:190
TPZSkylMatrix< REAL > matrix
Definition: numatst.cpp:255
Abstract class implements storage and decomposition process of the frontal matrix. Frontal.
virtual void TensorProductIJ(int ithread, typename TPZFront< TVar >::STensorProductMTData *data) override
Does the tensor product betweem two vectors in the positions dependent of ithread.
void DecomposeEquations(int64_t mineq, int64_t maxeq, TPZEqnArray< TVar > &result)
Decompose these equations and put the result in eqnarray Default decompose method is Cholesky...
DecomposeType fDecomposeType
Used Decomposition method.
Definition: TPZFront.h:172
void Push(const T object)
Pushes a copy of the object on the stack.
Definition: pzstack.h:80
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
void EqnBackward(TPZFMatrix< TVar > &U, DecomposeType dec)
Backward substitution on equations stored in EqnArray.
Definition: tpzeqnarray.cpp:93
void Reset()
Resets data structure.
Definition: tpzeqnarray.cpp:81
TVar & Element(int64_t i, int64_t j)
Returns ith, jth element of matrix. .
Definition: TPZFrontSym.h:98
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Definition: tfadfunc.h:120
void SetSymmetric()
Sets fSymmetric to the symmetric value.
Definition: tpzeqnarray.cpp:26
void AddTerm(int col, TVar val)
Add a term to the current equation.
Definition: tpzeqnarray.h:83
void DecomposeOneEquation(int64_t ieq, TPZEqnArray< TVar > &eqnarray)
Decomposes ieq equation and add the result to EqnArray.
DecomposeType GetDecomposeType() const
Returns decomposition type.
Definition: TPZFrontSym.cpp:28
Full matrix class. Matrix.
Definition: pzfmatrix.h:32
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
Definition: pzfmatrix.h:616
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
virtual void ExtractFrontMatrix(TPZFMatrix< TVar > &front) override
Reorders the elements of the frontmatrix into the full matrix.
void EndEquation()
Ends the current equation.
Definition: tpzeqnarray.cpp:70
virtual int64_t NFree() override
Returns the number of free equations.
int ClassId() const override
Define the class id associated with the class.
void SemaphoreWait(pz_semaphore_t &s)
void Print(const char *name, std::ostream &out=std::cout) const
Prints TPZFront data.
Definition: TPZFrontSym.cpp:51
void FreeGlobal(int64_t global)
Sets the global equation as freed, allowing the space.
void AllocData()
Allocates data for Front.
Definition: TPZFrontSym.cpp:91
std::string GetMatrixType()
Returns its type.
virtual void Print(std::ostream &out) const
Definition: pzmatrix.h:253
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
void PrintGlobal(const char *name, std::ostream &out=std::cout)
Definition: TPZFrontSym.cpp:33
static void main()
TPZFrontSym()
Simple constructor.
TPZFront< TVar > * fMat
matriz TPZFront
Definition: TPZFront.h:208
int ClassId() const override
Define the class id associated with the class.
Definition: TPZFront.h:317
virtual int SolveDirect(TPZFMatrix< TVar > &F, const DecomposeType dt, std::list< int64_t > &singular)
Solves the linear system using Direct methods.
Definition: pzmatrix.cpp:710
DecomposeType
Defines decomposition type for any matrix classes.
Definition: pzmatrix.h:52
void Compress()
Compress data structure.