55 if ( myMode == _1dMat ) {
60 }
else if ( myMode == _PlaneStress ) {
70 vol = ( this->
at(1) + this->
at(2) + this->
at(3) ) / 3.0;
82 if ( myMode == _1dMat ) {
87 }
else if ( myMode == _PlaneStress ) {
97 for (
int i = 0; i < 3; i++ ) {
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 = 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) );
280 printf(
"StressVector (MaterialMode %d)\n",
mode);
281 for (
double x : *
this ) {
282 printf(
"%10.3e ", x);
298 if ( myMode == _1dMat ) {
301 }
else if ( myMode == _PlaneStress ) {
318 if ( myMode == _1dMat ) {
321 }
else if ( myMode == _PlaneStress ) {
324 }
else if ( myMode == _PlaneStrain ) {
343 if ( myMode == _1dMat ) {
346 }
else if ( myMode == _PlaneStress ) {
350 }
else if ( myMode == _PlaneStrain ) {
374 double volumetricStress;
423 return 1. / 3. * acos(c1);
434 if ( myMode == _1dMat ) {
435 strain(0) =
values [ 0 ] / EModulus;
436 }
else if ( myMode == _PlaneStress ) {
437 strain(0) = (
values [ 0 ] - nu *
values [ 1 ] ) / EModulus;
438 strain(1) = ( -nu *
values [ 0 ] +
values [ 1 ] ) / EModulus;
439 strain(2) = ( ( 2. + 2. * nu ) *
values [ 2 ] ) / EModulus;
440 }
else if ( myMode == _PlaneStrain ) {
444 strain(3) = 2. * ( 1. + nu ) *
values [ 3 ] / EModulus;
449 strain(3) = ( 2. * ( 1. + nu ) *
values [ 3 ] ) / EModulus;
450 strain(4) = ( 2. * ( 1. + nu ) *
values [ 4 ] ) / EModulus;
451 strain(5) = ( 2. * ( 1. + nu ) *
values [ 5 ] ) / EModulus;
457 const double EModulus,
458 const double nu)
const 468 const double GModulus)
const 474 if ( myMode == _1dMat ) {
476 }
else if ( myMode == _PlaneStress ) {
478 }
else if ( myMode == _PlaneStrain ) {
479 strain(0) = 1. / ( 2. * GModulus ) *
values [ 0 ];
480 strain(1) = 1. / ( 2. * GModulus ) *
values [ 1 ];
481 strain(2) = 1. / ( 2. * GModulus ) *
values [ 2 ];
482 strain(3) = 1. / GModulus *
values [ 3 ];
483 }
else if ( myMode == _PlaneStrainGrad ) {
484 strain(0) = 1. / ( 2. * GModulus ) *
values [ 0 ];
485 strain(1) = 1. / ( 2. * GModulus ) *
values [ 1 ];
486 strain(2) = 1. / ( 2. * GModulus ) *
values [ 2 ];
487 strain(3) = 1. / GModulus *
values [ 3 ];
488 strain(4) = values [ 4 ];
490 strain(0) = 1. / ( 2. * GModulus ) *
values [ 0 ];
491 strain(1) = 1. / ( 2. * GModulus ) *
values [ 1 ];
492 strain(2) = 1. / ( 2. * GModulus ) *
values [ 2 ];
493 strain(3) = 1. / GModulus *
values [ 3 ];
494 strain(4) = 1. / GModulus * values [ 4 ];
495 strain(5) = 1. / GModulus * values [ 5 ];
506 if ( myMode == _1dMat ) {
508 return fabs(
values [ 0 ]);
509 }
else if ( myMode == _PlaneStress ) {
512 }
else if ( myMode == _PlaneStrain ) {
516 }
else if ( myMode == _PlaneStrainGrad ) {
545 if ( transpose == 1 ) {
551 answer.
at(1, 1) = t.
at(1, 1) * t.
at(1, 1);
552 answer.at(1, 2) = t.
at(2, 1) * t.
at(2, 1);
553 answer.at(1, 3) = t.
at(3, 1) * t.
at(3, 1);
554 answer.at(1, 4) = 2.0 * t.
at(2, 1) * t.
at(3, 1);
555 answer.at(1, 5) = 2.0 * t.
at(1, 1) * t.
at(3, 1);
556 answer.at(1, 6) = 2.0 * t.
at(1, 1) * t.
at(2, 1);
558 answer.at(2, 1) = t.
at(1, 2) * t.
at(1, 2);
559 answer.at(2, 2) = t.
at(2, 2) * t.
at(2, 2);
560 answer.at(2, 3) = t.
at(3, 2) * t.
at(3, 2);
561 answer.at(2, 4) = 2.0 * t.
at(2, 2) * t.
at(3, 2);
562 answer.at(2, 5) = 2.0 * t.
at(1, 2) * t.
at(3, 2);
563 answer.at(2, 6) = 2.0 * t.
at(1, 2) * t.
at(2, 2);
565 answer.at(3, 1) = t.
at(1, 3) * t.
at(1, 3);
566 answer.at(3, 2) = t.
at(2, 3) * t.
at(2, 3);
567 answer.at(3, 3) = t.
at(3, 3) * t.
at(3, 3);
568 answer.at(3, 4) = 2.0 * t.
at(2, 3) * t.
at(3, 3);
569 answer.at(3, 5) = 2.0 * t.
at(1, 3) * t.
at(3, 3);
570 answer.at(3, 6) = 2.0 * t.
at(1, 3) * t.
at(2, 3);
572 answer.at(4, 1) = t.
at(1, 2) * t.
at(1, 3);
573 answer.at(4, 2) = t.
at(2, 2) * t.
at(2, 3);
574 answer.at(4, 3) = t.
at(3, 2) * t.
at(3, 3);
575 answer.at(4, 4) = ( t.
at(2, 2) * t.
at(3, 3) + t.
at(3, 2) * t.
at(2, 3) );
576 answer.at(4, 5) = ( t.
at(1, 2) * t.
at(3, 3) + t.
at(3, 2) * t.
at(1, 3) );
577 answer.at(4, 6) = ( t.
at(1, 2) * t.
at(2, 3) + t.
at(2, 2) * t.
at(1, 3) );
579 answer.at(5, 1) = t.
at(1, 1) * t.
at(1, 3);
580 answer.at(5, 2) = t.
at(2, 1) * t.
at(2, 3);
581 answer.at(5, 3) = t.
at(3, 1) * t.
at(3, 3);
582 answer.at(5, 4) = ( t.
at(2, 1) * t.
at(3, 3) + t.
at(3, 1) * t.
at(2, 3) );
583 answer.at(5, 5) = ( t.
at(1, 1) * t.
at(3, 3) + t.
at(3, 1) * t.
at(1, 3) );
584 answer.at(5, 6) = ( t.
at(1, 1) * t.
at(2, 3) + t.
at(2, 1) * t.
at(1, 3) );
586 answer.at(6, 1) = t.
at(1, 1) * t.
at(1, 2);
587 answer.at(6, 2) = t.
at(2, 1) * t.
at(2, 2);
588 answer.at(6, 3) = t.
at(3, 1) * t.
at(3, 2);
589 answer.at(6, 4) = ( t.
at(2, 1) * t.
at(3, 2) + t.
at(3, 1) * t.
at(2, 2) );
590 answer.at(6, 5) = ( t.
at(1, 1) * t.
at(3, 2) + t.
at(3, 1) * t.
at(1, 2) );
591 answer.at(6, 6) = ( t.
at(1, 1) * t.
at(2, 2) + t.
at(2, 1) * t.
at(1, 2) );
double computeThirdCoordinate() const
Computes the third Haigh-Westergaard coordinate of the deviatoric stress.
double computeThirdInvariant() const
Computes the third invariant J3 of the deviatoric stress state.
std::vector< double > values
Stored values.
Specialization of a floating point array for representing a stress state.
MaterialMode giveStressStrainMode() const
Returns the material mode of receiver.
double & at(int i)
Coefficient access function.
void convertToFullForm(FloatArray &fullform) const
Computes the full form of receiver.
void computePrincipalValDir(FloatArray &answer, FloatMatrix &dir) const
Computes principal values and directions of receiver vector.
double computeFirstInvariant() const
Computes the first invariant I1 of the stress.
StressStrainMatMode mode
Stress strain mode.
Specialization of a floating point array for representing a strain state.
MaterialMode
Type representing material mode of integration point.
double computeSecondInvariant() const
Computes the second invariant J2 of the deviatoric stress.
Base class for stress/strain vector representations.
void printYourself() const
Prints receiver on stdout, useful for debugging.
double computeStressNorm() const
Computes the norm of the stress tensor using engineering notation.
void applyDeviatoricElasticCompliance(StrainVector &strain, const double EModulus, const double nu) const
Applies the isotropic elastic stiffness to the deviatoric stress.
bool jaco_(FloatArray &eval, FloatMatrix &v, int nf)
Computes eigenvalues and eigenvectors of receiver (must be symmetric) The receiver is preserved...
void computeDeviatoricVolumetricSum(StressVector &answer, double vol) const
Sums volumetric part to receiver.
void cubic3r(double a, double b, double c, double d, double *r1, double *r2, double *r3, int *num)
Solves cubic equation for real roots, assuming that if cubic polynomial given then the only possibili...
void giveTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, int transpose=0) const
Computes 3d transformation matrix from standard vector transformation matrix.
double computeSecondCoordinate() const
Computes the second Haigh-Westergaard coordinate of the deviatoric stress.
void applyElasticCompliance(StrainVector &strain, const double EModulus, const double nu) const
Applies the isotropic elastic compliance to the stress.
double at(int i, int j) const
Coefficient access function.
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
void computeAllThreeHWCoordinates(double &xsi, double &rho, double &theta) const
Computes all three Haigh-Westergaard coordinate of the stress.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
void zero()
Zeroes all coefficients of receiver.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
void zero()
Zeroes all coefficient of receiver.
StressVector(MaterialMode)
Constructor. Creates zero value stress/strain vector for given material mode.
void computePrincipalValues(FloatArray &answer) const
Member function that computes principal values of receiver (stress vector).
double computeFirstCoordinate() const
Computes the first Haigh-Westergaard coordinate of the stress.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void computeDeviatoricVolumetricSplit(StressVector &dev, double &vol) const
Computes split of receiver into deviatoric and volumetric part.
void resize(int s)
Resizes receiver towards requested size.