51StressVector :: computeDeviatoricVolumetricSplit(
StressVector &dev,
double &vol)
const
55 if ( myMode == _1dMat ) {
60 }
else if ( myMode == _PlaneStress ) {
70 vol = ( this->
at(1) + this->
at(2) + this->
at(3) ) / 3.0;
78StressVector :: computeDeviatoricVolumetricSum(
StressVector &answer,
double vol)
const
82 if ( myMode == _1dMat ) {
87 }
else if ( myMode == _PlaneStress ) {
97 for (
int i = 0; i < 3; i++ ) {
104StressVector :: computePrincipalValues(
FloatArray &answer)
const
113 if ( myMode == _1dMat ) {
115 }
else if ( myMode == _PlaneStress ) {
120 ast = this->
at(1) + this->
at(2);
121 dst = this->
at(1) - this->
at(2);
122 D = std::sqrt( dst * dst + 4.0 * this->
at(3) * this->
at(3) );
123 answer.
at(1) = 0.5 * ( ast + D );
124 answer.
at(2) = 0.5 * ( ast - D );
127 double I1 = 0.0, I2 = 0.0, I3 = 0.0, s1, s2, s3;
132 for (
int i = 1; i <=
size; i++ ) {
133 if ( fabs( s.
at(i) ) > 1.e-20 ) {
140 if ( nonzeroFlag == 0 ) {
144 I1 = s.
at(1) + s.
at(2) + s.
at(3);
145 I2 = s.
at(1) * s.
at(2) + s.
at(2) * s.
at(3) + s.
at(3) * s.
at(1) -
146 ( s.
at(4) * s.
at(4) + s.
at(5) * s.
at(5) + s.
at(6) * s.
at(6) );
147 I3 = s.
at(1) * s.
at(2) * s.
at(3) + 2. * s.
at(4) * s.
at(5) * s.
at(6) -
148 ( s.
at(1) * s.
at(4) * s.
at(4) + s.
at(2) * s.
at(5) * s.
at(5) +
149 s.
at(3) * s.
at(6) * s.
at(6) );
156 cubic3r( (
double ) -1., I1, -I2, I3, & s1, & s2, & s3, &num);
171 for (
int i = 1; i < 3; i++ ) {
172 for (
int j = 1; j < 3; j++ ) {
173 if ( answer.
at(j + 1) > answer.
at(j) ) {
174 std :: swap( answer.
at(j + 1), answer.
at(j) );
200 if ( myMode == _1dMat ) {
205 }
else if ( myMode == _PlaneStress ) {
210 for (
int i = 1; i <=
size; i++ ) {
211 if ( fabs( this->
at(i) ) > 1.e-20 ) {
216 if ( nonzeroFlag == 0 ) {
222 ss.
at(1, 1) = this->
at(1);
223 ss.
at(2, 2) = this->
at(2);
224 ss.
at(1, 2) = ss.
at(2, 1) = this->
at(3);
233 for (
int i = 1; i <=
size; i++ ) {
234 if ( fabs( s.
at(i) ) > 1.e-20 ) {
239 if ( nonzeroFlag == 0 ) {
245 ss.
at(1, 1) = s.
at(1);
246 ss.
at(2, 2) = s.
at(2);
247 ss.
at(3, 3) = s.
at(3);
248 ss.
at(1, 2) = ss.
at(2, 1) = s.
at(6);
249 ss.
at(1, 3) = ss.
at(3, 1) = s.
at(5);
250 ss.
at(2, 3) = ss.
at(3, 2) = s.
at(4);
254 ss.Jacobi(& answer, & dir, & i);
256 ss.
jaco_(answer, dir, 10);
260 if ( myMode == _PlaneStress ) {
264 for (
int ii = 1; ii < nval; ii++ ) {
265 for (
int jj = 1; jj < nval; jj++ ) {
266 if ( answer.
at(jj + 1) > answer.
at(jj) ) {
268 std :: swap( answer.
at(jj + 1), answer.
at(jj) );
269 for (
int kk = 1; kk <= nval; kk++ ) {
270 std :: swap( dir.
at(kk, jj + 1), dir.
at(kk, jj) );
278StressVector :: printYourself()
const
280 printf(
"StressVector (MaterialMode %d)\n",
mode);
281 for (
double x : *
this ) {
282 printf(
"%10.3e ", x);
291StressVector :: computeFirstInvariant()
const
301 if ( myMode == _1dMat ) {
304 }
else if ( myMode == _PlaneStress ) {
314StressVector :: computeSecondInvariant()
const
324 if ( myMode == _1dMat ) {
327 }
else if ( myMode == _PlaneStress ) {
330 }
else if ( myMode == _PlaneStrain ) {
342StressVector :: computeThirdInvariant()
const
352 if ( myMode == _1dMat ) {
355 }
else if ( myMode == _PlaneStress ) {
359 }
else if ( myMode == _PlaneStrain ) {
376StressVector :: computeAllThreeHWCoordinates(
double &xsi,
383 double volumetricStress;
391StressVector :: computeFirstCoordinate()
const
401StressVector :: computeSecondCoordinate()
const
411StressVector :: computeThirdCoordinate()
const
432 return 1. / 3. * acos(c1);
436StressVector :: applyElasticCompliance(
StrainVector &strain,
const double EModulus,
const double nu)
const
446 if ( myMode == _1dMat ) {
447 strain(0) =
values [ 0 ] / EModulus;
448 }
else if ( myMode == _PlaneStress ) {
449 strain(0) = (
values [ 0 ] - nu *
values [ 1 ] ) / EModulus;
450 strain(1) = ( -nu *
values [ 0 ] +
values [ 1 ] ) / EModulus;
451 strain(2) = ( ( 2. + 2. * nu ) *
values [ 2 ] ) / EModulus;
452 }
else if ( myMode == _PlaneStrain ) {
456 strain(3) = 2. * ( 1. + nu ) *
values [ 3 ] / EModulus;
461 strain(3) = ( 2. * ( 1. + nu ) *
values [ 3 ] ) / EModulus;
462 strain(4) = ( 2. * ( 1. + nu ) *
values [ 4 ] ) / EModulus;
463 strain(5) = ( 2. * ( 1. + nu ) *
values [ 5 ] ) / EModulus;
469 const double EModulus,
470 const double nu)
const
480 const double GModulus)
const
489 if ( myMode == _1dMat ) {
491 }
else if ( myMode == _PlaneStress ) {
493 }
else if ( myMode == _PlaneStrain ) {
494 strain(0) = 1. / ( 2. * GModulus ) *
values [ 0 ];
495 strain(1) = 1. / ( 2. * GModulus ) *
values [ 1 ];
496 strain(2) = 1. / ( 2. * GModulus ) *
values [ 2 ];
497 strain(3) = 1. / GModulus *
values [ 3 ];
498 }
else if ( myMode == _PlaneStrainGrad ) {
499 strain(0) = 1. / ( 2. * GModulus ) *
values [ 0 ];
500 strain(1) = 1. / ( 2. * GModulus ) *
values [ 1 ];
501 strain(2) = 1. / ( 2. * GModulus ) *
values [ 2 ];
502 strain(3) = 1. / GModulus *
values [ 3 ];
505 strain(0) = 1. / ( 2. * GModulus ) *
values [ 0 ];
506 strain(1) = 1. / ( 2. * GModulus ) *
values [ 1 ];
507 strain(2) = 1. / ( 2. * GModulus ) *
values [ 2 ];
508 strain(3) = 1. / GModulus *
values [ 3 ];
509 strain(4) = 1. / GModulus *
values [ 4 ];
510 strain(5) = 1. / GModulus *
values [ 5 ];
515StressVector :: computeStressNorm()
const
524 if ( myMode == _1dMat ) {
526 return fabs(
values [ 0 ]);
527 }
else if ( myMode == _PlaneStress ) {
530 }
else if ( myMode == _PlaneStrain ) {
534 }
else if ( myMode == _PlaneStrainGrad ) {
569 answer.at(1, 1) = t.
at(1, 1) * t.
at(1, 1);
570 answer.at(1, 2) = t.
at(2, 1) * t.
at(2, 1);
571 answer.at(1, 3) = t.
at(3, 1) * t.
at(3, 1);
572 answer.at(1, 4) = 2.0 * t.
at(2, 1) * t.
at(3, 1);
573 answer.at(1, 5) = 2.0 * t.
at(1, 1) * t.
at(3, 1);
574 answer.at(1, 6) = 2.0 * t.
at(1, 1) * t.
at(2, 1);
576 answer.at(2, 1) = t.
at(1, 2) * t.
at(1, 2);
577 answer.at(2, 2) = t.
at(2, 2) * t.
at(2, 2);
578 answer.at(2, 3) = t.
at(3, 2) * t.
at(3, 2);
579 answer.at(2, 4) = 2.0 * t.
at(2, 2) * t.
at(3, 2);
580 answer.at(2, 5) = 2.0 * t.
at(1, 2) * t.
at(3, 2);
581 answer.at(2, 6) = 2.0 * t.
at(1, 2) * t.
at(2, 2);
583 answer.at(3, 1) = t.
at(1, 3) * t.
at(1, 3);
584 answer.at(3, 2) = t.
at(2, 3) * t.
at(2, 3);
585 answer.at(3, 3) = t.
at(3, 3) * t.
at(3, 3);
586 answer.at(3, 4) = 2.0 * t.
at(2, 3) * t.
at(3, 3);
587 answer.at(3, 5) = 2.0 * t.
at(1, 3) * t.
at(3, 3);
588 answer.at(3, 6) = 2.0 * t.
at(1, 3) * t.
at(2, 3);
590 answer.at(4, 1) = t.
at(1, 2) * t.
at(1, 3);
591 answer.at(4, 2) = t.
at(2, 2) * t.
at(2, 3);
592 answer.at(4, 3) = t.
at(3, 2) * t.
at(3, 3);
593 answer.at(4, 4) = ( t.
at(2, 2) * t.
at(3, 3) + t.
at(3, 2) * t.
at(2, 3) );
594 answer.at(4, 5) = ( t.
at(1, 2) * t.
at(3, 3) + t.
at(3, 2) * t.
at(1, 3) );
595 answer.at(4, 6) = ( t.
at(1, 2) * t.
at(2, 3) + t.
at(2, 2) * t.
at(1, 3) );
597 answer.at(5, 1) = t.
at(1, 1) * t.
at(1, 3);
598 answer.at(5, 2) = t.
at(2, 1) * t.
at(2, 3);
599 answer.at(5, 3) = t.
at(3, 1) * t.
at(3, 3);
600 answer.at(5, 4) = ( t.
at(2, 1) * t.
at(3, 3) + t.
at(3, 1) * t.
at(2, 3) );
601 answer.at(5, 5) = ( t.
at(1, 1) * t.
at(3, 3) + t.
at(3, 1) * t.
at(1, 3) );
602 answer.at(5, 6) = ( t.
at(1, 1) * t.
at(2, 3) + t.
at(2, 1) * t.
at(1, 3) );
604 answer.at(6, 1) = t.
at(1, 1) * t.
at(1, 2);
605 answer.at(6, 2) = t.
at(2, 1) * t.
at(2, 2);
606 answer.at(6, 3) = t.
at(3, 1) * t.
at(3, 2);
607 answer.at(6, 4) = ( t.
at(2, 1) * t.
at(3, 2) + t.
at(3, 1) * t.
at(2, 2) );
608 answer.at(6, 5) = ( t.
at(1, 1) * t.
at(3, 2) + t.
at(3, 1) * t.
at(1, 2) );
609 answer.at(6, 6) = ( t.
at(1, 1) * t.
at(2, 2) + t.
at(2, 1) * t.
at(1, 2) );
std::vector< double > values
Stored values.
Index giveSize() const
Returns the size of receiver.
void zero()
Zeroes all coefficients of receiver.
void resize(Index rows, Index cols)
bool jaco_(FloatArray &eval, FloatMatrix &v, int nf)
void beTranspositionOf(const FloatMatrix &src)
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
StressStrainBaseVector(MaterialMode)
Constructor. Creates zero value stress/strain vector for given material mode.
StressStrainMatMode mode
Stress strain mode.
MaterialMode giveStressStrainMode() const
Returns the material mode of receiver.
void convertToFullForm(FloatArray &fullform) const
void computeDeviatoricVolumetricSplit(StressVector &dev, double &vol) const
double computeFirstInvariant() const
double computeSecondCoordinate() const
double computeSecondInvariant() const
void applyDeviatoricElasticCompliance(StrainVector &strain, const double EModulus, const double nu) const
StressVector(MaterialMode)
Constructor. Creates zero value stress/strain vector for given material mode.
double computeThirdCoordinate() const
double computeFirstCoordinate() const
double computeThirdInvariant() const
FloatMatrixF< M, N > transpose(const FloatMatrixF< N, M > &mat)
Constructs transposed matrix.
void cubic3r(double a, double b, double c, double d, double *r1, double *r2, double *r3, int *num)