22 STATE preStressXX, STATE preStressYY, STATE preStressZZ) :
24 TPZMaterial(nummat),fFy(0.),fFrictionAngle(0.),fCohesion(0.),fPlasticPostProc(ENonePlasticProc)
29 if (force.
NElements() != 3)
PZError << __PRETTY_FUNCTION__ <<
" - error!" << std::endl;
33 for(i = 0; i < 3; i++) this->
fForce[i] = force[i];
78 out <<
"\nTPZElasticity3D material:\n";
79 out <<
"\tfE = " << this->
fE << std::endl;
80 out <<
"\tfPoisson = " << this->
fPoisson << std::endl;
81 out <<
"\tfForce = " << this->
fForce << std::endl;
83 out <<
"\tBase class print\n";
85 out <<
"End of TPZElasticity3D::Print\n";
106 const int phr = phi.
Rows();
113 const REAL E = this->
fE;
115 const REAL
C1 = E / (2.+ 2.*nu);
116 const REAL
C2 = E * nu / (-1. + nu + 2.*nu*nu);
117 const REAL
C3 = E * (nu - 1.) / (-1. + nu +2. * nu * nu);
120 for(in = 0; in < phr; in++)
123 for(kd = 0; kd < 3; kd++)
125 ef(in*3+kd, 0) += weight * ( locForce[kd] * phi(in,0) -
fPreStress[kd] * dphi(kd,in) );
128 for(
int jn = 0; jn < phr; jn++ )
131 for(
int ud = 0; ud < 3; ud++)
133 for(
int vd = 0; vd < 3; vd++)
135 Deriv(vd,ud) = dphi(vd,in)*dphi(ud,jn);
140 val = ( Deriv(1,1) + Deriv(2,2) ) * C1 + Deriv(0,0) *
C3;
141 ek(in*3+0,jn*3+0) += weight *
val;
143 val = Deriv(1,0) * C1 - Deriv(0,1) *
C2;
144 ek(in*3+0,jn*3+1) += weight *
val;
146 val = Deriv(2,0) * C1 - Deriv(0,2) *
C2;
147 ek(in*3+0,jn*3+2) += weight *
val;
150 val = Deriv(0,1) * C1 - Deriv(1,0) *
C2;
151 ek(in*3+1,jn*3+0) += weight *
val;
153 val = ( Deriv(0,0) + Deriv(2,2) ) * C1 + Deriv(1,1) *
C3;
154 ek(in*3+1,jn*3+1) += weight *
val;
156 val = Deriv(2,1) * C1 - Deriv(1,2) *
C2;
157 ek(in*3+1,jn*3+2) += weight *
val;
160 val = Deriv(0,2) * C1 - Deriv(2,0) *
C2;
161 ek(in*3+2,jn*3+0) += weight *
val;
163 val = Deriv(1,2) * C1 - Deriv(2,1) *
C2;
164 ek(in*3+2,jn*3+1) += weight *
val;
166 val = ( Deriv(0,0) + Deriv(1,1) ) * C1 + Deriv(2,2) *
C3;
167 ek(in*3+2,jn*3+2) += weight *
val;
175 for(
int jn = 0; jn < phr; jn++)
178 for(kd = 0; kd < 3; kd++)
180 ef(jn*3+kd, 0) += weight * ( locForce[kd] * phi(jn,0) -
fPreStress[kd] * dphi(kd,jn) );
182 for(
int in = 0; in < phr; in++ )
185 for(
int ud = 0; ud < 3; ud++)
187 for(
int vd = 0; vd < 3; vd++)
189 Deriv[vd][ud] = dphi(vd,in)*dphi(ud,jn);
194 STATE *ptr1 = &ek(in*3,jn*3);
195 *ptr1++ += weight * (( Deriv[1][1] + Deriv[2][2] ) * C1 + Deriv[0][0] * C3);
198 *ptr1++ += weight * (Deriv[0][1] * C1 - Deriv[1][0] *
C2);
201 *ptr1 += weight * (Deriv[0][2] * C1 - Deriv[2][0] *
C2);
203 STATE *ptr2 = &ek(in*3+0, jn*3+1);
204 *ptr2++ += weight * (Deriv[1][0] * C1 - Deriv[0][1] *
C2);
206 *ptr2++ += weight * (( Deriv[0][0] + Deriv[2][2] ) * C1 + Deriv[1][1] * C3);
208 *ptr2 += weight * (Deriv[1][2] * C1 - Deriv[2][1] *
C2);
210 STATE *ptr3 = &ek(in*3+0, jn*3+2);
211 *ptr3++ += weight * (Deriv[2][0] * C1 - Deriv[0][2] *
C2);
213 *ptr3++ += weight * (Deriv[2][1] * C1 - Deriv[1][2] *
C2);
215 *ptr3 += weight * (( Deriv[0][0] + Deriv[1][1] ) * C1 + Deriv[2][2] * C3);
223 for(
int jn = 0; jn < phr; jn++)
227 for(kd = 0; kd < 3; kd++)
229 dphij[kd] = dphi(kd,jn);
230 ef(jn*3+kd, 0) += weight * ( locForce[kd] * phi(jn,0) -
fPreStress[kd] * dphi(kd,jn) );
232 for(
int in = 0; in < phr; in++ )
236 for(
int ud = 0; ud < 3; ud++)
238 for(
int vd = 0; vd < 3; vd++)
240 Deriv[vd][ud] = dphi(vd,in)*dphij[ud];
245 STATE *ptr1 = &ek(in*3,jn*3);
246 STATE *ptr2 = &ek(in*3+0, jn*3+1);
247 STATE *ptr3 = &ek(in*3+0, jn*3+2);
248 ptr1[0] += weight * (( Deriv[1][1] + Deriv[2][2] ) * C1 + Deriv[0][0] * C3);
251 ptr1[1] += weight * (Deriv[0][1] * C1 - Deriv[1][0] *
C2);
254 ptr1[2] += weight * (Deriv[0][2] * C1 - Deriv[2][0] *
C2);
256 ptr2[0] += weight * (Deriv[1][0] * C1 - Deriv[0][1] *
C2);
258 ptr2[1] += weight * (( Deriv[0][0] + Deriv[2][2] ) * C1 + Deriv[1][1] * C3);
260 ptr2[2] += weight * (Deriv[1][2] * C1 - Deriv[2][1] *
C2);
262 ptr3[0] += weight * (Deriv[2][0] * C1 - Deriv[0][2] *
C2);
264 ptr3[1] += weight * (Deriv[2][1] * C1 - Deriv[1][2] *
C2);
266 ptr3[2] += weight * (( Deriv[0][0] + Deriv[1][1] ) * C1 + Deriv[2][2] * C3);
274 for(
int jn = 0; jn < phr; jn++)
278 for(kd = 0; kd < 3; kd++)
280 dphij[kd] = dphi(kd,jn);
281 ef(jn*3+kd, 0) += weight * ( locForce[kd] * phi(jn,0) -
fPreStress[kd] * dphi(kd,jn) );
284 const int stride = 3;
285 int phmax = (phr/stride)*stride;
287 for(in = 0; in < phmax; in+=stride )
289 REAL Deriv[3*stride][3];
291 for(
int ud = 0; ud < 3; ud++)
293 for (
int istr=0; istr<stride; istr++)
295 for(
int vd = 0; vd < 3; vd++)
297 Deriv[vd+istr*stride][ud] = dphi(vd,in+istr)*dphij[ud];
303 STATE *ptr1 = &ek(in*3,jn*3);
304 STATE *ptr2 = &ek(in*3+0, jn*3+1);
305 STATE *ptr3 = &ek(in*3+0, jn*3+2);
306 ptr1[0] += weight * (( Deriv[1][1] + Deriv[2][2] ) * C1 + Deriv[0][0] * C3);
307 ptr1[1] += weight * (Deriv[0][1] * C1 - Deriv[1][0] *
C2);
308 ptr1[2] += weight * (Deriv[0][2] * C1 - Deriv[2][0] *
C2);
309 ptr2[0] += weight * (Deriv[1][0] * C1 - Deriv[0][1] *
C2);
310 ptr2[1] += weight * (( Deriv[0][0] + Deriv[2][2] ) * C1 + Deriv[1][1] * C3);
311 ptr2[2] += weight * (Deriv[1][2] * C1 - Deriv[2][1] *
C2);
312 ptr3[0] += weight * (Deriv[2][0] * C1 - Deriv[0][2] *
C2);
313 ptr3[1] += weight * (Deriv[2][1] * C1 - Deriv[1][2] *
C2);
314 ptr3[2] += weight * (( Deriv[0][0] + Deriv[1][1] ) * C1 + Deriv[2][2] * C3);
316 ptr1[0+add1] += weight * (( Deriv[1+add1][1] + Deriv[2+add1][2] ) * C1 + Deriv[0+add1][0] * C3);
317 ptr1[1+add1] += weight * (Deriv[0+add1][1] * C1 - Deriv[1+add1][0] *
C2);
318 ptr1[2+add1] += weight * (Deriv[0+add1][2] * C1 - Deriv[2+add1][0] *
C2);
319 ptr2[0+add1] += weight * (Deriv[1+add1][0] * C1 - Deriv[0+add1][1] *
C2);
320 ptr2[1+add1] += weight * (( Deriv[0+add1][0] + Deriv[2+add1][2] ) * C1 + Deriv[1+add1][1] * C3);
321 ptr2[2+add1] += weight * (Deriv[1+add1][2] * C1 - Deriv[2+add1][1] *
C2);
322 ptr3[0+add1] += weight * (Deriv[2+add1][0] * C1 - Deriv[0+add1][2] *
C2);
323 ptr3[1+add1] += weight * (Deriv[2+add1][1] * C1 - Deriv[1+add1][2] *
C2);
324 ptr3[2+add1] += weight * (( Deriv[0+add1][0] + Deriv[1+add1][1] ) * C1 + Deriv[2+add1][2] * C3);
326 ptr1[0+add2] += weight * (( Deriv[1+add2][1] + Deriv[2+add2][2] ) * C1 + Deriv[0+add2][0] * C3);
327 ptr1[1+add2] += weight * (Deriv[0+add2][1] * C1 - Deriv[1+add2][0] *
C2);
328 ptr1[2+add2] += weight * (Deriv[0+add2][2] * C1 - Deriv[2+add2][0] *
C2);
329 ptr2[0+add2] += weight * (Deriv[1+add2][0] * C1 - Deriv[0+add2][1] *
C2);
330 ptr2[1+add2] += weight * (( Deriv[0+add2][0] + Deriv[2+add2][2] ) * C1 + Deriv[1+add2][1] * C3);
331 ptr2[2+add2] += weight * (Deriv[1+add2][2] * C1 - Deriv[2+add2][1] *
C2);
332 ptr3[0+add2] += weight * (Deriv[2+add2][0] * C1 - Deriv[0+add2][2] *
C2);
333 ptr3[1+add2] += weight * (Deriv[2+add2][1] * C1 - Deriv[1+add2][2] *
C2);
334 ptr3[2+add2] += weight * (( Deriv[0+add2][0] + Deriv[1+add2][1] ) * C1 + Deriv[2+add2][2] * C3);
336 for(; in < phr; in++ )
340 for(
int ud = 0; ud < 3; ud++)
342 for(
int vd = 0; vd < 3; vd++)
344 Deriv[vd][ud] = dphi(vd,in)*dphij[ud];
349 STATE *ptr1 = &ek(in*3,jn*3);
350 STATE *ptr2 = &ek(in*3+0, jn*3+1);
351 STATE *ptr3 = &ek(in*3+0, jn*3+2);
352 ptr1[0] += weight * (( Deriv[1][1] + Deriv[2][2] ) * C1 + Deriv[0][0] * C3);
355 ptr1[1] += weight * (Deriv[0][1] * C1 - Deriv[1][0] *
C2);
358 ptr1[2] += weight * (Deriv[0][2] * C1 - Deriv[2][0] *
C2);
360 ptr2[0] += weight * (Deriv[1][0] * C1 - Deriv[0][1] *
C2);
362 ptr2[1] += weight * (( Deriv[0][0] + Deriv[2][2] ) * C1 + Deriv[1][1] * C3);
364 ptr2[2] += weight * (Deriv[1][2] * C1 - Deriv[2][1] *
C2);
366 ptr3[0] += weight * (Deriv[2][0] * C1 - Deriv[0][2] *
C2);
368 ptr3[1] += weight * (Deriv[2][1] * C1 - Deriv[1][2] *
C2);
370 ptr3[2] += weight * (( Deriv[0][0] + Deriv[1][1] ) * C1 + Deriv[2][2] * C3);
379 int64_t nphi = data.
phi.
Rows();
380 for (int64_t iph=0; iph<nphi; iph++) {
381 BMatrix(0,3*iph) = data.
dphix(0,iph);
382 BMatrix(1,3*iph+1) = data.
dphix(1,iph);
383 BMatrix(2,3*iph+2) = data.
dphix(2,iph);
384 BMatrix(3,3*iph) = data.
dphix(1,iph);
385 BMatrix(3,3*iph+1) = data.
dphix(0,iph);
386 BMatrix(4,3*iph) = data.
dphix(2,iph);
387 BMatrix(4,3*iph+2) = data.
dphix(0,iph);
388 BMatrix(5,3*iph+1) = data.
dphix(2,iph);
389 BMatrix(5,3*iph+2) = data.
dphix(1,iph);
408 #if !defined CODE0 && !defined CODE1 && !defined CODE2 && !defined CODE3 412 if ( !ek.
VerifySymmetry( 1.e-8 ) )
PZError << __PRETTY_FUNCTION__ <<
"\nERROR - NON SYMMETRIC MATRIX" << std::endl;
422 int phc = phi.
Cols();
430 locForce[0] = res[0];
431 locForce[1] = res[1];
432 locForce[2] = res[2];
435 REAL dvxdx, dvxdy, dvxdz;
436 REAL dvydx, dvydy, dvydz;
437 REAL dvzdx, dvzdy, dvzdz;
439 REAL duxdx, duxdy, duxdz;
440 REAL duydx, duydy, duydz;
441 REAL duzdx, duzdy, duzdz;
449 for(
int in = 0; in < phc; in++ )
466 for (
int col = 0; col < efc; col++)
468 ef(in,col) += weight*( locForce[0] * phi(0, in)
469 + locForce[1] * phi(1, in)
470 + locForce[2] * phi(2, in)
475 for(
int jn = 0; jn < phc; jn++ )
492 REAL eq1 = duydy*dvxdx*lambda + duzdz*dvxdx*lambda + duxdy*dvydx*mu +
493 duydx*dvydx*mu + duxdz*dvzdx*mu + duzdx*dvzdx*mu +
494 duxdx*dvxdx*(lambda + 2.*mu);
496 REAL eq2 = duxdx*dvydy*lambda + duzdz*dvydy*lambda + duxdy*dvxdy*mu +
497 duydx*dvxdy*mu + duydz*dvzdy*mu + duzdy*dvzdy*mu +
498 duydy*dvydy*(lambda + 2.*mu);
500 REAL eq3 = duxdx*dvzdz*lambda + duydy*dvzdz*lambda + duxdz*dvxdz*mu +
501 duzdx*dvxdz*mu + duydz*dvydz*mu + duzdy*dvydz*mu +
502 duzdz*dvzdz*(lambda + 2.*mu);
504 ek(in,jn) += weight * (eq1 + eq2 + eq3);
516 int phc = phi.
Cols();
523 for(in = 0 ; in < phc; in++)
528 ef(in,il) += weight * BIGNUMBER * ( v2(0,il)*phi(0,in) + v2(1,il)*phi(1,in) + v2(2,il)*phi(2,in) );
530 for (jn = 0 ; jn < phc; jn++)
532 ek(in,jn) += weight * BIGNUMBER * ( phi(0,in)*phi(0,jn) + phi(1,in)*phi(1,jn) + phi(2,in)*phi(2,jn) );
539 for (in = 0; in < phc; in++)
544 ef(in,il) += weight * ( v2(0,il)*phi(0,in) + v2(1,il)*phi(1,in) + v2(2,il)*phi(2,in) );
551 for(in = 0 ; in < phc; in++)
556 ef(in,il)+= weight * ( v2(0,il)*phi(0,in) + v2(1,il)*phi(1,in) + v2(2,il)*phi(2,in) );
559 for (jn = 0; jn <phc; jn++)
562 ek(in,jn) += bc.
Val1()(0,0)*phi(0,in)*phi(0,jn)*weight
564 + bc.
Val1()(1,0)*phi(1,in)*phi(0,jn)*weight
566 + bc.
Val1()(2,0)*phi(2,in)*phi(0,jn)*weight
569 + bc.
Val1()(0,1)*phi(0,in)*phi(1,jn)*weight
571 + bc.
Val1()(1,1)*phi(1,in)*phi(1,jn)*weight
573 + bc.
Val1()(2,1)*phi(2,in)*phi(1,jn)*weight
576 + bc.
Val1()(0,2)*phi(0,in)*phi(2,jn)*weight
578 + bc.
Val1()(1,2)*phi(1,in)*phi(2,jn)*weight
580 + bc.
Val1()(2,2)*phi(2,in)*phi(2,jn)*weight;
587 for(in = 0 ; in < phc; in++)
592 for (jn = 0 ; jn < phc; jn++)
594 ek(in,jn) += weight * BIGNUMBER * ( v2(0,il)*phi(0,in)*phi(0,jn) + v2(1,il)*phi(1,in)*phi(1,jn) + v2(2,il)*phi(2,in)*phi(2,jn) );
606 PZError <<
"TPZElastitity3D::ContributeBC error - Wrong boundary condition type" << std::endl;
626 const STATE BIGNUMBER = 1.e12;
628 const int phr = phi.
Rows();
636 val2loc(0,0) = val2vec[0];
637 val2loc(1,0) = val2vec[1];
638 val2loc(2,0) = val2vec[2];
643 for (
int i=0; i<3; i++) {
645 for (
int j=0; j<3; j++) {
646 val2loc(i,0) += val1loc(i,j)*val2vec[j];
652 for (
int i=0; i<3; i++) {
654 for (
int j=0; j<3; j++) {
655 val2loc(i,0) += val1loc(i,j)*data.
normal[j];
662 int numbersol = data.
sol.
size();
663 if (numbersol != 1) {
669 for(in = 0 ; in < phr; in++) {
670 ef(3*in+0,0) += BIGNUMBER * val2loc(0,0) * phi(in,0) * weight;
671 ef(3*in+1,0) += BIGNUMBER * val2loc(1,0) * phi(in,0) * weight;
672 ef(3*in+2,0) += BIGNUMBER * val2loc(2,0) * phi(in,0) * weight;
674 for (jn = 0 ; jn < phr; jn++) {
675 ek(3*in+0,3*jn+0) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
676 ek(3*in+1,3*jn+1) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
677 ek(3*in+2,3*jn+2) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
683 for(in = 0 ; in < phi.
Rows(); in++) {
684 ef(3*in+0,0) += val2loc(0,0) * phi(in,0) * weight;
685 ef(3*in+1,0) += val2loc(1,0) * phi(in,0) * weight;
686 ef(3*in+2,0) += val2loc(2,0) * phi(in,0) * weight;
690 for(in = 0 ; in < phi.
Rows(); in++) {
691 ef(3*in+0,0) += val2loc(0,0) * phi(in,0) * weight;
692 ef(3*in+1,0) += val2loc(1,0) * phi(in,0) * weight;
693 ef(3*in+2,0) += val2loc(2,0) * phi(in,0) * weight;
694 for(jn=0; jn<phi.
Rows(); jn++)
696 for(idf=0; idf<3; idf++)
for(jdf=0; jdf<3; jdf++)
698 ek(3*in+idf,3*jn+jdf) += val1loc(idf,jdf)*weight*phi(in,0)*phi(jn,0);
704 for(in = 0 ; in < phr; in++) {
705 for (jn = 0 ; jn < phr; jn++) {
706 ek(3*in+0,3*jn+0) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight * val2loc(0,0);
707 ek(3*in+1,3*jn+1) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight * val2loc(1,0);
708 ek(3*in+2,3*jn+2) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight * val2loc(2,0);
714 for(in = 0; in < 3; in ++)
715 val2loc(in,0) = - ( val1loc(in,0) * data.
normal[0] +
716 val1loc(in,1) * data.
normal[1] +
717 val1loc(in,2) * data.
normal[2] );
720 for(in = 0 ; in < phi.
Rows(); in++) {
721 ef(3*in+0,0) += val2loc(0,0) * phi(in,0) * weight;
722 ef(3*in+1,0) += val2loc(1,0) * phi(in,0) * weight;
723 ef(3*in+2,0) += val2loc(2,0) * phi(in,0) * weight;
729 for(in = 0 ; in < phr; in++) {
730 ef(3*in+0,0) += BIGNUMBER * val2loc(0,0) * phi(in,0) * weight;
732 for (jn = 0 ; jn < phr; jn++) {
733 ek(3*in+0,3*jn+0) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
738 for(in = 0 ; in < phr; in++) {
739 ef(3*in+1,0) += BIGNUMBER * val2loc(1,0) * phi(in,0) * weight;
741 for (jn = 0 ; jn < phr; jn++) {
742 ek(3*in+1,3*jn+1) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
747 for(in = 0 ; in < phr; in++) {
748 ef(3*in+2,0) += BIGNUMBER * val2loc(2,0) * phi(in,0) * weight;
750 for (jn = 0 ; jn < phr; jn++) {
751 ek(3*in+2,3*jn+2) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
756 for(in = 0 ; in < phr; in++) {
757 ef(3*in+0,0) += BIGNUMBER * val2loc(0,0) * phi(in,0) * weight;
758 ef(3*in+2,0) += BIGNUMBER * val2loc(2,0) * phi(in,0) * weight;
760 for (jn = 0 ; jn < phr; jn++) {
761 ek(3*in+0,3*jn+0) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
762 ek(3*in+2,3*jn+2) += BIGNUMBER * phi(in,0) * phi(jn,0) * weight;
767 PZError <<
"TPZElastitity3D::ContributeBC error - Wrong boundary condition type" << std::endl;
837 for(i = 0; i < 3; i++){
873 int64_t numiterations = 1000;
878 for (
int i=0; i<eigv.
size(); i++) {
882 if (result ==
false){
883 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! - result = false - numiterations = " << numiterations <<
" - tol = " << tol << std::endl;
892 int64_t numiterations = 1000;
896 Solout[0] = PrincipalStress[0];
898 if (result ==
false){
899 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! - result = false - numiterations = " << numiterations <<
" - tol = " << tol << std::endl;
908 int64_t numiterations = 1000;
913 for (
int i=0; i<eigv.
size(); i++) {
917 if (result ==
false){
918 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! - result = false - numiterations = " << numiterations <<
" - tol = " << tol << std::endl;
927 int64_t numiterations = 1000;
931 Solout[0] = PrincipalStrain[0];
933 if (result ==
false){
934 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! - result = false - numiterations = " << numiterations <<
" - tol = " << tol << std::endl;
942 for (
int i=0; i<eigvec.
size(); i++) {
943 Solout[i] = eigvec[i];
949 for (
int i=0; i<eigvec.
size(); i++) {
950 Solout[i] = eigvec[i];
956 for (
int i=0; i<eigvec.
size(); i++) {
957 Solout[i] = eigvec[i];
966 int64_t numiterations = 1000;
971 if (result ==
false){
972 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! - result = false - numiterations = " << numiterations <<
" - tol = " << tol << std::endl;
977 Solout[0] = ( PrincipalStress[0] - PrincipalStress[1] ) * ( PrincipalStress[0] - PrincipalStress[1] )
978 + ( PrincipalStress[1] - PrincipalStress[2] ) * ( PrincipalStress[1] - PrincipalStress[2] )
979 + ( PrincipalStress[2] - PrincipalStress[0] ) * ( PrincipalStress[2] - PrincipalStress[0] );
980 Solout[0] = Solout[0] / (2. * this->
fFy * this->
fFy);
988 for (
int i=0; i<eigvec.
size(); i++) {
989 Solout[i] = eigvec[i];
999 for (
int i=0; i<eigvec.
size(); i++) {
1000 Solout[i] = eigvec[i];
1008 Solout[0] = Stress(0,0);
1009 Solout[1] = Stress(1,0);
1010 Solout[2] = Stress(2,0);
1017 Solout[0] = Strain(0,0);
1018 Solout[1] = Strain(1,0);
1019 Solout[2] = Strain(2,0);
1026 Solout[0] = Stress(0,0);
1033 Solout[0] = Stress(1,1);
1040 Solout[0] = Stress(2,2);
1047 Solout[0] = Stress(0,0) + Stress(1,1) + Stress(2,2);
1056 Solout[0] = -(Stress(0,1)*Stress(1,0)) - Stress(0,2)*Stress(2,0) - Stress(1,2)*Stress(2,1) +
1057 Stress(1,1)*Stress(2,2) + Stress(0,0)*(Stress(1,1) + Stress(2,2));
1065 Solout[0] = -(Stress(0,2)*Stress(1,1)*Stress(2,0)) + Stress(0,1)*Stress(1,2)*Stress(2,0) +
1066 Stress(0,2)*Stress(1,0)*Stress(2,1) - Stress(0,0)*Stress(1,2)*Stress(2,1) -
1067 Stress(0,1)*Stress(1,0)*Stress(2,2) + Stress(0,0)*Stress(1,1)*Stress(2,2);
1082 for(i = 0; i < 3; i++) L2 += (u[i] - u_exact[i]) * (u[i] - u_exact[i]);
1086 for(i = 0; i < 3; i++)
for(j = 0; j < 3; j++) SemiH1 += (dudx(i,j) - du_exact(i,j)) * (dudx(i,j) - du_exact(i,j));
1089 for (
int i=0; i<3; i++) {
1090 for (
int j=0; j<3; j++) {
1091 diffdsol(i,j) = dudx(i,j)-du_exact(i,j);
1097 for (
int i=0; i<3; i++) {
1098 for (
int j=0; j<3; j++) {
1099 energy += diffdsol(i,j)*diffstress(i,j);
1117 Strain(0,0) = DSol(0,0);
1118 Strain(0,1) = 0.5 * ( DSol(1,0) + DSol(0,1) );
1119 Strain(0,2) = 0.5 * ( DSol(2,0) + DSol(0,2) );
1120 Strain(1,0) = Strain(0,1);
1121 Strain(1,1) = DSol(1,1);
1122 Strain(1,2) = 0.5 * ( DSol(2,1) + DSol(1,2) );
1123 Strain(2,0) = Strain(0,2);
1124 Strain(2,1) = Strain(1,2);
1125 Strain(2,2) = DSol(2,2);
1137 Stress(0,0) = Vec(0,0);
1138 Stress(0,1) = Vec(3,0);
1139 Stress(0,2) = Vec(4,0);
1140 Stress(1,0) = Vec(3,0);
1141 Stress(1,1) = Vec(1,0);
1142 Stress(1,2) = Vec(5,0);
1143 Stress(2,0) = Vec(4,0);
1144 Stress(2,1) = Vec(5,0);
1145 Stress(2,2) = Vec(2,0);
1150 Strain(0,0) = DSol(0,0);
1151 Strain(1,0) = DSol(1,1);
1152 Strain(2,0) = DSol(2,2);
1153 Strain(3,0) = 0.5 * ( DSol(1,0) + DSol(0,1) );
1154 Strain(4,0) = 0.5 * ( DSol(2,0) + DSol(0,2) );
1155 Strain(5,0) = 0.5 * ( DSol(2,1) + DSol(1,2) );
1159 REAL const1 = -1. + this->
fPoisson;
1161 const REAL E = this->
fE;
1164 Stress(0,0) = E * ( DSol(0,0) * const1 - ( DSol(1,1) + DSol(2,2) ) * ni ) / const2 +
fPreStress[0];
1165 Stress(1,0) = E * ( DSol(1,1) * const1 - ( DSol(0,0) + DSol(2,2) ) * ni ) / const2 + fPreStress[1];
1166 Stress(2,0) = E * ( DSol(2,2) * const1 - ( DSol(0,0) + DSol(1,1) ) * ni ) / const2 + fPreStress[2];
1168 REAL const3 = 2. * ( 1. + ni );
1169 Stress(3,0) = E * ( DSol(1,0) + DSol(0,1) ) / const3;
1170 Stress(4,0) = E * ( DSol(2,0) + DSol(0,2) ) / const3;
1171 Stress(5,0) = E * ( DSol(2,1) + DSol(1,2) ) / const3;
1177 Out[0] = Dir[0] * StrVec(0,0) + Dir[1] * StrVec(3,0) + Dir[2] * StrVec(4,0);
1178 Out[1] = Dir[1] * StrVec(1,0) + Dir[0] * StrVec(3,0) + Dir[2] * StrVec(5,0);
1179 Out[2] = Dir[2] * StrVec(2,0) + Dir[0] * StrVec(4,0) + Dir[1] * StrVec(5,0);
1189 int64_t numiterations = 1000;
1194 if (result ==
false){
1195 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! - result = false - numiterations = " << numiterations <<
" - tol = " << tol << std::endl;
1199 for(
int i = 0; i < 3; i++) Solout[i] = Eigenvectors(direction,i);
1204 I1 = A(0,0)+A(1,1)+A(2,2);
1205 I2 = A(0,0)*A(1,1)-A(1,0)*A(0,1) + A(1,1)*A(2,2)-A(2,1)*A(1,2) + A(0,0)*A(2,2) - A(2,0)*A(0,2);
1206 I3 = A(0,0)*A(1,1)*A(2,2) + A(2,0)*A(0,1)*A(1,2) + A(1,0)*A(2,1)*A(0,2) - ( A(2,0)*A(1,1)*A(0,2) + A(1,0)*A(0,1)*A(2,2) + A(2,1)*A(1,2)*A(0,0) );
1211 p = (A(0,0)+A(1,1)+A(2,2))/3.;
1213 for(
int i = 0; i < 3; i++) Deviator(i,i) -= p;
1235 if(val < -1.) val = -1.;
1236 if(val > +1) val = +1.;
1237 const STATE theta = 1./3.*
asin(val);
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
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.
virtual bool SolveEigenvaluesJacobi(int64_t &numiterations, REAL &tol, TPZVec< TVar > *Sort=0)
Transforms this matrix in a diagonal matrix, where the diagonal values are its eigenvalues. This method is efficient only for small matrices.
void ComputeStrainVector(TPZFMatrix< STATE > &Strain, TPZFMatrix< STATE > &DSol) const
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 fFy
Yeilding stress for von mises post processing.
TPZManVector< REAL, 3 > normal
normal to the element at the integration point
int fNumLoadCases
Defines the number of load cases generated by this material.
void PrincipalDirection(TPZFMatrix< STATE > &DSol, TPZVec< STATE > &Solout, int direction) const
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
virtual void ContributeVecShapeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc)
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
Post-processing method. Based on solution Sol and its derivatives DSol, it computes the post-processe...
virtual bool SolveEigensystemJacobi(int64_t &numiterations, REAL &tol, TPZVec< TVar > &Eigenvalues, TPZFMatrix< TVar > &Eigenvectors) const
Compute Eigenvalues and Eigenvectors of this matrix. This method is efficient only for small matrice...
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
This class implements a 3D isotropic elasticity material.
PLASTICPOSTPROC fPlasticPostProc
Plastic model for post-processing.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point...
virtual void ContributeVecShape(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
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
void ApplyDirection(TPZFMatrix< STATE > &StrVec, TPZVec< STATE > &Out) const
REAL val(STATE &number)
Returns value of the variable.
void Invariants(TPZFMatrix< STATE > &A, STATE &I1, STATE &I2, STATE &I3) const
virtual void ComputeStressTensor(TPZFMatrix< STATE > &Stress, TPZMaterialData &data) const
void StressDecomposition(TPZFMatrix< STATE > &StressTensor, TPZFMatrix< STATE > &Deviator, STATE &p) const
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
REAL fFrictionAngle
Mohr-Coulomb parameters.
TPZFMatrix< STATE > & Val2(int loadcase=0)
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
virtual int ClassId() const override
Define the class id associated with the class.
Contains the TPZElasticity3D class which implements a 3D isotropic elasticity material.
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.
This abstract class defines the behaviour which each derived class needs to implement.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Implements Dirichlet and Neumann boundary conditions.
TPZAutoPointer< TPZFunction< STATE > > & ForcingFunction()
Returns a procedure as source function for the material.
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...
virtual void Print(std::ostream &out) override
Print material report.
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
TPZManVector< REAL, 3 > fPostProcessDirection
Direction to compute stress and strain.
TPZManVector< REAL > fPreStress
virtual void Write(const bool val)
virtual ~TPZElasticity3D()
Default destructor.
void FillDataRequirements(TPZMaterialData &data) override
Fill material data parameter with necessary requirements for the Contribute method.
Contains TPZMatrixclass which implements full matrix (using column major representation).
virtual void FillDataRequirements(TPZMaterialData &data)
Fill material data parameter with necessary requirements for the.
#define DebugStop()
Returns a message to user put a breakpoint in.
This class defines the boundary condition for TPZMaterial objects.
Free store vector implementation.
int64_t Rows() const
Returns number of rows.
STATE MohrCoulombPlasticFunction(TPZFMatrix< STATE > &StressTensor) const
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 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)
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
void ComputeStrainTensor(TPZFMatrix< STATE > &Strain, TPZFMatrix< STATE > &DSol) const
Contains TPZMatrix<TVar>class, root matrix class.
virtual void ComputeStressVector(TPZFMatrix< STATE > &Stress, TPZFMatrix< STATE > &DSol) const
int ClassId() const override
Unique identifier for serialization purposes.
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 int VerifySymmetry(REAL tol=1.e-13) const
Checks if current matrix value is symmetric.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
STATE fPoisson
Poisson's ratio.
expr_ expr_ expr_ expr_ expr_ expr_ asin
void Fill(const T ©, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
TPZManVector< STATE, 3 > fForce
External forces.
int64_t Cols() const
Returns number of cols.
Defines the interface for saving and reading data. Persistency.
STATE fE
Young's modulus.
int64_t NElements() const
Returns the number of elements of the vector.
virtual 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
Evaluate error between approximate (FEM) and exact solutions.
STATE VonMisesPlasticFunction(TPZFMatrix< STATE > &StressTensor) const
virtual int VariableIndex(const std::string &name) override
Returns index of post-processing variable.
TPZElasticity3D()
Default constructor.
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
virtual int NSolutionVariables(int var) override
Number of data of variable var.
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)