22 static LoggerPtr logger(Logger::getLogger(
"pz.topology.pztetrahedron"));
29 static int nhighdimsides[15] = {7,7,7,7,3,3,3,3,3,3,1,1,1,1,0};
31 int TPZTetrahedron::FaceNodes[4][3] = { {0,1,2},{0,1,3},{1,2,3},{0,2,3} };
33 int TPZTetrahedron::SideNodes[6][2] = { {0,1},{1,2},{2,0},{0,3},{1,3},{2,3} };
35 int TPZTetrahedron::ShapeFaceId[4][3] = { {0,1,2},{0,1,3},{1,2,3},{0,2,3} };
37 int TPZTetrahedron::fPermutations[24][15] =
39 {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14},
40 {0,1,3,2,4,8,7,6,5,9,11,10,12,13,14},
41 {0,2,1,3,6,5,4,7,9,8,10,13,12,11,14},
42 {0,2,3,1,6,9,7,4,5,8,13,10,12,11,14},
43 {0,3,1,2,7,8,4,6,9,5,11,13,12,10,14},
44 {0,3,2,1,7,9,6,4,8,5,13,11,12,10,14},
45 {1,0,2,3,4,6,5,8,7,9,10,11,13,12,14},
46 {1,0,3,2,4,7,8,5,6,9,11,10,13,12,14},
47 {1,2,0,3,5,6,4,8,9,7,10,12,13,11,14},
48 {1,2,3,0,5,9,8,4,6,7,12,10,13,11,14},
49 {1,3,0,2,8,7,4,5,9,6,11,12,13,10,14},
50 {1,3,2,0,8,9,5,4,7,6,12,11,13,10,14},
51 {2,0,1,3,6,4,5,9,7,8,10,13,11,12,14},
52 {2,0,3,1,6,7,9,5,4,8,13,10,11,12,14},
53 {2,1,0,3,5,4,6,9,8,7,10,12,11,13,14},
54 {2,1,3,0,5,8,9,6,4,7,12,10,11,13,14},
55 {2,3,0,1,9,7,6,5,8,4,13,12,11,10,14},
56 {2,3,1,0,9,8,5,6,7,4,12,13,11,10,14},
57 {3,0,1,2,7,4,8,9,6,5,11,13,10,12,14},
58 {3,0,2,1,7,6,9,8,4,5,13,11,10,12,14},
59 {3,1,0,2,8,4,7,9,5,6,11,12,10,13,14},
60 {3,1,2,0,8,5,9,7,4,6,12,11,10,13,14},
61 {3,2,0,1,9,6,7,8,5,4,13,12,10,11,14},
62 {3,2,1,0,9,5,8,7,6,4,12,13,10,11,14}
65 static int sidedimension[15] = {0,0,0,0,1,1,1,1,1,1,2,2,2,2,3};
68 static int FaceConnectLocId[4][7] = { {0,1,2,4,5,6,10},{0,1,3,4,8,7,11},
69 {1,2,3,5,9,8,12},{0,2,3,6,9,7,13} };
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},{0,0,-99}},
102 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,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},{0,0,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,0,-99}},
111 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,0,-99}},
112 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{0,0,-99}},
113 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,0,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},{0,1,-99}},
120 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{1,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},{0,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},{0,1,-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,0,1}}
134 {{0.5,0,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0,-99}},
135 {{0.5,0,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0,-99}},
136 {{0.5,0,0},{-99,-99,-99},{-99,-99,-99},{0.5,0,0}}
139 {{-0.5,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,-99}},
140 {{0.5,0,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0,-99}},
141 {{-0.5,0.5,0},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,0}}
144 {{0,-0.5,-99},{-99,-99,-99},{-99,-99,-99},{0,0.5,-99}},
145 {{-0.5,0,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0,-99}},
146 {{0,-0.5,0},{-99,-99,-99},{-99,-99,-99},{0,0.5,0}}
149 {{0,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0,0.5,-99}},
150 {{0,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0,0.5,-99}},
151 {{0,0,0.5},{-99,-99,-99},{-99,-99,-99},{0,0,0.5}}
154 {{-0.5,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,-99}},
155 {{0,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0,0.5,-99}},
156 {{-0.5,0,0.5},{-99,-99,-99},{-99,-99,-99},{0.5,0,0.5}}
159 {{-0.5,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,-99}},
160 {{-0.5,0.5,-99},{-99,-99,-99},{-99,-99,-99},{0.5,0.5,-99}},
161 {{0,-0.5,0.5},{-99,-99,-99},{-99,-99,-99},{0,0.5,0.5}}
164 {{1,0,0},{0,1,0},{-99,-99,-99},{0,0,0}}
167 {{1,0,0},{0,0,1},{-99,-99,-99},{0,0,0}}
170 {{-1,1,0},{-1,0,1},{-99,-99,-99},{1,0,0}}
173 {{0,1,0},{0,0,1},{-99,-99,-99},{0,0,0}}
176 {{-99,-99,-99},{-99,-99,-99},{-99,-99,-99},{-99,-99,-99}}
181 {.0,.0,.0},{1.,.0,.0},{0.,1.,.0},{.0,0.,1.0},{.5,.0,.0},
182 {.5,.5,.0},{0.,.5,.0},{0.,0.,.5},{.5,0.,0.5},{.0,.5,.5},
183 {1./3.,1./3., 0. } ,{1./3., .0 ,1./3.},
184 {1./3.,1./3.,1./3.} ,{ 0. ,1./3.,1./3.},{1./4.,1./4.,1./4.} };
188 {0,0,-1}, {1,0,-1}, {0,1,-1}, {0,0,-1}, {0.5,0.5,-1}, {0,0,-1}, {0,0,-1},
189 {0,-1,0}, {1,-1,0}, {0,-1,1}, {0,-1,0}, {0.5,-1,0.5}, {0,-1,0}, {0,-1,0},
190 {1,0,0} , {0,1,0} , {0,0,1}, {1,1,0}, {0,0.5,0.5}, {0.5,0,0.5}, {1,1,1} ,
191 {-1,0,0}, {-1,1,0}, {-1,0,1}, {-1,0,0}, {-1,0.5,0.5}, {-1,0,0} , {-1,0,0},
194 {1,0,0},{-1,1,0},{0,-1,0}, {0,0,1}, {-1,0,1}, {0,-1,1},
207 {-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},{-1,0,0},
208 {1,0,0}, {1,0,0}, {1,0,0}, {1,0,0}, {1,0,0}, {1,0,0}, {1,0,0},
209 {1/
sqrt(2),0,-1/
sqrt(2)},{1/
sqrt(2),0,-1/
sqrt(2)},{1/
sqrt(2),0,-1/
sqrt(2)},{1/
sqrt(2),0,-1/
sqrt(2)},{1/
sqrt(2),0,-1/
sqrt(2)},{1/
sqrt(2),0,-1/
sqrt(2)},{1/
sqrt(2),0,-1/
sqrt(2)},
210 {0,0,1} ,{0,0,1} ,{0,0,1} ,{0,0,1} ,{0,0,1} ,{0,0,1} ,{0,0,1} ,
213 {0,-1,0},{1,1,0},{0,0,-1}, {0,-1,0}, {0,-1,0}, {1,1,1},
227 {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0}, {0,1,0},
228 {0,0,1}, {0,0,1}, {0,0,1}, {0,0,1}, {0,0,1}, {0,0,1}, {0,0,1},
229 {-1/
sqrt(6),2/
sqrt(6),-1/
sqrt(6)},{-1/
sqrt(6),2/
sqrt(6),-1/
sqrt(6)},{-1/
sqrt(6),2/
sqrt(6),-1/
sqrt(6)},{-1/
sqrt(6),2/
sqrt(6),-1/
sqrt(6)},{-1/
sqrt(6),2/
sqrt(6),-1/
sqrt(6)},{-1/
sqrt(6),2/
sqrt(6),-1/
sqrt(6)},{-1/
sqrt(6),2/
sqrt(6),-1/
sqrt(6)},
230 {0,1,0},{0,1,0},{0,1,0},{0,1,0},{0,1,0},{0,1,0},{0,1,0},
233 {0,0,-1},{0,0,-1},{-1,0,0}, {-1,0,0}, {1,1,1}, {-1,0,0},
262 0,0,0,0,0,0,0,0,0,0,
263 0,0,0,0,0,0,0,0,0,0,
264 0,0,0,0,0,0,0,0,1,1,
265 1,1,1,1,1,1,1,1,1,1,
271 static int direcaoksioueta [45] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,2};
275 T qsi = loc[0], eta = loc[1] , zeta = loc[2];
277 phi(0,0) = 1.0-qsi-eta-zeta;
297 void TPZTetrahedron::BlendFactorForSide(
const int &side,
const TPZVec<T> &xi, T &blendFactor,
299 blendFactorDxi.
Resize(TPZTetrahedron::Dimension, (T) 0);
303 std::ostringstream sout;
304 if(side < NCornerNodes || side >= NSides){
305 sout<<
"The side\t"<<side<<
"is invalid. Aborting..."<<std::endl;
309 sout<<
"The method BlendFactorForSide expects the point xi to correspond to coordinates of a point";
310 sout<<
" inside the parametric domain. Aborting...";
313 if(!sout.str().empty()){
314 PZError<<std::endl<<sout.str()<<std::endl;
322 if(!CheckProjectionForSingularity(side,xi)){
323 std::cout<<
"Side projection is not regular and it should have been checked earlier. Aborting.."<<std::endl;
326 for(
int i = 0; i < blendFactorDxi.
size(); i++) blendFactorDxi[i] = 0;
332 TPZTetrahedron::TShape(xi, phi, dphi);
333 for (
int i = 0; i < TPZTetrahedron::NSideNodes(side); i++) {
334 const int currentNode = TPZTetrahedron::SideNodeLocId(side, i);
335 blendFactor += phi(currentNode, 0);
336 blendFactorDxi[0] += dphi(0, currentNode);
337 blendFactorDxi[1] += dphi(1, currentNode);
338 blendFactorDxi[2] += dphi(2, currentNode);
345 blendFactorDxi[0] = 0;
346 blendFactorDxi[1] = 0;
347 blendFactorDxi[2] = 0;
356 blendFactorDxi[0] *= 2 * blendFactor;
357 blendFactorDxi[1] *= 2 * blendFactor;
358 blendFactorDxi[2] *= 2 * blendFactor;
359 blendFactor *= blendFactor;
365 blendFactorDxi[0] *= 3 * blendFactor * blendFactor;
366 blendFactorDxi[1] *= 3 * blendFactor * blendFactor;
367 blendFactorDxi[2] *= 3 * blendFactor * blendFactor;
368 blendFactor *= blendFactor * blendFactor;
371 blendFactorDxi[0] = 0;
372 blendFactorDxi[1] = 0;
373 blendFactorDxi[2] = 0;
379 int TPZTetrahedron::NBilinearSides()
385 void TPZTetrahedron::LowerDimensionSides(
int side,
TPZStack<int> &smallsides)
388 int nsidecon = NContainedSides(side);
390 for(is=0; is<nsidecon-1; is++)
391 smallsides.
Push(ContainedSideLocId(side,is));
394 void TPZTetrahedron::LowerDimensionSides(
int side,
TPZStack<int> &smallsides,
int DimTarget)
397 int nsidecon = NContainedSides(side);
398 for(
int is = 0; is < nsidecon - 1; is++) {
399 if (SideDimension(ContainedSideLocId(side,is)) == DimTarget) smallsides.
Push(ContainedSideLocId(side,is));
405 if(side <0 || side >= NSides) {
406 PZError <<
"TPZTetrahedron::HigherDimensionSides side "<< side << endl;
409 for(is=0; is<nhighdimsides[side]; is++) high.
Push(highsides[side][is]);
413 int TPZTetrahedron::NSideNodes(
int side)
415 return nsidenodes[side];
418 int TPZTetrahedron::NumSides(
int dimension) {
if(dimension<0 || dimension> 3) {
419 PZError <<
"TPZTetrahedron::NumSides. Bad parameter i.\n";
422 if(dimension==0)
return 4;
423 if(dimension==1)
return 6;
424 if(dimension==2)
return 4;
425 if(dimension==3)
return 1;
429 int TPZTetrahedron::SideNodeLocId(
int side,
int node)
431 if(side<4 && node == 0)
return side;
432 if(side>=4 && side < 10 && node <2)
return SideNodes[side-4][node];
433 if(side >= 10 && side < 14 && node <3)
return FaceNodes[side-10][node];
434 if(side ==14 && node < 4)
return node;
435 PZError <<
"TPZTetrahedron::SideNodeLocId inconsistent side or node " << side
436 <<
' ' << node << endl;
443 if (center.
size()!=Dimension) {
447 for(i=0; i<Dimension; i++) {
448 center[i] = MidSideNode[side][i];
452 int TPZTetrahedron::SideDimension(
int side) {
453 if(side<0 || side >= NSides) {
454 PZError <<
"TPZTetrahedron::SideDimension side " << side << endl;
457 return sidedimension[side];
462 if(sidefrom <0 || sidefrom >= NSides || sideto <0 || sideto >= NSides) {
463 PZError <<
"TPZTetrahedron::HigherDimensionSides sidefrom "<< sidefrom <<
464 ' ' << sideto << endl;
467 if(sidefrom == sideto) {
470 if(sidefrom == NSides-1) {
471 return TransformElementToSide(sideto);
473 int nhigh = nhighdimsides[sidefrom];
475 for(is=0; is<nhigh; is++) {
476 if(highsides[sidefrom][is] == sideto) {
477 int dfr = sidedimension[sidefrom];
478 int dto = sidedimension[sideto];
481 for(i=0; i<dto; i++) {
482 for(j=0; j<dfr; j++) {
483 trans.
Mult()(i,j) = sidetosidetransforms[sidefrom][is][j][i];
485 trans.
Sum()(i,0) = sidetosidetransforms[sidefrom][is][3][i];
490 PZError <<
"TPZTetrahedron::SideToSideTransform highside not found sidefrom " 491 << sidefrom <<
' ' << sideto << endl;
497 if(side<0 || side>14){
498 PZError <<
"TPZTetrahedron::TransformElementToSide called with side error\n";
520 t.
Mult()(0,0) = -1.0;
525 t.
Mult()(0,0) = -1.0;
526 t.
Mult()(0,1) = -2.0;
527 t.
Mult()(0,2) = -1.0;
539 t.
Mult()(0,0) = -1.0;
545 t.
Mult()(0,1) = -1.0;
561 t.
Mult()(0,0) = -1.0/3.0;
562 t.
Mult()(0,1) = 2.0/3.0;
563 t.
Mult()(0,2) = -1.0/3.0;
564 t.
Mult()(1,0) = -1.0/3.0;
565 t.
Mult()(1,1) = -1.0/3.0;
566 t.
Mult()(1,2) = 2.0/3.0;
568 t.
Sum()(0,0) = 1.0/3.0;
569 t.
Sum()(1,0)= 1.0/3.0;
675 if(side<0 || side>14){
676 PZError <<
"TPZTetrahedron::TransformSideToElement side out range\n";
700 t.
Mult()(0,0) = -0.5;
714 t.
Mult()(0,0) = -0.5;
720 t.
Mult()(1,0) = -0.5;
735 t.
Mult()(0,0) = -1.0;
736 t.
Mult()(0,1) = -1.0;
762 TPZIntPoints * TPZTetrahedron::CreateSideIntegrationRule(
int side,
int order) {
763 if(side<0 || side>15) {
764 PZError <<
"TPZTetrahedron::CreateSideIntegrationRule. bad side number.\n";
768 if(side<10)
return new TPZInt1d(order);
812 int TPZTetrahedron::NumSides() {
817 int TPZTetrahedron::NContainedSides(
int side) {
818 if(side<0)
return -1;
820 if(side<10)
return 3;
821 if(side<14)
return 7;
822 if(side==14)
return 15;
826 int TPZTetrahedron::ContainedSideLocId(
int side,
int node) {
827 if(side<0 || side>15)
return -1;
829 if(node==0)
return side;
834 if(node==1)
return (s+1)%3;
835 if(node==2)
return side;
840 if(node==1)
return 3;
841 if(node==2)
return side;
845 if(node<7)
return FaceConnectLocId[s][node];
847 if(side==14 && node<15){
850 PZError <<
"TPZShapeTetra::ContainedSideLocId called for node = " 851 << node <<
" and side = " << side <<
"\n";
856 const REAL qsi = pt[0];
857 const REAL eta = pt[1];
858 const REAL zeta = pt[2];
859 if( (qsi < 0. - tol) || (qsi > 1. + tol) ||
860 (eta < 0. - tol) || (eta > 1. + tol) ||
861 (zeta < 0. -tol) || (zeta > 1. +tol) ||
862 (qsi+eta+zeta > 1.+tol) ) {
875 REAL
val = (REAL) rand() / (RAND_MAX);
877 val = (1.-pt[0]) * (REAL) rand() / (RAND_MAX);
879 val = (1.-pt[0]-pt[1]) * (REAL) rand() / (RAND_MAX);
884 bool TPZTetrahedron::CheckProjectionForSingularity(
const int &side,
const TPZVec<T> &xiInterior) {
888 T qsi = xiInterior[0], eta = xiInterior[1], zeta = xiInterior[2];
889 bool regularmap =
true;
898 if(
fabs((T)(eta + zeta - 1.)) < zero) regularmap =
false;
901 if(
fabs((T)(qsi + eta)) < zero) regularmap =
false;
905 if(
fabs((T)(qsi + zeta - 1.)) < zero) regularmap =
false;
908 if(
fabs((T)(qsi + eta - 1.)) < zero) regularmap =
false;
912 if(
fabs((T)(qsi + zeta)) < zero) regularmap =
false;
916 if(
fabs((T)(eta + zeta)) < zero) regularmap =
false;
920 if(
fabs((T)(zeta - 1.)) < zero) regularmap =
false;
924 if(
fabs((T)(eta - 1.)) < zero) regularmap =
false;
928 if(
fabs((T)(qsi+eta+zeta)) < zero) regularmap =
false;
932 if(
fabs((T)(qsi - 1.)) < zero) regularmap =
false;
939 cout <<
"Cant compute CheckProjectionForSingularity method in TPZTetrahedron class!\nParameter (SIDE) must be between 4 and 13!\nMethod Aborted!\n";
948 T qsi = InternalPar[0], eta = InternalPar[1], zeta = InternalPar[2];
949 if(!CheckProjectionForSingularity(side,InternalPar)){
950 std::cout<<
"Side projection is not regular and it should have been checked earlier. Aborting.."<<std::endl;
966 T den = (-1 + eta + zeta);
967 SidePar[0] = -1 - (2*qsi)/den;
969 JacToSide(0,0) = -2/(-1 + eta + zeta);
970 JacToSide(0,1) = (2*qsi)/den;
971 JacToSide(0,2) = (2*qsi)/den;
979 SidePar[0] = -1 + (2*eta)/den;
981 JacToSide(0,0) = (-2*eta)/den;
982 JacToSide(0,1) = (2*qsi)/den;
990 T den = (-1 + qsi + zeta);
991 SidePar[0] = 1 + (2*eta)/den;
993 JacToSide(0,0) = (-2*eta)/(den * den);
994 JacToSide(0,1) = 2/den;
995 JacToSide(0,2) = (-2*eta)/(den*den);
1003 T den = (-1 + eta + qsi);
1004 SidePar[0] = -1 - (2*zeta)/den;
1005 JacToSide(0,0) = (2*zeta)/(den*den);
1006 JacToSide(0,1) = (2*zeta)/(den*den);
1007 JacToSide(0,2) = -2/den;
1015 T den = (qsi + zeta);
1016 SidePar[0] = -1 + (2*zeta)/den;
1018 JacToSide(0,0) = (-2*zeta)/den;
1020 JacToSide(0,2) = (2*qsi)/den;
1028 SidePar[0] = -1 + (2*zeta)/den;
1031 JacToSide(0,1) = (-2*zeta)/den;
1032 JacToSide(0,2) = (2*eta)/den;
1039 SidePar[0] = qsi/(1 - zeta);
1040 SidePar[1] = eta/(1 - zeta);
1041 JacToSide(0,0) = 1/(1 - zeta);
1043 JacToSide(0,2) = qsi/((-1 + zeta)*(-1 + zeta));
1045 JacToSide(1,1) = 1/(1 - zeta);
1046 JacToSide(1,2) = eta/((-1 + zeta)*(-1 + zeta));
1053 SidePar[0] = qsi/(1 - eta);
1054 SidePar[1] = zeta/(1 - eta);
1055 JacToSide(0,0) = 1/(1 - eta);
1056 JacToSide(0,1) = qsi/((-1 + eta)*(-1 + eta));
1059 JacToSide(1,1) = zeta/((-1 + eta)*(-1 + eta));
1060 JacToSide(1,2) = 1/(1 - eta);
1067 SidePar[0] = eta/(eta + qsi + zeta);
1068 SidePar[1] = zeta/(eta + qsi + zeta);
1069 T den = ((eta + qsi + zeta)*(eta + qsi + zeta));
1070 JacToSide(0,0) = -(eta/den);
1071 JacToSide(0,1) = (qsi + zeta)/den;
1072 JacToSide(0,2) = -(eta/den);
1073 JacToSide(1,0) = -(zeta/den);
1074 JacToSide(1,1) = -(zeta/den);
1075 JacToSide(1,2) = (eta + qsi)/den;
1082 SidePar[0] = eta/(1 - qsi);
1083 SidePar[1] = zeta/(1 - qsi);
1084 JacToSide(0,0) = eta/((-1 + qsi)*(-1 + qsi));
1085 JacToSide(0,1) = 1/(1 - qsi);
1087 JacToSide(1,0) = zeta/((-1 + qsi)*(-1 + qsi));
1089 JacToSide(1,2) = 1/(1 - qsi);
1093 SidePar = InternalPar;
1100 cout <<
"Cant compute MapToSide method in TPZTetrahedron class!\nParameter (SIDE) must be between 4 and 13!\nMethod Aborted!\n";
1101 cout <<
"This should have been caught earlier in the execution, there is something wrong.\n";
1102 cout <<
"Check method TPZTetrahedron::CheckProjectionForSingularity<T>\n";
1107 void TPZTetrahedron::ParametricDomainNodeCoord(
int node,
TPZVec<REAL> &nodeCoord)
1109 if(node > NCornerNodes)
1113 nodeCoord.
Resize(Dimension, 0.);
1187 int in1 = ContainedSideLocId(side,0);
1188 int in2 = ContainedSideLocId(side,1);
1189 return id[in1]<
id[in2] ? 0 : 1;
1199 for(i=0; i<3; i++) locid[i] =
id[ContainedSideLocId(side,i)];
1220 void TPZTetrahedron::GetSideHDivPermutation(
int transformationid,
TPZVec<int> &permgather)
1252 for (
int ivet=inicio; ivet<=fim; ivet++)
1254 for (
int ilin=0; ilin<3; ilin++)
1256 u[ilin] = t1vec(ilin,ivet);
1257 v[ilin] = t2vec(ilin,ivet);
1261 REAL normaX0xX1 = 0.0;
1263 e2[0] = u[1]*v[2]-u[2]*v[1];
1264 e2[1] = -(u[0]*v[2]-v[0]*u[2]);
1265 e2[2] = u[0]*v[1]-v[0]*u[1];
1269 REAL be2 = 0.0, ne2 = 0.0;
1270 for(
int i=0;i<3;i++)
1275 for (
int il=0; il<3; il++)
1277 for (
int i = 0 ; i<3; i++)
1279 dxt1[il] += gradx(il,i) * t1vec(i,ivet);
1280 dxt2[il] += gradx(il,i) * t2vec(i,ivet);
1281 dxt3[il] += gradx(il,i) * e2[i]/ne2;
1282 Vvec[il] += gradx(il,i) * bvec(i,ivet);
1284 be2 += bvec(il,ivet)*e2[il]/ne2;
1288 normal[0] = dxt1[1]*dxt2[2]-dxt1[2]*dxt2[1];
1289 normal[1] = -(dxt1[0]*dxt2[2]-dxt2[0]*dxt1[2]);
1290 normal[2] = dxt1[0]*dxt2[1]-dxt2[0]*dxt1[1];
1292 for (
int pos=0; pos<3; pos++)
1294 detgrad += normal[pos]*dxt3[pos];
1295 normaX0xX1 += normal[pos]*normal[pos];
1298 detgrad =
fabs(detgrad);
1299 normaX0xX1 =
sqrt(normaX0xX1);
1301 for (
int il=0; il<3; il++)
1303 Wvec(il,0) = Vvec[il]*normaX0xX1/(detgrad*be2);
1304 directions(il,cont) = Wvec(il,0);
1316 { std::cout <<
"Gradient dimensions are not compatible with this topology" << std::endl;
1320 int numvec = bvec.
Cols();
1324 directions.
Redim(3, numvec);
1326 for (
int lin = 0; lin<numvec ; lin++)
1328 for(
int col = 0;col<3;col++)
1330 bvec.
PutVal(col, lin, bTetra[lin][col]);
1331 t1vec.
PutVal(col, lin, t1Tetra[lin][col]);
1332 t2vec.
PutVal(col, lin, t2Tetra[lin][col]);
1342 int inicio = 0, fim = 6;
1344 int diff = fim-inicio+1;
1345 for (
int ip = 0; ip < diff; ip++) {
1346 sidevectors[ip] = vectorsideorderTe[ip+inicio];
1354 int inicio = 7, fim = 13;
1356 int diff = fim-inicio+1;
1357 for (
int ip = 0; ip < diff; ip++) {
1358 sidevectors[ip] = vectorsideorderTe[ip+inicio];
1366 int inicio = 14, fim = 20;
1368 int diff = fim-inicio+1;
1369 for (
int ip = 0; ip < diff; ip++) {
1370 sidevectors[ip] = vectorsideorderTe[ip+inicio];
1378 int inicio = 21, fim = 27;
1380 int diff = fim-inicio+1;
1381 for (
int ip = 0; ip < diff; ip++) {
1382 sidevectors[ip] = vectorsideorderTe[ip+inicio];
1388 directions.
Resize(3, 17);
1390 int inicio = 28, fim = 44;
1392 int diff = fim-inicio+1;
1393 for (
int ip = 0; ip < diff; ip++) {
1394 sidevectors[ip] = vectorsideorderTe[ip+inicio];
1406 template <
class TVar>
1413 for (
int i=0; i<3; i++) {
1417 vdiagxy[i] = (gradx(i,0)-gradx(i,1));
1418 vi[i] = gradx(i,2)-gradx(i,0);
1431 TVar Nvivdiagb = 1.0;
1435 for (
int i=0; i<3; i++) {
1440 for (
int i=0; i<3; i++)
1444 directions(i,0) = -v3[i];
1445 directions(i,1) = (v1[i]-v3[i]);
1446 directions(i,2) = (v2[i]-v3[i]);
1447 directions(i,3) = (directions(i,0)+directions(i,1))/2.;
1448 directions(i,4) = (directions(i,1)+directions(i,2))/2.;
1449 directions(i,5) = (directions(i,0)+directions(i,2))/2.;
1450 directions(i,6) = (directions(i,3)+directions(i,4)+directions(i,5))/3.;
1452 directions(i,7) = -v2[i];
1453 directions(i,8) = (v1[i]-v2[i]);
1454 directions(i,9) = (v3[i]-v2[i]);
1455 directions(i,10) = (directions(i,7)+directions(i,8))/2.;
1456 directions(i,11) = (directions(i,8)+directions(i,9))/2.;
1457 directions(i,12) = (directions(i,7)+directions(i,9))/2.;
1458 directions(i,13) = (directions(i,10)+directions(i,11)+directions(i,12))/3.;
1461 directions(i,14) = v1[i];
1462 directions(i,15) = v2[i];
1463 directions(i,16) = v3[i];
1464 directions(i,17) = (directions(i,14)+directions(i,15))/2.;
1465 directions(i,18) = (directions(i,15)+directions(i,16))/2.;
1466 directions(i,19) = (directions(i,14)+directions(i,16))/2.;
1467 directions(i,20) = (directions(i,17)+directions(i,18)+directions(i,19))/3.;
1469 directions(i,21) = -v1[i];
1470 directions(i,22) = (v2[i]-v1[i]);
1471 directions(i,23) = (v3[i]-v1[i]);
1472 directions(i,24) = (directions(i,21)+directions(i,22))/2.;
1473 directions(i,25) = (directions(i,22)+directions(i,23))/2.;
1474 directions(i,26) = (directions(i,21)+directions(i,23))/2.;
1475 directions(i,27) = (directions(i,24)+directions(i,25)+directions(i,26))/3.;
1478 directions(i,28) = v1[i];
1479 directions(i,29) = (v2[i]-v1[i]);
1480 directions(i,30) = -v2[i];
1481 directions(i,31) = v3[i];
1482 directions(i,32) = (v3[i]-v1[i]);
1483 directions(i,33) = (v3[i]-v2[i]);
1486 directions(i,34) = v1[i];
1487 directions(i,35) = v2[i];
1488 directions(i,36) = v1[i];
1489 directions(i,37) = v3[i];
1490 directions(i,38) = (v2[i]-v1[i]);
1491 directions(i,39) = (v3[i]-v1[i]);
1492 directions(i,40) = v2[i];
1493 directions(i,41) = v3[i];
1495 directions(i,42) = v1[i];
1496 directions(i,43) = v2[i];
1497 directions(i,44) = v3[i];
1508 int nsides = NumSides()*3;
1514 for (
int is = 0; is<nsides; is++)
1516 sides[is] = vectorsideorderTe[is];
1517 dir[is] = direcaoksioueta[is];
1518 bilounao[is] = bilinearounao[is];
1524 int nsides = NumSides()*3;
1530 for (
int is = 0; is<nsides; is++)
1532 sides[is] = vectorsideorderTe[is];
1533 dir[is] = direcaoksioueta[is];
1534 bilounao[is] = bilinearounao[is];
1536 for (
int i=0; i<Dimension*NumSides(); i++) {
1537 sidevectors[i] = vectorsideorderTe[i];
1541 template <
class TVar>
1546 for (
int i=0; i<3; i++) {
1551 constexpr
int nFaces{4},nEdges{6};
1553 constexpr REAL edgeLength[nEdges]{1,M_SQRT2,1,1,M_SQRT2,M_SQRT2};
1554 constexpr REAL sqrt3 = 1.73205080756887729352744634150587237;
1556 constexpr REAL faceArea[nFaces]{0.5,0.5,0.5*sqrt3,0.5};
1558 for(
auto iEdge = 0; iEdge < nEdges; iEdge++){
1559 edgeSign[iEdge] = transformationIds[iEdge] == 0 ? 1 : -1;
1561 for (
int i=0; i<3; i++)
1567 directions(i,0) = (v1[i]) * edgeSign[0] / edgeLength[0];
1568 directions(i,1) = (v1[i]+v2[i]+v3[i]) * edgeSign[0] / edgeLength[0];
1569 directions(i,2) = (v2[i]*M_SQRT2) * edgeSign[1] / edgeLength[1];
1570 directions(i,3) = (-v1[i]*M_SQRT2) * edgeSign[1] / edgeLength[1];
1571 directions(i,4) = (v1[i]+v2[i]+v3[i]) * -1 * edgeSign[2] / edgeLength[2];
1572 directions(i,5) = (-v2[i]) * edgeSign[2] / edgeLength[2];
1573 directions(i,6) = (v3[i]) * edgeSign[3] / edgeLength[3];
1574 directions(i,7) = (v1[i]+v2[i]+v3[i]) * edgeSign[3] / edgeLength[3];
1575 directions(i,8) = v3[i] * M_SQRT2 * edgeSign[4] / edgeLength[4];
1576 directions(i,9) = -v1[i] * M_SQRT2 * edgeSign[4] / edgeLength[4];
1577 directions(i,10) = v3[i] * M_SQRT2 * edgeSign[5] / edgeLength[5];
1578 directions(i,11) = -v2[i] * M_SQRT2 * edgeSign[5] / edgeLength[5];
1581 directions(i,12) = (v1[i]) * edgeSign[0] / edgeLength[0];
1582 directions(i,13) = ( (v2[i] - v1[i]) * M_SQRT1_2) * edgeSign[1] / edgeLength[1];
1583 directions(i,14) = (-v2[i]) * edgeSign[2] / edgeLength[2];
1584 directions(i,15) = (v3[i]) * edgeSign[3] / edgeLength[3];
1585 directions(i,16) = (v3[i]-v1[i]) * M_SQRT1_2 * edgeSign[4] / edgeLength[4];
1586 directions(i,17) = (v3[i]-v2[i]) * M_SQRT1_2 * edgeSign[5] / edgeLength[5];
1591 directions(i,18) = v2[i] * edgeSign[4 - NCornerNodes] / faceArea[0];
1592 directions(i,19) = -1 * (v1[i]+v2[i]+v3[i]) * M_SQRT1_2 * edgeSign[5 - NCornerNodes] / faceArea[0];
1593 directions(i,20) = v1[i] * edgeSign[6 - NCornerNodes] / faceArea[0];
1594 directions(i,21) = v3[i] * edgeSign[4 - NCornerNodes] / faceArea[1];
1595 directions(i,22) = -1 * (v1[i]+v2[i]+v3[i]) * M_SQRT1_2 * edgeSign[8 - NCornerNodes] / faceArea[1];
1596 directions(i,23) = -1 * v1[i] * edgeSign[7 - NCornerNodes] / faceArea[1];
1597 directions(i,24) = v3[i] * sqrt3 * edgeSign[5 - NCornerNodes] / faceArea[2];
1598 directions(i,25) = v1[i] * sqrt3 * M_SQRT1_2 * edgeSign[9 - NCornerNodes] / faceArea[2];
1599 directions(i,26) = -1 * v2[i] * sqrt3 * edgeSign[8 - NCornerNodes] / faceArea[2];
1600 directions(i,27) = -1 * v3[i] * edgeSign[6 - NCornerNodes] / faceArea[3];
1601 directions(i,28) = -1* (v1[i]+v2[i]+v3[i]) * M_SQRT1_2 * edgeSign[9 - NCornerNodes] / faceArea[3];
1602 directions(i,29) = -1 * v2[i] * edgeSign[7 - NCornerNodes] / faceArea[3];
1607 directions(i,38) = -v3[i];
1608 directions(i,39) = -v2[i];
1609 directions(i,40) = (v1[i]+v2[i]+v3[i])/sqrt3;
1610 directions(i,41) = -v1[i];
1613 directions(i,42) = v1[i];
1614 directions(i,43) = v2[i];
1615 directions(i,44) = v3[i];
1618 constexpr
auto firstVftVec = 30;
1620 for(
auto iFace = 0; iFace < nFaces; iFace ++){
1621 TPZTriangle::ComputeHCurlFaceDirections(vft1,vft2,transformationIds[nEdges + iFace]);
1622 directions(0,firstVftVec+2*iFace) = 0;directions(1,firstVftVec+2*iFace) = 0;directions(2,firstVftVec+2*iFace) = 0;
1623 directions(0,firstVftVec+2*iFace+1) = 0;directions(1,firstVftVec+2*iFace+1) = 0;directions(2,firstVftVec+2*iFace+1) = 0;
1624 auto axes = TPZTetrahedron::TransformElementToSide(NCornerNodes+nEdges+iFace).Mult();
1626 for(
auto x = 0; x < Dimension; x++){
1627 for(
auto i = 0; i < 2; i++) {
1628 directions(x, firstVftVec + 2 * iFace) += axes(x,i) * vft1[i];
1629 directions(x, firstVftVec + 2 * iFace + 1) += axes(x,i) * vft2[i];
1635 int TPZTetrahedron::ClassId()
const{
1636 return Hash(
"TPZTetrahedron");
1643 void TPZTetrahedron::Write(
TPZStream& buf,
int withclassid)
const {
1655 template bool pztopology::TPZTetrahedron::CheckProjectionForSingularity<REAL>(
const int &side,
const TPZVec<REAL> &xiInterior);
1659 template void pztopology::TPZTetrahedron::BlendFactorForSide<REAL>(
const int &,
const TPZVec<REAL> &, REAL &, TPZVec<REAL> &);
1668 template bool pztopology::TPZTetrahedron::CheckProjectionForSingularity<Fad<REAL> >(
const int &side,
const TPZVec<Fad<REAL> > &xiInterior);
1672 template void pztopology::TPZTetrahedron::BlendFactorForSide<Fad<REAL>>(
const int &,
const TPZVec<Fad<REAL>> &,
Fad<REAL> &,
1673 TPZVec<Fad<REAL>> &);
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
Contains the TPZInt1d, TPZIntTriang, TPZIntQuad, TPZIntCube3D, TPZIntTetra3D, TPZIntPyram3D and TPZIn...
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.
static int FaceConnectLocId[4][7]
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
static int sidedimension[15]
void computedirectionsT3(int inicio, int fim, TPZFMatrix< REAL > &bvec, TPZFMatrix< REAL > &t1vec, TPZFMatrix< REAL > &t2vec, TPZFMatrix< REAL > &gradx, TPZFMatrix< REAL > &directions)
virtual void Identity()
Converts the matrix in an identity matrix.
static int direcaoksioueta[45]
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.
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.
Contains the TPZTetrahedron class which defines the topology of the tetrahedron element.
#define LOGPZ_FATAL(A, B)
Define log for fatal errors (cout)
Abstract class defining integration rules. Numerical Integration.
static int highsides[15][7]
int Zero() override
Makes Zero all the elements.
static REAL MidSideNode[15][3]
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...
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 t2Tetra[45][3]
Free store vector implementation.
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
static REAL t1Tetra[45][3]
static int vectorsideorderTe[45]
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
static int nsidenodes[15]
int32_t Hash(std::string str)
Integration rule for one point. Numerical Integration.
static int bilinearounao[45]
MElementType
Define the element types.
static REAL bTetra[45][3]
static REAL sidetosidetransforms[15][7][4][3]
int64_t Cols() const
Returns number of cols.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
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.
Handles the numerical integration for three-dimensional problems using tetraedra elements. Numerical Integration.
static int nhighdimsides[15]
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.
void Transpose(TPZMatrix< TVar > *const T) const override
It makes *T the transpose of current matrix.
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.