22 static LoggerPtr logger(Logger::getLogger(
"pz.topology.pzpyramid"));
29 static int FaceConnectLocId[5][9] = { {0,1,2,3,5,6,7,8,13},{0,1,4,5,10,9,14,-1,-1},
30 {1,2,4,6,11,10,15,-1,-1},{3,2,4,7,11,12,16,-1,-1},{0,3,4,8,12,9,17,-1,-1} };
33 static int nhighdimsides[19] = {7,7,7,7,9,3,3,3,3,3,3,3,3,1,1,1,1,1,0};
35 int TPZPyramid::SideNodes[8][2] = { {0,1},{1,2},{2,3},{3,0},{0,4},{1,4},{2,4},{3,4} };
37 int TPZPyramid::FaceNodes[5][4] = { {0,1,2,3},{0,1,4,-1},{1,2,4,-1},{3,2,4,-1},{0,3,4,-1} };
39 int TPZPyramid::ShapeFaceId[5][4] = { {0,1,2,3},{0,1,4,-1},{1,2,4,-1},{3,2,4,-1},{0,3,4,-1} };
41 int TPZPyramid::fPermutations[8][19] =
43 {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18},
44 {0,3,2,1,4,8,7,6,5,9,12,11,10,13,17,16,15,14,18},
45 {1,0,3,2,4,5,8,7,6,10,9,12,11,13,14,17,16,15,18},
46 {1,2,3,0,4,6,7,8,5,10,11,12,9,13,15,16,17,14,18},
47 {2,1,0,3,4,6,5,8,7,11,10,9,12,13,15,14,17,16,18},
48 {2,3,0,1,4,7,8,5,6,11,12,9,10,13,16,17,14,15,18},
49 {3,0,1,2,4,8,5,6,7,12,9,10,11,13,17,14,15,16,18},
50 {3,2,1,0,4,7,6,5,8,12,11,10,9,13,16,15,14,17,18}
53 static int sidedimension[19] = {0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,3};
60 {9,10,11,12,14,15,16,17,18},
82 int TPZPyramid::NSideNodes(
int side)
84 return nsidenodes[side];
89 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-99,-99}},
90 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-99,-99}},
91 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-99,-99}},
92 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-1,-99}},
93 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,0,-99}},
94 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,0,-99}},
95 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-1,0}}
98 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-99,-99}},
99 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-99,-99}},
100 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-99,-99}},
101 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-1,-99}},
102 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,0,-99}},
103 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,0,-99}},
104 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-1,0}}
107 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-99,-99}},
108 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-99,-99}},
109 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-99,-99}},
110 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,1,-99}},
111 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,0,-99}},
112 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,0,-99}},
113 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,1,0}}
116 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-99,-99}},
117 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-99,-99}},
118 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,-99,-99}},
119 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,1,-99}},
120 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,0,-99}},
121 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,0,-99}},
122 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-1,1,0}}
125 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-99,-99}},
126 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-99,-99}},
127 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-99,-99}},
128 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,-99,-99}},
129 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,1,-99}},
130 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,1,-99}},
131 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,1,-99}},
132 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,1,-99}},
133 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,0,1}}
136 {{1,0,-99},{-99,-99,-99},{-99,-99,-99},{0,-1,-99}},
137 {{0.5,0,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0,-99}},
138 {{1,0,0},{-99,-99,-99},{-99,-99,-99},{0,-1,0}}
141 {{0,1,-99},{-99,-99,-99},{-99,-99,-99},{1,0,-99}},
142 {{0.5,0,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0,-99}},
143 {{0,1,0},{-99,-99,-99},{-99,-99,-99},{1,0,0}}
146 {{-1,0,-99},{-99,-99,-99},{-99,-99,-99},{0,1,-99}},
147 {{-0.5,0,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0,-99}},
148 {{-1,0,0},{-99,-99,-99},{-99,-99,-99},{0,1,0}}
151 {{0,-1,-99},{-99,-99,-99},{-99,-99,-99},{-1,0,-99}},
152 {{-0.5,0,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0,-99}},
153 {{0,-1,0},{-99,-99,-99},{-99,-99,-99},{-1,0,0}}
156 {{0,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0,0.5,-99}},
157 {{0,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0,0.5,-99}},
158 {{0.5,0.5,0.5},{-99,-99,-99},{-99,-99,-99},{-0.5,-0.5,0.5}}
161 {{-0.5,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,-99}},
162 {{0,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0,0.5,-99}},
163 {{-0.5,0.5,0.5},{-99,-99,-99},{-99,-99,-99},{0.5,-0.5,0.5}}
166 {{-0.5,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,-99}},
167 {{-0.5,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,-99}},
168 {{-0.5,-0.5,0.5},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,0.5}}
171 {{0,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0,0.5,-99}},
172 {{-0.5,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,-99}},
173 {{0.5,-0.5,0.5},{-99,-99,-99},{-99,-99,-99},{-0.5,0.5,0.5}}
176 {{1,0,0},{0,1,0},{-99,-99,-99},{0,0,0}}
179 {{2,0,0},{1,1,1},{-99,-99,-99},{-1,-1,0}}
182 {{0,2,0},{-1,1,1},{-99,-99,-99},{1,-1,0}}
185 {{2,0,0},{1,-1,1},{-99,-99,-99},{-1,1,0}}
188 {{0,2,0},{1,1,1},{-99,-99,-99},{-1,-1,0}}
191 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-99,-99,-99}}
196 {-1.,-1.}, {1.,-1.}, {1.,1.},{-1.,1.},{0.,0.,1.},
197 { 0.,-1.}, {1., 0.}, {0.,1.},{-1.,0.},
198 {-.5,-.5,.5},{.5,-.5,.5},{.5,.5,.5},{-.5,.5,.5},
199 {0., 0. , 0. },{ 0. ,-2./3.,1./3.},{2./3.,0.,1./3.},
200 {0.,2./3.,1./3.},{-2./3., 0. ,1./3.},{ 0. ,0.,1./5.} };
204 {-1,-1,-1}, {1,-1,-1}, {1,1,-1}, {-1,1,-1}, {0,-1,-1}, {1,0,-1}, {0,1,-1}, {-1,0,-1}, {0,0,-1},
205 {0,-1,0}, {0,-1,0}, {-1,1,1}, {0,-1,0}, {-1,-3,1}, {1,-3,1}, {0,-1,1},
206 {1,0,0}, {1,0,0}, {-1,0,0}, {1,0,0}, {3,-1,1}, {3,1,1}, {1,0,1},
207 {0,1,0}, {0,1,0}, {1,1,-1}, {0,1,0}, {-1,3,1}, {1,3,1}, {0,1,1},
208 {-1,0,0}, {-1,0,0}, {0,0,0}, {-1,0,0}, {-3,-1,1}, {-3,1,1}, {-1,0,1},
217 {1,0,0},{0,1,0},{-1,0,0},{0,-1,0}, {1,1,1}, {-1,1,1}, {-1,-1,1}, {1,-1,1},
225 {-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},
226 {-1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {-1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {-1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {-1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {-1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {-1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {-1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)},
227 {1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)},
228 {1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)}, {1/
sqrt(3),-1/
sqrt(3),-1/
sqrt(3)},
229 {-1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)}, {-1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)},{-1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)},{-1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)}, {-1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)},{-1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)},{-1/
sqrt(3),1/
sqrt(3),-1/
sqrt(3)},
238 {0,-1,0},{1,0,0},{0,1,0},{0,0,-1}, {-1,0,1},{0-1,1},{1,0,1},{0,1,1},
247 {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0},
248 {
sqrt(2/3), -(1/
sqrt(6)), -(1/
sqrt(6))}, {
sqrt(2/3), -(1/
sqrt(6)), -(1/
sqrt(6))}, {
sqrt(2/3), -(1/
sqrt(6)), -(1/
sqrt(6))}, {
sqrt(2/3), -(1/
sqrt(6)), -(1/
sqrt(6))}, {
sqrt(2/3), -(1/
sqrt(6)), -(1/
sqrt(6))}, {
sqrt(2/3), -(1/
sqrt(6)), -(1/
sqrt(6))}, {
sqrt(2/3), -(1/
sqrt(6)), -(1/
sqrt(6))},
249 {(1/
sqrt(6)),
sqrt(2/3), -(1/
sqrt(6))}, {(1/
sqrt(6)),
sqrt(2/3), -(1/
sqrt(6))}, {(1/
sqrt(6)),
sqrt(2/3), -(1/
sqrt(6))},{(1/
sqrt(6)),
sqrt(2/3), -(1/
sqrt(6))},{(1/
sqrt(6)),
sqrt(2/3), -(1/
sqrt(6))},{(1/
sqrt(6)),
sqrt(2/3), -(1/
sqrt(6))},{(1/
sqrt(6)),
sqrt(2/3), -(1/
sqrt(6))},
250 {-
sqrt(2/3), (1/
sqrt(6)), -(1/
sqrt(6))}, {-
sqrt(2/3), (1/
sqrt(6)), -(1/
sqrt(6))}, {-
sqrt(2/3), (1/
sqrt(6)), -(1/
sqrt(6))}, {-
sqrt(2/3), (1/
sqrt(6)), -(1/
sqrt(6))}, {-
sqrt(2/3), (1/
sqrt(6)), -(1/
sqrt(6))},{-
sqrt(2/3), (1/
sqrt(6)), -(1/
sqrt(6))}, {-
sqrt(2/3), (1/
sqrt(6)), -(1/
sqrt(6))},
251 {-(1/
sqrt(6)), -
sqrt(2/3), -(1/
sqrt(6))},{-(1/
sqrt(6)), -
sqrt(2/3), -(1/
sqrt(6))},{-(1/
sqrt(6)), -
sqrt(2/3), -(1/
sqrt(6))},{-(1/
sqrt(6)), -
sqrt(2/3), -(1/
sqrt(6))},{-(1/
sqrt(6)), -
sqrt(2/3), -(1/
sqrt(6))},{-(1/
sqrt(6)), -
sqrt(2/3), -(1/
sqrt(6))},{-(1/
sqrt(6)), -
sqrt(2/3), -(1/
sqrt(6))},
260 {0,0,-1},{0,0,-1},{0,0,-1},{-1,0,0}, {0,-1,1},{1,0,1},{0,1,1},{-1,0,1},
285 0,0,0,0,0,0,0,0,0,0,
286 0,0,0,0,0,0,0,0,0,0,
287 0,0,0,0,0,0,0,0,0,0,
288 0,0,0,0,0,0,0,1,1,1,
289 1,1,1,1,1,1,1,1,1,1,
293 0,0,0,0,0,0,0,0,0,0,
294 0,0,0,0,0,0,0,0,0,0,
295 0,0,0,0,0,0,0,0,0,0,
296 0,0,0,0,0,0,0,0,0,0,
297 0,0,0,0,0,0,1,0,1,0,
303 T xi = loc[0], eta = loc[1] , zeta = loc[2];
309 T T0xz = .5*(1.-zeta-xi) / (1.-zeta);
310 T T0yz = .5*(1.-zeta-eta) / (1.-zeta);
311 T T1xz = .5*(1.-zeta+xi) / (1.-zeta);
312 T T1yz = .5*(1.-zeta+eta) / (1.-zeta);
323 phi(0,0) = T0xz*T0yz*lmez;
324 phi(1,0) = T1xz*T0yz*lmez;
325 phi(2,0) = T1xz*T1yz*lmez;
326 phi(3,0) = T0xz*T1yz*lmez;
329 T lmexmez = 1.-xi-zeta;
330 T lmeymez = 1.-eta-zeta;
331 T lmaxmez = 1.+xi-zeta;
332 T lmaymez = 1.+eta-zeta;
346 dphi(0,0) = -.25*lmeymez / lmez;
347 dphi(1,0) = -.25*lmexmez / lmez;
348 dphi(2,0) = -.25*(lmeymez+lmexmez-lmexmez*lmeymez/lmez) / lmez;
349 dphi(0,1) = .25*lmeymez / lmez;
350 dphi(1,1) = -.25*lmaxmez / lmez;
351 dphi(2,1) = -.25*(lmeymez+lmaxmez-lmaxmez*lmeymez/lmez) / lmez;
352 dphi(0,2) = .25*lmaymez / lmez;
353 dphi(1,2) = .25*lmaxmez / lmez;
354 dphi(2,2) = -.25*(lmaymez+lmaxmez-lmaxmez*lmaymez/lmez) / lmez;
355 dphi(0,3) = -.25*lmaymez / lmez;
356 dphi(1,3) = .25*lmexmez / lmez;
357 dphi(2,3) = -.25*(lmaymez+lmexmez-lmexmez*lmaymez/lmez) / lmez;
365 void TPZPyramid::BlendFactorForSide(
const int &side,
const TPZVec<T> &xiVec, T &blendFactor,
368 blendFactorDxi.
Resize(TPZPyramid::Dimension, (T) 0);
371 std::ostringstream sout;
372 if(side < NCornerNodes || side >= NSides){
373 sout<<
"The side\t"<<side<<
"is invalid. Aborting..."<<std::endl;
377 sout<<
"The method BlendFactorForSide expects the point xi to correspond to coordinates of a point";
378 sout<<
" inside the parametric domain. Aborting...";
381 if(!sout.str().empty()){
382 PZError<<std::endl<<sout.str()<<std::endl;
390 if(!CheckProjectionForSingularity(side,xiVec)){
391 std::cout<<
"Side projection is not regular and it should have been checked earlier. Aborting.."<<std::endl;
394 for(
int i = 0; i < blendFactorDxi.
size(); i++) blendFactorDxi[i] = 0;
400 TPZPyramid::TShape(xiVec,phi,dphi);
401 for(
int i = 0; i < TPZPyramid::NSideNodes(side);i++){
402 const int currentNode = TPZPyramid::SideNodeLocId(side, i);
403 blendFactor += phi(currentNode,0);
404 blendFactorDxi[0] += dphi(0,currentNode);
405 blendFactorDxi[1] += dphi(1,currentNode);
406 blendFactorDxi[2] += dphi(2,currentNode);
409 const T &zeta = xiVec[2];
417 blendFactorDxi[0] = 0;
418 blendFactorDxi[1] = 0;
419 blendFactorDxi[2] = 0;
425 blendFactorDxi[0] *= (1 - zeta);
426 blendFactorDxi[1] *= (1 - zeta);
427 blendFactorDxi[2] = (1 - zeta) * blendFactorDxi[2] - blendFactor;
428 blendFactor *= 1.-zeta;
434 blendFactorDxi[0] *= 2 * blendFactor;
435 blendFactorDxi[1] *= 2 * blendFactor;
436 blendFactorDxi[2] *= 2 * blendFactor;
437 blendFactor *= blendFactor;
445 blendFactorDxi[0] *= 3 * blendFactor * blendFactor;
446 blendFactorDxi[1] *= 3 * blendFactor * blendFactor;
447 blendFactorDxi[2] *= 3 * blendFactor * blendFactor;
448 blendFactor *= blendFactor * blendFactor;
452 blendFactorDxi[0] = 0;
453 blendFactorDxi[1] = 0;
454 blendFactorDxi[2] = 0;
458 int TPZPyramid:: NBilinearSides()
467 int nsidecon = NContainedSides(side);
469 for(is=0; is<nsidecon-1; is++)
470 smallsides.
Push(ContainedSideLocId(side,is));
473 void TPZPyramid::LowerDimensionSides(
int side,
TPZStack<int> &smallsides,
int DimTarget)
476 int nsidecon = NContainedSides(side);
477 for(
int is = 0; is < nsidecon - 1; is++) {
478 if (SideDimension(ContainedSideLocId(side,is)) == DimTarget) smallsides.
Push(ContainedSideLocId(side,is));
484 if(side <0 || side >= NSides) {
485 PZError <<
"TPZPyramid::HigherDimensionSides side "<< side << endl;
488 for(is=0; is<nhighdimsides[side]; is++) high.
Push(highsides[side][is]);
492 int TPZPyramid::SideNodeLocId(
int side,
int node)
494 if(side <5 && node == 0)
return side;
495 if(side >= 5 && side <13 && node < 2)
return SideNodes[side-5][node];
496 if(side == 13 && node <4)
return FaceNodes[side-13][node];
497 if(side >13 && side < 18) {
499 return FaceNodes[side-13][node];
505 if(side == 18 && node < 5)
return node;
506 PZError <<
"TPZPyramid::SideNodeLocId inconsistent side or node " << side <<
' ' << node << endl;
511 if (center.
size()!=Dimension) {
515 for(i=0; i<Dimension; i++) {
516 center[i] = MidSideNode[side][i];
520 int TPZPyramid::SideDimension(
int side) {
521 if(side<0 || side >= NSides) {
522 PZError <<
"TPZPyramid::SideDimension side " << side << endl;
525 return sidedimension[side];
530 if(sidefrom <0 || sidefrom >= NSides || sideto <0 || sideto >= NSides) {
531 PZError <<
"TPZPyramid::HigherDimensionSides sidefrom "<< sidefrom <<
532 ' ' << sideto << endl;
535 if(sidefrom == sideto) {
538 if(sidefrom == NSides-1) {
539 return TransformElementToSide(sideto);
541 int nhigh = nhighdimsides[sidefrom];
543 for(is=0; is<nhigh; is++) {
544 if(highsides[sidefrom][is] == sideto) {
545 int dfr = sidedimension[sidefrom];
546 int dto = sidedimension[sideto];
549 for(i=0; i<dto; i++) {
550 for(j=0; j<dfr; j++) {
551 trans.
Mult()(i,j) = sidetosidetransforms[sidefrom][is][j][i];
553 trans.
Sum()(i,0) = sidetosidetransforms[sidefrom][is][3][i];
558 PZError <<
"TPZPyramid::SideToSideTransform highside not found sidefrom " 559 << sidefrom <<
' ' << sideto << endl;
565 if(side<0 || side>18){
566 PZError <<
"TPZPyramid::TransformElementToSide called with side error\n";
588 t.
Mult()(0,0) = -1.0;
591 t.
Mult()(0,1) = -1.0;
601 t.
Mult()(0,0) = -0.5;
608 t.
Mult()(0,0) = -0.5;
609 t.
Mult()(0,1) = -0.5;
616 t.
Mult()(0,1) = -0.5;
642 t.
Mult()(0,1) = -0.25;
643 t.
Mult()(0,2) = -0.25;
661 t.
Mult()(0,0) = 0.25;
663 t.
Mult()(0,2) = -0.25;
665 t.
Mult()(1,0) = -0.5;
678 t.
Mult()(0,1) = 0.25;
679 t.
Mult()(0,2) = -0.25;
681 t.
Mult()(1,1) = -0.5;
690 t.
Mult()(0,0) = -0.25;
692 t.
Mult()(0,2) = -0.25;
694 t.
Mult()(1,0) = 0.50;
695 t.
Mult()(1,2) = 0.50;
713 if(side<0 || side>18){
714 PZError <<
"TPZPyramid::TransformSideToElement side out range\n";
749 t.
Sum() (1,0) = -1.0;
756 t.
Mult()(0,0) = -1.0;
760 t.
Mult()(1,0) = -1.0;
772 t.
Mult()(0,0) = -0.5;
780 t.
Mult()(0,0) = -0.5;
781 t.
Mult()(1,0) = -0.5;
789 t.
Mult()(1,0) = -0.5;
809 t.
Mult()(0,1) = -1.0;
818 t.
Mult()(1,1) = -1.0;
842 TPZIntPoints * TPZPyramid::CreateSideIntegrationRule(
int side,
int order){
843 if(side<0 || side>18) {
844 PZError <<
"TPZPyramid::CreateSideIntegrationRule. Bad side number.\n";
848 if(side<13)
return new TPZInt1d(order);
849 if(side==13)
return new TPZIntQuad(order,order);
897 int TPZPyramid::NumSides() {
903 if(dimension<0 || dimension> 3) {
904 PZError <<
"TPZPyramid::NumSides. Bad parameter i.\n";
907 if(dimension==0)
return 5;
908 if(dimension==1)
return 8;
909 if(dimension==2)
return 5;
910 if(dimension==3)
return 1;
913 int TPZPyramid::NContainedSides(
int side) {
914 if(side<0)
return -1;
916 if(side<13)
return 3;
917 if(side==13)
return 9;
918 if(side<18)
return 7;
919 if(side==18)
return 19;
923 int TPZPyramid::ContainedSideLocId(
int side,
int node) {
924 if(side<0 || side>19 || node < 0)
return -1;
926 if(node==0)
return side;
931 if(node==1)
return (s+1)%4;
932 if(node==2)
return side;
937 if(node==1)
return 4;
938 if(node==2)
return side;
942 if(node<9)
return FaceConnectLocId[s][node];
944 else if(side==18 && node<19){
947 PZError <<
"TPZShapePiram::ContainedSideLocId called for node = " 948 << node <<
" and side = " << side <<
"\n";
953 const REAL qsi = pt[0];
954 const REAL eta = pt[1];
955 const REAL zeta = pt[2];
957 if( (qsi < -1. - tol) || (qsi > 1.+tol) ||
958 (eta < -1. - tol) || (eta > 1.+tol) ||
959 (zeta < 0. - tol) || (zeta > 1.+tol) ||
960 (
fabs(qsi) > 1.-zeta + tol) || (
fabs(eta) > 1.-zeta + tol)
975 REAL
val = (REAL) rand() / (RAND_MAX);
977 for(
int i=0; i<2; i++)
979 val = (1-pt[2])*(-1. + 2.*(REAL) rand() / (RAND_MAX));
985 bool TPZPyramid::CheckProjectionForSingularity(
const int &side,
const TPZVec<T> &xiInterior) {
988 T qsi = xiInterior[0]; T eta = xiInterior[1]; T zeta = xiInterior[2];
989 bool regularmap =
true;
999 if(
fabs((T)(zeta-1.)) < zero) regularmap =
false;
1002 if(
fabs((T)(zeta-1.)) < zero) regularmap =
false;
1005 if(
fabs((T)(zeta-1.)) < zero) regularmap =
false;
1008 if(
fabs((T)(zeta-1.)) < zero) regularmap =
false;
1011 if(
fabs((T)(qsi-1.)) < zero ||
fabs((T)(eta-1.)) < zero ) regularmap =
false;
1012 else if(
fabs((T)(zeta-1.)) < zero) regularmap =
false;
1015 if(
fabs((T)(qsi+1.)) < zero ||
fabs((T)(eta-1.)) < zero ) regularmap =
false;
1016 else if(
fabs((T)(zeta-1.)) < zero) regularmap =
false;
1019 if(
fabs((T)(qsi+1.)) < zero ||
fabs((T)(eta+1.)) < zero ) regularmap =
false;
1020 else if(
fabs((T)(zeta-1.)) < zero ) regularmap =
false;
1023 if(
fabs((T)(qsi-1.)) < zero ||
fabs((T)(eta+1.)) < zero) regularmap =
false;
1024 else if(
fabs((T)(zeta-1.)) < zero) regularmap =
false;
1027 if(
fabs((T)(zeta-1.)) < zero) regularmap =
false;
1030 if(
fabs((T)(zeta+eta-1.)) < zero) regularmap =
false;
1031 else if(
fabs((T)(eta-1.)) < zero) regularmap =
false;
1034 if(
fabs((T)(zeta-qsi-1.)) < zero) regularmap =
false;
1035 else if(
fabs((T)(qsi+1.)) < zero) regularmap =
false;
1038 if(
fabs((T)(1-zeta+eta)) < zero) regularmap =
false;
1039 else if(
fabs((T)(eta+1.)) < zero) regularmap =
false;
1042 if(
fabs((T)(zeta+qsi-1.)) < zero) regularmap =
false;
1043 else if(
fabs((T)(qsi-1.)) < zero) regularmap =
false;
1049 PZError<<
"Cannot compute CheckProjectionForSingularity method in TPZPyramid class. Invalid parameter (side):\t";
1060 if(!CheckProjectionForSingularity(side,InternalPar)){
1061 std::cout<<
"Side projection is not regular and it should have been checked earlier. Aborting.."<<std::endl;
1065 T qsi = InternalPar[0]; T eta = InternalPar[1]; T zeta = InternalPar[2];
1080 SidePar[0] = qsi/(1 - zeta);
1081 JacToSide(0,0) = 1/(1 - zeta);
1083 JacToSide(0,2) = qsi/((-1 + zeta)*(-1 + zeta));
1090 SidePar[0] = eta/(1 - zeta);
1092 JacToSide(0,1) = 1/(1 - zeta);
1093 JacToSide(0,2) = eta/((-1 + zeta)*(-1 + zeta));
1100 SidePar[0] = qsi/(-1 + zeta);
1101 JacToSide(0,0) = 1/(-1 + zeta);
1103 JacToSide(0,2) = -(qsi/((-1 + zeta)*(-1 + zeta)));
1110 SidePar[0] = eta/(-1 + zeta);
1112 JacToSide(0,1) = 1/(-1 + zeta);
1113 JacToSide(0,2) = -(eta/((-1 + zeta)*(-1 + zeta)));
1120 SidePar[0] = -1 + (8*(-1 + zeta)*zeta)/(-1 + eta + qsi - eta*qsi - (2 + eta + qsi)*zeta + 3*(zeta*zeta));
1121 T denominator = (((-1 + qsi - 3*zeta)*(-1 + zeta) + eta*(-1 + qsi + zeta))*
1122 ((-1 + qsi - 3*zeta)*(-1 + zeta) + eta*(-1 + qsi + zeta)));
1123 JacToSide(0,0) = (8*(-1 + zeta)*zeta*(-1 + eta + zeta))/denominator;
1124 JacToSide(0,1) = (8*(-1 + zeta)*zeta*(-1 + qsi + zeta))/denominator;
1125 JacToSide(0,2) = (-8*((-1 + qsi)*((-1 + zeta)*(-1 + zeta)) + eta*((-1 + zeta)*
1126 (-1 + zeta) + qsi*(-1 + 2*zeta))))/denominator;
1133 SidePar[0] = -1 + (8*(-1 + zeta)*zeta)/(eta*(1 + qsi - zeta) + (-1 + zeta)*(1 + qsi + 3*zeta));
1134 T denominator = ((eta*(1 + qsi - zeta) + (-1 + zeta)*(1 + qsi + 3*zeta))*
1135 (eta*(1 + qsi - zeta) + (-1 + zeta)*(1 + qsi + 3*zeta)));
1136 JacToSide(0,0) = (-8*(-1 + zeta)*zeta*(-1 + eta + zeta))/denominator;
1137 JacToSide(0,1) = (-8*(1 + qsi - zeta)*(-1 + zeta)*zeta)/denominator;
1138 JacToSide(0,2) = (8*(1 + qsi)*((-1 + zeta)*(-1 + zeta)) -
1139 8*eta*(qsi + (-1 + zeta)*(-1 + zeta) - 2*qsi*zeta))/denominator;
1147 SidePar[0] = (1 + eta + qsi + eta*qsi - (6 + eta + qsi)*zeta + 5*(zeta*zeta))/
1148 (eta*(-1 - qsi + zeta) + (-1 + zeta)*(1 + qsi + 3*zeta));
1149 T denominator = (eta*(1 + qsi - zeta) - (-1 + zeta)*(1 + qsi + 3*zeta))*(eta*(1 + qsi - zeta) - (-1 + zeta)*(1 + qsi + 3*zeta));
1150 JacToSide(0,0) = (8*(1 + eta - zeta)*(-1 + zeta)*zeta)/denominator;
1151 JacToSide(0,1) = (8*(1 + qsi - zeta)*(-1 + zeta)*zeta)/denominator;
1152 JacToSide(0,2) = (8*((1 + qsi)*((-1 + zeta)*(-1 + zeta)) +
1153 eta*(qsi + (-1 + zeta)*(-1 + zeta) - 2*qsi*zeta)))/denominator;
1160 SidePar[0] = -1 + (8*(-1 + zeta)*zeta)/(qsi*(1 + eta - zeta) + (-1 + zeta)*(1 + eta + 3*zeta));
1161 T denominator = (qsi*(1 + eta - zeta) + (-1 + zeta)*(1 + eta + 3*zeta))*
1162 (qsi*(1 + eta - zeta) + (-1 + zeta)*(1 + eta + 3*zeta));
1163 JacToSide(0,0) = (-8*(1 + eta - zeta)*(-1 + zeta)*zeta)/denominator;
1164 JacToSide(0,1) = (-8*(-1 + zeta)*zeta*(-1 + qsi + zeta))/denominator;
1165 JacToSide(0,2) = (-8*(-1 + qsi)*((-1 + zeta)*(-1 + zeta)) +
1166 8*eta*((-1 + zeta)*(-1 + zeta) + qsi*(-1 + 2*zeta)))/(((-1 + qsi - 3*zeta)*(-1 + zeta)
1167 - eta*(-1 + qsi + zeta))*((-1 + qsi - 3*zeta)*(-1 + zeta) - eta*(-1 + qsi + zeta)));
1174 SidePar[0] = qsi/(1 - zeta);
1175 SidePar[1] = eta/(1 - zeta);
1176 JacToSide(0,0) = 1/(1 - zeta);
1178 JacToSide(0,2) = qsi/((-1 + zeta)*(-1 + zeta));
1180 JacToSide(1,1) = 1/(1 - zeta);
1181 JacToSide(1,2) = eta/((-1 + zeta)*(-1 + zeta));
1188 SidePar[0] = -((-1 + eta + zeta)*(-1 - qsi + zeta))/(2.*(-1 + zeta)*(1 - eta + zeta));
1189 SidePar[1] = (2*zeta)/(1 - eta + zeta);
1190 JacToSide(0,0) = (-1 + eta + zeta)/(2.*(-1 + zeta)*(1 - eta + zeta));
1191 JacToSide(0,1) = ((1 + qsi - zeta)*zeta)/((-1 + zeta)*((1 - eta + zeta)*(1 - eta + zeta)));
1192 JacToSide(0,2) = (eta*eta*qsi - (2 + qsi)*((-1 + zeta)*(-1 + zeta)) +
1193 2*eta*(1 - (2 + qsi)*zeta + zeta*zeta))/
1194 (2.*((-1 + zeta)*(-1 + zeta))*((1 - eta + zeta)*(1 - eta + zeta)));
1196 JacToSide(1,1) = (2*zeta)/((1 - eta + zeta)*(1 - eta + zeta));
1197 JacToSide(1,2) = (2 - 2*eta)/((1 - eta + zeta)*(1 - eta + zeta));
1204 SidePar[0] = ((1 + eta - zeta)*(-1 - qsi + zeta))/(2.*(-1 + zeta)*(1 + qsi + zeta));
1205 SidePar[1] = (2*zeta)/(1 + qsi + zeta);
1206 JacToSide(0,0) = (zeta*(-1 - eta + zeta))/((-1 + zeta)*((1 + qsi + zeta)*(1 + qsi + zeta)));
1207 JacToSide(0,1) = (-1 - qsi + zeta)/(2.*(-1 + zeta)*(1 + qsi + zeta));
1208 JacToSide(0,2) = (-2*(1 + qsi)*((-1 + zeta)*(-1 + zeta)) +
1209 eta*(qsi*qsi - (-1 + zeta)*(-1 + zeta) + 2*qsi*zeta))/
1210 (2.*((-1 + zeta)*(-1 + zeta))*((1 + qsi + zeta)*(1 + qsi + zeta)));
1211 JacToSide(1,0) = (-2*zeta)/((1 + qsi + zeta)*(1 + qsi + zeta));
1213 JacToSide(1,2) = (2*(1 + qsi))/((1 + qsi + zeta)*(1 + qsi + zeta));
1221 SidePar[0] = ((1 + eta - zeta)*(-1 - qsi + zeta))/(2.*(-1 + zeta)*(1 + eta + zeta));
1222 SidePar[1] = (2*zeta)/(1 + eta + zeta);
1223 JacToSide(0,0) = (-1 - eta + zeta)/(2.*(-1 + zeta)*(1 + eta + zeta));
1224 JacToSide(0,1) = (zeta*(-1 - qsi + zeta))/((-1 + zeta)*((1 + eta + zeta)*(1 + eta + zeta)));
1225 JacToSide(0,2) = (eta*eta*qsi - (2 + qsi)*((-1 + zeta)*(-1 + zeta)) -
1226 2*eta*(1 - (2 + qsi)*zeta + zeta*zeta))/
1227 (2.*((-1 + zeta)*(-1 + zeta))*((1 + eta + zeta)*(1 + eta + zeta)));
1229 JacToSide(1,1) = (-2*zeta)/((1 + eta + zeta)*(1 + eta + zeta));
1230 JacToSide(1,2) = (2*(1 + eta))/((1 + eta + zeta)*(1 + eta + zeta));
1237 SidePar[0] = ((1 + eta - zeta)*(-1 + qsi + zeta))/(2.*(-1 + zeta)*(1 - qsi + zeta));
1238 SidePar[1] = (2*zeta)/(1 - qsi + zeta);
1239 JacToSide(0,0) = ((1 + eta - zeta)*zeta)/((-1 + zeta)*((1 - qsi + zeta)*(1 - qsi + zeta)));
1240 JacToSide(0,1) = (-1 + qsi + zeta)/(2.*(-1 + zeta)*(1 - qsi + zeta));
1241 JacToSide(0,2) = (2*(-1 + qsi)*((-1 + zeta)*(-1 + zeta)) +
1242 eta*(qsi*qsi - (-1 + zeta)*(-1 + zeta) - 2*qsi*zeta))/
1243 (2.*((-1 + zeta)*(-1 + zeta))*((1 - qsi + zeta)*(1 - qsi + zeta)));
1244 JacToSide(1,0) = (2*zeta)/((1 - qsi + zeta)*(1 - qsi + zeta));
1246 JacToSide(1,2) = (2 - 2*qsi)/((1 - qsi + zeta)*(1 - qsi + zeta));
1251 SidePar = InternalPar;
1257 PZError<<
"Cannot compute MapToSide method in TPZPyramid class. Invalid parameter (side):\t";
1259 PZError <<
"This should have been caught earlier in the execution, there is something wrong.\n";
1260 PZError <<
"Check method TPZPyramid::CheckProjectionForSingularity<T>\n";
1264 for(
int i = 0; i < SidePar.
size();i++){
1272 void TPZPyramid::ParametricDomainNodeCoord(
int node,
TPZVec<REAL> &nodeCoord)
1274 if(node > NCornerNodes)
1278 nodeCoord.
Resize(Dimension, 0.);
1331 void TPZPyramid::GetSideHDivPermutation(
int transformationid,
TPZVec<int> &permgather)
1333 std::cout <<
"Please implement me\n";
1355 int in1 = ContainedSideLocId(side,0);
1356 int in2 = ContainedSideLocId(side,1);
1357 return id[in1]<
id[in2] ? 0 : 1;
1365 for(i=0; i<4; i++) locid[i] =
id[ContainedSideLocId(side,i)];
1376 for(i=0; i<3; i++) locid[i] =
id[ContainedSideLocId(side,i)];
1405 for (
int ivet=inicio; ivet<=fim; ivet++)
1407 for (
int ilin=0; ilin<3; ilin++)
1409 u[ilin] = t1vec(ilin,ivet);
1410 v[ilin] = t2vec(ilin,ivet);
1414 REAL normaX0xX1 = 0.0;
1416 e2[0] = u[1]*v[2]-u[2]*v[1];
1417 e2[1] = -(u[0]*v[2]-v[0]*u[2]);
1418 e2[2] = u[0]*v[1]-v[0]*u[1];
1422 REAL be2 = 0.0, ne2 = 0.0;
1423 for(
int i=0;i<3;i++)
1428 for (
int il=0; il<3; il++)
1430 for (
int i = 0 ; i<3; i++)
1432 dxt1[il] += gradx(il,i) * t1vec(i,ivet);
1433 dxt2[il] += gradx(il,i) * t2vec(i,ivet);
1434 dxt3[il] += gradx(il,i) * e2[i]/ne2;
1435 Vvec[il] += gradx(il,i) * bvec(i,ivet);
1437 be2 += bvec(il,ivet)*e2[il]/ne2;
1441 normal[0] = dxt1[1]*dxt2[2]-dxt1[2]*dxt2[1];
1442 normal[1] = -(dxt1[0]*dxt2[2]-dxt2[0]*dxt1[2]);
1443 normal[2] = dxt1[0]*dxt2[1]-dxt2[0]*dxt1[1];
1445 for (
int pos=0; pos<3; pos++)
1447 detgrad += normal[pos]*dxt3[pos];
1448 normaX0xX1 += normal[pos]*normal[pos];
1451 detgrad =
fabs(detgrad);
1452 normaX0xX1 =
sqrt(normaX0xX1);
1454 for (
int il=0; il<3; il++)
1456 Wvec(il,0) = Vvec[il]*normaX0xX1/(detgrad*be2);
1457 directions(il,cont) = Wvec(il,0);
1469 { std::cout <<
"Gradient dimensions are not compatible with this topology" << std::endl;
1473 int numvec = bvec.
Cols();
1477 directions.
Redim(3, numvec);
1478 for (
int lin = 0; lin<numvec; lin++)
1480 for(
int col = 0;col<3;col++)
1482 bvec.
PutVal(col, lin, bPiram[lin][col]);
1483 t1vec.
PutVal(col, lin, t1Piram[lin][col]);
1484 t2vec.
PutVal(col, lin, t2Piram[lin][col]);
1495 int inicio = 0, fim = 8;
1497 int diff = fim-inicio+1;
1498 for (
int ip = 0; ip < diff; ip++) {
1499 sidevectors[ip] = vectorsideorderPi[ip+inicio];
1509 int inicio = 9, fim = 15;
1511 int diff = fim-inicio+1;
1512 for (
int ip = 0; ip < diff; ip++) {
1513 sidevectors[ip] = vectorsideorderPi[ip+inicio];
1522 int inicio = 16, fim = 22;
1524 int diff = fim-inicio+1;
1525 for (
int ip = 0; ip < diff; ip++) {
1526 sidevectors[ip] = vectorsideorderPi[ip+inicio];
1535 int inicio = 23, fim = 29;
1537 int diff = fim-inicio+1;
1538 for (
int ip = 0; ip < diff; ip++) {
1539 sidevectors[ip] = vectorsideorderPi[ip+inicio];
1548 int inicio = 30, fim = 36;
1550 int diff = fim-inicio+1;
1551 for (
int ip = 0; ip < diff; ip++) {
1552 sidevectors[ip] = vectorsideorderPi[ip+inicio];
1559 directions.
Resize(3, 21);
1561 int inicio = 37, fim = 57;
1563 int diff = fim-inicio+1;
1564 for (
int ip = 0; ip < diff; ip++) {
1565 sidevectors[ip] = vectorsideorderPi[ip+inicio];
1576 template <
class TVar>
1582 for (
int i=0; i<3; i++) {
1597 std::cout <<
"Pyramid space not complete. Calling debugstop(). " << std::endl;
1601 for (
int i=0; i<3; i++) {
1605 ar9[i] = v3[i]-(-v1[i]-v2[i]);
1606 ar10[i] = v3[i]-(v1[i]-v2[i]);
1607 ar11[i] = v3[i]-(v1[i]+v2[i]);
1608 ar12[i] = v3[i]-(v2[i]-v1[i]);
1614 for (
int i=0; i<3; i++)
1617 directions(i,0) = -ar9[i];
1618 directions(i,1) = -ar10[i];
1619 directions(i,2) = -ar11[i];
1620 directions(i,3) = -ar12[i];
1621 directions(i,4) = ( directions(i,0)+directions(i,1) )/2.;
1622 directions(i,5) = ( directions(i,1)+directions(i,2) )/2.;
1623 directions(i,6) = ( directions(i,2)+directions(i,3) )/2.;
1624 directions(i,7) = ( directions(i,3)+directions(i,0) )/2.;
1625 directions(i,8) = ( directions(i,4)+directions(i,5)+directions(i,6)+directions(i,7) )/4.;
1627 static TVar scale = 1./(2);
1628 directions(i,9) = -v2[i]*scale;
1629 directions(i,10) = -v2[i]*scale;
1631 directions(i,11) = -v2[i]*scale;
1632 directions(i,12) = ( directions(i,9) + directions(i,10) )/2.;
1633 directions(i,13) = ( directions(i,10)+ directions(i,11) )/2.;
1634 directions(i,14) = ( directions(i,9) + directions(i,11) )/2.;
1635 directions(i,15) = ( directions(i,12)+ directions(i,13) + directions(i,14))/3.;
1637 directions(i,16) = v1[i]*scale;
1638 directions(i,17) = v1[i]*scale;
1639 directions(i,18) = v1[i]*scale;
1640 directions(i,19) = (directions(i,16) + directions(i,17))/2.;
1641 directions(i,20) = (directions(i,17) + directions(i,18))/2.;
1642 directions(i,21) = (directions(i,18) + directions(i,16))/2.;
1643 directions(i,22) = (directions(i,19) + directions(i,20) + directions(i,21))/3.;
1646 directions(i,23) = v2[i]*scale;
1647 directions(i,24) = v2[i]*scale;
1648 directions(i,25) = v2[i]*scale;
1649 directions(i,26) = (directions(i,23) + directions(i,24))/2.;
1650 directions(i,27) = (directions(i,24) + directions(i,25))/2.;
1651 directions(i,28) = (directions(i,25) + directions(i,23))/2.;
1652 directions(i,29) = (directions(i,26) + directions(i,27) + directions(i,28))/3.;
1654 directions(i,30) = -v1[i]*scale;
1655 directions(i,31) = -v1[i]*scale;
1656 directions(i,32) = -v1[i]*scale;
1657 directions(i,33) = ( directions(i,30) + directions(i,31) )/2.;
1658 directions(i,34) = ( directions(i,31) + directions(i,32) )/2.;
1659 directions(i,35) = ( directions(i,30) + directions(i,32) )/2.;
1660 directions(i,36) = (directions(i,33) + directions(i,34) + directions(i,35))/3.;
1661 directions(i,32) = 0.;
1664 directions(i,37) = v1[i];
1665 directions(i,38) = v2[i];
1666 directions(i,39) = -v1[i];
1667 directions(i,40) = -v2[i];
1670 directions(i,41) = ar9[i];
1671 directions(i,42) = ar10[i];
1672 directions(i,43) = ar11[i];
1673 directions(i,44) = ar12[i];
1676 directions(i,45) = v1[i];
1677 directions(i,46) = v2[i];
1678 directions(i,47) = v1[i];
1679 directions(i,48) = ar9[i];
1680 directions(i,49) = v2[i];
1681 directions(i,50) = ar10[i];
1682 directions(i,51) = v1[i];
1683 directions(i,52) = ar12[i];
1684 directions(i,53) = v2[i];
1685 directions(i,54) = ar9[i];
1688 directions(i,55) = v1[i];
1689 directions(i,56) = v2[i];
1690 directions(i,57) = v3[i];
1697 template <
class TVar>
1701 if (directions.
Cols() != 58 || ConstrainedFace < 1 || ConstrainedFace > 4) {
1705 int vectors[] = {11,18,25,32};
1709 for (
int i=0; i<3; i++) {
1715 for (
int i=0; i<3; i++) {
1719 ar9[i] = v3[i]-(-v1[i]-v2[i]);
1720 ar10[i] = v3[i]-(v1[i]-v2[i]);
1721 ar11[i] = v3[i]-(v1[i]+v2[i]);
1722 ar12[i] = v3[i]-(v2[i]-v1[i]);
1725 switch (ConstrainedFace) {
1727 for (
int i=0; i<3; i++) {
1728 directions(i,vectors[0]) = 0.;
1729 directions(i,vectors[1]) = ar12[i]/4.;
1730 directions(i,vectors[2]) = v2[i]/2.;
1731 directions(i,vectors[3]) = ar11[i]/4.;
1736 for (
int i=0; i<3; i++) {
1737 directions(i,vectors[0]) = ar12[i]/4.;
1738 directions(i,vectors[1]) = 0.;
1739 directions(i,vectors[2]) = ar9[i]/4.;
1740 directions(i,vectors[3]) = -v1[i]/2.;
1745 for (
int i=0; i<3; i++) {
1746 directions(i,vectors[0]) = -v2[i]/2.;
1747 directions(i,vectors[1]) = ar9[i]/4.;
1748 directions(i,vectors[2]) = 0.;
1749 directions(i,vectors[3]) = ar10[i]/4.;
1753 for (
int i=0; i<3; i++) {
1754 directions(i,vectors[0]) = ar11[i]/4.;
1755 directions(i,vectors[1]) = v1[i]/2.;
1756 directions(i,vectors[2]) = ar10[i]/4.;
1757 directions(i,vectors[3]) = 0.;
1770 int nsides = NumSides()*3+1;
1776 for (
int is = 0; is<nsides; is++)
1778 sides[is] = vectorsideorderPi[is];
1779 dir[is] = direcaoksioueta[is];
1780 bilounao[is] = bilinearounao[is];
1786 int nsides = NumSides()*3+1;
1792 for (
int is = 0; is<nsides; is++)
1794 sides[is] = vectorsideorderPi[is];
1795 dir[is] = direcaoksioueta[is];
1796 bilounao[is] = bilinearounao[is];
1799 for (
int i=0; i<nsides; i++) {
1800 sidevectors[i] = vectorsideorderPi[i];
1805 if(
fabs(pt[0])<1.e-10 &&
fabs(pt[1])<1.e-10 && pt[2]==1.) {
1834 REAL T0xz = .5*(1.-pt[2]-pt[0]) / (1.-pt[2]);
1835 REAL T0yz = .5*(1.-pt[2]-pt[1]) / (1.-pt[2]);
1836 REAL T1xz = .5*(1.-pt[2]+pt[0]) / (1.-pt[2]);
1837 REAL T1yz = .5*(1.-pt[2]+pt[1]) / (1.-pt[2]);
1838 REAL lmez = (1.-pt[2]);
1839 phi(0,0) = T0xz*T0yz*lmez;
1840 phi(1,0) = T1xz*T0yz*lmez;
1841 phi(2,0) = T1xz*T1yz*lmez;
1842 phi(3,0) = T0xz*T1yz*lmez;
1844 REAL lmexmez = 1.-pt[0]-pt[2];
1845 REAL lmeymez = 1.-pt[1]-pt[2];
1846 REAL lmaxmez = 1.+pt[0]-pt[2];
1847 REAL lmaymez = 1.+pt[1]-pt[2];
1848 dphi(0,0) = -.25*lmeymez / lmez;
1849 dphi(1,0) = -.25*lmexmez / lmez;
1850 dphi(2,0) = -.25*(lmeymez+lmexmez-lmexmez*lmeymez/lmez) / lmez;
1852 dphi(0,1) = .25*lmeymez / lmez;
1853 dphi(1,1) = -.25*lmaxmez / lmez;
1854 dphi(2,1) = -.25*(lmeymez+lmaxmez-lmaxmez*lmeymez/lmez) / lmez;
1856 dphi(0,2) = .25*lmaymez / lmez;
1857 dphi(1,2) = .25*lmaxmez / lmez;
1858 dphi(2,2) = -.25*(lmaymez+lmaxmez-lmaxmez*lmaymez/lmez) / lmez;
1860 dphi(0,3) = -.25*lmaymez / lmez;
1861 dphi(1,3) = .25*lmexmez / lmez;
1862 dphi(2,3) = -.25*(lmaymez+lmexmez-lmexmez*lmaymez/lmez) / lmez;
1869 int TPZPyramid::ClassId()
const{
1870 return Hash(
"TPZPyramid");
1877 void TPZPyramid::Write(
TPZStream& buf,
int withclassid)
const {
1888 template bool pztopology::TPZPyramid::CheckProjectionForSingularity<REAL>(
const int &side,
const TPZVec<REAL> &xiInterior);
1892 template void pztopology::TPZPyramid::BlendFactorForSide<REAL>(
const int &,
const TPZVec<REAL> &, REAL &, TPZVec<REAL> &);
1901 template bool pztopology::TPZPyramid::CheckProjectionForSingularity<Fad<REAL>>(
const int &side,
const TPZVec<Fad<REAL>> &xiInterior);
1905 template void pztopology::TPZPyramid::BlendFactorForSide<Fad<REAL>>(
const int &,
const TPZVec<Fad<REAL>> &,
Fad<REAL> &,
1906 TPZVec<Fad<REAL>> &);
static int sidedimension[19]
void computedirectionsPy(int inicio, int fim, TPZFMatrix< REAL > &bvec, TPZFMatrix< REAL > &t1vec, TPZFMatrix< REAL > &t2vec, TPZFMatrix< REAL > &gradx, TPZFMatrix< REAL > &directions)
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
static REAL bPiram[58][3]
static int highsides[19][9]
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
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.
Handles the numerical integration for two-dimensional problems using triangular elements. Numerical Integration.
Implements a vector class which allows to use external storage provided by the user. Utility.
static REAL t2Piram[58][3]
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
static REAL t1Piram[58][3]
virtual void Identity()
Converts the matrix in an identity matrix.
Defines enum MElementType and contains the implementation of MElementType_NNodes(...) functions.
This class implements a simple vector storage scheme for a templated class T. Utility.
REAL val(STATE &number)
Returns value of the variable.
Handles the numerical integration for three-dimensional problems using pyramid elements. Numerical Integration.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Contains the TPZTriangle class which defines the topology of a triangle.
Handles the numerical integration for one-dimensional problems. Numerical Integration.
#define LOGPZ_FATAL(A, B)
Define log for fatal errors (cout)
Abstract class defining integration rules. Numerical Integration.
static int nhighdimsides[19]
int Zero() override
Makes Zero all the elements.
int64_t size() const
Returns the number of elements of the vector.
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...
Handles the numerical integration for two-dimensional problems using quadrilateral elements...
Groups all classes defining the structure of the master element.
void Push(const T object)
Pushes a copy of the object on the stack.
#define DebugStop()
Returns a message to user put a breakpoint in.
static REAL sidetosidetransforms[19][9][4][3]
Free store vector implementation.
Contains the TPZQuadrilateral class which defines the topology of a quadrilateral element...
static int GetTransformId(TPZVec< int64_t > &id)
Method which identifies the transformation based on the IDs of the corner nodes.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
static int nsidenodes[27]
Vector with the number of vertices contained in the closure of the side.
Contains the TPZPyramid class which defines the topology of a pyramid element.
int32_t Hash(std::string str)
static int bilinearounao[58]
Integration rule for one point. Numerical Integration.
MElementType
Define the element types.
static REAL MidSideNode[19][3]
static int FaceConnectLocId[5][9]
static int direcaoksioueta[58]
int64_t Cols() const
Returns number of cols.
static int GetTransformId(TPZVec< int64_t > &id)
Method which identifies the transformation based on the IDs of the corner nodes.
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Defines the interface for saving and reading data. Persistency.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
int PutVal(const int64_t row, const int64_t col, const TVar &value) override
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
#define PZError
Defines the output device to error messages and the DebugStop() function.
static int vectorsideorderPi[58]