NeoPZ
tpzgeoelmapped.h
Go to the documentation of this file.
1 
6 #ifndef TPZGEOELMAPPED_H
7 #define TPZGEOELMAPPED_H
8 
9 #include "pzmanvector.h"
10 #include "pzfmatrix.h"
11 #include "pzgeoel.h"
12 #include "pzgeoelside.h"
13 #include "pzaxestools.h"
14 #include "pzgmesh.h"
15 
16 #include "pzlog.h"
17 #include <sstream>
18 
19 #ifdef LOG4CXX
20 static LoggerPtr loggermapped(Logger::getLogger("pz.mesh.geoelmapped"));
21 #endif
22 
32 template<class TBase>
33 class TPZGeoElMapped : public TBase {
34 public:
35  typedef typename TBase::Geo Geo;
37  TBase(), fCornerCo(Geo::Dimension,Geo::NNodes,0.)
38  {
39  }
40  TPZGeoElMapped(int64_t id,TPZVec<int64_t> &nodeindexes,int matind,TPZGeoMesh &mesh) :
42  TBase(id,nodeindexes,matind,mesh), fCornerCo(Geo::Dimension,Geo::NNodes,0.)
43  {
44  }
45  TPZGeoElMapped(TPZVec<int64_t> &nodeindices,int matind,TPZGeoMesh &mesh) :
47  TBase(nodeindices,matind,mesh), fCornerCo(Geo::Dimension,Geo::NNodes,0.)
48  {
49  }
50  TPZGeoElMapped(TPZVec<int64_t> &nodeindices,int matind,TPZGeoMesh &mesh,int64_t &index) :
52  TBase(nodeindices,matind,mesh,index), fCornerCo(Geo::Dimension,Geo::NNodes,0.)
53  {
54  }
55 
56  TPZGeoElMapped(TPZGeoMesh &destmesh, const TPZGeoElMapped<TBase> &copy);
57 
58  TPZGeoElMapped(TPZGeoMesh &destmesh, const TPZGeoElMapped<TBase> &copy, std::map<int64_t,int64_t> &gl2lcNdIdx,
59  std::map<int64_t,int64_t> &gl2lcElIdx);
60 
62  {
63  }
64 
65  public:
66 int ClassId() const override;
67 
68 
69  virtual TPZGeoEl * Clone(TPZGeoMesh &DestMesh) const override;
70 
73  virtual TPZGeoEl * ClonePatchEl(TPZGeoMesh &DestMesh,
74  std::map<int64_t,int64_t> &gl2lcNdIdx,
75  std::map<int64_t,int64_t> &gl2lcElIdx) const override;
76 
77 
78 
80  void Write(TPZStream &buf, int withclassid) const override{
81  TBase::Write(buf,withclassid);
82  fCornerCo.Write(buf,0);
83  }
84 
86  virtual void Read(TPZStream& buf, void* context) override
87  {
88  TBase::Read(buf,context);
89  fCornerCo.Read(buf,0);
90  }
91 
92  virtual bool IsLinearMapping(int side) const override;
93 
94  /*
95  virtual bool IsLinearMapping() const
96  {
97  TPZGeoEl *father = (TBase::fFatherIndex == -1) ? 0 : TBase::Mesh()->ElementVec()[TBase::fFatherIndex];
98  if(father) return father->IsLinearMapping();
99  else return TBase::IsLinearMapping();
100  }
101  */
102 
105  virtual bool IsGeoElMapped() const override {
106  return true;
107  }
108 
109 
110 
112  virtual TPZGeoEl *CreateGeoElement(MElementType type,
113  TPZVec<int64_t>& nodeindexes,
114  int matid,
115  int64_t& index) override;
116 
118  virtual void SetFatherIndex(int64_t fatherindex) override
119  {
120  TBase::SetFatherIndex(fatherindex);
121  TPZGeoEl *father = TBase::Father();
122  if(!father) return;
123  TPZGeoEl *nextfather = 0;
124  if(father) nextfather = father->Father();
125  while(nextfather)
126  {
127  father = nextfather;
128  nextfather = father->Father();
129  }
130  int in, nnodes = Geo::NNodes;
131  TPZManVector<REAL,3> nodeX(3);
132  TPZManVector<REAL,3> ptancestor(Geo::Dimension), aux(Geo::Dimension);
133  REAL Tol;
134  ZeroTolerance(Tol);
135  if(Tol < 1.e-10) Tol = 1.e-10;
136 
137  // Pira 18 maio 2009: nova implementaĆ§Ć£o
138 
139  // @omar:: decreased for non linear mappings
140  REAL epsilon = 0.1;
141  for(in=0; in<nnodes; in++)
142  {
143  for(int id = 0; id < 3; id++){
144  nodeX[id] = this->NodePtr(in)->Coord(id);
145  }
146 
147  TPZGeoElSide gels(this,in);
148  TPZGeoElSide nextfatherside = gels.Father2();
150  while(nextfatherside.Element())
151  {
152  fatherside = nextfatherside;
153  nextfatherside = nextfatherside.Father2();
154  }
155  TPZTransform<> trzero(0);
156  TPZTransform<> tr = this->BuildTransform2(in,father,trzero);
157  TPZTransform<> trfather = fatherside.Element()->SideToSideTransform(fatherside.Side(),fatherside.Element()->NSides()-1);
158  tr = trfather.Multiply(tr);
159  TPZVec<REAL> zero(0);
160  tr.Apply(zero, aux);
161  //aux.Fill(0.);
162  ptancestor.Fill(0.);
163  father->ComputeXInverse(nodeX, aux, epsilon);
164  int pointside = father->WhichSide(aux);
165  TPZTransform<> project = father->Projection(pointside);
166  project.Apply(aux,ptancestor);
167 
168 #ifdef PZDEBUG
169  {
170  double ksidiff = 0.;
171  for(int i = 0; i < ptancestor.NElements(); i++){
172  ksidiff += (aux[i]-ptancestor[i])*(aux[i]-ptancestor[i]);
173  }//i
174  ksidiff = sqrt(ksidiff);
175 #ifdef REALfloat
176  REAL tol = 1.e-6;
177 #else
178  REAL tol = 1.e-8;
179 #endif
180  if(ksidiff > tol){
181  std::cout.precision(12);
182  std::cout << "\nError at " << __PRETTY_FUNCTION__ << __LINE__ << "\n";
183  std::cout << "aux:\n";
184  for(int i = 0; i < aux.NElements(); i++) std::cout << aux[i] << "\t";
185  std::cout << "\nptancestor:\n";
186  for(int i = 0; i < ptancestor.NElements(); i++) std::cout << ptancestor[i] << "\t";
187  std::cout << "\n";
188  DebugStop();
189  }
190 
191  TPZManVector<REAL,3> fatherX(3);
192  father->X(ptancestor,fatherX);
193  double error = 0.;
194  double diff;
195  for(int i = 0; i < 3; i++){
196  diff = fatherX[i]-nodeX[i];
197  error += diff*diff;
198  }
199  error = sqrt(error);
200  if(error > epsilon){
201  std::cout << "\nError at " << __PRETTY_FUNCTION__ << __LINE__ << "\n";
202  std::cout << "this->Index = " << this->Index() << "\n";
203  std::cout << "aux:\n";
204  for(int i = 0; i < aux.NElements(); i++) std::cout << aux[i] << "\t";
205  std::cout << "\nptancestor:\n";
206  for(int i = 0; i < ptancestor.NElements(); i++) std::cout << ptancestor[i] << "\t";
207  std::cout << "\n";
208  std::cout << "nodeX:\n";
209  for(int i = 0; i < nodeX.NElements(); i++) std::cout << nodeX[i] << "\t";
210  std::cout << "\nfatherX:\n";
211  for(int i = 0; i < fatherX.NElements(); i++) std::cout << fatherX[i] << "\t";
212  std::cout << "\n";
213  DebugStop();
214  }
215 
216  TPZManVector<REAL,3> fatherXaux(3);
217  father->X(aux,fatherXaux);
218  error = 0.;
219  for(int i = 0; i < 3; i++){
220  diff = fatherX[i]-fatherXaux[i];
221  error += diff*diff;
222  }
223 
224  error = sqrt(error);
225  if(error > tol){
226  std::stringstream sout;
227 
228  sout.precision(16);
229  sout << "\nError at " << __PRETTY_FUNCTION__ << __LINE__ << "\n";
230  sout << "this->Index = " << this->Index() << "\n";
231  sout << "Node number " << in << std::endl;
232  sout << "Node index " << this->NodeIndex(in) << std::endl;
233  sout << "Father side " << this->FatherSide(in,0) << std::endl;
234  sout << "aux:\n";
235  for(int i = 0; i < aux.NElements(); i++) sout << aux[i] << "\t";
236  sout << "\nptancestor:\n";
237  for(int i = 0; i < ptancestor.NElements(); i++) sout << ptancestor[i] << "\t";
238  sout << "\n";
239  sout << "nodeX:\n";
240  for(int i = 0; i < nodeX.NElements(); i++) sout << nodeX[i] << "\t";
241  sout << "\nfatherX:\n";
242  for(int i = 0; i < fatherX.NElements(); i++) sout << fatherX[i] << "\t";
243  sout << "\nfatherXaux:\n";
244  for(int i = 0; i < fatherXaux.NElements(); i++) sout << fatherXaux[i] << "\t";
245  std::cout << sout.str();
246 #ifdef LOG4CXX
247  father->Mesh()->Print(sout);
248  LOGPZ_ERROR(loggermapped,sout.str())
249 #endif
250  DebugStop();
251  }
252 
253  }
254 #endif
255  for(int id=0; id<Geo::Dimension; id++)
256  {
257  fCornerCo(id,in) = ptancestor[id];
258  }
259 
260  }//for
261 
262  }//method
263 
264 #ifdef _AUTODIFF
265 
266  virtual void GradXFad(TPZVec<Fad<REAL> > &qsi, TPZFMatrix<Fad<REAL> > &gradx) const {
267  DebugStop();
268  }
269 #endif
270 // /** @brief Return the Jacobian matrix at the point*/
271 // virtual void GradX(TPZVec<REAL> &qsi, TPZFMatrix<REAL> &gradx) const {
272 //
273 // /// Creating Variables
274 // TPZGeoEl *father = TBase::Father();
275 // if(!father)
276 // {
277 // TBase::GradX(qsi,gradx);
278 // return;
279 // }
280 //
281 // TPZGeoEl *nextfather = 0;
282 // if(father) nextfather = father->Father();
283 // while(nextfather)
284 // {
285 // father = nextfather;
286 // nextfather = father->Father();
287 // }
288 //
289 // const int dim = Geo::Dimension;
290 // const int father_dim = father->Dimension();
291 // TPZManVector<REAL,3> ksibar(father_dim,0.0);
292 //
293 // TPZFNMatrix<9> gradxlocal(father_dim,dim);
294 // Geo::X(fCornerCo,qsi,ksibar);
295 // Geo::GradX(fCornerCo,qsi,gradxlocal);
296 //
297 // TPZFNMatrix<9> gradxfather;
298 // father->GradX(ksibar, gradxfather);
299 //
300 // // @brief Combining Variables
301 // gradxfather.Multiply(gradxlocal, gradx);
302 // }
303 
305  void GradX(TPZVec<REAL> &qsi, TPZFMatrix<REAL> &gradx) const override {
306  return TGradX(qsi, gradx);
307  }
308 #ifdef _AUTODIFF
309  void GradX(TPZVec<Fad<REAL>> &qsi, TPZFMatrix<Fad<REAL>> &gradx) const override {
310  return TGradX(qsi, gradx);
311  }
312 #endif
313 
314 // /** @brief Returns the Jacobian matrix at the point (from son to father)*/
315 // virtual void Jacobian(TPZVec<REAL> &coordinate,TPZFMatrix<REAL> &jac,TPZFMatrix<REAL> &axes,REAL &detjac,TPZFMatrix<REAL> &jacinv) const
316 // {
317 // /// Creating Variables
318 // TPZGeoEl *father = TBase::Father();
319 // if(!father)
320 // {
321 // TBase::Jacobian(coordinate,jac,axes,detjac,jacinv);
322 // return;
323 // }
324 // TPZGeoEl *nextfather = 0;
325 // if(father) nextfather = father->Father();
326 // while(nextfather)
327 // {
328 // father = nextfather;
329 // nextfather = father->Father();
330 // }
331 // const int dim = Geo::Dimension;
332 // TPZManVector<REAL,3> ksibar(father->Dimension());
333 // TPZFNMatrix<dim*dim+1> jaclocal(dim,dim,0.),jacinvlocal(dim,dim,0.),jacfather(dim,dim,0.), jacinvfather(dim,dim,0.);
334 // TPZFNMatrix<9> axeslocal(3,3,0.), axesfather(3,3,0.);
335 // REAL detjaclocal, detjacfather;
336 //
337 // TPZFNMatrix<9> gradxlocal;
338 // Geo::GradX(fCornerCo,coordinate,gradxlocal);
339 // /// Processing Variables (isolated)
340 // Geo::Jacobian(fCornerCo,coordinate,jaclocal,axeslocal,detjaclocal,jacinvlocal);
341 // Geo::X(fCornerCo,coordinate,ksibar);
342 // father->Jacobian(ksibar,jacfather,axesfather,detjacfather,jacinvfather);
343 //
344 // /// @brief Combining Variables
345 // TPZFNMatrix<9> aux(dim,dim);
346 //
347 // //jacinv
348 // axeslocal.Resize(dim,dim); //reducing axes local to its correct dimension in this context
349 // axeslocal.Multiply(jacinvfather,aux);
350 // jacinvlocal.Multiply(aux,jacinv);
351 //
352 // //jac
353 // axeslocal.Transpose();
354 // axeslocal.Multiply(jaclocal,aux);
355 // jacfather.Multiply(aux,jac);
356 //
357 // //detjac
358 // detjac = detjaclocal*detjacfather;
359 //
360 // //axes
361 // axes = axesfather;
362 // }
363 
365  void X(TPZVec<REAL> &ksi,TPZVec<REAL> &result) const override {
366  return TX(ksi,result);
367  }
368 #ifdef _AUTODIFF
369  void X(TPZVec<Fad<REAL>> &ksi,TPZVec<Fad<REAL>> &result) const override {
370  return TX(ksi,result);
371  }
372 #endif
373 
374  virtual void Print(std::ostream & out = std::cout) override
375  {
376  TBase::Print(out);
377 
378  fCornerCo.Print("fCornerCo Print():",out);
379  }
380 
382  virtual void JacobianConv(TPZVec< REAL > QsiEta, TPZVec< REAL > &XYZ)
383  {std::cout << "\n***USING THE JACOBIAN FOR 3D ELEMENTS METHOD***\n";
384  TPZFMatrix<REAL> jacobian(3,3);
385  TPZFMatrix<REAL> Axes(3,3);
386  TPZFMatrix<REAL> InvJac(3,3);
387  TPZVec< REAL > QsiEtaIni (3,1);
388  QsiEtaIni[0] = QsiEta[0];
389  QsiEtaIni[1] = QsiEta[1];
390  QsiEtaIni[2] = QsiEta[2];
391  const double deltaQsi = 0.1;
392  const double deltaEta = 0.1;
393  const double deltaZeta = 0.1;
394  double alpha;
395 
396  std::cout << "\ninitial Qsi = " << QsiEtaIni[0] << " | initial Eta = " << QsiEtaIni[1] << " | initial Zeta = " << QsiEtaIni[2] <<"\n";
397  std::cout << "deltaQsi = const = " << deltaQsi << " | deltaEta = const = " << deltaEta << " | deltaZeta = const = " << deltaZeta <<"\n\n";
398 
399  TPZVec< REAL > XYZaprox(3);
400  TPZFMatrix<REAL> error(11,1,0.);
401  int edge;
402  double dX, dY, dZ;
403  for(int i = 0; i <= 10; i++)
404  {
405  alpha = i/10.;
406  X(QsiEtaIni,XYZ);//for aproximate compute
407  //Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
408 
409  dX = alpha*( jacobian.GetVal(0,0)*deltaQsi + jacobian.GetVal(0,1)*deltaEta + jacobian.GetVal(0,2)*deltaZeta)*Axes(0,0) + alpha*( jacobian.GetVal(1,0)*deltaQsi + jacobian.GetVal(1,1)*deltaEta + jacobian.GetVal(1,2)*deltaZeta)*Axes(1,0) + alpha*( jacobian.GetVal(2,0)*deltaQsi + jacobian.GetVal(2,1)*deltaEta + jacobian.GetVal(2,2)*deltaZeta)*Axes(2,0);
410  XYZaprox[0] = XYZ[0] + dX;
411 
412  dY = alpha*( jacobian.GetVal(0,0)*deltaQsi + jacobian.GetVal(0,1)*deltaEta + jacobian.GetVal(0,2)*deltaZeta)*Axes(0,1) + alpha*( jacobian.GetVal(1,0)*deltaQsi + jacobian.GetVal(1,1)*deltaEta + jacobian.GetVal(1,2)*deltaZeta)*Axes(1,1) + alpha*( jacobian.GetVal(2,0)*deltaQsi + jacobian.GetVal(2,1)*deltaEta + jacobian.GetVal(2,2)*deltaZeta)*Axes(2,1);
413  XYZaprox[1] = XYZ[1] + dY;
414 
415  dZ = alpha*( jacobian.GetVal(0,0)*deltaQsi + jacobian.GetVal(0,1)*deltaEta + jacobian.GetVal(0,2)*deltaZeta)*Axes(0,2) + alpha*( jacobian.GetVal(1,0)*deltaQsi + jacobian.GetVal(1,1)*deltaEta + jacobian.GetVal(1,2)*deltaZeta)*Axes(1,2) + alpha*( jacobian.GetVal(2,0)*deltaQsi + jacobian.GetVal(2,1)*deltaEta + jacobian.GetVal(2,2)*deltaZeta)*Axes(2,2);
416  XYZaprox[2] = XYZ[2] + dZ;
417 
418  QsiEta[0] = QsiEtaIni[0] + alpha*deltaQsi;
419  QsiEta[1] = QsiEtaIni[1] + alpha*deltaEta;
420  QsiEta[2] = QsiEtaIni[2] + alpha*deltaZeta;
421  edge = i + 1;
422  if((QsiEta[1]>1.00001-QsiEta[0]) || QsiEta[2]>1.00001-QsiEta[0]-QsiEta[1]) break;
423  X(QsiEta,XYZ);//for real compute
424 
425  XYZ[0] -= XYZaprox[0];
426  XYZ[1] -= XYZaprox[1];
427  XYZ[2] -= XYZaprox[2];
428 
429  double XDiffNorm = sqrt(XYZ[0]*XYZ[0] + XYZ[1]*XYZ[1] + XYZ[2]*XYZ[2]);
430  error(int(i),0) = XDiffNorm;
431  }
432 
433  std::cout << "ERROR Vector:\n";
434  for(int j = 2; j < edge; j++)
435  {
436  std::cout << error(j,0) << "\n";
437  }
438 
439  std::cout << "\nConvergence Order:\n";
440  for(int j = 2; j < edge; j++)
441  {
442  std::cout << ( log(error(1,0)) - log(error(j,0)) )/( log(0.1)-log(j/10.) ) << "\n";
443  }
444  if(edge != 11) std::cout << "The direction track has touch the edge of the element.\nThe method has stopped!\n";
445  }
446 
447 private:
448 
449 #ifdef WIN32
450  TPZFNMatrix<24/*Geo::Dimension*Geo::NNodes*/> fCornerCo;
451 #else
453 #endif
454 
456  void KsiBar(TPZVec<REAL> &ksi, TPZVec<REAL> &ksibar, TPZFMatrix<REAL> &jac) const
457  {
458  const int dim = Geo::Dimension;
459  TPZFNMatrix<Geo::NNodes> phi(Geo::NNodes,1,0.);
460  TPZFNMatrix<dim*Geo::NNodes> dphi(dim,Geo::NNodes,0.);
461  Geo::Shape(ksi,phi,dphi);
462  jac.Redim(dim,dim);
463  ksibar.Fill(0.);
464  int in,id,jd;
465  for(in=0; in<Geo::NNodes; in++)
466  {
467  for(id=0; id<dim; id++)
468  {
469  ksibar[id] += phi(in,0)*fCornerCo.GetVal(id,in);
470  for(jd=0; jd<dim; jd++)
471  {
472  jac(id,jd) += dphi(jd,in)*fCornerCo.GetVal(id,in);
473  }
474  }
475  }
476  }
477 
479  void KsiBar(TPZVec<REAL> &ksi, TPZVec<REAL> &ksibar) const{
480  return TKsiBar(ksi,ksibar);
481  }
482 
483  #ifdef _AUTODIFF
484  void KsiBar(TPZVec<Fad<REAL>> &ksi, TPZVec<Fad<REAL>> &ksibar) const{
485  return TKsiBar(ksi,ksibar);
486  }
487  #endif
488 
489  virtual TPZGeoEl *CreateBCGeoEl(int side, int bc) override {
490  int ns = this->NSideNodes(side);
491  TPZManVector<int64_t> nodeindices(ns);
492  int in;
493  for(in=0; in<ns; in++)
494  {
495  nodeindices[in] = this->SideNodeIndex(side,in);
496  }
497  int64_t index;
498 
499  TPZGeoMesh *mesh = this->Mesh();
500  MElementType type = this->Type(side);
501 
502  TPZGeoEl *newel = mesh->CreateGeoBlendElement(type, nodeindices, bc, index);
503  TPZGeoElSide me(this,side);
504  TPZGeoElSide newelside(newel,newel->NSides()-1);
505 
506  newelside.InsertConnectivity(me);
507  newel->Initialize();
508 
509  return newel;
510  }
511 
512 protected:
513  template<class T>
514  void TGradX(TPZVec<T> &qsi, TPZFMatrix<T> &gradx) const {
515 
517  TPZGeoEl *father = TBase::Father();
518  if(!father)
519  {
520  TBase::GradX(qsi,gradx);
521  return;
522  }
523  TPZGeoEl *nextfather = father;
524  while(nextfather)
525  {
526  father = nextfather;
527  nextfather = father->Father();
528  }
529 
530  TPZManVector<T,3> ksibar(father->Dimension());
531  TPZFNMatrix<9,T> gradxlocal;
532  Geo::GradX(fCornerCo,qsi,gradxlocal);
533  Geo::X(fCornerCo,qsi,ksibar);
534  TPZFNMatrix<9,T> gradxfather;
535  father->GradX(ksibar, gradxfather);
536 
538  gradxfather.Multiply(gradxlocal, gradx);
539 #ifdef LOG4CXX
540  if(loggermapped->isDebugEnabled())
541  {
542  std::stringstream sout;
543  gradxfather.Print("gradx father",sout);
544  gradxlocal.Print("gradx local",sout);
545  gradx.Print("gradx",sout);
546  LOGPZ_DEBUG(loggermapped, sout.str())
547  }
548 #endif
549  }
550 
551  template<class T>
552  void TX(TPZVec<T> &ksi,TPZVec<T> &result) const
553  {
554  TPZGeoEl *father = TBase::Father();
555 
556  if(!father)
557  {
558  return TBase::X(ksi,result);
559  }
560 
561  else
562  {
563  TPZGeoEl *nextfather = 0;
564  if(father) nextfather = father->Father();
565  while(nextfather)
566  {
567  father = nextfather;
568  nextfather = father->Father();
569  }
570 
571  TPZManVector<T,3> ksibar(this->Dimension());
572  KsiBar(ksi,ksibar);
573  father->X(ksibar,result);
574  }
575  }
576 
578  template<class T>
579  void TKsiBar(TPZVec<T> &ksi, TPZVec<T> &ksibar) const
580  {
581  const int dim = Geo::Dimension;
582  TPZFNMatrix<Geo::NNodes,T> phi(Geo::NNodes,1,0.);
583  TPZFNMatrix<dim*dim+1,T> jac(dim,dim,0.);
584  TPZFNMatrix<dim*Geo::NNodes+1,T> dphi(dim,Geo::NNodes,0.);
585  Geo::TShape(ksi,phi,dphi);
586  ksibar.Fill(0.);
587  int in,id;
588  for(in=0; in<Geo::NNodes; in++)
589  {
590  for(id=0; id<dim; id++)
591  {
592  ksibar[id] += phi(in,0)*fCornerCo.GetVal(id,in);
593  }
594  }
595  }
596 };
597 
598 template<class TBase>
599 inline bool TPZGeoElMapped<TBase>::IsLinearMapping(int side) const
600 {
601  TPZGeoElSide fatherside = this->Father2(side);
602  if (fatherside.Element()) {
603  return fatherside.IsLinearMapping();
604  }
605  else
606  {
607  return TBase::IsLinearMapping(side);
608  }
609 }
610 
611 template<class TBase>
613  return Hash("TPZGeoElMapped") ^ TBase::ClassId() << 1;
614 }
615 #endif
virtual TPZGeoEl * ClonePatchEl(TPZGeoMesh &DestMesh, std::map< int64_t, int64_t > &gl2lcNdIdx, std::map< int64_t, int64_t > &gl2lcElIdx) const override
void Print(std::ostream &out=std::cout)
Prints the structural information of the vector object to the output stream. This method will not p...
Definition: pzvec.h:482
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
TPZGeoElMapped(int64_t id, TPZVec< int64_t > &nodeindexes, int matind, TPZGeoMesh &mesh)
Contains declaration of TPZGeoElSide class which represents an element and its side, and TPZGeoElSideIndex class which represents an TPZGeoElSide index.
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.
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual bool IsLinearMapping(int side) const override
TBase::Geo Geo
TPZGeoElSide Father2() const
returns the father/side pair which contains the set of points associated with this/side ...
TPZTransform< REAL > Projection(int side)
Compute the projection of the point within the interior of the element to the side of the element...
Definition: pzgeoel.cpp:1970
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Definition: pzgeoelside.h:83
Definition: fad.h:54
static int fatherside[8][21]
Definition: pzrefprism.cpp:303
virtual void Initialize()
Definition: pzgeoel.h:176
TPZGeoMesh * Mesh() const
Returns the mesh to which the element belongs.
Definition: pzgeoel.h:220
virtual int NSides() const =0
Returns the number of connectivities of the element.
This class implements a geometric element which uses its ancestral to compute its jacobian...
virtual TPZGeoEl * CreateGeoBlendElement(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index)
Creates a geometric element in same fashion of CreateGeoElement but here the elements are blend...
Definition: pzgmesh.cpp:1400
int WhichSide(TPZVec< int64_t > &SideNodeIds)
Returns the side number which is connected to the SideNodes returns -1 if no side is found...
Definition: pzgeoel.cpp:165
void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
void error(char *string)
Definition: testShape.cc:7
bool IsLinearMapping() const
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
virtual TPZGeoEl * CreateBCGeoEl(int side, int bc) override
static const double tol
Definition: pzgeoprism.cpp:23
void TX(TPZVec< T > &ksi, TPZVec< T > &result) const
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: pzfmatrix.h:783
TPZGeoElMapped(TPZVec< int64_t > &nodeindices, int matind, TPZGeoMesh &mesh, int64_t &index)
virtual void Print(std::ostream &out=std::cout) const
Print the information of the grid to an ostream.
Definition: pzgmesh.cpp:130
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
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
Free store vector implementation.
TPZFNMatrix< Geo::Dimension *Geo::NNodes > fCornerCo
void Shape(TPZVec< REAL > &pt, TPZVec< int > orders, TPZVec< TPZTransform< REAL > > &transvec, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index) override
Creates a geometric element according to the type of the father element.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Definition: tfadfunc.h:120
TPZGeoElMapped(TPZVec< int64_t > &nodeindices, int matind, TPZGeoMesh &mesh)
void TKsiBar(TPZVec< T > &ksi, TPZVec< T > &ksibar) const
Compute the map of the point ksi to the ancestor ksibar.
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
Definition: pzlog.h:93
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
int ClassId() const override
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
void KsiBar(TPZVec< REAL > &ksi, TPZVec< REAL > &ksibar) const
Compute the map of the point ksi to the ancestor ksibar.
virtual TPZGeoEl * Clone(TPZGeoMesh &DestMesh) const override
TPZTransform< T > Multiply(TPZTransform< T > &right)
Multiply the transformation object (to the right) with right (Multiplying matrices) ...
Definition: pztrnsform.cpp:112
void KsiBar(TPZVec< REAL > &ksi, TPZVec< REAL > &ksibar, TPZFMatrix< REAL > &jac) const
Compute the map of the point ksi to the ancestor ksibar and the gradient of the ancestor ksibar with ...
TPZGeoEl * Element() const
Definition: pzgeoelside.h:162
virtual void GradX(TPZVec< REAL > &qsi, TPZFMatrix< REAL > &gradx) const =0
Return the gradient of the transformation at the given coordinate.
virtual void Read(TPZStream &buf, void *context) override
Read the element data from a stream.
virtual int Dimension() const =0
Returns the dimension of the element.
virtual TPZTransform< REAL > SideToSideTransform(int sidefrom, int sideto)=0
Compute the transformation between the master element space of one side of an element to the master e...
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_ log
Definition: tfadfunc.h:130
bool ComputeXInverse(TPZVec< REAL > &XD, TPZVec< REAL > &ksi, REAL Tol)
Computes the XInverse and returns true if ksi belongs to master element domain.
Definition: pzgeoel.cpp:686
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...
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
MElementType
Define the element types.
Definition: pzeltype.h:52
void X(TPZVec< REAL > &ksi, TPZVec< REAL > &result) const override
Returns the Jacobian matrix at the point (from son to father)
void GradX(TPZVec< REAL > &qsi, TPZFMatrix< REAL > &gradx) const override
Return the Jacobian matrix at the point.
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
void TGradX(TPZVec< T > &qsi, TPZFMatrix< T > &gradx) const
int Side() const
Definition: pzgeoelside.h:169
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 declaration of the TPZAxesTools class which implements verifications over axes...
virtual void Print(std::ostream &out) const
Definition: pzmatrix.h:253
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
virtual void JacobianConv(TPZVec< REAL > QsiEta, TPZVec< REAL > &XYZ)
Avaliate the Jacobian 3D (3x3 size) by Expected Convergence Order.
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
virtual void SetFatherIndex(int64_t fatherindex) override
Sets the father element index.
REAL ZeroTolerance()
Returns the tolerance to Zero value. Actually: .
Definition: pzreal.h:633
virtual bool IsGeoElMapped() const override
Returns if is a TPZGeoElMapped< T > element.
TPZGeoEl * Father() const
Computes the normal vectors needed for forming HDiv vector valued shape functions.
Definition: pzgeoel.cpp:2574
const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
Definition: pzfmatrix.h:566
void InsertConnectivity(TPZGeoElSide &neighbour)
This method inserts the element/side and all lowerdimension sides into the connectivity loop...
void Apply(TPZVec< T > &vectorin, TPZVec< T > &vectorout)
Transforms the vector.
Definition: pztrnsform.cpp:121
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
Definition: pzfmatrix.h:716
virtual void Print(std::ostream &out=std::cout) override