54 if ( myMode == _1dMat ) {
59 }
else if ( myMode == _PlaneStress ) {
69 vol = ( this->
at(1) + this->
at(2) + this->
at(3) ) / 3.0;
81 if ( myMode == _1dMat ) {
86 }
else if ( myMode == _PlaneStress ) {
96 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 + 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 0.25 * ( 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) +
148 0.25 * ( s.
at(4) * s.
at(5) * s.
at(6) - s.
at(1) * s.
at(4) * s.
at(4) -
149 s.
at(2) * s.
at(5) * s.
at(5) - 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) );
193 for (
int i = 1; i <= n; i++ ) {
194 answer.at(i) = princdir.
at(i, 1);
217 if ( myMode == _1dMat ) {
223 }
else if ( myMode == _PlaneStress ) {
228 for (
int i = 1; i <= size; i++ ) {
229 if ( fabs( this->
at(i) ) > 1.e-20 ) {
234 if ( nonzeroFlag == 0 ) {
239 ss.
at(1, 1) = this->
at(1);
240 ss.
at(2, 2) = this->
at(2);
242 ss.
at(1, 2) = ss.
at(2, 1) = 0.5 * this->
at(3);
251 for (
int i = 1; i <= size; i++ ) {
252 if ( fabs( s.
at(i) ) > 1.e-20 ) {
257 if ( nonzeroFlag == 0 ) {
262 ss.
at(1, 1) = s.
at(1);
263 ss.
at(2, 2) = s.
at(2);
264 ss.
at(3, 3) = s.
at(3);
265 ss.
at(1, 2) = ss.
at(2, 1) = 0.5 * s.
at(6);
266 ss.
at(1, 3) = ss.
at(3, 1) = 0.5 * s.
at(5);
267 ss.
at(2, 3) = ss.
at(3, 2) = 0.5 * s.
at(4);
271 ss.Jacobi(& answer, & dir, & i);
273 ss.
jaco_(answer, dir, 10);
277 if ( myMode == _PlaneStress ) {
281 for (
int ii = 1; ii < nval; ii++ ) {
282 for (
int jj = 1; jj < nval; jj++ ) {
283 if ( answer.
at(jj + 1) > answer.
at(jj) ) {
285 std :: swap( answer.
at(jj + 1), answer.
at(jj) );
286 for (
int kk = 1; kk <= nval; kk++ ) {
287 std :: swap( dir.
at(kk, jj + 1), dir.
at(kk, jj) );
297 printf(
"StrainVector (MaterialMode %d)\n",
mode);
298 for (
double x : this->
values ) {
299 printf(
"%10.3e ", x);
313 if ( myMode == _1dMat ) {
316 }
else if ( myMode == _PlaneStress ) {
332 if ( myMode == _1dMat ) {
335 }
else if ( myMode == _PlaneStress ) {
338 }
else if ( myMode == _PlaneStrain ) {
357 if ( myMode == _1dMat ) {
358 stress(0) = EModulus *
values [ 0 ];
359 }
else if ( myMode == _PlaneStress ) {
360 double factor = EModulus / ( 1. - nu * nu );
361 stress(0) = factor * (
values [ 0 ] + nu *
values [ 1 ] );
362 stress(1) = factor * ( nu *
values [ 0 ] +
values [ 1 ] );
363 stress(2) = factor * ( ( ( 1 - nu ) / 2. ) *
values [ 2 ] );
364 }
else if ( myMode == _PlaneStrain ) {
369 double factor = EModulus / ( ( 1. + nu ) * ( 1. - 2. * nu ) );
370 stress(0) = factor * ( ( 1. - nu ) *
values [ 0 ] + nu *
values [ 1 ] );
371 stress(1) = factor * ( nu * values [ 0 ] + ( 1. - nu ) * values [ 1 ] );
372 stress(2) = nu * ( stress(0) + stress(1) );
373 stress(3) = factor * ( ( ( 1. - 2. * nu ) / 2. ) * values [ 3 ] );
379 double factor = EModulus / ( ( 1. + nu ) * ( 1. - 2. * nu ) );
380 stress(0) = factor * ( ( 1. - nu ) *
values [ 0 ] + nu *
values [ 1 ] + nu *
values [ 2 ] );
381 stress(1) = factor * ( nu * values [ 0 ] + ( 1. - nu ) * values [ 1 ] + nu * values [ 2 ] );
382 stress(2) = factor * ( nu * values [ 0 ] + nu * values [ 1 ] + ( 1. - nu ) * values [ 2 ] );
383 stress(3) = factor * ( ( ( 1. - 2. * nu ) / 2. ) * values [ 3 ] );
384 stress(4) = factor * ( ( ( 1. - 2. * nu ) / 2. ) * values [ 4 ] );
385 stress(5) = factor * ( ( ( 1. - 2. * nu ) / 2. ) * values [ 5 ] );
391 const double EModulus,
392 const double nu)
const 403 const double GModulus)
const 410 if ( myMode == _1dMat ) {
412 }
else if ( myMode == _PlaneStress ) {
414 }
else if ( myMode == _PlaneStrain ) {
419 stress(0) = 2. * GModulus *
values [ 0 ];
420 stress(1) = 2. * GModulus * values [ 1 ];
421 stress(2) = 2. * GModulus * values [ 2 ];
422 stress(3) = GModulus * values [ 3 ];
423 }
else if ( myMode == _PlaneStrainGrad ) {
428 stress(0) = 2. * GModulus *
values [ 0 ];
429 stress(1) = 2. * GModulus * values [ 1 ];
430 stress(2) = 2. * GModulus * values [ 2 ];
431 stress(3) = GModulus * values [ 3 ];
432 stress(4) = values [ 4 ];
438 stress(0) = 2. * GModulus *
values [ 0 ];
439 stress(1) = 2. * GModulus * values [ 1 ];
440 stress(2) = 2. * GModulus * values [ 2 ];
441 stress(3) = GModulus * values [ 3 ];
442 stress(4) = GModulus * values [ 4 ];
443 stress(5) = GModulus * values [ 5 ];
466 if ( transpose == 1 ) {
472 answer.
at(1, 1) = t.
at(1, 1) * t.
at(1, 1);
473 answer.at(1, 2) = t.
at(2, 1) * t.
at(2, 1);
474 answer.at(1, 3) = t.
at(3, 1) * t.
at(3, 1);
475 answer.at(1, 4) = t.
at(2, 1) * t.
at(3, 1);
476 answer.at(1, 5) = t.
at(1, 1) * t.
at(3, 1);
477 answer.at(1, 6) = t.
at(1, 1) * t.
at(2, 1);
479 answer.at(2, 1) = t.
at(1, 2) * t.
at(1, 2);
480 answer.at(2, 2) = t.
at(2, 2) * t.
at(2, 2);
481 answer.at(2, 3) = t.
at(3, 2) * t.
at(3, 2);
482 answer.at(2, 4) = t.
at(2, 2) * t.
at(3, 2);
483 answer.at(2, 5) = t.
at(1, 2) * t.
at(3, 2);
484 answer.at(2, 6) = t.
at(1, 2) * t.
at(2, 2);
486 answer.at(3, 1) = t.
at(1, 3) * t.
at(1, 3);
487 answer.at(3, 2) = t.
at(2, 3) * t.
at(2, 3);
488 answer.at(3, 3) = t.
at(3, 3) * t.
at(3, 3);
489 answer.at(3, 4) = t.
at(2, 3) * t.
at(3, 3);
490 answer.at(3, 5) = t.
at(1, 3) * t.
at(3, 3);
491 answer.at(3, 6) = t.
at(1, 3) * t.
at(2, 3);
493 answer.at(4, 1) = 2.0 * t.
at(1, 2) * t.
at(1, 3);
494 answer.at(4, 2) = 2.0 * t.
at(2, 2) * t.
at(2, 3);
495 answer.at(4, 3) = 2.0 * t.
at(3, 2) * t.
at(3, 3);
496 answer.at(4, 4) = ( t.
at(2, 2) * t.
at(3, 3) + t.
at(3, 2) * t.
at(2, 3) );
497 answer.at(4, 5) = ( t.
at(1, 2) * t.
at(3, 3) + t.
at(3, 2) * t.
at(1, 3) );
498 answer.at(4, 6) = ( t.
at(1, 2) * t.
at(2, 3) + t.
at(2, 2) * t.
at(1, 3) );
500 answer.at(5, 1) = 2.0 * t.
at(1, 1) * t.
at(1, 3);
501 answer.at(5, 2) = 2.0 * t.
at(2, 1) * t.
at(2, 3);
502 answer.at(5, 3) = 2.0 * t.
at(3, 1) * t.
at(3, 3);
503 answer.at(5, 4) = ( t.
at(2, 1) * t.
at(3, 3) + t.
at(3, 1) * t.
at(2, 3) );
504 answer.at(5, 5) = ( t.
at(1, 1) * t.
at(3, 3) + t.
at(3, 1) * t.
at(1, 3) );
505 answer.at(5, 6) = ( t.
at(1, 1) * t.
at(2, 3) + t.
at(2, 1) * t.
at(1, 3) );
507 answer.at(6, 1) = 2.0 * t.
at(1, 1) * t.
at(1, 2);
508 answer.at(6, 2) = 2.0 * t.
at(2, 1) * t.
at(2, 2);
509 answer.at(6, 3) = 2.0 * t.
at(3, 1) * t.
at(3, 2);
510 answer.at(6, 4) = ( t.
at(2, 1) * t.
at(3, 2) + t.
at(3, 1) * t.
at(2, 2) );
511 answer.at(6, 5) = ( t.
at(1, 1) * t.
at(3, 2) + t.
at(3, 1) * t.
at(1, 2) );
512 answer.at(6, 6) = ( t.
at(1, 1) * t.
at(2, 2) + t.
at(2, 1) * t.
at(1, 2) );
void applyElasticStiffness(StressVector &stress, const double EModulus, const double nu) const
Applies the elastic stiffness to the strain.
void computeDeviatoricVolumetricSplit(StrainVector &answer, double &vol) const
Computes split of receiver into deviatoric and volumetric part.
void computeMaxPrincipalDir(FloatArray &answer) const
Computes the principal direction of the receiver associated with the maximum principal value...
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 giveTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, int transpose=0) const
Computes 3d transformation matrix from standard vector transformation matrix.
void convertToFullForm(FloatArray &fullform) const
Computes the full form of receiver.
void computePrincipalValDir(FloatArray &answer, FloatMatrix &dir) const
Computes the principal values and principal directions of the receiver.
StressStrainMatMode mode
Stress strain mode.
Specialization of a floating point array for representing a strain state.
void applyDeviatoricElasticStiffness(StressVector &stress, const double EModulus, const double nu) const
Applies the elastic stiffness to the deviatoric strain.
MaterialMode
Type representing material mode of integration point.
Base class for stress/strain vector representations.
bool jaco_(FloatArray &eval, FloatMatrix &v, int nf)
Computes eigenvalues and eigenvectors of receiver (must be symmetric) The receiver is preserved...
void printYourself() const
Prints receiver on stdout, useful for debugging.
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...
StrainVector(MaterialMode)
Constructor. Creates zero value stress/strain vector for given material mode.
double at(int i, int j) const
Coefficient access function.
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
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 computeDeviatoricVolumetricSum(StrainVector &answer, const double vol) const
Computes sum of deviatoric and volumetric part.
double computeStrainNorm() const
Computes the tensorial norm of the strain in engineering notation.
void computePrincipalValues(FloatArray &answer) const
Computes the principal values of the receiver.
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 letStressStrainModeBe(const MaterialMode newMode)
Changes the material mode of receiver.
double computeVolumeChange() const
Computes the change of volume.
void resize(int s)
Resizes receiver towards requested size.