NeoPZ
pzelmat.cpp
Go to the documentation of this file.
1 
6 #include "pzelmat.h"
7 #include "pzfmatrix.h"
8 #include "pzcmesh.h"
9 
10 #include "pzlog.h"
11 
12 #ifdef LOG4CXX
13 static LoggerPtr logger(Logger::getLogger("pz.mesh.tpzelmat"));
14 #endif
15 
16 using namespace std;
17 
18 void TPZElementMatrix::SetMatrixSize(short NumBli, short NumBlj,
19  short BlSizei, short BlSizej) {
20 
21 
22  if(fMat.Rows() != NumBli*BlSizei || fMat.Cols() != NumBlj*BlSizej) {
23  fMat.Redim(NumBli*BlSizei,NumBlj*BlSizej);
24  }
25 }
26 
27 void TPZElementMatrix::SetMatrixMinSize(short NumBli, short NumBlj,
28  short BlSizei, short BlSizej) {
29 
30 
31  if(fMat.Rows() < NumBli*BlSizei || fMat.Cols() < NumBlj*BlSizej) {
32  fMat.Redim(NumBli*BlSizei,NumBlj*BlSizej);
33  }
34 }
35 
37  fType(cp.fType), fMesh(cp.fMesh), fConnect(cp.fConnect), fMat(cp.fMat),
38  fBlock(cp.fBlock), fConstrConnect(cp.fConstrConnect), fConstrMat(cp.fConstrMat),
39  fConstrBlock(cp.fConstrBlock), fDestinationIndex(cp.fDestinationIndex),
40  fSourceIndex(cp.fSourceIndex)
41 {
44 }
45 
46 
47 void TPZElementMatrix::Print(std::ostream &out){
48  if(fType == EK)
49  {
50  int ncon = fConnect.NElements();
51  int ic;
52  out << "Connect vector\n";
53  for(ic=0; ic<ncon; ic++) {
54  // out << "Connect index " << fConnect[ic] << endl;
55  out << "ic = " << ic << " index " << fConnect[ic] << " ";
56  this->fMesh->ConnectVec()[fConnect[ic]].Print(*fMesh,out);
57  }
58  out << "Constrained connect vector\n";
59  //fConstrMat.Print("Constrained matrix",out);
60  ncon = fConstrConnect.NElements();
61  for(ic=0; ic<ncon; ic++) {
62  // out << "Connect index " << fConstrConnect[ic] << endl;
63  out << "ic = " << ic << ' ';
64  this->fMesh->ConnectVec()[fConstrConnect[ic]].Print(*fMesh,out);
65  }
67  bool hasdepend = HasDependency();
68  int64_t size = fSourceIndex.NElements();
69  //TPZFMatrix<REAL> constrmatrix(size,size,0.);
70  TPZFNMatrix<400,STATE> constrmatrix(size,size,0.);
71  int64_t in,jn;
72  for(in=0; in<size; in++)
73  {
74  for (jn=0; jn<size; jn++) {
75  if(hasdepend)
76  {
77  constrmatrix(in,jn) = fConstrMat(fSourceIndex[in],fSourceIndex[jn]);
78  }
79  else {
80  constrmatrix(in,jn) = fMat(fSourceIndex[in],fSourceIndex[jn]);
81  }
82 
83  }
84  }
85  out << "SourceIndex = " << fSourceIndex << std::endl;
86  fConstrMat.Print("EKOrig=",out,EMathematicaInput);
87  std::stringstream sout;
88  sout << "EK = ";
89  //out << "Matrix size " << constrmatrix.Rows() << "\n";
90  //sout << "ConstrainedMatrix = ";
91  constrmatrix.Print(sout.str().c_str(), out, EMathematicaInput);
92  }
93  else if(fType == EF)
94  {
96  bool hasdepend = HasDependency();
97  int64_t size = fSourceIndex.NElements();
98  //TPZFMatrix<REAL> constrmatrix(size,size,0.);
99  TPZFMatrix<STATE> constrmatrix(size,fMat.Cols(),0.);
100  int64_t in,jn;
101  for(in=0; in<size; in++)
102  {
103  for (jn=0; jn<fMat.Cols(); jn++) {
104  if(hasdepend)
105  {
106  constrmatrix(in,jn) = fConstrMat(fSourceIndex[in],jn);
107  }
108  else {
109  constrmatrix(in,jn) = fMat(fSourceIndex[in],jn);
110  }
111 
112  }
113  }
114  std::stringstream sout;
115  sout << "EF = ";
116  //out << "Matrix size " << constrmatrix.Rows() << "\n";
117  //sout << "ConstrainedMatrix = ";
118  constrmatrix.Print(sout.str().c_str(), out, EMathematicaInput);
119  }
120  else
121  {
122  DebugStop();
123  }
124 }
125 
127  if (!this->HasDependency()){
128  this->fSourceIndex.Resize(this->fMat.Rows());
129  this->fDestinationIndex.Resize(this->fMat.Rows());
130  int64_t destindex = 0L;
131  int64_t fullmatindex = 0L;
132  const int numnod = this->NConnects();
133  for(int in = 0; in < numnod; in++){
134  const int64_t npindex = this->ConnectIndex(in);
135  TPZConnect &np = this->fMesh->ConnectVec()[npindex];
136  int64_t blocknumber = np.SequenceNumber();
137  int64_t firsteq = this->fMesh->Block().Position(blocknumber);
138  int ndf = this->fMesh->Block().Size(blocknumber);
139  if(np.HasDependency() || np.IsCondensed()) {
140  fullmatindex += ndf;
141  continue;
142  }//for (np)
143  for(int idf=0; idf<ndf; idf++){
144  this->fSourceIndex[destindex] = fullmatindex++;
145  this->fDestinationIndex[destindex++] = firsteq+idf;
146  }//for idf
147  }//for in
148  this->fSourceIndex.Resize(destindex);
149  this->fDestinationIndex.Resize(destindex);
150 #ifdef LOG4CXX
151  if (logger->isDebugEnabled())
152  {
153  std::stringstream sout;
154  sout<<"fSourceIndex " <<fSourceIndex<< "\nfDestinationIndex "<<fDestinationIndex<<std::endl;
155  LOGPZ_DEBUG(logger,sout.str())
156  }
157 #endif
158  }//if
159  else{
160 
161  int64_t destindex = 0L;
162  int64_t fullmatindex = 0L;
163  this->fDestinationIndex.Resize(this->fConstrMat.Rows());
164  this->fSourceIndex.Resize(this->fConstrMat.Rows());
165  int numnod = this->fConstrConnect.NElements();
166  for(int in = 0; in < numnod; in++){
167  const int64_t npindex = this->fConstrConnect[in];
168  TPZConnect &np = this->fMesh->ConnectVec()[npindex];
169  int64_t blocknumber = np.SequenceNumber();
170  int64_t firsteq = this->fMesh->Block().Position(blocknumber);
171  int ndf = this->fMesh->Block().Size(blocknumber);
172  if(np.HasDependency() || np.IsCondensed()) {
173  fullmatindex += ndf;
174  continue;
175  }//for (np)
176  for(int idf=0; idf<ndf; idf++) {
177  this->fSourceIndex[destindex] = fullmatindex++;
178  this->fDestinationIndex[destindex++] = firsteq+idf;
179  }//for idf
180  }//for in
181  this->fSourceIndex.Resize(destindex);
182  this->fDestinationIndex.Resize(destindex);
183  }
184 }//void
185 
187 
188  if (this->fMat.Rows() == 0){
189  LOGPZ_FATAL(logger, "this->fMat not initialized");
190  }
191 
192  int totalnodes= this->NConnects();
193  this->fConstrConnect.Resize(totalnodes);
194  if(totalnodes) this->fConstrConnect.Fill(0,0);
195  int in;
196  std::set<int64_t> origlist,connectlist;
197  for(in=0; in<totalnodes; in++) connectlist.insert(this->fConnect[in]);
198  for (std::list<TPZOneShapeRestraint>::iterator it = fOneRestraints.begin(); it != fOneRestraints.end(); it++) {
199  for (int c=0; c< it->fFaces.size(); c++) {
200  connectlist.insert(it->fFaces[c].first);
201  }
202  }
203  origlist = connectlist;
204  // total number of nodes of the constrained element
205  TPZConnect::BuildConnectList(connectlist, origlist, *this->fMesh);
206  this->fConstrConnect.resize(connectlist.size());
207  std::set<int64_t>::iterator it = connectlist.begin();
208  for (int64_t i=0; i<connectlist.size(); i++) {
209  fConstrConnect[i] = *it;
210  it++;
211  }
212  totalnodes = this->fConstrConnect.NElements();
213 
214  // compute the list of nodes and their proper order of processing
215  TPZVec<int> DependenceOrder;
216  // this->fConstrNod, totalnodes and DependenceOrder
217  // are initialized using codes documented above
218  BuildDependencyOrder(this->fConstrConnect,DependenceOrder,*this->fMesh);
219 
220  // compute the number of statevariables
221  // the number of state variables is the number of unknowns associated with
222  // each shapefunction
223  // numstate is best initialized during computation of the stiffness matrix
224  // TPZMaterial * mat = Material();
225  // int numstate = mat->NStateVariables();
226 
227  // initialize the block structure
228  this->fConstrBlock.SetNBlocks(totalnodes);
229 
230  // toteq contains the total number of equations of the constrained matrix
231  int64_t toteq = 0;
232  for(in=0; in<totalnodes; in++) {
233  int64_t dfnindex = this->fConstrConnect[in];
234  TPZConnect &dfn = fMesh->ConnectVec()[dfnindex];
235  int ndf = dfn.NDof(*fMesh);
236  int ndfcheck = dfn.NState()*dfn.NShape();
237  if(ndf != ndfcheck)
238  {
239  DebugStop();
240  }
241  this->fConstrBlock.Set(in,ndf);
242  toteq += ndf;
243  }
244 
245  this->fConstrBlock.Resequence();
246  this->fConstrBlock.SetMatrix(&this->fConstrMat);
247 
248  int64_t nrhs = this->fMat.Cols();
249  if (this->fType == TPZElementMatrix::EK){
250  this->fConstrMat.Redim(toteq,toteq);
251  }
252  else{
253  this->fConstrMat.Redim(toteq,nrhs);
254  }
255 
256  // copy the original matrix to the constrained matrix
257  int numnod = this->fConnect.NElements();
258  for(in=0; in<numnod; in++) {
259  int irnode =0;
260  int64_t idfn = this->fConnect[in];
261  // find the index of the node in the destination (constrained) matrix
262  while(irnode < totalnodes && this->fConstrConnect[irnode] != idfn) irnode++;
263 
264  // first and last rows in the original matrix
265  int64_t ifirst = this->fBlock.Position(in);
266  int64_t ilast = ifirst+this->fBlock.Size(in);
267 
268  // first and last rows in the desination (reception) matrix
269  int64_t irfirst = this->fConstrBlock.Position(irnode);
270  // int irlast = irfirst+this->fConstrBlock->Size(irnode);
271 
272  int64_t i,ir,ieq;
273  if (this->fType == TPZElementMatrix::EF){
274  for(i=ifirst,ir=irfirst;i<ilast;i++,ir++) {
275  for(ieq=0; ieq<nrhs; ieq++) {
276  (this->fConstrMat)(ir,ieq) = (this->fMat)(i,ieq);
277  }
278  }
279  }
280  else{
281  int jn;
282  for(jn=0; jn<numnod; jn++) {
283  int jrnode = 0;
284  int64_t jdfn = this->fConnect[jn];
285  // find the index of the node in the destination (constrained) matrix
286  while(jrnode < totalnodes && this->fConstrConnect[jrnode] != jdfn) jrnode++;
287  if(jrnode == totalnodes) {
288  LOGPZ_WARN(logger, "node not found in node list");
289  }
290  // first and last columns in the original matrix
291  int64_t jfirst = this->fBlock.Position(jn);
292  int64_t jlast = jfirst+this->fBlock.Size(jn);
293  // first and last columns in the desination (reception) matrix
294  int64_t jrfirst = this->fConstrBlock.Position(jrnode);
295  //int jrlast = irfirst+this->fConstrBlock->Size(jrnode);
296  int64_t j,jr;
297  for(i=ifirst,ir=irfirst;i<ilast; i++,ir++) {
298  for(j=jfirst,jr=jrfirst;j<jlast; j++,jr++) {
299  (this->fConstrMat)(ir,jr) = (this->fMat)(i,j);
300  }
301  }
302  }
303  }//else
304  }
305 
306  int numnodes_processed = 0;
307  int current_order = 0;
308  while(numnodes_processed < totalnodes) {
309  int in;
310  for(in=0; in<totalnodes; in++) {
311  int64_t dfnindex = this->fConstrConnect[in];
312  TPZConnect *dfn = &(fMesh->ConnectVec()[dfnindex]);
313  if(DependenceOrder[in] != current_order) continue;
314 
315  // only nodes which have dependency order equal to the
316  // current order are processed
317  numnodes_processed++;
318 
319  int64_t inpos = this->fConstrBlock.Position(in);
320  int64_t insize = this->fConstrBlock.Size(in);
321  // inpos : position of the dependent equation
322  // insize : number of equations processed
323 
324  // loop over the nodes from which dfn depends
325  TPZConnect::TPZDepend *dep = dfn->FirstDepend();
326  while(dep) {
327  int64_t depnodeindex = dep->fDepConnectIndex;
328  // look for the index where depnode is found
329  int depindex=0;
330  while(depindex < totalnodes && this->fConstrConnect[depindex] != depnodeindex) depindex++;
331  if(depindex == totalnodes) {
332  LOGPZ_WARN(logger,"node not found in node list");
333  }
334 
335  int64_t deppos = this->fConstrBlock.Position(depindex);
336  int64_t depsize = this->fConstrBlock.Size(depindex);
337  // deppos : position of the receiving equation
338  // depsize : number of receiving equations
339 
340  // process the rows of the constrained matrix
341  int64_t send;
342  int64_t receive;
343  int ieq;
344  STATE coef;
345  int idf;
346  int numstate = dfn->NState();
347  for(send=inpos; send<inpos+insize; send += numstate) {
348  for(receive=deppos; receive<deppos+depsize; receive += numstate) {
349  coef = dep->fDepMatrix((send-inpos)/numstate,(receive-deppos)/numstate);
350  if (this->fType == TPZElementMatrix::EK){
351  for(ieq=0; ieq<toteq; ieq++) for(idf=0; idf<numstate; idf++) {
352  (this->fConstrMat)(receive+idf,ieq) += coef*(this->fConstrMat)(send+idf,ieq);
353  }
354  }//EK
355  else{
356  for(ieq=0; ieq<nrhs; ieq++) for(idf=0; idf<numstate; idf++) {
357  (this->fConstrMat)(receive+idf,ieq) += coef*(this->fConstrMat)(send+idf,ieq);
358  }
359  }//EF
360  }
361  }
362 
363  if (this->fType == TPZElementMatrix::EK){
364  for(send=inpos; send<inpos+insize; send += numstate) {
365  for(receive=deppos; receive<deppos+depsize; receive += numstate) {
366  coef = dep->fDepMatrix((send-inpos)/numstate,(receive-deppos)/numstate);
367  for(ieq=0; ieq<toteq; ieq++) for(idf=0; idf<numstate; idf++) {
368  (this->fConstrMat)(ieq,receive+idf) += coef*(this->fConstrMat)(ieq,send+idf);
369  }
370  }
371  }
372  }//EK
373 
374  dep = dep->fNext;
375  } // end of while
376 
378  if (fOneRestraints.size())
379  {
381  }
382 
383 
384  } // end of loop over all nodes
385  current_order++;
386  } // end of while loop
387 }//void
388 
391 {
392  int64_t dfnindex = this->fConstrConnect[constraintindex];
393 
394 
395 #ifdef LOG4CXX
396  int count = 0;
397  for (std::list<TPZOneShapeRestraint>::iterator it = fOneRestraints.begin(); it != fOneRestraints.end(); it++) {
398  if (it->fFaces[0].first != dfnindex) {
399  continue;
400  }
401  count++;
402  }
403  if (count && logger->isDebugEnabled()) {
404  std::stringstream sout;
405  sout << "Element matrix before ApplyOneShapeConstraint\n";
406  fConstrMat.Print("EKBefore = ",sout,EMathematicaInput);
407  LOGPZ_DEBUG(logger, sout.str())
408  }
409 #endif
410  int64_t inpos = this->fConstrBlock.Position(constraintindex);
411  int64_t toteq = this->fConstrMat.Rows();
412  int64_t nrhs = this->fConstrMat.Cols();
413 
414  for (std::list<TPZOneShapeRestraint>::iterator it = fOneRestraints.begin(); it != fOneRestraints.end(); it++) {
415  if (it->fFaces[0].first != dfnindex) {
416  continue;
417  }
418  int64_t send = inpos+it->fFaces[0].second;
419  for (int id=1; id<4; id++) {
420  int64_t depindex = it->fFaces[id].first;
421  int locdep = 0;
422  for (locdep = 0; locdep < fConstrConnect.size(); locdep++) {
423  if (fConstrConnect[locdep] == depindex) {
424  break;
425  }
426  }
427  if (locdep == fConstrConnect.size()) {
428  DebugStop();
429  }
430  int64_t deppos = this->fConstrBlock.Position(locdep);
431  int64_t receive = deppos+it->fFaces[id].second;
432  REAL coef = -it->fOrient[id]/it->fOrient[0];
433  if (this->fType == TPZElementMatrix::EK){
434  for(int ieq=0; ieq<toteq; ieq++) {
435  (this->fConstrMat)(receive,ieq) += coef*(this->fConstrMat)(send,ieq);
436  }
437  }//EK
438  else
439  {
440 
441  for(int ieq=0; ieq<nrhs; ieq++) {
442  (this->fConstrMat)(receive,ieq) += coef*(this->fConstrMat)(send,ieq);
443  }
444  }//EF
445 
446  if (this->fType == TPZElementMatrix::EK){
447  for(int ieq=0; ieq<toteq; ieq++)
448  {
449  (this->fConstrMat)(ieq,receive) += coef*(this->fConstrMat)(ieq,send);
450  }
451  }//EK
452 
453  }
454  if (this->fType == TPZElementMatrix::EK){
455  for(int ieq=0; ieq<toteq; ieq++)
456  {
457  (this->fConstrMat)(ieq,send) = 0.;
458  (this->fConstrMat)(send,ieq) = 0.;
459  }
460  (this->fConstrMat)(send,send) = 1.;
461  }//EK
462  else
463  {
464  for(int ieq=0; ieq<nrhs; ieq++) {
465  (this->fConstrMat)(send,ieq) = 0.;
466  }
467  }
468 
469  }
470 #ifdef LOG4CXX
471  if (count && logger->isDebugEnabled()) {
472  std::stringstream sout;
473  sout << "Element matrix after ApplyOneShapeConstraint\n";
474  fConstrMat.Print("EKAfter = ",sout,EMathematicaInput);
475  LOGPZ_DEBUG(logger, sout.str())
476  }
477 #endif
478 }
479 
480 
481 
483 {
484  if (fOneRestraints.size()) {
485  return true;
486  }
487  int in, nconnects = this->NConnects();
488  int64_t index;
489  for(in=0; in<nconnects; in++)
490  {
491  index = this->ConnectIndex(in);
492  // bool val =this->fMesh->ConnectVec()[index].HasDependency();
493  if(this->fMesh->ConnectVec()[index].HasDependency())
494  {
495  return true;
496  }
497  }
498  return false;
499 }
500 
503 {
504  if (permute.size() != fConnect.size()) {
505  DebugStop();
506  }
507  TPZElementMatrix cp(*this);
508  for (int64_t i=0; i<fConnect.size(); ++i) {
509  fConnect[i] = cp.fConnect[permute[i]];
510  fBlock.Set(i, cp.fBlock.Size(permute[i]));
511  }
512  fBlock.Resequence();
513 #ifdef LOG4CXX2
514  if (logger->isDebugEnabled()) {
515  std::stringstream sout;
516  cp.fBlock.Print("cp.fBlock ",sout);
517  fBlock.Print("fBlock ",sout);
518  LOGPZ_DEBUG(logger, sout.str())
519  }
520 #endif
521  if (fType == EK) {
522  int64_t ibl,jbl;
523  for (ibl=0; ibl<fBlock.NBlocks(); ++ibl) {
524  int64_t iblsize = fBlock.Size(ibl);
525  for (jbl=0; jbl<fBlock.NBlocks(); ++jbl) {
526  int64_t jblsize = fBlock.Size(jbl);
527  for (int64_t idf=0; idf<iblsize; ++idf) {
528  for (int64_t jdf=0; jdf<jblsize; ++jdf) {
529  fBlock(ibl,jbl,idf,jdf) = cp.fBlock(permute[ibl],permute[jbl],idf,jdf);
530  }
531  }
532  }
533  }
534  }
535  else if (fType == EF)
536  {
537  int64_t ibl;
538  for (ibl=0; ibl<fBlock.NBlocks(); ++ibl) {
539  int64_t iblsize = fBlock.Size(ibl);
540  int64_t jblsize = fMat.Cols();
541  for (int64_t idf=0; idf<iblsize; ++idf) {
542  for (int64_t jdf=0; jdf<jblsize; ++jdf) {
543  fBlock(ibl,0,idf,jdf) = cp.fBlock(permute[ibl],0,idf,jdf);
544  }
545  }
546  }
547  }
548 }
549 
550 
552  // nodelist (input) : vector which contains pointers to all nodes which
553  // are in the dependency chain of the nodes of the element
554  int64_t totalnodes = connectlist.NElements();
555  DependenceOrder.Resize(totalnodes);
556  DependenceOrder.Fill(0,0);
557  // initialize the vector which contains the
558  // dependency order to zero
559  int CurrentOrder = 0;
560  // order which is currently processed
561  int64_t numnodes_processed = totalnodes;
562 
563  for (std::list<TPZOneShapeRestraint>::iterator it = fOneRestraints.begin(); it != fOneRestraints.end(); it++) {
564  for (int i=1; i<4; i++)
565  {
566  int64_t index = it->fFaces[1].first;
567  TPZConnect &dfn = mesh.ConnectVec()[index];
568  dfn.SetDependenceOrder(index,mesh,1,connectlist,DependenceOrder);
569  }
570  }
571 
572 
573  // number of nodes processed during the current cycle
574  while(numnodes_processed) {
575 
576  numnodes_processed = 0;
577  int64_t i;
578  for(i=0; i<totalnodes; i++) {
579  int64_t dfnindex = connectlist[i];
580  TPZConnect &dfn = mesh.ConnectVec()[dfnindex];
581  if(dfn.HasDependency() && DependenceOrder[i] == CurrentOrder) {
582  dfn.SetDependenceOrder(dfnindex,mesh,CurrentOrder,connectlist,DependenceOrder);
583  // this method will fill in the DependenceOrder vector by recursively
584  // calling SetDependenceOrder for the nodes upon which dfn depends
585  numnodes_processed++;
586  }
587  }
588  // force the loop to process the order one connects
589  if (fOneRestraints.size() && CurrentOrder == 0) {
590  numnodes_processed++;
591  }
592  CurrentOrder++;
593  }
594 }
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
Definition: pzblock.h:177
int Set(const int index, const int dim, const int pos=-1)
Modifies existing block dimensions or creates a new block with given index.
Definition: pzblock.cpp:104
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Definition: pzconnect.h:30
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 SetMatrixMinSize(short NumBli, short NumBlj, short BlMinSizei, short BlMinSizej)
Definition: pzelmat.cpp:27
TPZBlock< STATE > fConstrBlock
Block structure associated with fConstrMat.
Definition: pzelmat.h:51
void BuildDependencyOrder(TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder, TPZCompMesh &mesh)
Compute the dependency order of the connects, considering the one shape restraints.
Definition: pzelmat.cpp:551
virtual void resize(const int64_t newsize)
Definition: pzvec.h:213
TPZStack< int64_t > fConnect
Vector of pointers to TPZConnect objects.
Definition: pzelmat.h:39
void ApplyOneShapeConstraints(int constraintindex)
Apply the constraint of the one shape restraints.
Definition: pzelmat.cpp:390
TPZFNMatrix< 1000, STATE > fMat
Pointer to a blocked matrix object.
Definition: pzelmat.h:41
std::list< TPZOneShapeRestraint > fOneRestraints
list of one degree of freedom restraints
Definition: pzelmat.h:56
int NDof(TPZCompMesh &mesh)
Number of degrees of freedom associated with the object.
Definition: pzconnect.cpp:317
#define LOGPZ_WARN(A, B)
Define log for warnings.
Definition: pzlog.h:91
TPZBlock< STATE > fBlock
Block structure associated with fMat.
Definition: pzelmat.h:43
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Definition: pzmanvector.h:426
TPZManVector< int64_t > fDestinationIndex
Definition: pzelmat.h:53
void ComputeDestinationIndices()
Definition: pzelmat.cpp:126
#define LOGPZ_FATAL(A, B)
Define log for fatal errors (cout)
Definition: pzlog.h:95
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
int64_t ConnectIndex(int i) const
Returns the pointer to the ith node of the element.
Definition: pzelmat.h:92
void Print(std::ostream &out)
Definition: pzelmat.cpp:47
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
Definition: pzvec.h:373
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Definition: pzconnect.h:158
int NConnects()
Returns the number of nodes of TElementMatrix.
Definition: pzelmat.h:87
int64_t fDepConnectIndex
Definition: pzconnect.h:69
Structure to reference dependency.
Definition: pzconnect.h:67
void SetMatrixSize(short NumBli, short NumBlj, short BlSizei, short BlSizej)
Definition: pzelmat.cpp:18
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
TPZStack< int64_t > fConstrConnect
Vector of all nodes connected to the element.
Definition: pzelmat.h:45
unsigned int NShape() const
Definition: pzconnect.h:151
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
int HasDependency() const
Returns whether exist dependecy information.
Definition: pzconnect.h:292
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
Definition: pzcmesh.h:213
TPZCompMesh * fMesh
Definition: pzelmat.h:36
TPZDepend * fNext
Definition: pzconnect.h:71
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
Definition: pzcmesh.h:198
TPZManVector< int64_t > fSourceIndex
Definition: pzelmat.h:53
void BuildConnectList(int64_t index, std::set< int64_t > &indepconnectlist, std::set< int64_t > &depconnectlist, TPZCompMesh &mesh)
Builds the list of all connectivities related to ConnectIndex including the connects pointed to by de...
Definition: pzconnect.cpp:509
int SetNBlocks(const int num_of_blocks)
Sets number of blocks on diagonal matrix.
Definition: pzblock.cpp:91
Contains declaration of TPZCompMesh class which is a repository for computational elements...
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
Definition: pzfmatrix.h:616
unsigned char NState() const
Number of state variables associated with the connect.
Definition: pzconnect.h:146
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
Definition: pzelmat.h:30
TPZFNMatrix< 1000, STATE > fConstrMat
Pointer to the constrained matrix object.
Definition: pzelmat.h:48
int NBlocks() const
Returns number of blocks on diagonal.
Definition: pzblock.h:165
void ApplyConstraints()
Apply the constraints applied to the nodes by transforming the tangent matrix and right hand side...
Definition: pzelmat.cpp:186
TPZFNMatrix< 50, REAL > fDepMatrix
Definition: pzconnect.h:70
void PermuteGather(TPZVec< int64_t > &permute)
permute the order of the connects
Definition: pzelmat.cpp:502
static int idf[6]
TPZDepend * FirstDepend()
Definition: pzconnect.h:296
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
int Size(const int block_diagonal) const
Returns block dimension.
Definition: pzblock.h:171
void SetMatrix(TPZMatrix< TVar > *const other)
Changes pointer to other.
Definition: pzblock.h:51
void Fill(const T &copy, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
Definition: pzvec.h:460
int64_t Cols() const
Returns number of cols.
Definition: pzmatrix.h:809
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 Print(const char *title="", TPZostream &out=std::cout, TPZMatrix< TVar > *mat=NULL)
Prints all the blocks of the matrix.
Definition: pzblock.cpp:424
void SetDependenceOrder(int64_t myindex, TPZCompMesh &mesh, int CurrentOrder, TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder)
Definition: pzconnect.cpp:245
bool IsCondensed() const
Access method to return the indication whether the connect is condensed or not.
Definition: pzconnect.h:223
bool HasDependency()
Returns true if the element has at least one dependent node. Returns false otherwise.
Definition: pzelmat.cpp:482
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
Definition: pzfmatrix.h:716
int Resequence(const int start=0)
Resequences blocks positioning.
Definition: pzblock.cpp:150