NeoPZ
pzhdivpressure.cpp
Go to the documentation of this file.
1 
6 #include "pzcmesh.h"
7 #include "pzhdivpressure.h"
8 #include "pzquad.h"
9 #include "pzgeoel.h"
10 #include "TPZMaterial.h"
11 #include "pzlog.h"
12 #include "pzgeoquad.h"
13 #include "TPZShapeDisc.h"
14 #include "TPZCompElDisc.h"
15 #include "pzmaterialdata.h"
16 
17 #ifdef LOG4CXX
18 static LoggerPtr logger(Logger::getLogger("pz.mesh.TPZCompElHDivPressure"));
19 #endif
20 
21 using namespace std;
22 
23 
24 // TESTADO
25 template<class TSHAPE>
28 TPZCompElHDiv<TSHAPE>(mesh,gel,index) {
29 
30  if (TSHAPE::Type()==EQuadrilateral) {
32  }
33  else {
35  }
36 
37 
38  //fPressureOrder = mesh.GetDefaultOrder()-1;
39 
40 
41  //criando o connect da variavel dual
42  int nshape = 0;
43 
44  if (TSHAPE::Type()==EQuadrilateral) {
45  nshape = pzshape::TPZShapeDisc::NShapeF(this->fPressureOrder, this->Dimension(), pzshape::TPZShapeDisc:: ETensorial);
46  }
47  if (TSHAPE::Type()==ETriangle) {
48  nshape = pzshape::TPZShapeDisc::NShapeF(this->fPressureOrder, this->Dimension(), pzshape::TPZShapeDisc:: EOrdemTotal);
49  }
50  int nstate = 1;
52  int64_t newnodeindex = mesh.AllocateNewConnect(nshape,nstate,this->fPressureOrder);
53  TPZConnect &newnod = mesh.ConnectVec()[newnodeindex];
54  newnod.SetLagrangeMultiplier(1);
55  this->fConnectIndexes[this->NConnects()-1]=newnodeindex;
56  int64_t seqnum = newnod.SequenceNumber();
57  newnod.SetLagrangeMultiplier(1);
58  mesh.Block().Set(seqnum,nshape);
59  mesh.ConnectVec()[this->fConnectIndexes[this->NConnects()-1]].IncrementElConnected();
60 
61  // for (int i=0; i<this->NConnects(); i++) {
62  //#ifdef LOG4CXX
63  // {
64  // std::stringstream sout;
65  // sout << "verificando fConnectIndexes " << std::endl;
66  // sout<< " i "<<i<<"fConnectIndexes[i] "<<this->fConnectIndexes[i]<<std::endl;
67  // LOGPZ_DEBUG(logger,sout.str())
68  // }
69  //#endif
70  // }
71 
72 #ifdef LOG4CXX
73  if(logger->isDebugEnabled())
74  {
75  std::stringstream sout;
76  sout << "After creating last pressure connect " << newnodeindex << std::endl;
77  this->Print(sout);
78  LOGPZ_DEBUG(logger,sout.str())
79  }
80 #endif
81 
82  // for (int i=0; i<NConnects(); i++) {
83  // std::cout<< "fConnectIndexes[i] "<<this->fConnectIndexes[i]<<std::endl;
84  // }
85 
86 }
87 
88 
89 template<class TSHAPE>
92 TPZCompElHDiv<TSHAPE>(mesh,copy)
93 {
95 
96 }
97 
98 
99 template<class TSHAPE>
101  std::map<int64_t,int64_t> & gl2lcConMap, std::map<int64_t,int64_t> & gl2lcElMap) :
103 TPZCompElHDiv<TSHAPE>(mesh,copy,gl2lcConMap,gl2lcElMap)
104 {
105 
107 }
108 
109 template<class TSHAPE>
112 TPZCompElHDiv<TSHAPE>()
113 {
114  fPressureOrder = -1;
115 }
116 
117 template<class TSHAPE>
119  TPZGeoEl *gel = this->Reference();
120  if (gel) {
121  TPZCompEl *cel = gel->Reference();
122  if (cel) {
124  }
125  this->Reference()->ResetReference();
126  }
127 
128 }
129 
130 template<class TSHAPE>
132  return TSHAPE::Type();
133 }
134 
135 template<class TSHAPE>
137  fPressureOrder = order;
138 #ifdef LOG4CXX
139  {
140  std::stringstream sout;
141  sout << endl<<"Ordem da Variavel dual: "<< fPressureOrder<<std::endl;
142  LOGPZ_DEBUG(logger,sout.str())
143  }
144 #endif
145 
146 }
147 
148 template<class TSHAPE>
150  return fPressureOrder;
151 }
152 
153 template<class TSHAPE>
155 
156  return TPZCompElHDiv<TSHAPE>::NConnects()+1;//acrescentando um connect mais pra variavel dual
157 }
158 
159 template<class TSHAPE>
160 void TPZCompElHDivPressure<TSHAPE>::SetConnectIndex(int i, int64_t connectindex){
161 #ifndef NODEBUG
162  if(i<0 || i>= this->NConnects()) {
163  std::cout << " TPZCompElHDivPressure<TSHAPE>::SetConnectIndex index " << i <<
164  " out of range\n";
165  DebugStop();
166  return;
167  }
168 #endif
169  this-> fConnectIndexes[i] = connectindex;
170 #ifdef LOG4CXX
171  if(logger->isDebugEnabled())
172  {
173  std::stringstream sout;
174  sout << endl<<"Setting Connect : " << i << " to connectindex " << connectindex<<std::endl;
175  LOGPZ_DEBUG(logger,sout.str())
176  }
177 #endif
178 }
179 
180 template<class TSHAPE>
181 int TPZCompElHDivPressure<TSHAPE>::NConnectShapeF(int connect, int order)const
182 {
183  int dualorder=this->fPressureOrder;
184  if(connect< NConnects()-1)
185  {//tirando o connect da pressao
186  int numshape=TPZCompElHDiv<TSHAPE>::NConnectShapeF(connect,order);
187  return numshape;
188  }
189 
190 
191  else {
192  if(TSHAPE::Type()==EQuadrilateral)
193  {
194 
196  return(numshape);
197  }
198  else// (TSHAPE::Type()==ETriangle)
199  {
201  }
202  }
203 }
204 
205 
206 //Identifies the interpolation order on the connects of the element
207 template<class TSHAPE>
209  ord.Resize(NConnects());
210  int i;
211  for(i=0; i<NConnects(); i++) {
212  ord[i] = ConnectOrder(i);
213  }
214 }
215 
216 template<class TSHAPE>
218 //#ifndef NODEBUG
219 // if(con<0 || con>= this->NConnects()) {
220 // std::cout << "TPZCompElHDivPressure::ConnectIndex wrong parameter connect " << con <<
221 // " NConnects " << this-> NConnects() << std::endl;
222 // DebugStop();
223 // return -1;
224 // }
225 //
226 //#endif
227 
228  if(con<0 ) {
229  std::cout << "TPZCompElHDivPressure::ConnectIndex wrong parameter connect " << con <<
230  " NConnects " << this-> NConnects() << std::endl;
231  DebugStop();
232  return -1;
233  }
234  else{
235  if ( con>= this->NConnects()) {
236  int con2= con-TSHAPE::NCornerNodes;
237  return this->fConnectIndexes[con2];
238 
239 
240  }
241 
242  else{
243 
244 
245  return this->fConnectIndexes[con];
246 
247  }
248  }
249 }
250 
251 
252 
253 //Sets the preferred interpolation order along a side
254 template<class TSHAPE>
256 {
257  this->fPreferredOrder = order;
258 }
259 
260 
264 template<class TSHAPE>
266 {
267  if (connect < NConnects() - 1) {
268  return TPZCompElHDiv<TSHAPE>::ConnectOrder(connect);
269  }
270  else {
271  return (this->fPressureOrder);//definindo ordem de interpolacao para o connect da pressao
272  }
273 }
274 
275 
276 //compute the values of the shape function of the side
277 template<class TSHAPE>
279 
280  // this is an exception
281  // when the sides parameter is "out of bounds", the method appends the dualshape functions
282  // and assumes the point coordinates are already referring to the interior of the element
283  // I hate exceptions...
284  if( side == TSHAPE::NSides)
285  {
286  int nshapedual = NConnectShapeF(NConnects()-1,fPressureOrder);
287  TPZFNMatrix<300> phi1(nshapedual,1),phi2(phi);
288  TPZFNMatrix<900> dphi1(TSHAPE::Dimension,nshapedual),dphi2(dphi);
289  ShapeDual(point,phi1,dphi1);
290  Append(phi2, phi1, phi);
291  Append(dphi2, dphi1, dphi);
292  return;
293  }
294  else TPZCompElHDiv<TSHAPE>::SideShapeFunction(side,point,phi,dphi);
295 
296 }
297 
298 template<class TSHAPE>
300 
301  TPZMaterialData data;
302  InitMaterialData(data);
303  data.p=this->MaxOrder();
304 
305  this->ComputeShape(qsi,data);
306  //this->ComputeSolutionPressureHDiv(data);
307  this->ComputeSolution(qsi,data);
308 
309  data.x.Resize(3,0.);
310  this->Reference()->X(qsi,data.x);
311  this->Material()->Solution(data,var,sol);
312 }
313 
314 template<class TSHAPE>
316 
317  this->ComputeShape(qsi,data);
318  this->ComputeSolutionPressureHDiv(data);
319 }
320 
321 template<class TSHAPE>
323  const TPZFMatrix<REAL> &axes, TPZSolVec &sol, TPZGradSolVec &dsol){
324  TPZMaterialData data;
325  InitMaterialData(data);
326  this->ComputeSolutionPressureHDiv(data);
327 }
328 
329 template<class TSHAPE>
331 
332  this->ComputeSolutionPressureHDiv(data);
333 }
334 
335 template<class TSHAPE>
337 
338  TPZGeoEl * ref = this->Reference();
339  const int nshape = this->NShapeF();
340  const int dim = ref->Dimension();
341 
342  TPZMaterialData data;
343  data.phi.Resize(nshape,1);
344  data.dphix.Resize(dim,nshape);
345  data.jacobian.Resize(dim,dim);
346  data.jacinv.Resize(dim,dim);
347  data.x.Resize(3,0.);
348 
349  this->ComputeShape(qsi,data);
350  this->ComputeSolution(qsi, data.phi, data.dphix, data.axes, data.sol, data.dsol);
351 }
352 
353 template<class TSHAPE>
355 
356  const int numdof = this->Material()->NStateVariables();
357  const int ncon = this->NConnects();
358 
359 
360  TPZBlock<STATE> &block =this->Mesh()->Block();
361  TPZFMatrix<STATE> &MeshSol = this->Mesh()->Solution();
362  int64_t numbersol = MeshSol.Cols();
363 
364  int nsol= this->Dimension()+2;
365  data.sol.Resize(numbersol);
366  data.dsol.Resize(numbersol);
367  for (int64_t is=0; is<numbersol; is++) {
368  data.sol[is].Resize(nsol,1);//2 componente para fluxo+ 1 para pressao +1 para div
369  data.sol[is].Fill(0);
370 
371  }
372  //solucao associada a fluxo
373  int iv = 0,ishape=0,ivec=0,cols, jv=0;
374  for(int in=0; in<ncon-1 ; in++) {//estou tirando o connect da pressao
375  TPZConnect *df = &this->Connect(in);
376  int64_t dfseq = df->SequenceNumber();
377  int dfvar = block.Size(dfseq);
378  int64_t pos = block.Position(dfseq);
379 
380  for(int jn=0; jn<dfvar; jn++) {
381  ivec=data.fVecShapeIndex[jv ].first;
382  ishape=data.fVecShapeIndex[jv].second;
383 
384  TPZFNMatrix<3> ivecDiv(3,1);
385  ivecDiv(0,0) = data.fNormalVec(0,ivec);
386  ivecDiv(1,0) = data.fNormalVec(1,ivec);
387  ivecDiv(2,0) = data.fNormalVec(2,ivec);
388  TPZFNMatrix<3> axesvec(3,1);
389  data.axes.Multiply(ivecDiv,axesvec);
390 
391  for (int ilinha=0; ilinha<this->Dimension(); ilinha++) {
392  cols=iv%numdof;
393 
394  // #ifdef LOG4CXX
395  // std::stringstream sout;
396  // sout << " vetor " << ivec << " shape " << ishape<<" coef "<< MeshSol(pos+jn,0)<<endl;
397  // LOGPZ_DEBUG(logger,sout.str())
398  // #endif
399  for (int64_t is=0; is<numbersol; is++) {
400  data.sol[is][ilinha] += data.fNormalVec(ilinha,ivec)* data.phi(ishape,0)*MeshSol(pos+jn,is);
401  data.sol[is][nsol-1] += axesvec(ilinha,0)*data.dphix(ilinha,ishape)*MeshSol(pos+jn,is);//divergente
402 
403  }
404 
405  }
406 
407  jv++;
408  }
409 
410  iv++;
411  }
412 
413 
414  //colocando a solucao para o connect interno usando shape descontinua
415 
416  TPZConnect *df2 = &this->Connect(ncon-1);
417  int64_t dfseq2 = df2->SequenceNumber();
418  int64_t pos2 = block.Position(dfseq2);
419 
420  for (int64_t idesc=0; idesc<data.numberdualfunctions; idesc++) {
421  int iphi= data.phi.Rows()-data.numberdualfunctions +idesc;
422  for (int64_t is=0; is<numbersol; is++) {
423  data.sol[is][nsol-2]+= data.phi(iphi,0)*MeshSol(pos2+idesc,is);
424  }
425 
426  }
427 
428 }
429 
430 
431 template<class TSHAPE>
433 {
434  bool Is_u1PHI = (u1.Cols() == 1) ? true : false;
435  bool Is_u2PHI = (u2.Cols() == 1) ? true : false;
436 
437  if(Is_u1PHI && Is_u2PHI)
438  {
439  int64_t nu1 = u1.Rows(),nu2 = u2.Rows();
440  u12.Redim(nu1+nu2,1);
441  int64_t i;
442  for(i=0; i<nu1; i++) u12(i,0) = u1(i,0);
443  for(i=0; i<nu2; i++) u12(i+nu1,0) = u2(i,0);
444 
445 
446  }
447  else if(!Is_u1PHI || !Is_u2PHI) // Se u1 e u2 não são Phi's, implica em serem dPhi's
448  {
449  int64_t ru1 = u1.Rows(), cu1 = u1.Cols(), ru2 = u2.Rows(), cu2 = u2.Cols();
450  int64_t ru12 = ru1 < ru2 ? ru2 : ru1;
451  int64_t cu12 = cu1+cu2;
452  u12.Redim(ru12,cu12);
453  int64_t i,j;
454  for(i=0; i<ru1; i++) for(j=0; j<cu1; j++) u12(i,j) = u1(i,j);
455  for(i=0; i<ru2; i++) for(j=0; j<cu2; j++) u12(i,j+cu1) = u2(i,j);//---modifiquei--
456  }
457  else
458  {
459  PZError << "TPZCompElHDivPressure::Append. Bad input parameters " << std::endl;//Este metodo so serve para u1 E u2 do mesmo tipo
460 
461 
462  }
463 
464 }
465 
469 template<class TSHAPE>
471 {
472  int dimension= TSHAPE::Dimension;
473  REAL C=1;//fator de escala utilizado neste metodo
474  TPZManVector<REAL,3> X0(3,0.);//centro do elemento
475 
476  int degree= this->fPressureOrder;
477  // const int nshapedisc = pzshape::TPZShapeDisc::NShapeF(degree, dimension, pzshape::TPZShapeDisc:: ETensorial);
478  pzshape::TPZShapeDisc::Shape(dimension,C,X0,qsi,degree,phi,dphi, pzshape::TPZShapeDisc:: ETensorial);
479 
480 }
481 
482 template<class TSHAPE>
484 
485  TPZFMatrix<REAL> phiCont;
486  TPZFMatrix<REAL> dphiCont;
487  TPZCompElHDiv<TSHAPE>::Shape(pt,phiCont,dphiCont);
488 
489  // acrescentar as funcoes de pressao (via descontinuo)
490  REAL C=1;//fator de escala utilizado neste metodo
491  TPZManVector<REAL,3> X0(3,0.);//centro do elemento
492 
493  int dimension= TSHAPE::Dimension;
494  int degree= this->fPressureOrder;
495 
496  int nshapedisc;
498  TPZFNMatrix<660> phiDisc(nshapedisc,1);
499  TPZFNMatrix<660> dphiDisc(dimension,nshapedisc);
500 
501  if (TSHAPE::Type()==EQuadrilateral){
502  pzshape::TPZShapeDisc::Shape(dimension,C,X0,pt,degree,phiDisc,dphiDisc, pzshape::TPZShapeDisc::ETensorial);
503 
504 //#ifdef LOG4CXX
505 // std::stringstream sout;
506 // sout<<"\n ponto de integracao " << pt <<endl;
507 // sout<< "\n vetor phiDisc "<<phiDisc<<endl;
508 // LOGPZ_DEBUG(logger,sout.str())
509 //#endif
510 
511 
512  }
513  else if (TSHAPE::Type()==ETriangle) {
514  pzshape::TPZShapeDisc::Shape(dimension,C,X0,pt,degree,phiDisc,dphiDisc, pzshape::TPZShapeDisc::EOrdemTotal);
515  }
516  else {
517  DebugStop();
518  }
519 
520 
521  this->Append(phiCont,phiDisc,phi);
522  this->Append(dphiCont,dphiDisc,dphi);
523 // {
524 // #ifdef LOG4CXX
525 // std::stringstream sout;
526 // // sout<< "vetor phiCont"<<phiCont<<endl;
527 // sout<< "\n vetor phi "<<phi<<endl;
528 // LOGPZ_DEBUG(logger,sout.str())
529 // #endif
530 // }
531 }
532 
533 template<class TSHAPE>
535  return TSHAPE::TransformSideToElement(side);
536 }
537 
538 
543 template<class TSHAPE>
545 {
546 
547  //#ifdef LOG4CXX
548  // {
549  // LOGPZ_DEBUG(logger,"Initializing normal vectors")
550  // }
551  //#endif
555 }
556 
558 template<class TSHAPE>
559 void TPZCompElHDivPressure<TSHAPE>::Write(TPZStream &buf, int withclassid) const
560 {
561  TPZInterpolatedElement::Write(buf,withclassid);
562  TPZManVector<int,3> order(3,0);
563  this-> fIntRule.GetOrder(order);
564  buf.Write(order);
565  buf.Write(this->fConnectIndexes.begin(),TSHAPE::NSides);
566  buf.Write(&this->fPreferredOrder,1);
567  buf.Write(&this->fPressureOrder);
568  int classid = this->ClassId();
569  buf.Write ( &classid, 1 );
570 }
571 
572 
573 //Read the element data from a stream
574 
575 template<class TSHAPE>
577 {
578  TPZInterpolatedElement::Read(buf,context);
579  TPZManVector<int,3> order;
580  buf.Read(order);
581  this-> fIntRule.SetOrder(order);
582  buf.Read(this->fConnectIndexes.begin(),TSHAPE::NSides);
583  buf.Read(&this->fPreferredOrder,1);
584  buf.Read(&this->fPressureOrder);
585  int classid = -1;
586  buf.Read( &classid, 1 );
587  if ( classid != this->ClassId() )
588  {
589  std::stringstream sout;
590  sout << "ERROR - " << __PRETTY_FUNCTION__
591  << " trying to restore an object id " << this->ClassId() << " for an package of id = " << classid;
592  LOGPZ_ERROR ( logger, sout.str().c_str() );
593  }
594 }
595 
596 
597 #include "pzshapecube.h"
598 #include "TPZRefCube.h"
599 #include "pzshapelinear.h"
600 #include "TPZRefLinear.h"
601 #include "pzrefquad.h"
602 #include "pzshapequad.h"
603 #include "pzgeoquad.h"
604 #include "pzshapetriang.h"
605 #include "pzreftriangle.h"
606 #include "pzgeotriangle.h"
607 #include "pzshapeprism.h"
608 #include "pzrefprism.h"
609 #include "pzgeoprism.h"
610 #include "pzshapetetra.h"
611 #include "pzreftetrahedra.h"
612 #include "pzgeotetrahedra.h"
613 #include "pzshapepiram.h"
614 #include "pzrefpyram.h"
615 #include "pzgeopyramid.h"
616 #include "pzrefpoint.h"
617 #include "pzgeopoint.h"
618 #include "pzshapepoint.h"
619 #include "pzgraphelq2dd.h"
620 #include "tpzgraphelt3d.h"
621 #include "pzgraphel1dd.h"
622 #include "pztrigraphd.h"
623 #include "pzgraphelq3dd.h"
624 #include "tpzgraphelprismmapped.h"
625 #include "tpzgraphelpyramidmapped.h"
626 #include "tpzgraphelt2dmapped.h"
627 
628 using namespace pztopology;
629 
630 #include "tpzpoint.h"
631 #include "tpzline.h"
632 #include "tpzquadrilateral.h"
633 #include "tpztriangle.h"
634 #include "tpzcube.h"
635 #include "tpztetrahedron.h"
636 #include "tpzprism.h"
637 #include "tpzpyramid.h"
638 
639 #include "pzelchdivbound2.h"
640 
641 using namespace pzgeom;
642 using namespace pzshape;
643 
644 
645 template<class TSHAPE>
647  if(dimension == TSHAPE::Dimension && this->Material()->Id() > 0) {
648  new typename TSHAPE::GraphElType(this,&grafgrid);
649  }
650 }
651 
652 //template class
653 //TPZRestoreClass< TPZCompElHDivPressure<TPZShapePoint>>;
654 
655 #ifndef BORLAND
663 #endif
664 
665 
667 //template class TPZCompElHDivPressure<TPZShapePoint>;
674 
675 
676 //TPZCompEl * CreateHDivPressurePointEl(TPZGeoEl *gel,TPZCompMesh &mesh,int64_t &index) {
677 // return new TPZCompElHDivPressure<TPZShapePoint>(mesh,gel,index);
678 //}
679 
680 
682  return new TPZCompElHDivBound2< TPZShapeLinear>(mesh,gel,index);
683 }
684 
686  return new TPZCompElHDivPressure< TPZShapeQuad>(mesh,gel,index);
687 }
688 
690  return new TPZCompElHDivPressure< TPZShapeTriang >(mesh,gel,index);
691 }
692 
694  return new TPZCompElHDivPressure< TPZShapeCube >(mesh,gel,index);
695 }
696 
698  return new TPZCompElHDivPressure< TPZShapePrism>(mesh,gel,index);
699 }
700 
702  return new TPZCompElHDivPressure< TPZShapePiram >(mesh,gel,index);
703 }
704 
706  return new TPZCompElHDivPressure< TPZShapeTetra >(mesh,gel,index);
707 }
708 
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
void Shape(TPZVec< REAL > &pt, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override
Computes the shape function set at the point x.
Definition: pzelchdiv.cpp:1300
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
void Append(TPZFMatrix< REAL > &u1, TPZFMatrix< REAL > &u2, TPZFMatrix< REAL > &u12)
To append vectors.
virtual void Print(std::ostream &out=std::cout) const override
Prints the relevant data of the element to the output stream.
Definition: pzelchdiv.cpp:1671
Contains the TPZGraphElTd class which implements the graphical discontinuous triangular element...
Contains the TPZInt1d, TPZIntTriang, TPZIntQuad, TPZIntCube3D, TPZIntTetra3D, TPZIntPyram3D and TPZIn...
virtual void Solution(TPZVec< REAL > &qsi, int var, TPZVec< STATE > &sol) override
Compute the solution for a given variable.
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
virtual void SideShapeFunction(int side, TPZVec< REAL > &point, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override
Computes the values of the shape function of the side.
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.
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
virtual void InitMaterialData(TPZMaterialData &data) override
Initialize a material data and its attributes based on element dimension, number of state variables a...
TPZCompEl * CreateHDivPressurePrismEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational prismal element for HDivPressure approximate space.
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
Definition: pzintel.cpp:1940
void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
virtual void ShapeDual(TPZVec< REAL > &qsi, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
Compute the shape functions corresponding to the dual space.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
virtual int64_t AllocateNewConnect(int nshape, int nstate, int order)
Returns an index to a new connect.
Definition: pzcmesh.h:693
virtual int Dimension() const override
Returns the dimension of the element.
void ComputeSolutionPressureHDiv(TPZVec< REAL > &qsi, TPZMaterialData &data)
groups all classes dedicated to the computation of shape functions
Definition: pzshapeextend.h:16
Contains the TPZPoint class which defines the topology of a point.
virtual void SetPressureOrder(int ord)
Identifies the interpolation order for pressure variable.
Contains the TPZRefQuad class which implements the uniform refinement of a geometric quadrilateral el...
void SetLagrangeMultiplier(unsigned char mult)
Set the connect as a pressure connect or not.
Definition: pzconnect.h:236
void Shape(TPZVec< REAL > &pt, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override
Computes the shape function set at the point x.
void degree(int root, int adj_num, int adj_row[], int adj[], int mask[], int deg[], int *iccsze, int ls[], int node_num)
Definition: rcm.cpp:875
virtual void RemoveSideRestraintsII(MInsertMode mode)
Delete the restraints on the nodes of the connected elements if necessary.
Definition: pzintel.cpp:1286
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
MShapeFunctionType fShapeType
TPZFNMatrix< 9, REAL > jacinv
value of the inverse of the jacobian at the integration point
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Definition: pzmanvector.h:426
TPZFNMatrix< 9, REAL > jacobian
value of the jacobian at the integration point
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
Contains the TPZTriangle class which defines the topology of a triangle.
int p
maximum polinomial order of the shape functions
virtual void GetInterpolationOrder(TPZVec< int > &ord) override
Identifies the interpolation order on the interior of the element.
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
Contains the TPZRefPyramid class which implements the uniform refinement of a geometric hexahedral el...
int NShapeF() const override
Returns the total number of shapefunctions.
Definition: pzintel.cpp:63
Contains the TPZTetrahedron class which defines the topology of the tetrahedron element.
TPZCompEl * CreateHDivPressureTetraEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational tetrahedral element for HDivPressure approximate space.
virtual int ConnectOrder(int connect) const override
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
Definition: pzintel.cpp:1945
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
virtual int MaxOrder() override
Return the maximum order??
Definition: pzelchdiv.cpp:1689
Contains TPZShapeCube class which implements the shape functions of a hexaedral element.
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
Definition: pzcompel.cpp:959
static void Shape(int dimension, REAL C, TPZVec< REAL > &X0, TPZVec< REAL > &X, int degree, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi, MShapeType type)
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
Contains the TPZRefPrism class which implements the uniform refinement of a geometric prism element...
virtual void ComputeSolution(TPZVec< REAL > &qsi, TPZSolVec &sol, TPZGradSolVec &dsol, TPZFMatrix< REAL > &axes) override
Computes solution and its derivatives in the local coordinate qsi.
TPZCompEl * CreateHDivPressureLinearEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational linear element for HDivPressure approximate space.
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Definition: pzconnect.h:158
Groups all classes defining the structure of the master element.
Definition: PrismExtend.cpp:15
virtual void InitMaterialData(TPZMaterialData &data) override
Initialize a material data and its attributes based on element dimension, number of state variables a...
Definition: pzelchdiv.cpp:1471
Contains the TPZGraphElT3d class which implements the graphical representation of a tetrahedra elemen...
virtual void ComputeShape(TPZVec< REAL > &intpoint, TPZVec< REAL > &X, TPZFMatrix< REAL > &jacobian, TPZFMatrix< REAL > &axes, REAL &detjac, TPZFMatrix< REAL > &jacinv, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi, TPZFMatrix< REAL > &dphidx)
Compute shape functions based on master element in the classical FEM manner.
virtual void Write(const bool val)
Definition: TPZStream.cpp:8
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
Contains the TPZGraphElQ2dd class which implements the graphical two-dimensional discontinuous elemen...
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
virtual int NConnects() const override
Returns the number of connect objects of the element.
TPZFNMatrix< 180 > fNormalVec
list of normal vectors
Contains the TPZGraphElPrismMapped class which implements the graphical element for a prism using a d...
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
Definition: pzcompel.cpp:288
void Read(TPZStream &buf, void *context) override
Read the element data from a stream.
Contains the TPZQuadrilateral class which defines the topology of a quadrilateral element...
virtual void SetConnectIndex(int i, int64_t connectindex) override
Sets the node pointer of node i to nod.
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
Definition: pzgeoel.h:750
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
int numberdualfunctions
number of dual function (e.g. pressure in HDiv approximations)
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
virtual void SetPreferredOrder(int order) override
Sets the preferred interpolation order along a side.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
Definition: pzcmesh.h:213
Contains the TPZGraphElPyramidMapped class which implements the graphical element for a pyramid using...
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
Definition: pzcmesh.h:198
T * begin() const
Casting operator. Returns The fStore pointer.
Definition: pzvec.h:450
Contains the TPZMaterialData class which implements an interface between TPZCompEl::CalcStiff and TPZ...
Implements a generic computational element to HDiv scope. Computational Element.
Contains TPZShapePoint class which implements the shape function associated with a point...
#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...
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
Definition: pzfmatrix.h:616
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
Definition: pzcompel.cpp:298
Contains the TPZPyramid class which defines the topology of a pyramid element.
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
Contains declaration of TPZCompElHDivPressure class which implements a generic computational element ...
virtual int64_t ConnectIndex(int node) const override
Returns the index of the ith connectivity of the element.
Contains TPZShapePrism class which implements the shape functions of a prism element.
Contains the TPZRefTriangle class which implements the uniform refinement of a geometric triangular e...
TPZManVector< int64_t, TSHAPE::NSides > fConnectIndexes
Indexes of the connects associated with the elements.
Definition: pzelctemp.h:25
virtual int NConnects() const override
Returns the number of connect objects of the element.
Definition: pzelchdiv.cpp:193
Contains the TPZRefTetrahedra class which implements the uniform refinement of a geometric tetrahedra...
virtual int Dimension() const =0
Returns the dimension of the element.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Definition: pzcompel.cpp:1137
virtual void X(TPZVec< REAL > &qsi, TPZVec< REAL > &result) const =0
Return the coordinate in real space of the point coordinate in the master element space...
TPZTransform TransformSideToElement(int side) override
Returns the transformation which transform a point from the side to the interior of the element...
MElementType
Define the element types.
Definition: pzeltype.h:52
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Definition: pzgeoel.h:431
Contains declaration of TPZCompElHDivBound2 class which implements a generic computational element (H...
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
int Size(const int block_diagonal) const
Returns block dimension.
Definition: pzblock.h:171
TSHAPE::IntruleType fIntRule
Integration rule associated with the topology of the element.
Definition: pzelctemp.h:28
virtual void Multiply(const TPZFMatrix< TVar > &A, TPZFMatrix< TVar > &res, int opt=0) const
It mutiplies itself by TPZMatrix<TVar>A putting the result in res.
Definition: pzmatrix.cpp:1916
virtual int NConnectShapeF(int connect, int order) const override
Number of shapefunctions of the connect associated.
virtual void SideShapeFunction(int side, TPZVec< REAL > &point, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override
Computes the values of the shape function of the side.
Definition: pzelchdiv.cpp:899
Contains the TPZGraphElT2dMapped class which implements a graphical element for a triangle mapped int...
Contains the TPZRefLinear class which implements the uniform refinement of a geometric linear element...
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
Contains the declaration of the shape function discontinuous.
int64_t Cols() const
Returns number of cols.
Definition: pzmatrix.h:809
TPZCompEl * CreateHDivPressureCubeEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational cube element for HDivPressure approximate space.
virtual MElementType Type() override
Return the type of the element.
Contains TPZShapePiram class which implements the shape functions of a pyramid element.
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Definition: pzfmatrix.cpp:1016
void CreateGraphicalElement(TPZGraphMesh &grafgrid, int dimension) override
Creates corresponding graphical element(s) if the dimension matches graphical elements are used to ge...
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
TPZRegisterClassId()=default
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
TPZCompEl * CreateHDivPressureQuadEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational quadrilateral element for HDivPressure approximate space.
Contains the TPZGraphEl1dd class which implements the graphical one dimensional discontinuous element...
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
This class implements a "generic" computational element to HDiv scope. Computational Element...
Contains the TPZGeoPrism class which implements the geometry of a prism element.
Contains the TPZCube class which defines the topology of the hexahedron element.
Contains the TPZLine class which defines the topology of a line element.
TPZCompEl * CreateHDivPressureTriangleEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational triangular element for HDivPressure approximate space.
Groups all classes which model the geometry.
Definition: pzgeopoint.cpp:18
int fPreferredOrder
Preferred polynomial order.
TPZManVector< std::pair< int, int64_t > > fVecShapeIndex
correspondence between normal vector index and index of the shape functions
virtual int ConnectOrder(int connect) const override
return the interpolation order of the polynomial for connect
Definition: pzelchdiv.cpp:544
static int NShapeF(int degree, int dimension, MShapeType type)
Number of shapefunctions dependent on the dimension and order of interpolation.
int fPressureOrder
Defines the interpolation order for pressure variable.
Contains the TPZPrism class which defines the topology of a Prism.
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
TPZSolVec sol
vector of the solutions at the integration point
int GetDefaultOrder()
Definition: pzcmesh.h:398
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
Contains the TPZRefCube class which implements the uniform refinement of a geometric hexahedral eleme...
virtual int NConnectShapeF(int connect, int order) const override
Number of shapefunctions of the connect associated.
Definition: pzelchdiv.cpp:221
Contains the TPZGraphElQ3dd class which implements the graphical three dimensional discontinuous elem...
Contains the TPZRefPoint class which implements the uniform refinement of a geometric point element...
TPZFMatrix< STATE > & Solution()
Access the solution vector.
Definition: pzcmesh.h:219
TPZCompEl * CreateHDivPressurePyramEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational pyramidal element for HDivPressure approximate space.
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
Implements an interface to register a class id and a restore function. Persistence.
Definition: TPZSavable.h:150
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
Definition: pzfmatrix.h:716
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15
virtual void Read(bool &val)
Definition: TPZStream.cpp:91