20 static LoggerPtr logdata(Logger::getLogger(
"pz.mixedelasticity"));
66 int nref = datavec.
size();
67 for (
int i = 0; i < nref; i++) {
68 datavec[i].SetAllRequirements(
false);
69 datavec[i].fNeedsNeighborSol =
false;
70 datavec[i].fNeedsNeighborCenter =
false;
71 datavec[i].fNeedsNormal =
false;
95 int nphiuHdiv = datavec[sigmaBlock].fVecShapeIndex.
NElements();
97 DivergenceofPhi.
Resize(nphiuHdiv, 1);
99 REAL JacobianDet = datavec[sigmaBlock].detjac;
112 JacobianInverse.
Multiply(Qaxes, GradOfXInverse);
114 int ivectorindex = 0;
118 for (
int iq = 0; iq < nphiuHdiv; iq++) {
119 ivectorindex = datavec[sigmaBlock].fVecShapeIndex[iq].first;
120 ishapeindex = datavec[sigmaBlock].fVecShapeIndex[iq].second;
122 VectorOnXYZ(0, 0) = datavec[sigmaBlock].fNormalVec(0, ivectorindex);
123 VectorOnXYZ(1, 0) = datavec[sigmaBlock].fNormalVec(1, ivectorindex);
124 VectorOnXYZ(2, 0) = datavec[sigmaBlock].fNormalVec(2, ivectorindex);
126 GradOfXInverse.
Multiply(VectorOnXYZ, VectorOnMaster);
127 VectorOnMaster *= JacobianDet;
141 MatrixElast.
Redim(4, 4);
146 MatrixElast(
Exx,
Exx) = 1. / (2. * mu) - lambda / (2. * mu * (2. * lambda + 2. * mu));
147 MatrixElast(
Exx,
Eyy) = -lambda / (2. * mu * (2. * lambda + 2. * mu));
150 MatrixElast(
Exy,
Exy) = 1. / (2. * mu);
158 MatrixElast(
Exy,
Exy) = 1. / (2. * mu);
167 for (
int iq = 0; iq < 4; iq++) {
169 for (
int jq = 0; jq < 4; jq++) {
170 APhiStress[iq] += MatrixElast(iq, jq) * PhiStress[jq];
177 Stress[
Exx] = elast.
fE / (1 - elast.
fnu * elast.
fnu)*(Deformation[
Exx] + elast.
fnu * Deformation[
Eyy]);
178 Stress[
Eyy] = elast.
fE / (1. - elast.
fnu * elast.
fnu)*(elast.
fnu * Deformation[
Exx] + Deformation[Eyy]);
179 Stress[
Exy] = elast.
fE / (1. + elast.
fnu) * Deformation[
Exy];
180 Stress[
Eyx] = elast.
fE / (1. + elast.
fnu) * Deformation[
Eyx];
182 Stress[
Exx] = elast.
fE / ((1 + elast.
fnu)*(1 - 2. * elast.
fnu))*((1 - elast.
fnu) * Deformation[
Exx] + elast.
fnu * Deformation[
Eyy]);
183 Stress[
Eyy] = elast.
fE / ((1 + elast.
fnu)*(1 - 2. * elast.
fnu))*((1 - elast.
fnu) * Deformation[
Eyy] + elast.
fnu * Deformation[
Exx]);
184 Stress[
Exy] = elast.
fE / (1. + elast.
fnu) * Deformation[
Exy];
185 Stress[
Eyx] = elast.
fE / (1. + elast.
fnu) * Deformation[
Eyx];
190 out <<
"name of material : " <<
Name() <<
"\n";
191 out <<
"properties : \n";
192 out <<
"\tE_const = " <<
fE_const << endl;
193 out <<
"\tnu_const = " <<
fnu_const << endl;
194 out <<
"\tF = " <<
fForce[0] <<
' ' <<
fForce[1] << endl;
199 Svoigt[
Exx] = S(0, 0);
200 Svoigt[
Exy] = S(0, 1);
201 Svoigt[
Eyx] = S(1, 0);
202 Svoigt[
Eyy] = S(1, 1);
207 S(0, 0) = Svoigt[
Exx];
208 S(0, 1) = Svoigt[
Exy];
209 S(1, 0) = Svoigt[
Eyx];
210 S(1, 1) = Svoigt[
Eyy];
214 if (datavec[0].fVecShapeIndex.
size() == 0) {
218 REAL R = datavec[0].x[0];
252 int nshapeS, nshapeU, nshapeP;
253 nshapeS = datavec[0].fVecShapeIndex.
NElements();
254 nshapeU = datavec[1].phi.Rows();
255 nshapeP = datavec[2].phi.Rows();
260 TPZManVector<STATE, 4> phiSi1x(4, 0.0), phiSj1x(4, 0.0), phiSi1y(4, 0.0), phiSj1y(4, 0.0), phiPj1x(4, 0.0), phiPj1y(4, 0.0);
265 force[0] = this->
fForce[0];
266 force[1] = this->
fForce[1];
270 if (logdata->isDebugEnabled()) {
271 std::stringstream sout;
272 sout <<
" x = " << datavec[0].x <<
" force = " << force << std::endl;
277 for (
int i = 0; i < nshapeS; i++) {
278 int iphi = datavec[0].fVecShapeIndex[i].second;
279 int ivec = datavec[0].fVecShapeIndex[i].first;
284 for (
int e = 0; e < 3; e++) {
286 ivecS(e, 0) = datavec[0].fNormalVec(e, ivec);
287 phiSi(e, 0) = phiS(iphi, 0) * ivecS(e, 0);
291 datavec[0].axes.Multiply(ivecS, axesvec);
295 divSi += axesvec(
f, 0) * dphiS(
f, iphi);
300 phiTensx(0, 0) = phiSi(0, 0);
301 phiTensx(0, 1) = phiSi(1, 0);
303 phiTensy(1, 0) = phiSi(0, 0);
304 phiTensy(1, 1) = phiSi(1, 0);
312 for (
int j = 0; j < nshapeS; j++) {
313 int jphi = datavec[0].fVecShapeIndex[j].second;
314 int jvec = datavec[0].fVecShapeIndex[j].first;
317 phiSj(e, 0) = phiS(jphi, 0) * datavec[0].fNormalVec(e, jvec);
322 phjTensx(0, 0) = phiSj(0, 0);
323 phjTensx(0, 1) = phiSj(1, 0);
325 phjTensy(1, 0) = phiSj(0, 0);
326 phjTensy(1, 1) = phiSj(1, 0);
336 STATE valxx =
InnerVec(AphiSi1x, phiSj1x);
337 STATE valxy =
InnerVec(AphiSi1x, phiSj1y);
338 STATE valyx =
InnerVec(AphiSi1y, phiSj1x);
339 STATE valyy =
InnerVec(AphiSi1y, phiSj1y);
348 ek(2 * i, 2 * j) += weight * valxx;
349 ek(2 * i, 2 * j + 1) += weight * valxy;
350 ek(2 * i + 1, 2 * j) += weight * valyx;
351 ek(2 * i + 1, 2 * j + 1) += weight * valyy;
355 for (
int j = 0; j < nshapeU; j++) {
356 phiUj1x[0] = phiU(j, 0);
357 phiUj1y[1] = phiU(j, 0);
359 STATE valx = weight *
InnerVec(divSi1x, phiUj1x);
360 STATE valy = weight *
InnerVec(divSi1y, phiUj1y);
363 ek(2 * j + nshapeS * 2, 2 * i) += valx;
364 ek(2 * j + 1 + nshapeS * 2, 2 * i + 1) += valy;
367 ek(2 * i, 2 * j + nshapeS * 2) += valx;
368 ek(2 * i + 1, 2 * j + 1 + nshapeS * 2) += valy;
372 for (
int j = 0; j < nshapeP; j++) {
374 phiPTensor(0, 1) = phiP(j, 0);
375 phiPTensor(1, 0) = -phiP(j, 0);
378 STATE valxx =
InnerVec(phiSi1x, phiPj1x);
379 STATE valxy =
InnerVec(phiSi1y, phiPj1x);
381 ek(j + nshapeS * 2 + nshapeU * 2, 2 * i) += weight * valxx;
382 ek(j + nshapeS * 2 + nshapeU * 2, 2 * i + 1) += weight * valxy;
385 ek(2 * i, j + nshapeS * 2 + nshapeU * 2) += weight * valxx;
386 ek(2 * i + 1, j + nshapeS * 2 + nshapeU * 2) += weight * valxy;
390 for (
int i = 0; i < nshapeU; i++) {
391 phiUj1x[0] = phiU(i, 0);
392 phiUj1y[1] = phiU(i, 0);
395 STATE factfx = -weight * phiUj1x[0] * force[0];
396 STATE factfy = -weight * phiUj1y[1] * force[1];
402 ef(nshapeS * 2 + 2 * i, 0) += factfx;
403 ef(nshapeS * 2 + 2 * i + 1, 0) += factfy;
408 for (
int j = 0; j < nshapeU; j++) {
409 ek(nshapeS * 2 + 2 * i, nshapeS * 2 + 2 * j) -= weight * phiU(i, 0) * phiU(j, 0) / (elast.
fE * R);
428 int phc, phrU, dphc, dphr, efr, efc, ekr, ekc;
439 if (phc != 1 || dphr != 2 || phrU != dphc) {
440 PZError <<
"\nTPZMixedElasticityMaterial.contr, inconsistent input data : \n" <<
441 "phi.Cols() = " << phi.
Cols() <<
" dphi.Cols() = " << dphiU.
Cols() <<
442 " phi.Rows = " << phi.
Rows() <<
" dphi.Rows = " <<
443 dphiU.
Rows() <<
"\nek.Rows() = " << ek.
Rows() <<
" ek.Cols() = " 445 "\nef.Rows() = " << ef.
Rows() <<
" ef.Cols() = " 446 << ef.
Cols() <<
"\n";
472 REAL MuL = elast.
fmu;
480 for (
int iu = 0; iu < phrU; iu++) {
481 for (
int col = 0; col < efc; col++) {
482 ef(2 * iu, col) += weight * (force[0] * phi(iu, 0));
483 ef(2 * iu + 1, col) += weight * (force[1] * phi(iu, 0));
488 dv[0] = dphiU(0, iu) * axes(0, 0) + dphiU(1, iu) * axes(1, 0);
490 dv[1] = dphiU(0, iu) * axes(0, 1) + dphiU(1, iu) * axes(1, 1);
492 for (
int ju = 0; ju < phrU; ju++) {
495 du[0] = dphiU(0, ju) * axes(0, 0) + dphiU(1, ju) * axes(1, 0);
497 du[1] = dphiU(0, ju) * axes(0, 1) + dphiU(1, ju) * axes(1, 1);
501 ek(2 * iu + FirstU, 2 * ju + FirstU) += weight * ((4 * (MuL)*(LambdaL + MuL) / (LambdaL + 2 * MuL)) * dv[0] * du[0] + (MuL) * dv[1] * du[1]);
502 ek(2 * iu + FirstU, 2 * ju + 1 + FirstU) += weight * ((2 * (MuL)*(LambdaL) / (LambdaL + 2 * MuL)) * dv[0] * du[1] + (MuL) * dv[1] * du[0]);
503 ek(2 * iu + 1 + FirstU, 2 * ju + FirstU) += weight * ((2 * (MuL)*(LambdaL) / (LambdaL + 2 * MuL)) * dv[1] * du[0] + (MuL) * dv[0] * du[1]);
504 ek(2 * iu + 1 + FirstU, 2 * ju + 1 + FirstU) += weight * ((4 * (MuL)*(LambdaL + MuL) / (LambdaL + 2 * MuL)) * dv[1] * du[1] + (MuL) * dv[0] * du[0]);
507 ek(2 * iu + FirstU, 2 * ju + FirstU) += weight * ((LambdaL + 2 * MuL) * dv[0] * du[0] + (MuL) * dv[1] * du[1]);
508 ek(2 * iu + FirstU, 2 * ju + 1 + FirstU) += weight * (LambdaL * dv[0] * du[1] + (MuL) * dv[1] * du[0]);
509 ek(2 * iu + 1 + FirstU, 2 * ju + FirstU) += weight * (LambdaL * dv[1] * du[0] + (MuL) * dv[0] * du[1]);
510 ek(2 * iu + 1 + FirstU, 2 * ju + 1 + FirstU) += weight * ((LambdaL + 2 * MuL) * dv[1] * du[1] + (MuL) * dv[0] * du[0]);
524 if (type == 4 || type == 5 || type == 6) {
533 int ndisp = datavec[1].phi.Rows();
552 nshapeS = datavec[0].phi.Rows();
561 REAL R = datavec[0].x[0];
562 if (R < 1.e-6) R = 1.e-6;
567 for (
int iq = 0; iq < nshapeS; iq++) {
568 ef(2 * iq, 0) += v_2(0, 0) * phiS(iq, 0) * weight;
569 ef(2 * iq + 1, 0) += v_2(1, 0) * phiS(iq, 0) * weight;
576 for (
int iq = 0; iq < nshapeS; iq++) {
577 for (
int jq = 0; jq < nshapeS; jq++) {
579 ek(2 * iq, 2 * jq) +=
gBigNumber * phiS(iq, 0) * phiS(jq, 0) * weight / R;
580 ek(2 * iq + 1, 2 * jq + 1) +=
gBigNumber * phiS(iq, 0) * phiS(jq, 0) * weight / R;
582 ek(2 * iq, 2 * jq) +=
gBigNumber * phiS(iq, 0) * phiS(jq, 0) * weight;
583 ek(2 * iq + 1, 2 * jq + 1) +=
gBigNumber * phiS(iq, 0) * phiS(jq, 0) * weight;
586 ef(2 * iq, 0) +=
gBigNumber * v_2(0, 0) * phiS(iq, 0) * weight;
587 ef(2 * iq + 1, 0) +=
gBigNumber * v_2(1, 0) * phiS(iq, 0) * weight;
594 for (
int iq = 0; iq < nshapeS; iq++) {
595 for (
int jq = 0; jq < nshapeS; jq++) {
597 ek(2 * iq, 2 * jq) += v_1(0, 0) * phiS(iq, 0) * phiS(jq, 0) * weight / R;
598 ek(2 * iq + 1, 2 * jq + 1) += v_1(1, 1) * phiS(iq, 0) * phiS(jq, 0) * weight / R;
599 ek(2 * iq + 1, 2 * jq) += v_1(1, 0) * phiS(iq, 0) * phiS(jq, 0) * weight / R;
600 ek(2 * iq, 2 * jq + 1) += v_1(0, 1) * phiS(iq, 0) * phiS(jq, 0) * weight / R;
602 ek(2 * iq, 2 * jq) += v_1(0, 0) * phiS(iq, 0) * phiS(jq, 0) * weight;
603 ek(2 * iq + 1, 2 * jq + 1) += v_1(1, 1) * phiS(iq, 0) * phiS(jq, 0) * weight;
604 ek(2 * iq + 1, 2 * jq) += v_1(1, 0) * phiS(iq, 0) * phiS(jq, 0) * weight;
605 ek(2 * iq, 2 * jq + 1) += v_1(0, 1) * phiS(iq, 0) * phiS(jq, 0) * weight;
608 ef(2 * iq, 0) += v_2(0, 0) * phiS(iq, 0) * weight;
609 ef(2 * iq + 1, 0) += v_2(1, 0) * phiS(iq, 0) * weight;
617 if (v_1(0, 0) > 1.e-1) {
618 ek(2 * nshapeS, 2 * nshapeS) = 1.;
620 if (v_1(1, 1) > 1.e-1) {
621 ek(2 * nshapeS + 1, 2 * nshapeS + 1) = 1.;
645 int phr = phi.
Rows();
664 for (in = 0; in < phr; in++) {
667 v2[0] = bc.
Val2(il)(0, 0);
668 v2[1] = bc.
Val2(il)(1, 0);
669 ef(2 * in, il) += BIGNUMBER * v2[0] * phi(in, 0) * weight;
670 ef(2 * in + 1, il) += BIGNUMBER * v2[1] * phi(in, 0) * weight;
672 for (jn = 0; jn < phi.
Rows(); jn++) {
673 ek(2 * in, 2 * jn) += BIGNUMBER * phi(in, 0) * phi(jn, 0) * weight;
674 ek(2 * in + 1, 2 * jn + 1) += BIGNUMBER * phi(in, 0) * phi(jn, 0) * weight;
682 for (in = 0; in < phr; in++) {
685 ef(2 * in, il) += v2(0, 0) * phi(in, 0) * weight;
686 ef(2 * in + 1, il) += v2(1, 0) * phi(in, 0) * weight;
694 for (in = 0; in < phi.
Rows(); in++) {
697 ef(2 * in, il) += v2(0, 0) * phi(in, 0) * weight;
698 ef(2 * in + 1, il) += v2(1, 0) * phi(in, 0) * weight;
701 for (jn = 0; jn < phi.
Rows(); jn++) {
702 ek(2 * in, 2 * jn) += bc.
Val1()(0, 0) * phi(in, 0) *
704 ek(2 * in + 1, 2 * jn) += bc.
Val1()(1, 0) * phi(in, 0) *
706 ek(2 * in + 1, 2 * jn + 1) += bc.
Val1()(1, 1) * phi(in, 0) *
708 ek(2 * in, 2 * jn + 1) += bc.
Val1()(0, 1) * phi(in, 0) *
715 for (in = 0; in < phr; in++) {
718 for (jn = 0; jn < phr; jn++) {
719 ek(nstate * in + 0, nstate * jn + 0) += BIGNUMBER * phi(in, 0) * phi(jn, 0) * weight * bc.
Val2()(0, 0);
720 ek(nstate * in + 1, nstate * jn + 1) += BIGNUMBER * phi(in, 0) * phi(jn, 0) * weight * bc.
Val2()(1, 0);
729 for (in = 0; in < dim; in++) {
730 v2[in] = (v1(in, 0) * data.
normal[0] +
731 v1(in, 1) * data.
normal[1]);
735 for (in = 0; in < phi.
Rows(); in++) {
736 ef(nstate * in + 0, 0) += v2[0] * phi(in, 0) * weight;
737 ef(nstate * in + 1, 0) += v2[1] * phi(in, 0) * weight;
747 for (in = 0; in < phi.
Rows(); in++) {
749 ef(nstate * in + 0, 0) += (bc.
Val2(il)(0, 0) * data.
normal[0]) * phi(in, 0) * weight;
750 ef(nstate * in + 1, 0) += (bc.
Val2(il)(0, 0) * data.
normal[1]) * phi(in, 0) * weight;
752 for (jn = 0; jn < phi.
Rows(); jn++) {
753 for (
int idf = 0;
idf < 2;
idf++)
for (
int jdf = 0; jdf < 2; jdf++) {
754 ek(nstate * in +
idf, nstate * jn + jdf) += bc.
Val1()(
idf, jdf) * data.
normal[
idf] * data.
normal[jdf] * phi(in, 0) * phi(jn, 0) * weight;
767 for (in = 0; in < phi.
Rows(); in++) {
769 ef(nstate * in + 0, 0) += (bc.
Val2(il)(0, 0) * data.
normal[0]) * phi(in, 0) * weight;
770 ef(nstate * in + 1, 0) += (bc.
Val2(il)(0, 0) * data.
normal[1]) * phi(in, 0) * weight;
772 for (jn = 0; jn < phi.
Rows(); jn++) {
773 for (
int idf = 0;
idf < 2;
idf++)
for (
int jdf = 0; jdf < 2; jdf++) {
774 ek(nstate * in +
idf, nstate * jn + jdf) += bc.
Val1()(
idf, jdf) * phi(in, 0) * phi(jn, 0) * weight;
791 if (!strcmp(
"displacement", name.c_str()))
return 9;
792 if (!strcmp(
"Displacement", name.c_str()))
return 9;
793 if (!strcmp(
"DisplacementMem", name.c_str()))
return 9;
794 if (!strcmp(
"Pressure", name.c_str()))
return 1;
795 if (!strcmp(
"MaxStress", name.c_str()))
return 2;
796 if (!strcmp(
"PrincipalStress1", name.c_str()))
return 3;
797 if (!strcmp(
"PrincipalStress2", name.c_str()))
return 4;
798 if (!strcmp(
"SigmaX", name.c_str()))
return 5;
799 if (!strcmp(
"SigmaY", name.c_str()))
return 6;
800 if (!strcmp(
"TauXY", name.c_str()))
return 8;
801 if (!strcmp(
"Strain", name.c_str()))
return 11;
802 if (!strcmp(
"SigmaZ", name.c_str()))
return 12;
803 if (!strcmp(
"sig_x", name.c_str()))
return 5;
804 if (!strcmp(
"sig_y", name.c_str()))
return 6;
805 if (!strcmp(
"tau_xy", name.c_str()))
return 8;
806 if (!strcmp(
"Displacement6", name.c_str()))
return 7;
807 if (!strcmp(
"Stress", name.c_str()))
return 10;
808 if (!strcmp(
"Flux", name.c_str()))
return 10;
809 if (!strcmp(
"J2", name.c_str()))
return 20;
810 if (!strcmp(
"I1", name.c_str()))
return 21;
811 if (!strcmp(
"J2Stress", name.c_str()))
return 20;
812 if (!strcmp(
"I1Stress", name.c_str()))
return 21;
813 if (!strcmp(
"Alpha", name.c_str()))
return 22;
814 if (!strcmp(
"PlasticSqJ2", name.c_str()))
return 22;
815 if (!strcmp(
"PlasticSqJ2El", name.c_str()))
return 22;
816 if (!strcmp(
"YieldSurface", name.c_str()))
return 27;
817 if (!strcmp(
"NormalStress", name.c_str()))
return 23;
818 if (!strcmp(
"ShearStress", name.c_str()))
return 24;
819 if (!strcmp(
"NormalStrain", name.c_str()))
return 25;
820 if (!strcmp(
"ShearStrain", name.c_str()))
return 26;
821 if (!strcmp(
"Rotation", name.c_str()))
return 27;
822 if(!strcmp(
"Young_Modulus",name.c_str()))
return 28;
823 if(!strcmp(
"Poisson",name.c_str()))
return 29;
920 REAL TauXY, aux, Sig1, Sig2,
angle;
923 DSolxy(0, 0) = DSol(0, 0) * axes(0, 0) + DSol(1, 0) * axes(1, 0);
924 DSolxy(1, 0) = DSol(0, 0) * axes(0, 1) + DSol(1, 0) * axes(1, 1);
926 DSolxy(0, 1) = DSol(0, 1) * axes(0, 0) + DSol(1, 1) * axes(1, 0);
927 DSolxy(1, 1) = DSol(0, 1) * axes(0, 1) + DSol(1, 1) * axes(1, 1);
931 epsxy = 0.5 * (DSolxy(1, 0) + DSolxy(0, 1));
936 epsz = -lambda * (epsx + epsy) / (lambda + 2. * mu);
940 TauXY = 2 * mu*epsxy;
942 REAL TauXY2 = elast.
fE * epsxy / (1. + elast.
fnu);
944 if (
fabs(TauXY - TauXY2) > 1.e-10) {
948 if (
fabs(TauXY - TauXY2) > 1.e-6) {
954 SigX = elast.
fE / (1 - elast.
fnu * elast.
fnu)*(epsx + elast.
fnu * epsy);
955 SigY = elast.
fE / (1 - elast.
fnu * elast.
fnu)*(elast.
fnu * epsx + epsy);
958 SigX = elast.
fE / ((1. - 2. * elast.
fnu)*(1. + elast.
fnu))*((1. - elast.
fnu) * epsx + elast.
fnu * epsy);
959 SigY = elast.
fE / ((1. - 2. * elast.
fnu)*(1. + elast.
fnu))*(elast.
fnu * epsx + (1. - elast.
fnu) * epsy);
960 SigZ = lambda * (epsx + epsy);
989 Solout[0] = SigX + SigY + SigZ;
1005 aux =
sqrt(0.25 * (SigX - SigY)*(SigX - SigY)
1009 if (
fabs(TauXY) < 1.e-10 &&
fabs(SigY - SigX) < 1.e-10) angle = 0.;
1010 else angle =
atan2(2 * TauXY, SigY - SigX) / 2.;
1011 Sig1 = 0.5 * (SigX + SigY) + aux;
1012 Sig2 = 0.5 * (SigX + SigY) - aux;
1015 Solout[0] = Sig1 *
cos(angle);
1016 Solout[1] = Sig1 *
sin(angle);
1021 Solout[0] = -Sig2 *
sin(angle);
1022 Solout[1] = Sig2 *
cos(angle);
1034 Solout[
Exy] = TauXY;
1035 Solout[
Eyx] = TauXY;
1038 cout <<
"Very critical error TPZMixedElasticityMaterial::Solution\n";
1058 REAL J2 = (
pow(SigX + SigY, 2) - (3 * (-
pow(SigX, 2) -
pow(SigY, 2) +
pow(SigX + SigY, 2) - 2 *
pow(TauXY, 2))) / 2.) / 2.;
1064 REAL I1 = SigX + SigY;
1107 if (data.
size() != 3) {
1118 for (
int i = 0; i < dim; i++) {
1119 for (
int j = 0; j < 3; j++) {
1121 sigma(i, j) = data[0].sol[0][j + i * 3] / R;
1123 sigma(i, j) = data[0].sol[0][j + i * 3];
1128 for (
int i = 0; i < dim; i++) {
1129 disp[i] = data[1].sol[0][i];
1132 antisym(0, 1) = data[2].sol[0][0];
1133 antisym(1, 0) = -antisym(0, 1);
1143 REAL nu = result[1];
1148 REAL mu = elast.
fmu;
1150 REAL nu = elast.
fnu;
1159 Solout[0] = elast.
fnu;
1176 eps(2, 2) = -1. / E * nu * (sigma(0, 0) + sigma(1, 1));
1178 sigma(2, 2) = nu * (sigma(0, 0) + sigma(1, 1));
1182 Pressure = -1/3. * (sigma(0, 0) + sigma(1, 1) + sigma(2,2));
1183 sigmah(0, 1) = sigma(0, 1);
1184 sigmah(1, 0) = sigma(1, 0);
1185 sigmah(0, 0) = sigma(0, 0) + Pressure;
1186 sigmah(1, 1) = sigma(1, 1) + Pressure;
1187 sigmah(2, 2) = sigma(2, 2) + Pressure;
1190 Solout[0] = disp[0];
1191 Solout[1] = disp[1];
1196 Solout[0] = -1 / 3 * (sigma(0, 0) + sigma(1, 1) + sigma(2, 2));
1201 Solout[0] = sigma(2, 2);
1207 Solout[0] = sigma(1, 1);
1213 Solout[0] = sigma(0, 0);
1218 Solout[0] = 0.5 * (sigma(0, 1) + sigma(1, 0));
1223 Solout[0] = eps(0, 0);
1224 Solout[1] = eps(1, 0);
1225 Solout[2] = eps(0, 1);
1226 Solout[3] = eps(2, 2);
1232 Solout[
Exx] = sigma(0, 0);
1233 Solout[
Eyx] = sigma(1, 0);
1234 Solout[
Exy] = sigma(0, 1);
1235 Solout[
Eyy] = sigma(1, 1);
1241 Solout[0] = sigma(0, 0) + sigma(1, 1) + sigma(2, 2);
1246 Solout[0] = sigmah(1, 1) * sigmah(0, 0) + sigmah(1, 1) * sigma(2, 2)
1247 + sigmah(0,0) * sigmah(2,2) - sigmah(1, 0) * sigmah(1, 0) - sigmah(0, 1) * sigmah(0, 1);
1254 Solout[0] = Pressure +
sqrt(0.25 * (sigma(0, 0) - sigma(1, 1))*(sigma(0, 0) - sigma(1, 1)) + sigma(1, 2));
1259 Solout[0] = antisym(0, 1);
1276 for (
int i = 0; i < S.
Cols(); i++) {
1277 for (
int j = 0; j < S.
Cols(); j++) {
1278 Val += S(i, j) * T(i, j);
1286 template <
typename TVar>
1295 for (
int i = 0; i < S.
size(); i++) {
1305 if (GradU.
Rows() != GradU.
Cols()) {
1312 for (
int i = 0; i < GradU.
Rows(); i++) {
1327 for (
int i = 0; i < data.
phi.
Rows(); i++) {
1335 if (
fabs(axes(2, 0)) >= 1.e-6 ||
fabs(axes(2, 1)) >= 1.e-6) {
1336 cout <<
"TPZMixedElasticityMaterial::Flux only serves for xy configuration\n";
1353 for (
int i = 0; i < dim; i++) {
1354 for (
int j = 0; j < dim; j++) {
1355 sigma(i, j) = data[0].sol[0][j + i * 3];
1357 sigma(i, j) /= x[0];
1363 for (
int i = 0; i < dim; i++) {
1364 for (
int j = 0; j < dim; j++) {
1365 divSigma[i] += data[0].dsol[0](i * 3 + j, j);
1370 for (
int i = 0; i < dim; i++) {
1371 disp[i] = data[1].sol[0][i];
1375 if (logdata->isDebugEnabled())
1377 std::stringstream sout;
1378 sout <<
"DISP*************************** = " << disp << std::endl;
1385 eps_exact(0, 0) = du_exact(0, 0);
1386 eps_exact(1, 0) = eps_exact(0, 1) = 0.5 * (du_exact(0, 1) + du_exact(1, 0));
1387 eps_exact(1, 1) = du_exact(1, 1);
1388 ToVoigt(eps_exact, eps_exactV);
1398 REAL nu = result[1];
1405 STATE rotation = data[2].sol[0][0];
1406 STATE rotationExact = 0.5*(du_exact(1, 0)-du_exact(0, 1));
1411 for (
int i = 0; i < 4; i++) {
1412 if (
abs(eps_again[i] - eps_exactV[i]) > 1.e-8) {
1440 errors[3] = (disp[0] - u_exact[0])*(disp[0] - u_exact[0])+(disp[1] - u_exact[1])*(disp[1] - u_exact[1]);
1457 for (
int i = 0; i < 4; i++) {
1459 errors[0] += (SigmaV[i] - sigma_exactV[i])*(SigmaV[i] - sigma_exactV[i]);
1462 errors[1] += (SigmaV[i] - sigma_exactV[i])*(EPSZV[i] - eps_exactV[i]);
1464 if (errors[1] < 0.) {
1465 std::cout <<
"I should stop \n";
1468 errors[7] = (SigmaV[0] - sigma_exactV[0])*(SigmaV[0] - sigma_exactV[0]);
1474 for(
int i=0; i<
fDimension; i++) divSigmaExact[i] *= -1.;
1477 errors[2] =
pow(divSigma[0]-divSigmaExact[0],2) +
pow(divSigma[1]-divSigmaExact[1],2);
1479 errors[4] =
pow(rotation-rotationExact,2);
1481 errors[5] =
pow(SigmaV[
Exy]-SigmaV[
Eyx],2);
1485 for(
int i=0; i<4; i++)
1487 errors[6] += eps_exactV[i]*sigma_exactV[i];
1539 REAL sigx, sigy, sigxy,
gamma;
1541 du(0, 0) = dudx(0, 0) * axes(0, 0) + dudx(1, 0) * axes(1, 0);
1542 du(1, 0) = dudx(0, 0) * axes(0, 1) + dudx(1, 0) * axes(1, 1);
1543 du(0, 1) = dudx(0, 1) * axes(0, 0) + dudx(1, 1) * axes(1, 0);
1544 du(1, 1) = dudx(0, 1) * axes(0, 1) + dudx(1, 1) * axes(1, 1);
1545 TPZManVector<STATE, 4> deform(4), deformexact(4), stress(4), stressexact(4), deformerror(4), stresserror(4);
1555 REAL nu = result[1];
1563 ToVoigt(du_exact, deformexact);
1566 for (
int i = 0; i < 4; i++) {
1567 deformerror[i] = deform[i] - deformexact[i];
1568 stresserror[i] = stress[i] - stressexact[i];
1572 for (
int i = 0; i < 4; i++) {
1573 values[0] += stresserror[i] * deformerror[i];
1581 for (
int i = 0; i < 2; i++) {
1582 values[i] += (u[i] - u_exact[i])*(u[i] - u_exact[i]);
1587 for (
int i = 0; i < 4; i++) {
1588 values[2] += deformerror[i] * deformerror[i];
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
virtual void FillDataRequirements(TPZMaterialData &data) override
Fill material data parameter with necessary requirements for the.
REAL flambda
first Lame Parameter
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...
TPZFlopCounter atan2(const TPZFlopCounter &val1, const TPZFlopCounter &val2)
Returns the arc tangent in radians and increments the counter of the Arc Tangent. ATAN2 returns the ...
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
REAL fnu
Poison coefficient.
int ClassId() const override
Unique identifier for serialization purposes.
TPZManVector< REAL, 3 > normal
normal to the element at the integration point
STATE Inner(TPZFMatrix< STATE > &S, TPZFMatrix< STATE > &T)
int fNumLoadCases
Defines the number of load cases generated by this material.
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
void FillVecShapeIndex(TPZMaterialData &data)
transform a H1 data structure to a vector data structure
clarg::argBool bc("-bc", "binary checkpoints", false)
bool fAxisSymmetric
flag indicates axix-AxisSymmetric
TPZMixedElasticityMaterial()
Default constructor.
virtual void Identity()
Converts the matrix in an identity matrix.
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
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
MShapeFunctionType fShapeType
REAL fE_const
Elasticity modulus.
TinyFad< 8, T > abs(const TinyFad< 8, T > &in)
TPZAutoPointer< TPZFunction< STATE > > fElasticity
This class implements a simple vector storage scheme for a templated class T. Utility.
virtual void FillBoundaryConditionDataRequirement(int type, TPZMaterialData &data) override
This method defines which parameters need to be initialized in order to compute the contribution of t...
void ElasticityModulusTensor(TPZFMatrix< STATE > &MatrixElast, TElasticityAtPoint &elast)
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
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.
This class implements a two dimensional elastic material in plane stress or strain.
void SetElasticity(REAL E, REAL nu)
Set elasticity parameters.
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
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...
int fPostProcIndex
indicates which solution should be used for post processing
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
int fPlaneStress
Uses plain stress.
static void FromVoigt(TPZVec< STATE > &Svoigt, TPZFMatrix< STATE > &S)
Transform a Voigt notation to a tensor.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
TPZAutoPointer< TPZFunction< STATE > > & ForcingFunction()
Returns a procedure as source function for the material.
STATE Tr(TPZFMatrix< REAL > &GradU)
int64_t size() const
Returns the number of elements of the vector.
virtual int NSolutionVariables(int var) override
int Dimension() const override
Returns the model dimension.
REAL flambda_const
first Lame Parameter
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual int ClassId() const override
Unique identifier for serialization purposes.
void ComputeDivergenceOnDeformed(TPZVec< TPZMaterialData > &datavec, TPZFMatrix< STATE > &DivergenceofPhi)
virtual void Write(const bool val)
TPZFMatrix< STATE > fMatrixA
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZFNMatrix< 180 > fNormalVec
list of normal vectors
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
This class defines the boundary condition for TPZMaterial objects.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Calculates the element stiffness matrix.
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()
int fDimension
dimension of the material
void ComputeDeformationVector(TPZVec< STATE > &PhiStress, TPZVec< STATE > &APhiStress, TElasticityAtPoint &elastb)
virtual ~TPZMixedElasticityMaterial()
Default destructor.
virtual int HasForcingFunction()
Directive that gives true if the material has a forcing function.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
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.
static REAL angle
Angle in radians to test.
REAL fE
Elasticity modulus.
Contains the TPZMatWithMem class which implements the memory features.
virtual void ContributeBC(TPZVec< TPZMaterialData > &datavec, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Applies the element boundary conditions Mixed.
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.
virtual std::string Name() override
Returns the material name.
virtual int NEvalErrors() override
Returns the number of norm errors. Default is 3: energy, L2 and H1.
Contains the TPZMixedElasticityMaterial class which implements a two dimensional elastic material in ...
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.
virtual void Multiply(const TPZFMatrix< TVar > &A, TPZFMatrix< TVar > &res, int opt=0) const
It mutiplies itself by TPZMatrix<TVar>A putting the result in res.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
static void ToVoigt(TPZFMatrix< STATE > &S, TPZVec< STATE > &Svoigt)
Transform a tensor to a Voigt notation.
REAL fmu_const
Second Lame Parameter.
int NumLoadCases()
returns the number of load cases for this material object
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
void ComputeStressVector(TPZVec< STATE > &Deformation, TPZVec< STATE > &Stress, TElasticityAtPoint &elast)
int64_t Cols() const
Returns number of cols.
virtual void Print(std::ostream &out) const
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
TVar InnerVec(const TPZVec< TVar > &S, const TPZVec< TVar > &T)
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
REAL fmu
Second Lame Parameter.
REAL fnu_const
Poison coefficient.
virtual void Print(std::ostream &out=std::cout) override
Print the material data.
TPZManVector< std::pair< int, int64_t > > fVecShapeIndex
correspondence between normal vector index and index of the shape functions
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
void Transpose(TPZMatrix< TVar > *const T) const override
It makes *T the transpose of current matrix.
virtual int VariableIndex(const std::string &name) override
TPZManVector< REAL, 3 > fForce
Forcing vector.
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)