NeoPZ
pzconnect.cpp
Go to the documentation of this file.
1 
6 #include "pzconnect.h"
7 #include "pzerror.h"
8 #include "pzvec.h"
9 #include "pzstack.h"
10 #include "pzcmesh.h"
11 #include "pzbndcond.h"
12 #include "TPZStream.h"
13 #include "pzlog.h"
14 
15 #ifdef LOG4CXX
16 static LoggerPtr logger(Logger::getLogger("pz.mesh.tpzconnect"));
17 #endif
18 
19 using namespace std;
20 
21 TPZConnect::TPZConnect() : fDependList(0){
22  Reset();
23 }
24 
26  if(fDependList) {
27  cout << "The dependency list should be NULL - Index " << fSequenceNumber << "\n";
28  TPZDepend *ptr = fDependList;
29  while(ptr) {
30  int depindex = ptr->fDepConnectIndex;
31  cout << "Connect index = " << depindex << endl;
32  ptr->fDepMatrix.Print(" ",cout);
33  ptr = ptr->fNext;
34  // nod.Print(mesh,out);
35  }
36  delete fDependList;
37  fDependList = 0;
38  }
39 }
40 
44  fNShape = copy.fNShape;
45  // fOrder = copy.fOrder;
46  fFlags = copy.fFlags;
47  fDependList = 0;
48  if(copy.fDependList) fDependList = new TPZDepend(*copy.fDependList);
49 }
50 
52  if(this == &copy) return *this;
53  if(fDependList) delete fDependList;
56  SetNShape(copy.fNShape);
57  SetOrder(copy.fCompose.fOrder,-1);
58  SetNState(copy.fCompose.fNState);
59  SetCondensed(copy.fCompose.fIsCondensed);
60  SetLagrangeMultiplier(copy.fCompose.fLagrangeMultiplier);
61 
62  fFlags = copy.fFlags;
63  if(copy.fDependList) fDependList = new TPZDepend(*copy.fDependList);
64  return *this;
65 }
66 
67 void TPZConnect::Print(const TPZCompMesh &mesh, std::ostream & out) {
68  int orde = fCompose.fOrder;
69  int nstate = fCompose.fNState;
70  int nshape = fNShape;
71  out << "TPZConnect : " << "Sequence number = " << fSequenceNumber <<" Order = " << orde << " NState = " << nstate << " NShape " << nshape << " IsCondensed " << IsCondensed() << " IsLagrMult " << (int) LagrangeMultiplier();
72  if(fSequenceNumber > -1)
73  {
74  int64_t pos = mesh.Block().Position(fSequenceNumber);
75  out << "\tEquation = " << pos;
76  out << "\tNumElCon = " << fNElConnected << " Block size " << mesh.Block().Size(fSequenceNumber);
77  out << " Solution ";
78  int64_t ieq;
79  for(ieq=0; ieq< mesh.Block().Size(fSequenceNumber); ieq++)
80  {
81  out << mesh.Block()(fSequenceNumber,0,ieq,0) << ' ';
82  }
83  }
84 
85  out << endl;
86  if(fDependList) {
87  out << "Dependency :\n";
88  TPZDepend *ptr = fDependList;
89  while(ptr) {
90  int64_t depindex = ptr->fDepConnectIndex;
91  //TPZConnect &nod = mesh.ConnectVec()[depindex];
92  out << "Connect index = " << depindex << endl;
93  ptr->fDepMatrix.Print(" ",out);
94  ptr = ptr->fNext;
95  // nod.Print(mesh,out);
96  }
97  }
98 }
99 
100 void TPZConnect::Print(TPZCompMesh &mesh, TPZVec<REAL> &cp, std::ostream & out)
101 {
102  out << "TPZConnect : " << "Sequence number = " << fSequenceNumber <<" Order = " << fCompose.fOrder << " NState = " << fCompose.fNState << " NShape " << fNShape ;
103  out << " coordinate " << cp;
104  if(fSequenceNumber > -1)
105  {
106  out << "\tNumElCon = " << fNElConnected << " Block size " << mesh.Block().Size(fSequenceNumber);
107  out << " Solution ";
108  int64_t ieq;
109  for(ieq=0; ieq< mesh.Block().Size(fSequenceNumber); ieq++)
110  {
111  out << mesh.Block()(fSequenceNumber,0,ieq,0) << ' ';
112  }
113  }
114 
115  out << endl;
116  if(fDependList) {
117  out << "Dependency :\n";
118  TPZDepend *ptr = fDependList;
119  while(ptr) {
120  int64_t depindex = ptr->fDepConnectIndex;
121  //TPZConnect &nod = mesh.ConnectVec()[depindex];
122  out << "Connect index = " << depindex << endl;
123  ptr->fDepMatrix.Print(" ",out);
124  ptr = ptr->fNext;
125  // nod.Print(mesh,out);
126  }
127  }
128 }
129 
130 TPZConnect::TPZDepend *TPZConnect::AddDependency(int64_t myindex, int64_t dependindex,TPZFMatrix<REAL> &depmat,int64_t ipos,int64_t jpos,int isize,int jsize){
131  if(dependindex == myindex) return 0;
132  TPZDepend *connect =0;
133  if(dependindex == -1)
134  {
135  cout << "dependindex = -1 in " << __PRETTY_FUNCTION__ << "DebugStop() called!" << endl;
136  DebugStop();
137  }
138  if (isize == 0 || jsize == 0) {
139  DebugStop();
140  }
141  if(fDependList) connect = fDependList->HasDepend(dependindex);
142  if(!connect) {
143  connect = new TPZDepend(dependindex,depmat,ipos,jpos,isize,jsize);
144  connect->fNext = fDependList;
145  fDependList = connect;
146  } else {
147  TPZFNMatrix<50,REAL> temp(isize,jsize);
148  int i,j;
149  for(i=0; i<isize; i++) for(j=0; j<jsize; j++) temp(i,j) = depmat(ipos+i,jpos+j);
150 
151 
152  if (temp.Rows()!=connect->fDepMatrix.Rows() || temp.Cols()!=connect->fDepMatrix.Cols()){
153  cout << "TPZConnect::Dependency inconsistent \t"
154  << "temp(r,c): (" << temp.Rows() << " , " << temp.Cols() << " )\t fDepMatrix(r,c): ( "
155  << connect->fDepMatrix.Rows() << " , " << connect->fDepMatrix.Cols() << " )\n";
156  DebugStop();
157  return connect;
158  }
159 
160 
161  temp -= connect->fDepMatrix;
162  REAL val = Norm(temp);
163  if(val > 1.e-6) {
164  cout << "TPZConnect::Dependency inconsistent\n";
165  }
166  }
167  return connect;
168 }
169 
171  if(fDependList)
172  {
173  delete fDependList;
174  fDependList = 0;
175  }
176 }
177 
178 void TPZConnect::RemoveDepend(int64_t myindex, int64_t dependindex) {
179  if(dependindex == myindex || !fDependList) return;
180  TPZDepend *dep = fDependList->HasDepend(dependindex);
181  if(dep) fDependList = fDependList->RemoveDepend(dep);
182 }
183 
185 {
186  if(!fDependList) return 0;
187  int maxdep = 0;
188  TPZDepend *ptr = fDependList;
189  while(ptr) {
190  int depindex = ptr->fDepConnectIndex;
191  TPZConnect &nod = mesh.ConnectVec()[depindex];
192  int depth = nod.DependencyDepth(mesh);
193  maxdep = depth > maxdep ? depth : maxdep;
194  ptr = ptr->fNext;
195  }
196  maxdep++;
197  return maxdep;
198 }
199 
202 {
203  if(!fDependList) return 0;
204  int numdep = 0;
205  TPZDepend *ptr = fDependList;
206  while(ptr)
207  {
208  numdep++;
209  ptr = ptr->fNext;
210  }
211  return numdep;
212 }
213 
214 
221 void TPZConnect::AddToList(int64_t myindex, TPZCompMesh &mesh, TPZStack<int64_t> &connectlist){
222  int64_t in=0, cap = connectlist.NElements();
223  while(in < cap && connectlist[in] != myindex) in++;
224  if(in == cap) connectlist.Push(myindex);
225  // this inserts the node in the list and increments the pointer firstfree
226  TPZDepend *dp = fDependList;
227  while(dp) {
228  TPZConnect &depc = mesh.ConnectVec()[dp->fDepConnectIndex];
229  depc.AddToList(dp->fDepConnectIndex,mesh,connectlist);
230  dp = dp->fNext;
231  }
232 }
233 
234 void TPZConnect::AddToList(int64_t myindex, TPZCompMesh &mesh, std::set<int64_t> &connectlist){
235  connectlist.insert(myindex);
236  // this inserts the node in the list and increments the pointer firstfree
237  TPZDepend *dp = fDependList;
238  while(dp) {
239  TPZConnect &depc = mesh.ConnectVec()[dp->fDepConnectIndex];
240  depc.AddToList(dp->fDepConnectIndex,mesh,connectlist);
241  dp = dp->fNext;
242  }
243 }
244 
245 void TPZConnect::SetDependenceOrder(int64_t myindex, TPZCompMesh &mesh, int CurrentOrder,TPZVec<int64_t> &ConnectList,TPZVec<int> &DependenceOrder) {
246  int64_t in=0,cap = ConnectList.NElements();
247  // identify where the current node is in the list
248  while(in<cap && ConnectList[in] != myindex) in++;
249  if(in== cap) {
250  cout << "TPZConnect::SetDependenceOrder node not encountered in list\n";
251  DebugStop();
252  return;
253  }
254  DependenceOrder[in] = (DependenceOrder[in] < CurrentOrder) ? CurrentOrder : DependenceOrder[in];
255  TPZDepend *dl = fDependList;
256  while(dl) {
257  int depindex = dl->fDepConnectIndex;
258  TPZConnect &depc = mesh.ConnectVec()[depindex];
259  depc.SetDependenceOrder(depindex,mesh,CurrentOrder+1,ConnectList,DependenceOrder);
260  // call SetDependenceOrder recursively on the nodes from which the current node depends
261  dl = dl->fNext;
262  // move to the next item in the list
263  }
264 }
265 
267 
268 }
269 
270 TPZConnect::TPZDepend::TPZDepend(int64_t dependindex,TPZFMatrix<REAL> &depmat,int64_t ipos,int64_t jpos, int isize, int jsize) :
271 fDepMatrix(isize,jsize) {
272  fDepConnectIndex = dependindex;
273  int i,j;
274  for(i=0; i<isize; i++) for(j=0; j<jsize; j++) fDepMatrix(i,j) = depmat(ipos+i,jpos+j);
275  fNext = 0;
276 }
277 
279 fDepMatrix(copy.fDepMatrix), fNext(0) {
280  if(copy.fNext) fNext = new TPZDepend(*copy.fNext);
281 }
282 
283 TPZConnect::TPZDepend::TPZDepend(int64_t connectindex) : fDepConnectIndex(connectindex),
284 fDepMatrix(),fNext(0)
285 {
286 }
287 
289  if(fNext) delete fNext;
290 }
291 
293  TPZDepend *ptr = this;
294  while(ptr && ptr->fDepConnectIndex != depindex) ptr = ptr->fNext;
295  return ptr;
296 }
297 
299  TPZDepend *res = this;
300  if(this == ptr) {
301  res = ptr->fNext;
302  this->fNext = 0;
303  delete this;
304  } else {
305  TPZDepend *run = this;
306  while(run && run->fNext != ptr) run = run->fNext;
307  if(run) {
308  run->fNext = run->fNext->fNext;
309  ptr->fNext = 0;
310  delete ptr;
311  }
312  }
313  return res;
314 }
315 
316 
318  if(fSequenceNumber<0) {
319  PZError << "TPZConnect::NDof. Connect is inactive.\n";
320  return -1;
321  }
322  return mesh.Block().Size(fSequenceNumber);
323 }
324 
325 
326 int TPZConnect::CheckDependency(int nshape, TPZCompMesh *mesh, int nstate) {
327 
328  if(HasDependency()) {
330  while(first) {
331  int64_t nr = first->fDepMatrix.Rows();
332  int64_t nc = first->fDepMatrix.Cols();
333  if(nr != nshape) {
334  cout << "TPZConnect::CheckDependency inconsistent dependency nshape = " << nshape << " nrows " << nr << endl;
335  return -1;
336  }
337  TPZConnect &c2 = mesh->ConnectVec()[first->fDepConnectIndex];
338  if(nc*nstate != c2.NDof(*mesh)) {
339  cout << "TPZConnect::CheckDependency inconsistent dependency ndof = " << c2.NDof(*mesh) << " ncols " << nc << endl;
340  return -1;
341  }
342  int c2result = 0;
343  if(c2.HasDependency()) {
344  c2result = c2.CheckDependency(c2.NDof(*mesh)/nstate,mesh,nstate);
345  }
346  if(c2result == -1) return c2result;
347  first = first->fNext;
348  }
349  }
350  return 0;
351 }
352 
353 void TPZConnect::ExpandShape(int64_t cind, TPZVec<int64_t> &connectlist, TPZVec<int> &blocksize, TPZFMatrix<REAL> &phi, TPZFMatrix<REAL> &dphi){
354 
355  if(!fDependList) return;
356  int64_t dim = dphi.Rows();
357  int64_t locind = 0;
358  int64_t ncon = connectlist.NElements();
359  int eqloc = 0;
360  while(locind < ncon && connectlist[locind] != cind) {
361  eqloc += blocksize[locind];
362  locind++;
363  }
364  if(locind == ncon) {
365  cout << "TPZConnect::ExpandShape wrong data structure locind\n";
366  return;
367  }
368  TPZDepend *dep = fDependList;
369  while(dep) {
370  int64_t eqrem = 0;
371  int64_t remind = 0;
372  while(remind < ncon && connectlist[remind] != dep->fDepConnectIndex) {
373  eqrem += blocksize[remind];
374  remind++;
375  }
376  if(remind == ncon) {
377  cout << "TPZConnect::ExpandShape wrong data structure remind\n";
378  return;
379  }
380  int64_t rows = dep->fDepMatrix.Rows();
381  int64_t cols = dep->fDepMatrix.Cols();
382  if(rows != blocksize[locind] || cols != blocksize[remind]) {
383  cout << "TPZConnect::ExpandShape wrong data structure sizes\n";
384  return;
385  }
386  int64_t r,c,d;
387  for(r=0; r<rows; r++) {
388  for(c=0; c<cols; c++) {
389  phi(eqrem+c,0) += phi(eqloc+r)*(REAL)(dep->fDepMatrix(r,c));
390  for(d=0; d<dim; d++) {
391  dphi(d,eqrem+c) += dphi(d,eqloc+r)*(REAL)(dep->fDepMatrix(r,c));
392  }
393  }
394  }
395  dep = dep->fNext;
396  }
397  int r,d;
398  for(r=0; r<blocksize[locind]; r++) {
399  phi(eqloc+r,0) = 0.;
400  for(d=0; d<dim; d++) {
401  dphi(d,eqloc+r) = 0.;
402  }
403  }
404 }
405 
407  return Hash("TPZConnect::TPZDepend");
408 }
409 
410 void TPZConnect::TPZDepend::Write(TPZStream &buf, int withclassid) const {
411  buf.Write(&fDepConnectIndex);
412  fDepMatrix.Write(buf, withclassid);
414 }
415 
416 void TPZConnect::TPZDepend::Read(TPZStream &buf, void *context) {
417  buf.Read(&fDepConnectIndex);
418  fDepMatrix.Read(buf, context);
419  fNext = dynamic_cast<TPZDepend*>(TPZPersistenceManager::GetInstance(&buf));
420 }
421 
423 void TPZConnect::Write(TPZStream &buf, int withclassid) const { //ok
424  buf.Write(&fSequenceNumber);
425  buf.Write(&fNElConnected);
426  buf.Write(&fFlags);
427  buf.Write(&fCompose.fOrder);
428  buf.Write(&fCompose.fNState);
429  buf.Write(&fCompose.fLagrangeMultiplier);
430  buf.Write(fCompose.fIsCondensed);
431  buf.Write(&fNShape);
433 }
434 
436 void TPZConnect::Read(TPZStream &buf, void *context) { //ok
437  buf.Read(&fSequenceNumber);
438  buf.Read(&fNElConnected);
439  buf.Read(&fFlags);
440  buf.Read(&fCompose.fOrder);
441  buf.Read(&fCompose.fNState);
442  buf.Read(&fCompose.fLagrangeMultiplier);
443  buf.Read(fCompose.fIsCondensed);
444  buf.Read(&fNShape);
446 }
447 
448 void TPZConnect::CopyFrom(TPZConnect &orig,std::map<int64_t,int64_t> & gl2lcIdx)
449 {
452  fFlags = orig.fFlags;
453  fNShape = orig.fNShape;
454  TPZDepend * depend = orig.fDependList;
455  bool copydepend = true;
456  while ( depend )
457  {
458  if (gl2lcIdx.find(depend->fDepConnectIndex) != gl2lcIdx.end())
459  {
460  depend = depend->fNext;
461  }
462  else
463  {
464  depend = 0;
465  copydepend = false;
466  }
467  }
468  if(orig.fDependList && copydepend)
469  {
470  fDependList = new TPZDepend(-1);
471  fDependList->CopyFrom(orig.fDependList,gl2lcIdx);
472  }
473 }
474 
475 void TPZConnect::TPZDepend::CopyFrom(TPZDepend *orig,std::map<int64_t,int64_t>& gl2lcIdx)
476 {
477  int64_t loccondepIdx = -1;
478  int64_t origdepconIdx = orig->fDepConnectIndex;
479  if (gl2lcIdx.find(origdepconIdx) != gl2lcIdx.end()) loccondepIdx = gl2lcIdx[origdepconIdx];
480  else
481  {
482  std::stringstream sout;
483  sout << "ERROR in : " << __PRETTY_FUNCTION__
484  << " trying to clone a dependency connect index: " << origdepconIdx
485  << " wich is not in mapped connect indexes!" ;
486  LOGPZ_ERROR(logger,sout.str().c_str());
487  return;
488  }
489  fDepConnectIndex = loccondepIdx;
490 
491  fDepMatrix = orig->fDepMatrix;
492 
493  TPZDepend *depend = orig->fNext;
494  while (depend)
495  {
496  if (gl2lcIdx.find(depend->fDepConnectIndex) != gl2lcIdx.end())
497  {
498  fNext = new TPZDepend(-1);
499  fNext->CopyFrom(depend,gl2lcIdx);
500  depend = 0;
501  }
502  else
503  {
504  depend = depend->fNext;
505  }
506  }
507 }
508 
509 void TPZConnect::BuildConnectList(int64_t index, std::set<int64_t> &indepconnectlist, std::set<int64_t> &depconnectlist, TPZCompMesh &mesh){
510  if(fDependList)
511  {
512  depconnectlist.insert(index);
513  TPZDepend *dep = fDependList;
514  while(dep)
515  {
516  TPZConnect &master = mesh.ConnectVec()[dep->fDepConnectIndex];
517  master.BuildConnectList(dep->fDepConnectIndex,indepconnectlist,depconnectlist,mesh);
518  dep = dep->fNext;
519  }
520  }
521  else if (IsCondensed())
522  {
523  depconnectlist.insert(index);
524  }
525  else
526  {
527  indepconnectlist.insert(index);
528  }
529 }//void
530 
532  TPZConnect *dfn;
533  int64_t dfnindex;
534  int64_t nconnects = ConnectIndex.NElements();
535  int64_t in;
536  for(in = 0; in < nconnects; in++){
537  dfnindex = ConnectIndex[in];
538  dfn = & (mesh.ConnectVec()[ dfnindex ]);
539  dfn->AddToList(dfnindex,mesh,connectlist);
540  }//for in
541 }//void
542 
543 void TPZConnect::BuildConnectList(std::set<int64_t> &connectlist, std::set<int64_t> &additional, TPZCompMesh &mesh){
544  TPZConnect *dfn;
545  int dfnindex;
546  TPZAdmChunkVector<TPZConnect> &connectvec = mesh.ConnectVec();
547  // int nconnects = additional.size();
548  std::set<int64_t>::iterator it;
549  for(it = additional.begin() ; it != additional.end(); it++){
550  dfnindex = *it;
551  dfn = & connectvec[ dfnindex ];
552  dfn->AddToList(dfnindex,mesh,connectlist);
553  }//for in
554 }//void
555 
556 void TPZConnect::BuildDependencyOrder(TPZVec<int64_t> &connectlist, TPZVec<int> &DependenceOrder, TPZCompMesh &mesh) {
557  // nodelist (input) : vector which contains pointers to all nodes which
558  // are in the dependency chain of the nodes of the element
559  int64_t totalnodes = connectlist.NElements();
560  DependenceOrder.Resize(totalnodes);
561  DependenceOrder.Fill(0,0);
562  // initialize the vector which contains the
563  // dependency order to zero
564  int CurrentOrder = 0;
565  // order which is currently processed
566  int64_t numnodes_processed = totalnodes;
567  // number of nodes processed during the current cycle
568 
569  while(numnodes_processed) {
570 
571  numnodes_processed = 0;
572  int64_t i;
573  for(i=0; i<totalnodes; i++) {
574  int64_t dfnindex = connectlist[i];
575  TPZConnect &dfn = mesh.ConnectVec()[dfnindex];
576  if(dfn.HasDependency() && DependenceOrder[i] == CurrentOrder) {
577  dfn.SetDependenceOrder(dfnindex,mesh,CurrentOrder,connectlist,DependenceOrder);
578  // this method will fill in the DependenceOrder vector by recursively
579  // calling SetDependenceOrder for the nodes upon which dfn depends
580  numnodes_processed++;
581  }
582  }
583  CurrentOrder++;
584  }
585 }
586 
587 template class TPZRestoreClass<TPZConnect>;
589 
590 
int ClassId() const override
Define the class id associated with the class.
Definition: pzconnect.cpp:406
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: pzconnect.cpp:410
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: pzfmatrix.h:789
unsigned int fNShape
Number of shape functions associated with the connect.
Definition: pzconnect.h:62
int64_t fSequenceNumber
Node block number.
Definition: pzconnect.h:34
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
Definition: pzblock.h:177
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 RemoveDepend()
Deletes all dependency information.
Definition: pzconnect.cpp:170
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
Definition: pzconnect.cpp:436
void SetOrder(int order, int64_t index)
Set the order of the shapefunction associated with the connect.
Definition: pzconnect.h:168
unsigned int fFlags
Definition: pzconnect.h:46
Templated vector implementation.
Defines PZError.
void SetLagrangeMultiplier(unsigned char mult)
Set the connect as a pressure connect or not.
Definition: pzconnect.h:236
TPZDepend * AddDependency(int64_t myindex, int64_t dependindex, TPZFMatrix< REAL > &depmat, int64_t ipos, int64_t jpos, int isize, int jsize)
Add dependency between connects.
Definition: pzconnect.cpp:130
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
int NDof(TPZCompMesh &mesh)
Number of degrees of freedom associated with the object.
Definition: pzconnect.cpp:317
struct TPZConnect::@47::@49 fCompose
static TPZSavable * GetInstance(const int64_t &objId)
int CheckDependency(int nshape, TPZCompMesh *mesh, int nstate)
Definition: pzconnect.cpp:326
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: pzconnect.cpp:416
int DependencyDepth(TPZCompMesh &mesh)
the maximum number of recursive dependencies
Definition: pzconnect.cpp:184
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
TPZDepend * fDependList
Dependency list of the connect (NULL if the connect is not constrained)
Definition: pzconnect.h:95
unsigned char LagrangeMultiplier() const
Access method to return the indication whether the connect is associated with a pressure lagrange mul...
Definition: pzconnect.h:230
int NumDepend() const
size of the dependency list
Definition: pzconnect.cpp:201
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
void Push(const T object)
Pushes a copy of the object on the stack.
Definition: pzstack.h:80
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: pzfmatrix.h:783
void Reset()
Reset the data of the connect.
Definition: pzconnect.h:113
int64_t fDepConnectIndex
Definition: pzconnect.h:69
virtual void Write(const bool val)
Definition: TPZStream.cpp:8
Structure to reference dependency.
Definition: pzconnect.h:67
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
Definition: pzconnect.cpp:423
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
TPZConnect()
Default constructor.
Definition: pzconnect.cpp:21
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
Contains declaration of TPZConnect class which represents a set of shape functions associated with a ...
void SetNState(int nstate)
Set the number of state variables.
Definition: pzconnect.h:196
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
void SetNShape(int nshape)
Set the number of shape functions associated with the connect.
Definition: pzconnect.h:205
int HasDependency() const
Returns whether exist dependecy information.
Definition: pzconnect.h:292
string res
Definition: test.py:151
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
Definition: pzcmesh.h:213
TPZDepend * fNext
Definition: pzconnect.h:71
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
Definition: pzcmesh.h:198
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
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
Definition: pzlog.h:93
Contains declaration of TPZCompMesh class which is a repository for computational elements...
void SetCondensed(bool flag)
Set the connect as a condensed connect or not.
Definition: pzconnect.h:242
A simple stack.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
void AddToList(int64_t myindex, TPZCompMesh &mesh, TPZStack< int64_t > &connectlist)
Adds itself and the connects from which it depends to the list.
Definition: pzconnect.cpp:221
TPZFNMatrix< 50, REAL > fDepMatrix
Definition: pzconnect.h:70
TPZConnect & operator=(const TPZConnect &con)
Definition: pzconnect.cpp:51
TPZDepend * HasDepend(int64_t DepConnectIndex)
Definition: pzconnect.cpp:292
int fNElConnected
Number of element connected.
Definition: pzconnect.h:37
TPZDepend * FirstDepend()
Definition: pzconnect.h:296
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
int NDof() const
Number of degrees of freedom associated with the object.
Definition: pzconnect.h:138
static void BuildDependencyOrder(TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder, TPZCompMesh &mesh)
This method builds the vector DependenceOrder which indicates in which order constrained nodes need t...
Definition: pzconnect.cpp:556
int Size(const int block_diagonal) const
Returns block dimension.
Definition: pzblock.h:171
~TPZConnect()
Default destructor.
Definition: pzconnect.cpp:25
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
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
void SetDependenceOrder(int64_t myindex, TPZCompMesh &mesh, int CurrentOrder, TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder)
Definition: pzconnect.cpp:245
void Print(const TPZCompMesh &mesh, std::ostream &out=std::cout)
Print the information for the connect element.
Definition: pzconnect.cpp:67
void CopyFrom(TPZDepend *orig, std::map< int64_t, int64_t > &gl2lcIdx)
Copy a depend data structure to a clone depend in a clone mesh.
Definition: pzconnect.cpp:475
bool IsCondensed() const
Access method to return the indication whether the connect is condensed or not.
Definition: pzconnect.h:223
TPZDepend * RemoveDepend(TPZDepend *Ptr)
Definition: pzconnect.cpp:298
void ExpandShape(int64_t cind, TPZVec< int64_t > &connectlist, TPZVec< int > &blocksize, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
Definition: pzconnect.cpp:353
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
Implements an interface to register a class id and a restore function. Persistence.
Definition: TPZSavable.h:150
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15
void CopyFrom(TPZConnect &orig, std::map< int64_t, int64_t > &gl2lcIdx)
Copy a connect data structure from an original connect to a new connect mapping their indexes...
Definition: pzconnect.cpp:448
virtual void Read(bool &val)
Definition: TPZStream.cpp:91