NeoPZ
TPZFrontNonSym.cpp
Go to the documentation of this file.
1 
6 #include "TPZFrontNonSym.h"
7 #include "tpzeqnarray.h"
8 
9 // #ifdef USING_BLAS
10 // void cblas_dger(const enum CBLAS_ORDER order, const int M, const int N,
11 // const double alpha, const double *X, const int incX,
12 // const double *Y, const int incY, double *A, const int lda);
13 // #endif
14 // #ifdef USING_ATLAS
15 // void cblas_dger(const enum CBLAS_ORDER order, const int M, const int N,
16 // const double alpha, const double *X, const int incX,
17 // const double *Y, const int incY, double *A, const int lda);
18 // void cblas_dscal(const int N, const double alpha, double *X, const int incX);
19 // void cblas_dcopy(const int N, const double *X, const int incX,
20 // double *Y, const int incY);
21 // #endif
22 
24 const REAL TOL=1.e-10;
25 
26 using namespace std;
27 
28 #include "pzlog.h"
29 
30 #ifdef LOG4CXX
31 
32 static LoggerPtr logger(Logger::getLogger("pz.frontstrmatrix.frontnonsym"));
33 #endif
34 
35 
36 template<class TVar>
37 void TPZFrontNonSym<TVar>::PrintGlobal(const char *name, std::ostream& out){
38  int64_t i, j;
39  out << name << endl;
40  for(i=0;i<this->fLocal.NElements();i++){
41  if(this->fLocal[i]!=-1) out << i << " ";
42  }
43  out << endl;
44  for(i=0;i<this->fLocal.NElements();i++){
45  if(this->fLocal[i]==-1) continue;
46  for(j=0;j<this->fLocal.NElements();j++){
47  if(this->fLocal[j]==-1) continue;
48  out << Element(this->fLocal[i],this->fLocal[j]) << " ";
49  }
50  out << endl;
51  }
52  out << endl;
53  out.flush();
54 }
55 
56 template<class TVar>
57 void TPZFrontNonSym<TVar>::Print(const char *name, std::ostream& out) const
58 {
59  if(name) out << name << endl;
60  int64_t i,j,loop_limit;
61 
62 
63  out << "Frontal Matrix Size "<< this->fFront << endl;
64  out << "Maximum Frontal Matrix Size "<< this->fMaxFront << endl;
65 
66  out << endl;
67  out << "Local Indexation "<< endl;
68  out << "Position "<<" Local index"<< endl;
69  for(i=0;i<this->fLocal.NElements();i++){
70  out << i << " " << this->fLocal[i] << endl;
71  }
72 
73  out << endl;
74  out << "Global Indexation "<< endl;
75  out << "Position "<<" Global index"<< endl;
76 
77  for(i=0;i<this->fGlobal.NElements();i++){
78  out << i << " "<< this->fGlobal[i] << endl;
79  }
80 
81  out << endl;
82  out << "Local Freed Equations "<< this->fFree.NElements() << endl;
83  out << "position "<< "Local Equation "<<endl;
84  loop_limit=this->fFree.NElements();
85  for(i=0;i<loop_limit;i++){
86  out << i << " " << this->fFree[i] << endl;
87  }
88  out << "Frontal Matrix "<< endl;
89  if(this->fData.NElements() > 0) {
90  for(i=0;i<this->fFront;i++){
91  for(j=0;j<this->fFront;j++) out << Element(i,j) << " ";
92  out << endl;
93  }
94  }
95 }
96 
97 template<class TVar>
99 {
100  this->fData.Resize(this->fMaxFront*this->fMaxFront);
101  this->fGlobal.Fill(-1);
102  this->fData.Fill(0.);
103  this->fFront=0;
104  //this->fLocal.Fill(-1);
105 }
106 
107 template<class TVar>
108 void TPZFrontNonSym<TVar>::Reset(int64_t GlobalSize)
109 {
110  this->fData.Resize(0);
111  this->fFree.Resize(0);
112  this->fFront=0;
113  this->fGlobal.Resize(0);
114  this->fLocal.Resize(GlobalSize);
115  this->fLocal.Fill(-1);
116  this->fMaxFront=0;
117  this->fWork=0;
118  this->fNextRigidBodyMode = GlobalSize;
119 }
120 
121 template<class TVar>
123 {
124  return this->fFree.NElements();
125 }
126 
127 template<class TVar>
128 int TPZFrontNonSym<TVar>::Local(int64_t global){
129  int64_t index;
130 
131  if(this->fLocal[global]!=-1) return this->fLocal[global];
132  if(this->fFree.NElements()){
133  index=this->fFree.Pop();
134  }else{
135  index=this->fFront;
136  }
137  // At this point we extend the frontmatrix
138  if(index >= this->fMaxFront) {
139  // cout << endl;
140  // cout << "Dynamically expanding the front size to " << index+this->fExpandRatio << endl;
141  Expand(index+this->fExpandRatio);
142  }
143  this->fLocal[global]=index;
144  if(index==this->fFront) this->fFront++;
145  if(this->fGlobal.NElements()<=index) this->fGlobal.Resize(index+1);
146  this->fGlobal[index]=global;
147  return index;
148 }
149 
150 template<class TVar>
152 {
153  if(this->fLocal[global]==-1){
154  cout << "TPZFront FreeGlobal was called with wrong parameters !" << endl;
155  return;
156  }
157  int64_t index;
158  index=this->fLocal[global];
159  this->fGlobal[index]=-1;
160  this->fLocal[global]=-1;
161  this->fFree.Push(index);
162 }
163 
164 template<>
165 void TPZFrontNonSym<std::complex<float> >::DecomposeOneEquation(int64_t ieq, TPZEqnArray<std::complex<float> > &eqnarray)
166 {
167  DebugStop();
168 }
169 template<>
170 void TPZFrontNonSym<std::complex<double> >::DecomposeOneEquation(int64_t ieq, TPZEqnArray<std::complex<double> > &eqnarray)
171 {
172  DebugStop();
173 }
174 template<>
175 void TPZFrontNonSym<std::complex<long double> >::DecomposeOneEquation(int64_t ieq, TPZEqnArray<std::complex<long double> > &eqnarray)
176 {
177  DebugStop();
178 }
179 template<class TVar>
181 {
182  //std::cout<<" fNextRigidBodyMode AQQQQ "<<this->fNextRigidBodyMode<<endl;
183 
184  // if (this->fNextRigidBodyMode > this->fLocal.NElements()|| this->fNextRigidBodyMode == this->fLocal.NElements()) {
185  // DebugStop();
186  // }
187  //eqnarray.SetNonSymmetric();
188  int64_t i, ilocal;
189  ilocal = Local(ieq);
190 
191 #ifdef LOG4CXX
192  {
193  double diagonal=fabs(Element(ilocal,ilocal));
194  std::stringstream sout;
195  sout<<" Valor da Diagonal ( " << ilocal<< ", "<< ilocal<< " ) = "<< diagonal<<std::endl;
196  LOGPZ_DEBUG(logger,sout.str())
197  }
198 #endif
199 
200 
201  if(fabs(Element(ilocal,ilocal)) <TOL)
202  {
203  Local(this->fNextRigidBodyMode);
204  }
205 
206  TPZVec<TVar> AuxVecRow(this->fFront);
207  TPZVec<TVar> AuxVecCol(this->fFront);
208 
209 // #ifdef USING_ATLAS
210 // cblas_dcopy(this->fFront, &Element(0, ilocal), 1, &AuxVecCol[0], 1);
211 // cblas_dcopy(this->fFront, &Element(ilocal, 0), this->fMaxFront, &AuxVecRow[0], 1);
212 // #else
213  for(i=0;i<this->fFront;i++){
214  AuxVecCol[i]=Element(i,ilocal);
215  AuxVecRow[i]=Element(ilocal,i);
216  }
217 // #endif
218 
219  TVar diag = AuxVecRow[ilocal];
220 
221  if (fabs(diag) < TOL ) {
222  if (this->fNextRigidBodyMode < this->fLocal.NElements()) {
223  int jlocal = Local(this->fNextRigidBodyMode);
224 
225 
226  AuxVecRow[ilocal] = 1.;
227  AuxVecRow[jlocal] = -1.;
228  AuxVecCol[jlocal] = -1.;
229  diag = 1.;
230  Element(ilocal, jlocal) = -1.;
231  Element(jlocal, ilocal) = -1.;
232  Element(jlocal, jlocal) = 1.;
233  this->fNextRigidBodyMode++;
234  }
235  }
236 
237 // #ifdef USING_ATLAS
238 //
239 // cblas_dscal(this->fFront, (1/diag), &AuxVecCol[0], 1);
240 //
241 // #else
242  for(i=0;i<this->fFront;i++){
243  AuxVecCol[i]/=diag;
244  }
245 // #endif
246  this->fWork+=this->fFront*this->fFront;
247 // #ifdef USING_ATLAS
248 // //Blas utilizatioin
249 // CBLAS_ORDER order = CblasColMajor;
250 // // CBLAS_UPLO up_lo = CblasUpper;
251 // int64_t sz = this->fFront;
252 // int64_t incx = 1;
253 // int64_t stride = this->fMaxFront;
254 // double db = -1.;//AuxVec[ilocal];
255 // //resultado=cblas_dger(sz,&sz,&db,(double)&AuxVecCol[0],&incx,&AuxVecRow[0],&incx,&Element(0,0),&stride);
256 // cblas_dger(order, sz, sz, db,
257 // &AuxVecCol[0], incx,
258 // &AuxVecRow[0], incx, &Element(0,0), stride);
259 // #endif
260 // #ifdef USING_BLAS
261 // //Blas utilizatioin
262 // CBLAS_ORDER order = CblasColMajor;
263 // // CBLAS_UPLO up_lo = CblasUpper;
264 // int64_t sz = this->fFront;
265 // int64_t incx = 1;
266 // int64_t stride = this->fMaxFront;
267 // double db = -1.;//AuxVec[ilocal];
268 // //resultado=cblas_dger(sz,&sz,&db,(double)&AuxVecCol[0],&incx,&AuxVecRow[0],&incx,&Element(0,0),&stride);
269 // cblas_dger(order, sz, sz, db,
270 // &AuxVecCol[0], incx,
271 // &AuxVecRow[0], incx, &Element(0,0), stride);
272 //
273 // #endif
274 // #ifndef USING_ATLAS
275 // #ifndef USING_BLAS
276 
277 // int64_t j; METODOLOGIA ANTIGA QUE PERCORRE A MATRIZ DE UM JEITO MAIS LENTO
278 // for(i=0;i<this->fFront;i++){
279 // for(j=0;j<this->fFront;j++) Element(i,j)-=AuxVecCol[i]*AuxVecRow[j];
280 // }
281 
282  int64_t j;
283  if(this->fProductMTData){
284  this->ProductTensorMT( AuxVecCol, AuxVecRow );
285  }
286  else{
287  for(j=0;j<this->fFront;j++){
288  for(i=0;i<this->fFront;i++)
289  Element(i,j)-=AuxVecCol[i]*AuxVecRow[j];
290  }
291  }
292  /* Print("After correct elimination",cout);
293  */
294 // #endif
295 // #endif
296  AuxVecRow[ilocal]=1.;
297  eqnarray.BeginEquation(ieq);
298  eqnarray.AddTerm(ieq,diag);
299  for(i=0;i<this->fFront;i++) {
300  if(i!=ilocal && this->fGlobal[i]!= -1 && AuxVecRow[i] != 0.) eqnarray.AddTerm(this->fGlobal[i],AuxVecRow[i]);
301  }
302  eqnarray.EndEquation();
303 
304  eqnarray.BeginEquation(ieq);//, diag);
305  eqnarray.AddTerm(ieq,1.);
306  for(i=0;i<this->fFront;i++) {
307  if(i!=ilocal && this->fGlobal[i]!= -1 && AuxVecCol[i] != 0.) eqnarray.AddTerm(this->fGlobal[i],AuxVecCol[i]);
308  }
309  eqnarray.EndEquation();
310 
311 // #ifdef USING_ATLAS
312 // TPZVec<double> zero(this->fFront, 0.);
313 // cblas_dcopy(this->fFront, &Element(0, ilocal), 1, &zero[0], 1);
314 // cblas_dcopy(this->fFront, &Element(ilocal, 0), this->fMaxFront, &zero[0], 1);
315 // #else
316  for(i=0;i<this->fFront;i++){
317  Element(i,ilocal)=0.;
318  Element(ilocal,i)=0.;
319  }
320 // #endif
321 
322  FreeGlobal(ieq);
323  this->fDecomposeType=ELU;
324  // PrintGlobal("After", output);
325 }
326 
327 template <class TVar>
329  if(!data) DebugStop();
330  while(data->fRunning){
331  tht::SemaphoreWait(data->fWorkSem[ ithread ]);
332  if(!data->fRunning) break;
333  const int n = data->fAuxVecCol->NElements();
334  const int Nthreads = data->NThreads();
335 
336  for(int j = 0 + ithread; j < n; j += Nthreads){
337  const TVar RowVal = data->fAuxVecRow->operator[](j);
338  int i = 0;
339  TVar * ElemPtr = &(this->Element(i,j));
340  TVar * ColValPtr = &(data->fAuxVecCol->operator[](i));
341  for(; i < n; i++, ColValPtr++, ElemPtr++){
342  (*ElemPtr) -= (*ColValPtr) * RowVal;
343  }
344  }
345  data->WorkDone();
346  }
347 }
348 
349 template<class TVar>
351 {
352  int64_t i, j, ilocal, jlocal, nel;
353  nel=sourceindex.NElements();
354  for (i = 0; i < nel; i++) {
355  // message #1.1.1 to this:TPZFront
356  ilocal = this->Local(destinationindex[i]);
357  for (j = 0; j < nel; j++) {
358  // message #1.1.2.1 to this:TPZFront
359  jlocal = this->Local(destinationindex[j]);
360 
361  // message #1.1.2.2 to this:TPZFront
362  this->Element(ilocal, jlocal)+=elmat(sourceindex[i],sourceindex[j]);
363  }
364  }
365 }
366 
367 template<class TVar>
369 {
370  int64_t i, j, ilocal, jlocal, nel;
371  nel = destinationindex.NElements();
372  for(i=0;i<nel;i++){
373  ilocal = this->Local(destinationindex[i]);
374  for(j=0;j<nel;j++) {
375  jlocal=this->Local(destinationindex[j]);
376  this->Element(ilocal, jlocal)+=elmat(i,j);
377  }
378  }
379 }
380 
381 template<class TVar>
383  // PrintGlobal("Antes do Expande");
384  this->fData.Resize(larger*larger,0.);
385  int64_t i,j;
386  for(j=this->fFront-1;j>=0;j--){
387  for(i=this->fFront-1;i>=0;i--){
388  this->fData[j*larger + i]=this->fData[j*this->fMaxFront + i];
389  if(j) this->fData[j*this->fMaxFront+i] = 0.;
390  }
391  }
392  this->fMaxFront = larger;
393 }
394 
395 template<class TVar>
397  // PrintGlobal("Before COmpress");
398  // Print("Before Compress", cout);
399  TPZStack <int64_t> from;
400  int64_t nfound;
401  int64_t i, j;
402  for(i = 0; i < this->fFront; i++){
403  if(this->fGlobal[i] != -1) from.Push(i);
404  }
405 
410  nfound = from.NElements();
411  for(i=0;i<nfound;i++) {
412  this->fGlobal[i]=this->fGlobal[from[i]];
413  //this->fGlobal[from[i]] = -1;
414  this->fLocal[this->fGlobal[i]] = i;
415  }
416  for(;i<this->fGlobal.NElements();i++) this->fGlobal[i] = -1;
417 
418  if(nfound+this->fFree.NElements()!=this->fFront) cout << "TPZFront.Compress inconsistent data structure\n";
419 
420  this->fFront = nfound;
421  this->fFree.Resize(0);
422  this->fGlobal.Resize(this->fFront);
423  if(this->fData.NElements()==0) return;
424 
425  for(j = 0; j < nfound; j++){
426  for(i = 0; i < nfound; i++){
427  Element(i,j) = Element(from[i], from[j]);
428  if(from[i]!=i || from[j]!=j) Element(from[i],from[j])=0.;
429  }
430  }
431 }
432 
433 template<class TVar>
435 {
436  int64_t i, loop_limit, aux;
437  loop_limit=destinationindex.NElements();
438  for(i=0;i<loop_limit;i++){
439  aux=destinationindex[i];
440  Local(aux);
441  this->fFront = this->fGlobal.NElements();
442  }
443  this->fMaxFront=(this->fFront<this->fMaxFront)?this->fMaxFront:this->fFront;
444 
445 }
446 
447 template<class TVar>
448 void TPZFrontNonSym<TVar>::SymbolicDecomposeEquations(int64_t mineq, int64_t maxeq)
449 {
450  int64_t i;
451  for(i=mineq;i<=maxeq;i++) FreeGlobal(i);
452 }
453 
454 template<class TVar>
455 void TPZFrontNonSym<TVar>::DecomposeEquations(int64_t mineq, int64_t maxeq, TPZEqnArray<TVar> & eqnarray){
456  // message #1.1 to eqnarray:TPZEqnArray
457  int64_t ieq;
458 
459  eqnarray.Reset();
460  eqnarray.SetNonSymmetric();
461 
462  for (ieq = mineq; ieq <= maxeq; ieq++) {
463  // message #1.2.1 to this:TPZFront
464  this->DecomposeOneEquation(ieq, eqnarray);
465  // this->Print("Teste.txt",output);
466  }
467 }
468 
469 template<class TVar>
471 TPZRegisterClassId(&TPZFrontNonSym<TVar>::ClassId), TPZFront<TVar>(GlobalSize)
472 {
473  this->fDecomposeType=ELU;
474  this->fWork=0;
475 }
476 
477 template<class TVar>
480  this->fDecomposeType=ELU;
481  this->fWork=0;
482 }
483 
484 template<class TVar>
487 }
488 
489 template<class TVar>
491 
492 
493 
494 template<class TVar>
496 {
497  int i, j;
501  int matsize=6;
502  TPZFMatrix<TVar> TestMatrix(matsize,matsize);
503  for(i=0;i<matsize;i++) {
504  for(j=i;j<matsize;j++) {
505  int random = rand();
506  double rnd = (random*matsize)/0x7fff;
507  TestMatrix(i,j)=rnd;
508  TestMatrix(j,i)=TestMatrix(i,j);
509  if(i==j) TestMatrix(i,j)=6000.;
510  }
511  }
512 
513  TPZFMatrix<TVar> Prova;
514  Prova=TestMatrix;
515 
516  // Prova.Decompose_Cholesky();
517  Prova.Print("TPZFMatrix<TVar> Cholesky");
518 
519  TPZFrontNonSym TestFront(matsize);
520 
521 
522  TPZVec<int64_t> DestIndex(matsize);
523  for(i=0;i<matsize;i++) DestIndex[i]=i;
524 
525  TestFront.SymbolicAddKel(DestIndex);
526  TestFront.SymbolicDecomposeEquations(0,matsize-1);
527 
528  std::string OutFile;
529  OutFile = "TPZFrontNonSymTest.txt";
530 
531  ofstream output(OutFile.c_str(),ios::app);
532 
533  TestFront.Compress();
534 
535  TestFront.AllocData();
536 
537  TestFront.AddKel(TestMatrix, DestIndex);
538  TPZEqnArray<TVar> Result;
539 
540  TestFront.DecomposeEquations(0,matsize-1,Result);
541  ofstream outeqn("TestEQNArray.txt",ios::app);
542 
543  Result.Print("TestEQNArray.txt",outeqn);
544 
545 
546  TPZFMatrix<TVar> Load(matsize);
547 
548  for(i=0;i<matsize;i++) {
549  int random = rand();
550  double rnd = (random*matsize)/0x7fff;
551  Load(i,0)=rnd;
552  }
553 
554  TPZFMatrix<TVar> Load_2(matsize);
555  Load_2=Load;
556 
557  DecomposeType decType = ECholesky;
558  Prova.SolveDirect(Load, decType);
559 
560  Load.Print("Load");
561  //TestFront.Print(OutFile, output);
562 
563  Result.EqnForward(Load_2, decType);
564  Result.EqnBackward(Load_2, decType);
565 
566  Load_2.Print("Eqn");
567 }
568 
569 template<class TVar>
571  return "Non symmetric matrix";
572 }
573 
574 template<class TVar>
576 {
577  // Extend the front with the non initialized rigid body modes
578  int64_t ieq;
579  int64_t maxeq = this->fLocal.NElements();
580  for (ieq = this->fNextRigidBodyMode; ieq< maxeq; ieq++) {
581  int ilocal = Local(ieq);
582  Element(ilocal, ilocal) = 1.;
583  }
584 
585  int64_t mineq = 0;
586  for(mineq=0; mineq<maxeq; mineq++) if(this->fLocal[mineq] != -1) break;
587  int64_t numeq = maxeq-mineq;
588  front.Redim(numeq,numeq);
589  int64_t jeq;
590  for(ieq=mineq;ieq<maxeq;ieq++) {
591  if(this->fLocal[ieq] == -1) continue;
592  int64_t il = ieq-mineq;
593  for(jeq=0;jeq<maxeq;jeq++) {
594  if(this->fLocal[jeq] == -1) continue;
595  int64_t jl = jeq-mineq;
596  front(il,jl) = this->Element(this->fLocal[ieq],this->fLocal[jeq]);
597  }
598  }
599 
600 }
601 
602 template class TPZFrontNonSym<float>;
603 template class TPZFrontNonSym<double>;
604 template class TPZFrontNonSym<long double>;
605 
606 template class TPZFrontNonSym<std::complex<float> >;
607 template class TPZFrontNonSym<std::complex<double> >;
void AddKel(TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &destinationindex)
Add a contribution of a stiffness matrix.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
Definition: tfadfunc.h:140
void EqnForward(TPZFMatrix< TVar > &F, DecomposeType dec)
Forward substitution on equations stored in EqnArray.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
void Expand(int largefrontsize)
Expand the front matrix.
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
TPZFrontNonSym()
Simple constructor.
TPZVec< TVar > * fAuxVecCol
vetores de operacao
Definition: TPZFront.h:196
static void main()
TPZVec< TVar > * fAuxVecRow
Definition: TPZFront.h:196
Contains the TPZFrontNonSym class which implements storage and decomposition process of the frontal m...
virtual void TensorProductIJ(int ithread, typename TPZFront< TVar >::STensorProductMTData *data) override
struct para paralelizar a decomposicao da matriz
Definition: TPZFront.h:178
int NThreads()
num threads
Definition: TPZFront.h:202
void Compress()
Compress data structure.
int fWork
Definition: TPZFront.h:74
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
const REAL TOL
Initializing tolerance for current implementations.
void Reset(int64_t GlobalSize=0)
Resets data structure.
Abstract class implements storage and decomposition process of the frontal matrix. Frontal.
void AllocData()
Allocates data for Front.
DecomposeType fDecomposeType
Used Decomposition method.
Definition: TPZFront.h:172
void DecomposeEquations(int64_t mineq, int64_t maxeq, TPZEqnArray< TVar > &result)
Decompose these equations and put the result in eqnarray. Default decompose method is LU...
void Push(const T object)
Pushes a copy of the object on the stack.
Definition: pzstack.h:80
int ClassId() const override
Define the class id associated with the class.
void FreeGlobal(int64_t global)
Sets the global equation as freed, allowing the space used by this equation to be used by future ass...
#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
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
virtual void ExtractFrontMatrix(TPZFMatrix< TVar > &front) override
Extract the front matrix.
Definition: pzmatrix.h:52
void Reset()
Resets data structure.
Definition: tpzeqnarray.cpp:81
void SetNonSymmetric()
Sets EqnArray to a non symmetric form.
Definition: tpzeqnarray.cpp:18
void AddTerm(int col, TVar val)
Add a term to the current equation.
Definition: tpzeqnarray.h:83
~TPZFrontNonSym()
Simple destructor.
int64_t fNextRigidBodyMode
Equation where rigid body modes can be stored.
Definition: TPZFront.h:158
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
TVar & Element(int64_t i, int64_t j)
Returns the ith,jth element of the matrix. .
void EndEquation()
Ends the current equation.
Definition: tpzeqnarray.cpp:70
void SemaphoreWait(pz_semaphore_t &s)
void SymbolicAddKel(TPZVec< int64_t > &destinationindex)
Add a contribution of a stiffness matrix using the indexes to compute the frontwidth.
void SymbolicDecomposeEquations(int64_t mineq, int64_t maxeq)
Decompose these equations in a symbolic way and store freed indexes in fFree.
virtual int64_t NFree() override
Returns the number of free equations.
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 DecomposeOneEquation(int64_t ieq, TPZEqnArray< TVar > &eqnarray)
Decomposes ieq equation and add the result to EqnArray.
void Print(const char *name, std::ostream &out) const
It prints TPZFront data.
int Local(int64_t global)
Returns a local index corresponding to a global equation number.
std::string GetMatrixType()
Type of matrix.
void PrintGlobal(const char *name, std::ostream &out)
Abstract class implements storage and decomposition process of the frontal matrix involving non-simet...
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