18 static LoggerPtr logger(Logger::getLogger(
"pz.material.axisymetric"));
19 static LoggerPtr logdata(Logger::getLogger(
"pz.material.axisymetric.data"));
33 fTemperatureFunction(0) {
53 TPZDiscontinuousGalerkin(num),
fIntegral(0.),
fAlpha(1.e-5),
fDelTemperature(0.),
f_AxisR(3,0.),
f_AxisZ(3,0.),
f_Origin(3,0.),
fTemperatureFunction(0)
75 TPZDiscontinuousGalerkin(num),
fIntegral(0.),
fAlpha(1.e-5),
fDelTemperature(0.),
f_AxisR(3,0.),
f_AxisZ(3,0.),
f_Origin(3,0.),
109 if(Orig.
size() == 3 && AxisZ.
size() == 3 && AxisR.
size() == 3)
111 TPZFNMatrix<6> Vecs(3,2,0.), VecsOrt(3,2,0.), JacVecsOrth(2,2,0.);
112 for(
int i = 0; i < 3; i++)
114 Vecs.PutVal(i,0,AxisR[i]);
115 Vecs.PutVal(i,1,AxisZ[i]);
117 Vecs.GramSchmidt(VecsOrt,JacVecsOrth);
119 for(
int j = 0; j < 3; j++)
121 AxisR[j] = VecsOrt.GetVal(j,0);
122 AxisZ[j] = VecsOrt.GetVal(j,1);
130 cout <<
"Invalid Origin and/or Axis vector on TPZElasticityAxiMaterial()!\n";
164 out <<
"name of material : " <<
Name() <<
"\n";
165 out <<
"properties : \n";
166 out <<
"\tE = " <<
fE << endl;
167 out <<
"\tnu = " <<
fnu << endl;
168 out <<
"\tF = " <<
ff[0] <<
' ' <<
ff[1] << endl;
177 int64_t phc,phr,dphc,dphr,efr,efc,ekr,ekc;
186 if(phc != 1 || dphr != 2 || phr != dphc || ekr != phr*2 || ekc != phr*2 || efr != phr*2 || efc != 1)
188 PZError <<
"\nTPZElasticityMaterial.contr, inconsistent input data : \n" <<
189 "phi.Cols() = " << phi.
Cols() <<
" dphi.Cols() = " << dphi.
Cols() <<
190 " phi.Rows = " << phi.
Rows() <<
" dphi.Rows = " <<
191 dphi.
Rows() <<
"\nek.Rows() = " << ek.
Rows() <<
" ek.Cols() = " 193 "\nef.Rows() = " << ef.
Rows() <<
" ef.Cols() = " 194 << ef.
Cols() <<
"\n";
210 int s = (R > 0)? 1:-1;
212 if(R < 1.e-10) R = 1.e-10;
230 REAL axis0DOTr = 0., axis1DOTr = 0., axis0DOTz = 0., axis1DOTz = 0.;
231 for(
int pos = 0; pos < 3; pos++)
239 REAL R2PI = 2. * M_PI * R;
241 REAL lambda = -((
fE*
fnu)/((1. +
fnu)*(2.*
fnu-1.)));
242 REAL mi =
fE/(2.*(1. +
fnu));
244 REAL epsT = DelTemp*
fAlpha;
245 REAL TensorThermico = (3.*lambda+2.*mi)*epsT;
250 for( int64_t in = 0; in < phr; in++ )
254 dphiRZi.PutVal(0,0, dphi.
GetVal(0,in)*axis0DOTr + dphi.
GetVal(1,in)*axis1DOTr );
257 dphiRZi.PutVal(1,0, dphi.
GetVal(0,in)*axis0DOTz + dphi.
GetVal(1,in)*axis1DOTz );
259 ef(2*in, 0) += weight * R2PI * (
ff[0] * phi(in,0) + TensorThermico*(phi(in,0)/R + dphiRZi(0,0)));
260 ef(2*in+1, 0) += weight * R2PI * (
ff[1] * phi(in,0) + TensorThermico*dphiRZi(1,0));
262 for( int64_t jn = 0; jn < phr; jn++ )
271 REAL term00 = dphiRZi(0,0) * (lambda + 2.*mi) * dphiRZj(0,0) +
272 dphiRZi(1,0) * mi * dphiRZj(1,0) +
273 phi(in,0) * lambda/R * dphiRZj(0,0) +
274 dphiRZi(0,0) * lambda/R * phi(jn,0) +
275 phi(in,0) * (lambda+2.*mi)/(R*R) * phi(jn,0);
277 REAL term01 = dphiRZi(1,0) * mi * dphiRZj(0,0) +
278 dphiRZi(0,0) * lambda * dphiRZj(1,0) +
279 phi(in,0) * lambda/R * dphiRZj(1,0);
281 REAL term10 = dphiRZi(1,0) * lambda * dphiRZj(0,0) +
282 dphiRZi(0,0) * mi * dphiRZj(1,0) +
283 dphiRZi(1,0) * lambda/R * phi(jn,0);
285 REAL term11 = dphiRZi(0,0) * mi * dphiRZj(0,0) +
286 dphiRZi(1,0) * (lambda + 2.*mi) * dphiRZj(1,0);
288 ek(2*in,2*jn) += weight * R2PI * term00;
289 ek(2*in,2*jn+1) += weight * R2PI * term01;
290 ek(2*in+1,2*jn) += weight * R2PI * term10;
291 ek(2*in+1,2*jn+1) += weight * R2PI * term11;
296 if(logdata->isDebugEnabled())
298 std::stringstream sout;
312 int64_t phr = phi.
Rows();
315 v2[0] = bc.
Val2()(0,0);
316 v2[1] = bc.
Val2()(1,0);
321 int s = (R > 0) ? 1:-1;
323 double R2PI = 2. * M_PI * R;
325 static REAL accum1 = 0., accum2 = 0.;
331 for(in = 0 ; in < phr; in++)
333 ef(2*in,0) += BIGNUMBER * v2[0]*
334 phi(in,0) * R2PI * weight;
336 ef(2*in+1,0) += BIGNUMBER * v2[1]*
337 phi(in,0) * R2PI * weight;
339 for (jn = 0 ; jn < phi.
Rows(); jn++)
341 ek(2*in,2*jn) += BIGNUMBER * phi(in,0) * phi(jn,0) * R2PI * weight;
342 ek(2*in+1,2*jn+1) += BIGNUMBER * phi(in,0) * phi(jn,0) * R2PI * weight;
350 for(in = 0 ; in < phi.
Rows(); in++)
352 ef(2*in,0) += v2[0] * phi(in,0) * R2PI * weight;
353 ef(2*in+1,0) += v2[1] * phi(in,0) * R2PI * weight;
355 accum1 += v2[1] * R2PI *weight;
357 if (logger->isDebugEnabled())
359 std::stringstream sout;
360 sout <<
"Accumulated force 1 " << accum1;
369 for(in = 0 ; in < phi.
Rows(); in++)
371 ef(2*in, 0) += v2[0] * phi(in, 0) * R2PI * weight;
372 ef(2*in+1, 0) += v2[1] * phi(in, 0) * R2PI * weight;
374 for (jn = 0 ; jn < phi.
Rows(); jn++)
376 ek(2*in,2*jn) += bc.
Val1()(0,0) * phi(in,0) * phi(jn,0) * R2PI * weight;
377 ek(2*in+1,2*jn) += bc.
Val1()(1,0) * phi(in,0) * phi(jn,0) * R2PI * weight;
378 ek(2*in+1,2*jn+1) += bc.
Val1()(1,1) * phi(in,0) * phi(jn,0) * R2PI * weight;
379 ek(2*in,2*jn+1) += bc.
Val1()(0,1) * phi(in,0) * phi(jn,0) * R2PI * weight;
388 Nxy[0] = data.
axes(0,1);
389 Nxy[1] = -data.
axes(0,0);
401 for(in = 0 ; in < phi.
Rows(); in++)
403 ef(2*in,0) += v2[0] * Nrz[0] * phi(in,0) * R2PI * weight;
404 ef(2*in+1,0) += v2[0] * Nrz[1] * phi(in,0) * R2PI * weight;
406 accum2 += v2[0] * Nrz[1] * R2PI *weight;
408 if (logger->isDebugEnabled())
410 std::stringstream sout;
411 sout <<
"Accumulated force 2 " << accum2;
434 int &LeftPOrder=dataleft.
p;
435 int &RightPOrder=dataright.
p;
437 REAL &faceSize=data.
HSize;
440 if (logger->isDebugEnabled())
442 std::stringstream sout;
450 if(logdata->isDebugEnabled())
452 std::stringstream sout;
453 sout <<
"Origin = { " <<
f_Origin <<
"};" << std::endl;
454 sout <<
"AxisR = { " <<
f_AxisR <<
"};" << std::endl;
455 sout <<
"AxisZ = { " <<
f_AxisZ <<
"};" << std::endl;
461 int64_t nrowl = phiL.
Rows();
462 int64_t nrowr = phiR.
Rows();
467 int s = (R > 0)? 1:-1;
471 TPZFNMatrix<16> dphiRZiL(2,1), dphiRZjL(2,1), dphiRZiR(2,1), dphiRZjR(2,1);
473 double axis0DOTrL = 0., axis1DOTrL = 0., axis0DOTzL = 0., axis1DOTzL = 0.;
474 double axis0DOTrR = 0., axis1DOTrR = 0., axis0DOTzR = 0., axis1DOTzR = 0.;
475 for(
int pos = 0; pos < 3; pos++)
487 REAL R2PI = 2.0 * M_PI * R;
490 REAL penalty =
fPenaltyConstant*(0.5 * (LeftPOrder*LeftPOrder + RightPOrder*RightPOrder))/faceSize;
499 double lambda = -((
fE*
fnu)/((1. +
fnu)*(2.*
fnu-1.)));
500 double mu =
fE/(2.*(1. +
fnu));
502 int64_t numbersol = dataleft.
dsol.
size();
503 if (numbersol != 1) {
508 if (logdata->isDebugEnabled())
510 std::stringstream sout;
513 sout <<
"R = " << R <<
";" << std::endl;
514 sout <<
"fE = " <<
fE <<
";" << std::endl;
515 sout <<
"fnu = " <<
fnu <<
";" << std::endl;
516 sout <<
"Lambda = " << lambda <<
";" << std::endl;
517 sout <<
"Mu = " << mu <<
";" << std::endl;
518 sout <<
"weight = " << weight <<
";" << std::endl;
526 DSolLAxes(0,0) = dataleft.
dsol[0](0,0)*axis0DOTrL+dataleft.
dsol[0](1,0)*axis1DOTrL;
527 DSolLAxes(1,0) = dataleft.
dsol[0](0,0)*axis0DOTzL+dataleft.
dsol[0](1,0)*axis1DOTzL;
528 DSolLAxes(0,1) = dataleft.
dsol[0](0,1)*axis0DOTrL+dataleft.
dsol[0](1,1)*axis1DOTrL;
529 DSolLAxes(1,1) = dataleft.
dsol[0](0,1)*axis0DOTzL+dataleft.
dsol[0](1,1)*axis1DOTzL;
531 DSolRAxes(0,0) = dataright.
dsol[0](0,0)*axis0DOTrR+dataright.
dsol[0](1,0)*axis1DOTrR;
532 DSolRAxes(1,0) = dataright.
dsol[0](0,0)*axis0DOTzR+dataright.
dsol[0](1,0)*axis1DOTzR;
533 DSolRAxes(0,1) = dataright.
dsol[0](0,1)*axis0DOTrR+dataright.
dsol[0](1,1)*axis1DOTrR;
534 DSolRAxes(1,1) = dataright.
dsol[0](0,1)*axis0DOTzR+dataright.
dsol[0](1,1)*axis1DOTzR;
537 DeformL(0,0) = DSolLAxes(0,0);
538 DeformL(1,1) = DSolLAxes(1,1);
539 DeformL(0,1) = (DSolLAxes(0,1)+DSolLAxes(1,0))/2.;
540 DeformL(1,0) = DeformL(0,1);
541 DeformL(2,2) = dataleft.
sol[0][0]/R;
543 DeformR(0,0) = DSolRAxes(0,0);
544 DeformR(1,1) = DSolRAxes(1,1);
545 DeformR(0,1) = (DSolRAxes(0,1)+DSolRAxes(1,0))/2.;
546 DeformR(1,0) = DeformR(0,1);
547 DeformR(2,2) = dataright.
sol[0][0]/R;
550 REAL TrDeformL, TrDeformR;
551 TrDeformL = DeformL(0,0)+DeformL(1,1)+DeformL(2,2);
552 TrDeformR = DeformR(0,0)+DeformR(1,1)+DeformR(2,2);
553 TensorL = REAL(2.*mu)*DeformL;
554 TensorR = REAL(2.*mu)*DeformR;
555 REAL normalCompL, normalCompR;
556 for (
int i=0; i<3; i++) {
557 TensorL(i,i) += lambda*TrDeformL;
558 TensorR(i,i) += lambda*TrDeformR;
560 normalCompL = TensorL(1,0)*normal[0]+TensorL(1,1)*normal[1];
561 normalCompR = TensorR(1,0)*normal[0]+TensorR(1,1)*normal[1];
562 if (logdata->isDebugEnabled() && TrDeformL != 0.)
564 std::stringstream sout;
568 sout <<
"NormalCompL = " << normalCompL <<
";" << std::endl;
569 sout <<
"NormalCompR = " << normalCompR <<
";" << std::endl;
578 for(il = 0; il< nrowl; il++ )
581 dphiRZiL.PutVal(0,0, dphiL.
GetVal(0,il)*axis0DOTrL + dphiL.
GetVal(1,il)*axis1DOTrL );
584 dphiRZiL.PutVal(1,0, dphiL.
GetVal(0,il)*axis0DOTzL + dphiL.
GetVal(1,il)*axis1DOTzL );
587 for( jl = 0; jl < nrowl; jl++ )
590 dphiRZjL.PutVal(0,0, dphiL.
GetVal(0,jl)*axis0DOTrL + dphiL.
GetVal(1,jl)*axis1DOTrL );
593 dphiRZjL.PutVal(1,0, dphiL.
GetVal(0,jl)*axis0DOTzL + dphiL.
GetVal(1,jl)*axis1DOTzL );
595 double nr = normal[0];
596 double nz = normal[1];
598 double term00 = -1.*(lambda*nr*phiL(il,0)*phiL(jl,0)/(2.*R) +
599 mu*nz*phiL(il,0)*dphiRZjL(1,0)/2. +
600 lambda*nr*phiL(il,0)*dphiRZjL(0,0)/2. +
601 mu*nr*phiL(il,0)*dphiRZjL(0,0));
602 term00 += symmetry*(lambda*nr*phiL(il,0)*phiL(jl,0)/(2.*R) +
603 mu*nz*phiL(jl,0)*dphiRZiL(1,0)/2. +
604 lambda*nr*phiL(jl,0)*dphiRZiL(0,0)/2. +
605 mu*nr*phiL(jl,0)*dphiRZiL(0,0));
606 term00 += beta*penalty*phiL(il,0)*phiL(jl,0);
609 double term01 = -1.*(lambda*nr*phiL(il,0)*dphiRZjL(1,0)/2. +
610 mu*nz*phiL(il,0)*dphiRZjL(0,0)/2.);
611 term01 += symmetry*(lambda*nz*phiL(il,0)*phiL(jl,0)/(2.*R) +
612 mu*nr*phiL(jl,0)*dphiRZiL(1,0)/2. +
613 lambda*nz*phiL(jl,0)*dphiRZiL(0,0)/2.);
616 double term10 = -1.*(lambda*nz*phiL(il,0)*phiL(jl,0)/(2.*R) +
617 mu*nr*phiL(il,0)*dphiRZjL(1,0)/2. +
618 lambda*nz*phiL(il,0)*dphiRZjL(0,0)/2.);
619 term10 += symmetry*(lambda*nr*phiL(jl,0)*dphiRZiL(1,0)/2. +
620 mu*nz*phiL(jl,0)*dphiRZiL(0,0)/2.);
623 double term11 = -1.*(lambda*nz*phiL(il,0)*dphiRZjL(1,0)/2. +
624 mu*nz*phiL(il,0)*dphiRZjL(1,0) +
625 mu*nr*phiL(il,0)*dphiRZjL(0,0)/2.);
626 term11 += symmetry*(lambda*nz*phiL(jl,0)*dphiRZiL(1,0)/2. +
627 mu*nz*phiL(jl,0)*dphiRZiL(1,0) +
628 mu*nr*phiL(jl,0)*dphiRZiL(0,0)/2.);
629 term11 +=beta*penalty*phiL(il,0)*phiL(jl,0);
632 ek(2*il, 2*jl) += weight*R2PI*term00;
633 ek(2*il, 2*jl+1) += weight*R2PI*term01;
634 ek(2*il+1, 2*jl) += weight*R2PI*term10;
635 ek(2*il+1, 2*jl+1) += weight*R2PI*term11;
642 for( il = 0; il < nrowl; il++ )
648 dphiRZiL.PutVal(1,0, dphiL.
GetVal(0,il)*axis0DOTzL + dphiL.
GetVal(1,il)*axis1DOTzL );
650 for(jr = 0; jr < nrowr; jr++ )
659 double lambda = -((
fE*
fnu)/((1. +
fnu)*(2.*
fnu-1.)));
660 double mu =
fE/(2.*(1. +
fnu));
661 double nr = normal[0];
662 double nz = normal[1];
664 double term02 = -1.*(lambda*nr*phiL(il,0)*phiR(jr,0)/(2.*R) +
665 mu*nz*phiL(il,0)*dphiRZjR(1,0)/2. +
666 lambda*nr*phiL(il,0)*dphiRZjR(0,0)/2. +
667 mu*nr*phiL(il,0)*dphiRZjR(0,0));
668 term02 += -1.*symmetry*(lambda*nr*phiL(il,0)*phiR(jr,0)/(2.*R) +
669 mu*nz*phiR(jr,0)*dphiRZiL(1,0)/2. +
670 lambda*nr*phiR(jr,0)*dphiRZiL(0,0)/2. +
671 mu*nr*phiR(jr,0)*dphiRZiL(0,0));
672 term02 += -1.*beta*penalty*phiL(il,0)*phiR(jr,0);
675 double term03 = -1.*(lambda*nr*phiL(il,0)*dphiRZjR(1,0)/2. +
676 mu*nz*phiL(il,0)*dphiRZjR(0,0)/2.);
677 term03 += -1.*symmetry*(lambda*nz*phiL(il,0)*phiR(jr,0)/(2.*R) +
678 mu*nr*phiR(jr,0)*dphiRZiL(1,0)/2. +
679 lambda*nz*phiR(jr,0)*dphiRZiL(0,0)/2.);
682 double term12 = -1.*(lambda*nz*phiL(il,0)*phiR(jr,0)/(2.*R) +
683 mu*nr*phiL(il,0)*dphiRZjR(1,0)/2. +
684 lambda*nz*phiL(il,0)*dphiRZjR(0,0)/2.);
685 term12 += -1.*symmetry*(lambda*nr*phiR(jr,0)*dphiRZiL(1,0)/2. +
686 mu*nz*phiR(jr,0)*dphiRZiL(0,0)/2.);
689 double term13 = -1.*(lambda*nz*phiL(il,0)*dphiRZjR(1,0)/2. +
690 mu*nz*phiL(il,0)*dphiRZjR(1,0) +
691 mu*nr*phiL(il,0)*dphiRZjR(0,0)/2.);
692 term13 += -1.*symmetry*(lambda*nz*phiR(jr,0)*dphiRZiL(1,0)/2. +
693 mu*nz*phiR(jr,0)*dphiRZiL(1,0) +
694 mu*nr*phiR(jr,0)*dphiRZiL(0,0)/2.);
695 term13 += -1.*beta*penalty*phiL(il,0)*phiR(jr,0);
697 ek(2*il, 2*jr+2*nrowl) += weight*R2PI*term02;
698 ek(2*il, 2*jr+2*nrowl+1) += weight*R2PI*term03;
699 ek(2*il+1, 2*jr+2*nrowl) += weight*R2PI*term12;
700 ek(2*il+1, 2*jr+2*nrowl+1) += weight*R2PI*term13;
706 for( ir = 0; ir < nrowr; ir++ )
712 dphiRZiR.PutVal(1,0, dphiR.
GetVal(0,ir)*axis0DOTzR + dphiR.
GetVal(1,ir)*axis1DOTzR );
714 for( jl = 0; jl < nrowl; jl++ )
717 dphiRZjL.PutVal(0,0, dphiL.
GetVal(0,jl)*axis0DOTrL + dphiL.
GetVal(1,jl)*axis1DOTrL );
720 dphiRZjL.PutVal(1,0, dphiL.
GetVal(0,jl)*axis0DOTzL + dphiL.
GetVal(1,jl)*axis1DOTzL );
723 double lambda = -((
fE*
fnu)/((1. +
fnu)*(2.*
fnu-1.)));
724 double mu =
fE/(2.*(1. +
fnu));
725 double nr = normal[0];
726 double nz = normal[1];
728 double term20 = (lambda*nr*phiR(ir,0)*phiL(jl,0)/(2.*R) +
729 mu*nz*phiR(ir,0)*dphiRZjL(1,0)/2. +
730 lambda*nr*phiR(ir,0)*dphiRZjL(0,0)/2. +
731 mu*nr*phiR(ir,0)*dphiRZjL(0,0));
732 term20 += symmetry*(lambda*nr*phiR(ir,0)*phiL(jl,0)/(2.*R) +
733 mu*nz*phiL(jl,0)*dphiRZiR(1,0)/2. +
734 lambda*nr*phiL(jl,0)*dphiRZiR(0,0)/2. +
735 mu*nr*phiL(jl,0)*dphiRZiR(0,0));
736 term20 += -1.*beta*penalty*phiR(ir,0)*phiL(jl,0);
739 double term21 = (lambda*nr*phiR(ir,0)*dphiRZjL(1,0)/2. +
740 mu*nz*phiR(ir,0)*dphiRZjL(0,0)/2.);
741 term21 += symmetry*(lambda*nz*phiR(ir,0)*phiL(jl,0)/(2.*R) +
742 mu*nr*phiL(jl,0)*dphiRZiR(1,0)/2. +
743 lambda*nz*phiL(jl,0)*dphiRZiR(0,0)/2.);
746 double term30 = (lambda*nz*phiR(ir,0)*phiL(jl,0)/(2.*R) +
747 mu*nr*phiR(ir,0)*dphiRZjL(1,0)/2. +
748 lambda*nz*phiR(ir,0)*dphiRZjL(0,0)/2.);
749 term30 += symmetry*(lambda*nr*phiL(jl,0)*dphiRZiR(1,0)/2. +
750 mu*nz*phiL(jl,0)*dphiRZiR(0,0)/2.);
753 double term31 = (lambda*nz*phiR(ir,0)*dphiRZjL(1,0)/2. +
754 mu*nz*phiR(ir,0)*dphiRZjL(1,0) +
755 mu*nr*phiR(ir,0)*dphiRZjL(0,0)/2.);
756 term31 += symmetry*(lambda*nz*phiL(jl,0)*dphiRZiR(1,0)/2. +
757 mu*nz*phiL(jl,0)*dphiRZiR(1,0) +
758 mu*nr*phiL(jl,0)*dphiRZiR(0,0)/2.);
759 term31 += -1.*beta*penalty*phiR(ir,0)*phiL(jl,0);
761 ek(2*ir+2*nrowl, 2*jl) += weight*R2PI*term20;
762 ek(2*ir+2*nrowl, 2*jl+1) += weight*R2PI*term21;
763 ek(2*ir+2*nrowl+1, 2*jl) += weight*R2PI*term30;
764 ek(2*ir+2*nrowl+1, 2*jl+1) += weight*R2PI*term31;
771 for(ir = 0; ir < nrowr; ir++ )
777 dphiRZiR.PutVal(1,0, dphiR.
GetVal(0,ir)*axis0DOTzR + dphiR.
GetVal(1,ir)*axis1DOTzR );
779 for( jr = 0; jr < nrowr; jr++ )
787 double lambda = -((
fE*
fnu)/((1. +
fnu)*(2.*
fnu-1.)));
788 double mu =
fE/(2.*(1. +
fnu));
789 double nr = normal[0];
790 double nz = normal[1];
792 double term22 = (lambda*nr*phiR(ir,0)*phiR(jr,0)/(2.*R) +
793 mu*nz*phiR(ir,0)*dphiRZjR(1,0)/2. +
794 lambda*nr*phiR(ir,0)*dphiRZjR(0,0)/2. +
795 mu*nr*phiR(ir,0)*dphiRZjR(0,0));
796 term22 += -1.*symmetry*(lambda*nr*phiR(ir,0)*phiR(jr,0)/(2.*R) +
797 mu*nz*phiR(jr,0)*dphiRZiR(1,0)/2. +
798 lambda*nr*phiR(jr,0)*dphiRZiR(0,0)/2. +
799 mu*nr*phiR(jr,0)*dphiRZiR(0,0));
800 term22 += beta*penalty*phiR(ir,0)*phiR(jr,0);
803 double term23 = (lambda*nr*phiR(ir,0)*dphiRZjR(1,0)/2. +
804 mu*nz*phiR(ir,0)*dphiRZjR(0,0)/2.);
805 term23 += -1.*symmetry*(lambda*nz*phiR(ir,0)*phiR(jr,0)/(2.*R) +
806 mu*nr*phiR(jr,0)*dphiRZiR(1,0)/2. +
807 lambda*nz*phiR(jr,0)*dphiRZiR(0,0)/2.);
810 double term32 = (lambda*nz*phiR(ir,0)*phiR(jr,0)/(2.*R) +
811 mu*nr*phiR(ir,0)*dphiRZjR(1,0)/2. +
812 lambda*nz*phiR(ir,0)*dphiRZjR(0,0)/2.);
813 term32 += -1.*symmetry*(lambda*nr*phiR(jr,0)*dphiRZiR(1,0)/2. +
814 mu*nz*phiR(jr,0)*dphiRZiR(0,0)/2.);
817 double term33 = (lambda*nz*phiR(ir,0)*dphiRZjR(1,0)/2. +
818 mu*nz*phiR(ir,0)*dphiRZjR(1,0) +
819 mu*nr*phiR(ir,0)*dphiRZjR(0,0)/2.);
820 term33 += -1.*symmetry*(lambda*nz*phiR(jr,0)*dphiRZiR(1,0)/2. +
821 mu*nz*phiR(jr,0)*dphiRZiR(1,0) +
822 mu*nr*phiR(jr,0)*dphiRZiR(0,0)/2.);
823 term33 += beta*penalty*phiR(ir,0)*phiR(jr,0);
826 ek(2*ir+2*nrowl, 2*jr+2*nrowl) += weight*R2PI*term22;
827 ek(2*ir+2*nrowl, 2*jr+2*nrowl+1) += weight*R2PI*term23;
828 ek(2*ir+2*nrowl+1, 2*jr+2*nrowl) += weight*R2PI*term32;
829 ek(2*ir+2*nrowl+1, 2*jr+2*nrowl+1) += weight*R2PI*term33;
834 if(logdata->isDebugEnabled())
836 std::stringstream sout;
848 if(!strcmp(
"Eigenvector1",name.c_str()))
return 9;
849 if(!strcmp(
"Eigenvector2",name.c_str()))
return 1;
850 if(!strcmp(
"Eigenvector3",name.c_str()))
return 2;
851 if(!strcmp(
"Sigmarr",name.c_str()))
return 3;
852 if(!strcmp(
"Sigmazz",name.c_str()))
return 4;
853 if(!strcmp(
"Sigmatt",name.c_str()))
return 5;
854 if(!strcmp(
"Taurz",name.c_str()))
return 6;
855 if(!strcmp(
"displacement",name.c_str()))
return 7;
856 if(!strcmp(
"MohrCoulomb",name.c_str()))
return 8;
900 int64_t numbersol = data.
dsol.
size();
901 if (numbersol != 1) {
913 int s = (R > 0)? 1:-1;
915 if(R < 1.e-10) R = 1.e-10;
927 double axis0DOTr = 0., axis1DOTr = 0., axis0DOTz = 0., axis1DOTz = 0.;
928 for(
int pos = 0; pos < 3; pos++)
936 DSolrz.
PutVal(0,0, DSolAxes(0,0)*axis0DOTr + DSolAxes(1,0)*axis1DOTr );
937 DSolrz.
PutVal(0,1, DSolAxes(0,0)*axis0DOTz + DSolAxes(1,0)*axis1DOTz );
938 DSolrz.
PutVal(1,0, DSolAxes(0,1)*axis0DOTr + DSolAxes(1,1)*axis1DOTr );
939 DSolrz.
PutVal(1,1, DSolAxes(0,1)*axis0DOTz + DSolAxes(1,1)*axis1DOTz );
943 if (logger->isDebugEnabled())
945 std::stringstream sout;
946 sout <<
"Point " << data.
x << std::endl;
947 sout <<
"Solution " << data.
sol << std::endl;
948 DSolrz.
Print(
"Derivatives of the solution\n",sout);
949 sout <<
"Radius " << R << std::endl;
956 Einf.PutVal(0,0,DSolrz(0,0));
957 Einf.PutVal(0,1,0.5*(DSolrz(0,1) + DSolrz(1,0)));
958 Einf.PutVal(1,0,0.5*(DSolrz(0,1) + DSolrz(1,0)));
959 Einf.PutVal(1,1,DSolrz(1,1));
960 Einf.PutVal(2,2,data.
sol[0][0]/R);
963 if (logger->isDebugEnabled())
965 std::stringstream sout;
966 Einf.Print(
"Deformation tensor",sout);
971 double lambda = -((
fE*
fnu)/((1. +
fnu)*(2.*
fnu-1.)));
972 double mi =
fE/(2.*(1. +
fnu));
973 double trE = Einf(0,0) + Einf(1,1) + Einf(2,2);
976 if (logger->isDebugEnabled())
978 std::stringstream sout;
979 sout <<
"E = " <<
fE <<
" fnu = " <<
fnu <<
" mi = " << mi <<
" lambda = " << lambda <<
" trE = " << trE;
986 double cte = lambda*trE;
987 REAL epsT = DelTemp*
fAlpha;
988 REAL TensorThermico = (3.*lambda+2.*mi)*epsT;
992 T.PutVal(0,0,cte + 2.*mi*Einf(0,0)-TensorThermico);
993 T.PutVal(0,1, 2.*mi*Einf(0,1));
994 T.PutVal(0,2, 2.*mi*Einf(0,2));
995 T.PutVal(1,0, 2.*mi*Einf(1,0));
996 T.PutVal(1,1,cte + 2.*mi*Einf(1,1)-TensorThermico);
997 T.PutVal(1,2, 2.*mi*Einf(1,2));
998 T.PutVal(2,0, 2.*mi*Einf(2,0));
999 T.PutVal(2,1, 2.*mi*Einf(2,1));
1000 T.PutVal(2,2,cte + 2.*mi*Einf(2,2)-TensorThermico);
1003 if (logger->isDebugEnabled())
1005 std::stringstream sout;
1006 T.Print(
"Stress tensor",sout);
1015 int64_t NumIt = 1000;
1020 EigenWorks = T.SolveEigensystemJacobi(NumIt, tol, EigValues, EigVectors);
1024 for(
int i = 0; i < 3; i++) Solout[i] = EigValues[0] * EigVectors(0,i);
1026 else cout <<
"TPZElasticityAxiMaterial::Solution Error -> case 0\n";
1028 if (logger->isDebugEnabled())
1030 std::stringstream sout;
1031 sout <<
"First eigenvector " << std::endl;
1041 int64_t NumIt = 1000;
1046 EigenWorks = T.SolveEigensystemJacobi(NumIt, tol, EigValues, EigVectors);
1050 for(
int i = 0; i < 3; i++) Solout[i] = EigValues[1] * EigVectors(1,i);
1052 else cout <<
"TPZElasticityAxiMaterial::Solution Error -> case 1\n";
1054 if (logger->isDebugEnabled())
1056 std::stringstream sout;
1057 sout <<
"Second eigenvector " << std::endl;
1067 int64_t NumIt = 1000;
1072 EigenWorks = T.SolveEigensystemJacobi(NumIt, tol, EigValues, EigVectors);
1076 for(
int i = 0; i < 3; i++) Solout[i] = EigValues[2] * EigVectors(2,i);
1078 else cout <<
"TPZElasticityAxiMaterial::Solution Error -> case 2\n";
1080 if (logger->isDebugEnabled())
1082 std::stringstream sout;
1083 sout <<
"Third eigenvector " << std::endl;
1096 if (logger->isDebugEnabled())
1098 std::stringstream sout;
1099 sout <<
"Sigma r " << T(0,0);
1111 if (logger->isDebugEnabled())
1113 std::stringstream sout;
1114 sout <<
"Sigma z " << T(1,1);
1126 if (logger->isDebugEnabled())
1128 std::stringstream sout;
1129 sout <<
"Sigma theta " << T(2,2);
1141 if (logger->isDebugEnabled())
1143 std::stringstream sout;
1144 sout <<
"Sigma rz " << T(0,1);
1154 Solout[0] = SolAxes[0];
1155 Solout[1] = SolAxes[1];
1156 Solout[2] = SolAxes[2];
1163 REAL i1, i2, i3, j1, j2, j3;
1165 i1 = T(0,0) + T(1,1) + T(2,2);
1169 i2 = 0.5*( i1*i1 - (T2(0,0) + T2(1,1) + T2(2,2)) );
1171 i3 = T(0,0)*T(1,1)*T(2,2) + T(0,1)*T(1,2)*T(2,0) + T(0,2)*T(1,0)*T(2,1) - T(0,2)*T(1,1)*T(2,0) - T(1,2)*T(2,1)*T(0,0) - T(2,2)*T(0,1)*T(1,0);
1174 j2 = 1./3.*(i1*i1 - 3.*i2);
1175 j3 = 1./27.*(2.*i1*i1*i1 - 9.*i1*i2 + 27.*i3);
1177 REAL cos3theta = 3.*
sqrt(3.)/2. * j3/(
pow(j2,(REAL)1.5));
1179 REAL theta =
acos(cos3theta)/3.;
1183 if (logger->isDebugEnabled())
1185 std::stringstream sout;
1186 sout <<
"Criterio de Mohr Coulomb \ni1 " << i1 <<
" i2 " << i2 <<
1187 " i3 " << i3 <<
" \nj1 " << j1 <<
" j2 " << j2 <<
" j3 " << j3
1188 <<
" \nf_phi " <<
f_phi <<
1189 " f_c " <<
f_c <<
" theta " << theta <<
" MohrCoul " << Solout[0];
1198 cout <<
"TPZElasticityAxiMaterial::Solution Error -> default\n";
1207 if(
fabs(axes(2,0)) >= 1.e-6 ||
fabs(axes(2,1)) >= 1.e-6)
1209 cout <<
"TPZElasticityAxiMaterial::Flux only serves for xy configuration\n";
1219 REAL sigx,sigy,sigxy,
gamma;
1226 gamma = du(1,0)+du(0,1);
1229 sigma[2] =
fE*0.5/(1.+
fnu)*gamma;
1247 gamma = du_exact(1,0)+du_exact(0,1);
1250 sigma_exact[2] =
fE*0.5/(1.+
fnu)*gamma;
1251 sigx = (sigma[0] - sigma_exact[0]);
1252 sigy = (sigma[1] - sigma_exact[1]);
1253 sigxy = (sigma[2] - sigma_exact[2]);
1255 values[0] =
fE*(sigx*sigx + sigy*sigy + 2*
fnu*sigx*sigy)/(1-
fnu*
fnu);
1256 values[0] = (values[0] + .5*
fE*sigxy*sigxy/(1+
fnu));
1262 values[1] =
pow((REAL)
fabs(u[0] - u_exact[0]),(REAL)2.0)+
pow((REAL)
fabs(u[1] - u_exact[1]),(REAL)2.0);
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
REAL fPenaltyConstant
Penalty term.
void Errors(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &dudx, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values) override
Computes the error due to the difference between the interpolated flux and the flux computed based o...
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
void Print(std::ostream &out=std::cout)
Prints the structural information of the vector object to the output stream. This method will not p...
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
int ClassId() const override
Unique identifier for serialization purposes.
TPZManVector< REAL, 3 > normal
normal to the element at the integration point
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
TPZManVector< REAL > f_AxisZ
Revolution Axis.
Implements a two dimensional elastic material in plane stress or strain.
REAL fAlpha
Thermal expansion coeficient.
REAL fDelTemperature
Temperature difference.
clarg::argBool bc("-bc", "binary checkpoints", false)
TPZManVector< REAL > f_Origin
Origin of AxisR and AxisZ.
virtual void Flux(TPZVec< REAL > &x, TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux) override
Computes the value of the flux function to be used by ZZ error estimator.
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to stiffness matrix and load vector at one integration point...
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
virtual int ClassId() const override
Unique identifier for serialization purposes.
REAL f_phi
Mohr Coulomb Plasticity Criteria Data.
void SetOrigin(TPZManVector< REAL > &Orig, TPZManVector< REAL > &AxisZ, TPZManVector< REAL > &AxisR)
Set the origin of Revolution Axis ( ), the direction of Revolution Axis ( ), and the Radius vector (...
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
REAL E()
Returns the elasticity modulus E.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
int p
maximum polinomial order of the shape functions
TPZElasticityAxiMaterial()
Default constructor.
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
virtual void Print(std::ostream &out=std::cout)
Prints out the data associated with the material.
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
TPZManVector< REAL > GetAxisZ()
REAL fSymmetric
Symmetric.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
int64_t size() const
Returns the number of elements of the vector.
expr_ expr_ expr_ expr_ acos
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...
REAL ComputeR(TPZVec< REAL > &x)
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
REAL ff[3]
Forcing vector.
virtual void Write(const bool val)
virtual void Print(std::ostream &out=std::cout) override
Prints the material data.
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZManVector< REAL > GetAxisR()
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
This class defines the boundary condition for TPZMaterial objects.
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
void PrintMathematica(std::ostream &out) const
Prints the data in a format suitable for Mathematica.
virtual ~TPZElasticityAxiMaterial()
Destructor.
int64_t Rows() const
Returns number of rows.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
TPZFMatrix< STATE > & Val1()
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var. var is obtained by cal...
REAL HSize
measure of the size of the element
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout) override
Returns the solution associated with the var index based on the finite element approximation.
static REAL gBigNumber
Big number to penalization method, used for Dirichlet conditions.
int32_t Hash(std::string str)
long double gamma(unsigned int n)
Evaluate the factorial of a integer.
Contains TPZMatrix<TVar>class, root matrix class.
std::string Name() override
Returns the material name.
REAL f_c
Mohr Coulomb Plasticity Criteria Data.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Calculates the element stiffness matrix.
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
void(* fTemperatureFunction)(const TPZVec< REAL > &rz, REAL &temperature)
Function which defines the temperature.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
TPZManVector< REAL > GetOrigin()
int64_t Cols() const
Returns number of cols.
REAL fnu
Poison coeficient.
virtual void Print(std::ostream &out) const
Defines the interface for saving and reading data. Persistency.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Applies the element boundary conditions.
REAL fE
Elasticity modulus.
Contains the TPZElasticityAxiMaterial class which implements a two dimensional elastic material in pl...
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
TPZSolVec sol
vector of the solutions at the integration point
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.
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.
TPZManVector< REAL > f_AxisR
Direction of Surface.
Implements an interface to register a class id and a restore function. Persistence.
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.
virtual void Read(bool &val)