45 #define YIELD_TOL 1.e-6 46 #define YIELD_TOL_SECONDARY 1.e-4 48 #define PLASTIC_MATERIAL_MAX_ITERATIONS 120 78 return mode == _3dMat ||
81 mode == _PlaneStress ||
108 FloatArray strainVectorR, plasticStrainVectorR;
128 this->
closestPointReturn(fullStressVector, activeConditionMap, gamma, gp, strainVectorR,
129 plasticStrainVectorR, strainSpaceHardeningVariables, tStep);
131 this->
cuttingPlaneReturn(fullStressVector, activeConditionMap, gamma, gp, strainVectorR,
132 plasticStrainVectorR, strainSpaceHardeningVariables, tStep);
139 double omega =
computeDamage(gp, strainSpaceHardeningVariables, tStep);
141 helpVec.
times(1. - omega);
155 bool yieldFlag =
false;
156 for (
int i = 1; i <=
nsurf; i++ ) {
157 if ( gamma.
at(i) > 0. ) {
197 FloatArray dgamma, dgammared, tempGamma, dkappa;
204 std :: vector< FloatArray > yieldGradSigVec(this->
nsurf), loadGradSigVec(this->
nsurf), * loadGradSigVecPtr;
205 std :: vector< FloatArray > yieldGradKVec(this->
nsurf), loadGradKVec(this->
nsurf);
210 int elastic, restart, actSurf, indx;
211 bool yieldConsistency, init =
true;
220 loadGradSigVecPtr = & yieldGradSigVec;
222 loadGradSigVecPtr = & loadGradSigVec;
247 elasticStrainVectorR = totalStrain;
248 elasticStrainVectorR.
subtract(plasticStrainVectorR);
257 activeConditionMap.
zero();
260 initialConditionMap.
zero();
263 for (
int i = 1; i <= this->
nsurf; i++ ) {
264 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
268 initialConditionMap.
at(i) = 1;
273 activeConditionMap.
at(i) = actSurf;
288 printf(
"New activeConditionMap:");
298 for (
int i = 1; i <=
nsurf; i++ ) {
300 strainSpaceHardeningVariables);
301 if ( hasHardening ) {
303 strainSpaceHardeningVariables);
308 for (
int i = 1; i <=
nsurf; i++ ) {
310 strainSpaceHardeningVariables);
311 if ( hasHardening ) {
313 strainSpaceHardeningVariables);
321 strainSpaceHardeningVariables, * loadGradSigVecPtr);
324 printf(
"Convergence[actSet: ");
325 for (
int i = 1; i <=
nsurf; i++ ) {
326 printf(
"%d ", activeConditionMap.
at(i) );
329 printf(
"] yield_val (gamma) ");
335 yieldConsistency =
true;
336 for (
int i = 1; i <=
nsurf; i++ ) {
337 if ( activeConditionMap.
at(i) ) {
338 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
340 yieldConsistency =
false;
345 printf(
"%e(%e) ", yieldValue, gamma.
at(i) );
360 if ( yieldConsistency ) {
361 answer = fullStressVector;
369 printf(
"Consistency: ");
373 for (
int i = 1; i <= this->
nsurf; i++ ) {
374 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
378 printf(
"%e ", yieldValue);
383 if ( ( gamma.
at(i) < 0.0 ) || ( ( activeConditionMap.
at(i) == 0 ) && ( yieldValue >
YIELD_TOL_SECONDARY ) ) ) {
391 printf(
"\nStress: ");
392 for (
int i = 1; i <= fullStressVector.
giveSize(); i++ ) {
393 printf(
" %e", fullStressVector.
at(i) );
396 printf(
"\nKappa : ");
397 for (
int i = 1; i <= strainSpaceHardeningVariables.
giveSize(); i++ ) {
398 printf(
" %e", strainSpaceHardeningVariables.
at(i) );
401 printf(
"\n Restart %d\n", restart);
411 for (
int i = 1; i <= this->
nsurf; i++ ) {
412 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
413 if ( ( ( activeConditionMap.
at(i) ) && ( gamma.
at(i) >= 0.0 ) ) || ( yieldValue >
YIELD_TOL ) ) {
416 newmap.
at(i) = actSurf;
434 elasticStrainVectorR = totalStrain;
435 elasticStrainVectorR.
subtract(plasticStrainVectorR);
440 OOFEM_ERROR(
"Internal Consistency error: all combinations of yield functions tried, no consistent return");
444 OOFEM_ERROR(
"Internal Consistency error: all combinations of yield functions tried, no consistent return");
449 for (
int i = 1; i <=
nsurf; i++ ) {
450 if ( activeConditionMap.
at(i) ) {
479 elasticStrainVectorR = totalStrain;
480 elasticStrainVectorR.
subtract(plasticStrainVectorR);
499 gamma, activeConditionMap,
500 fullStressVector, strainSpaceHardeningVariables);
508 gmat.
resize(actSurf, actSurf);
510 lmat.
resize(actSurf, strSize);
512 rmat.
resize(strSize, actSurf);
514 if ( hasHardening ) {
516 strainSpaceHardeningVariables, gamma);
518 fullStressVector, strainSpaceHardeningVariables, gamma);
521 for (
int i = 1; i <=
nsurf; i++ ) {
522 if ( ( indx = activeConditionMap.
at(i) ) ) {
523 if ( hasHardening ) {
525 helpVector.
add(yieldGradSigVec [ i - 1 ]);
526 for (
int j = 1; j <= strSize; j++ ) {
527 lmat.
at(indx, j) = helpVector.
at(j);
530 for (
int j = 1; j <= strSize; j++ ) {
531 lmat.
at(indx, j) = yieldGradSigVec [ i - 1 ].at(j);
535 if ( hasHardening ) {
537 strainSpaceHardeningVariables);
543 for (
int j = 1; j <= strSize; j++ ) {
544 rmat.
at(j, indx) += ( * loadGradSigVecPtr ) [ i - 1 ].at(j);
547 if ( hasHardening ) {
549 for (
int j = 1; j <= actSurf; j++ ) {
550 gmat.
at(indx, j) = ( -1.0 ) * helpVector2.
at(j);
554 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
555 rhs.
at(indx) = yieldValue;
564 helpVector2.
beProductOf(consistentModuli, residualVectorR);
573 for (
int i = 1; i <= this->
nsurf; i++ ) {
574 if ( ( indx = activeConditionMap.
at(i) ) ) {
575 dgamma.
at(i) = dgammared.
at(indx);
582 tempGamma.
add(dgamma);
591 for (
int i = 1; i <= this->
nsurf; i++ ) {
592 if ( tempGamma.
at(i) < 0.0 ) {
600 activeConditionMap.
zero();
601 for (
int i = 1; i <= this->
nsurf; i++ ) {
602 if ( tempGamma.
at(i) > 0.0 ) {
604 activeConditionMap.
at(i) = actSurf;
610 elasticStrainVectorR = totalStrain;
611 elasticStrainVectorR.
subtract(plasticStrainVectorR);
628 helpVector2.
resize(strSize);
630 for (
int i = 1; i <=
nsurf; i++ ) {
631 if ( activeConditionMap.
at(i) ) {
632 ( * loadGradSigVecPtr ) [ i - 1 ].times( dgamma.
at(i) );
633 residualVectorR.
add( ( * loadGradSigVecPtr ) [ i - 1 ] );
635 if ( hasHardening ) {
637 strainSpaceHardeningVariables);
639 fullStressVector, strainSpaceHardeningVariables, gamma);
644 residualVectorR.
add(helpVector2);
649 helpVector.
beProductOf(consistentModuli, residualVectorR);
650 helpVector2.
beProductOf(elasticModuliInverse, helpVector);
653 for (
int i = 1; i <= strSize; i++ ) {
654 plasticStrainVectorR.
at(i) += helpVector2.
at(i);
657 elasticStrainVectorR = totalStrain;
658 elasticStrainVectorR.
subtract(plasticStrainVectorR);
662 if ( hasHardening ) {
665 strainSpaceHardeningVariables.
add(dkappa);
678 fprintf( stderr,
"\nclosestPointReturn (mat no. %d): reached max number of iterations\n", this->
giveNumber() );
679 fprintf(stderr,
"activeSet: ");
680 for (
int i = 1; i <=
nsurf; i++ ) {
681 fprintf( stderr,
"%d ", activeConditionMap.
at(i) );
684 fprintf(stderr,
"\n");
696 bool smartCandidate =
false;
702 for (
int i = 1; i <= this->
nsurf; i++ ) {
703 if ( activeConditionMap.
at(i) ) {
704 if ( gamma.
at(i) < 0.0 ) {
705 smartCandidate =
true;
712 if ( smartCandidate && candidate && initialConditionMap.
at(candidate) ) {
715 newMap.
at(candidate) = 1;
731 elasticStrainVectorR = totalStrain;
732 elasticStrainVectorR.
subtract(plasticStrainVectorR);
737 OOFEM_ERROR(
"Internal Consistency error: all combinations of yield functions tried, no consistent return");
741 OOFEM_ERROR(
"Internal Consistency error: all combinations of yield functions tried, no consistent return");
746 for (
int i = 1; i <=
nsurf; i++ ) {
747 if ( activeConditionMap.
at(i) ) {
756 for (
int i = 1; i <= this->
nsurf; i++ ) {
757 if ( initialConditionMap.
at(i) ) {
774 elasticStrainVectorR = totalStrain;
775 elasticStrainVectorR.
subtract(plasticStrainVectorR);
780 OOFEM_ERROR(
"Internal Consistency error: all combinations of yield functions tried, no consistent return");
784 OOFEM_ERROR(
"Internal Consistency error: all combinations of yield functions tried, no consistent return");
788 for ( actSurf = 0, i = 1; i <=
nsurf; i++ ) {
789 if ( activeConditionMap.
at(i) ) {
805 elasticStrainVectorR = totalStrain;
806 elasticStrainVectorR.
subtract(plasticStrainVectorR);
817 OOFEM_WARNING(
"local equlibrium not reached in %d iterations\nElement %d, gp %d, continuing",
819 answer = fullStressVector;
827 answer = fullStressVector;
843 FloatArray helpVector, helpVector2, rhs, dkappa;
844 FloatMatrix elasticModuli, helpMtrx, helpMtrx2, gmat;
847 std :: vector< FloatArray > yieldGradSigVec(this->
nsurf), loadGradSigVec(this->
nsurf), * loadGradSigVecPtr;
848 std :: vector< FloatArray > yieldGradKVec(this->
nsurf), loadGradKVec(this->
nsurf);
852 int strSize, i, j, elastic, restart, actSurf, indx;
853 bool yieldConsistency, init =
true;
859 loadGradSigVecPtr = & yieldGradSigVec;
861 loadGradSigVecPtr = & loadGradSigVec;
878 elasticStrainVectorR = totalStrain;
879 elasticStrainVectorR.
subtract(plasticStrainVectorR);
885 activeConditionMap.
zero();
888 initialConditionMap.
zero();
891 for ( i = 1; i <= this->
nsurf; i++ ) {
892 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
896 initialConditionMap.
at(i) = 1;
901 activeConditionMap.
at(i) = actSurf;
912 for ( i = 1; i <=
nsurf; i++ ) {
914 strainSpaceHardeningVariables);
916 if ( hasHardening ) {
918 strainSpaceHardeningVariables);
923 for ( i = 1; i <=
nsurf; i++ ) {
925 strainSpaceHardeningVariables);
926 if ( hasHardening ) {
928 strainSpaceHardeningVariables);
935 gmat.
resize(actSurf, actSurf);
937 lmat.
resize(actSurf, strSize);
939 rmat.
resize(strSize, actSurf);
942 if ( hasHardening ) {
944 strainSpaceHardeningVariables, gamma);
946 fullStressVector, strainSpaceHardeningVariables, gamma);
949 for ( i = 1; i <=
nsurf; i++ ) {
950 if ( ( indx = activeConditionMap.
at(i) ) ) {
953 if ( hasHardening ) {
955 helpVector.
add(yieldGradSigVec [ i - 1 ]);
956 for ( j = 1; j <= strSize; j++ ) {
957 lmat.
at(indx, j) = helpVector.
at(j);
960 for ( j = 1; j <= strSize; j++ ) {
961 lmat.
at(indx, j) = yieldGradSigVec [ i - 1 ].at(j);
965 for ( j = 1; j <= strSize; j++ ) {
966 rmat.
at(j, indx) += ( * loadGradSigVecPtr ) [ i - 1 ].at(j);
969 if ( hasHardening ) {
971 for ( j = 1; j <= actSurf; j++ ) {
972 gmat.
at(indx, j) = ( -1.0 ) * helpVector2.
at(j);
985 for ( i = 1; i <= this->
nsurf; i++ ) {
986 if ( ( indx = activeConditionMap.
at(i) ) ) {
987 dgamma.
at(i) = helpVector.
at(indx);
996 for ( i = 1; i <= this->
nsurf; i++ ) {
997 if ( ( gamma.
at(i) + dgamma.
at(i) ) < 0.0 ) {
1006 activeConditionMap.
zero();
1007 for ( i = 1; i <= this->
nsurf; i++ ) {
1008 if ( ( gamma.
at(i) + dgamma.
at(i) ) > 0.0 ) {
1010 activeConditionMap.
at(i) = actSurf;
1016 elasticStrainVectorR = totalStrain;
1017 elasticStrainVectorR.
subtract(plasticStrainVectorR);
1031 helpVector.
resize(strSize);
1033 for ( i = 1; i <= this->
nsurf; i++ ) {
1034 if ( activeConditionMap.
at(i) ) {
1035 ( * loadGradSigVecPtr ) [ i - 1 ].times( dgamma.
at(i) );
1036 for ( j = 1; j <= strSize; j++ ) {
1037 helpVector.
at(j) += ( * loadGradSigVecPtr ) [ i - 1 ].at(j);
1042 plasticStrainVectorR.
add(helpVector);
1047 elasticStrainVectorR = totalStrain;
1048 elasticStrainVectorR.
subtract(plasticStrainVectorR);
1052 if ( hasHardening ) {
1055 strainSpaceHardeningVariables.
add(dkappa);
1059 yieldConsistency =
true;
1060 for ( i = 1; i <=
nsurf; i++ ) {
1061 if ( activeConditionMap.
at(i) ) {
1062 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
1064 yieldConsistency =
false;
1069 if ( yieldConsistency ) {
1072 for ( i = 1; i <= this->
nsurf; i++ ) {
1073 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
1074 if ( ( gamma.
at(i) < 0.0 ) || ( ( activeConditionMap.
at(i) == 0 ) && ( yieldValue >
YIELD_TOL ) ) ) {
1087 for ( i = 1; i <= this->
nsurf; i++ ) {
1088 yieldValue = this->
computeYieldValueAt(gp, i, fullStressVector, strainSpaceHardeningVariables);
1089 if ( ( ( activeConditionMap.
at(i) ) && ( gamma.
at(i) >= 0.0 ) ) || ( yieldValue >
YIELD_TOL ) ) {
1092 newmap.
at(i) = actSurf;
1099 activeConditionMap = newmap;
1102 activeConditionMap = newmap;
1106 for ( i = 1; i <= this->
nsurf; i++ ) {
1107 if ( initialConditionMap.
at(i) ) {
1109 activeConditionMap.
zero();
1110 activeConditionMap.
at(i) = 1;
1111 initialConditionMap.
at(i) = 0;
1123 elasticStrainVectorR = totalStrain;
1124 elasticStrainVectorR.
subtract(plasticStrainVectorR);
1145 bool smartCandidate =
false;
1151 for ( i = 1; i <= this->
nsurf; i++ ) {
1152 if ( activeConditionMap.
at(i) ) {
1153 if ( gamma.
at(i) < 0.0 ) {
1154 smartCandidate =
true;
1161 if ( smartCandidate && candidate && initialConditionMap.
at(candidate) ) {
1163 activeConditionMap.
zero();
1164 activeConditionMap.
at(candidate) = 1;
1165 initialConditionMap.
at(candidate) = 0;
1169 for ( i = 1; i <= this->
nsurf; i++ ) {
1170 if ( initialConditionMap.
at(i) ) {
1172 activeConditionMap.
zero();
1173 activeConditionMap.
at(i) = 1;
1174 initialConditionMap.
at(i) = 0;
1186 elasticStrainVectorR = totalStrain;
1187 elasticStrainVectorR.
subtract(plasticStrainVectorR);
1198 OOFEM_WARNING(
"local equlibrium not reached in %d iterations\nElement %d, gp %d, continuing",
1200 answer = fullStressVector;
1210 answer = fullStressVector;
1218 const FloatArray &strainSpaceHardeningVariables)
1223 strainSpaceHardeningVariables);
1231 const FloatArray &strainSpaceHardeningVariables,
1232 std :: vector< FloatArray > &gradientVectorR)
1240 size = plasticStrainVectorR.
giveSize();
1245 for (
int i = 1; i <= size; i++ ) {
1246 answer.
at(i) = oldPlasticStrainVectorR.
at(i) - plasticStrainVectorR.
at(i);
1249 for (
int i = 1; i <= this->
nsurf; i++ ) {
1250 if ( activeConditionMap.
at(i) ) {
1251 for (
int j = 1; j <= size; j++ ) {
1252 answer.
at(j) += gamma.
at(i) * gradientVectorR [ i - 1 ].at(j);
1271 reducedAnswer.
beProductOf(de, elasticStrainVectorR);
1281 const IntArray &activeConditionMap,
1283 const FloatArray &strainSpaceHardeningVariables)
1296 helpInverse.
resize(size, size);
1298 for ( i = 1; i <=
nsurf; i++ ) {
1299 if ( activeConditionMap.
at(i) ) {
1302 strainSpaceHardeningVariables);
1304 gradientMatrix.
times( gamma.
at(i) );
1305 helpInverse.
add(gradientMatrix);
1307 if ( hasHardening ) {
1309 strainSpaceHardeningVariables);
1311 gradientMatrix.
times( gamma.
at(i) );
1314 helpInverse.
add(help);
1319 for ( i = 1; i <= size; i++ ) {
1320 for ( j = 1; j <= size; j++ ) {
1321 helpInverse.
at(i, j) += elasticModuliInverse.
at(i, j);
1326 for ( i = 1; i <= size; i++ ) {
1327 if ( fabs( helpInverse.
at(i, i) ) > 1.e16 ) {
1328 helpInverse.
at(i, i) =
sgn( helpInverse.
at(i, i) ) * 1.e16;
1349 FloatMatrix consistentModuli, elasticModuli, umat, vmat;
1351 FloatMatrix gradientMatrix, gmat, gmatInv, gradMat, helpMtrx, helpMtrx2, answerR;
1352 FloatArray gradientVector, stressVector, fullStressVector;
1353 FloatArray strainSpaceHardeningVariables, helpVector;
1354 std :: vector< FloatArray > yieldGradSigVec(this->
nsurf), loadGradSigVec(this->
nsurf), * loadGradSigVecPtr;
1355 std :: vector< FloatArray > yieldGradKVec(this->
nsurf), loadGradKVec(this->
nsurf);
1360 int strSize, indx, actSurf = 0;
1366 loadGradSigVecPtr = & yieldGradSigVec;
1368 loadGradSigVecPtr = & loadGradSigVec;
1387 for (
int i = 1; i <=
nsurf; i++ ) {
1388 if ( activeConditionMap.
at(i) ) {
1406 activeConditionMap, fullStressVector, strainSpaceHardeningVariables);
1409 for (
int i = 1; i <=
nsurf; i++ ) {
1411 strainSpaceHardeningVariables);
1412 if ( hasHardening ) {
1414 strainSpaceHardeningVariables);
1419 for (
int i = 1; i <=
nsurf; i++ ) {
1421 strainSpaceHardeningVariables);
1422 if ( hasHardening ) {
1424 strainSpaceHardeningVariables);
1430 umat.
resize(strSize, actSurf);
1432 vmat.
resize(actSurf, strSize);
1434 gmat.
resize(actSurf, actSurf);
1437 if ( hasHardening ) {
1439 strainSpaceHardeningVariables, gamma);
1441 fullStressVector, strainSpaceHardeningVariables, gamma);
1444 for (
int i = 1; i <=
nsurf; i++ ) {
1445 if ( ( indx = activeConditionMap.
at(i) ) ) {
1446 if ( hasHardening ) {
1448 helpVector.
add(yieldGradSigVec [ i - 1 ]);
1449 for (
int j = 1; j <= strSize; j++ ) {
1450 vmat.
at(indx, j) = helpVector.
at(j);
1453 for (
int j = 1; j <= strSize; j++ ) {
1454 vmat.
at(indx, j) = yieldGradSigVec [ i - 1 ].at(j);
1458 if ( hasHardening ) {
1460 strainSpaceHardeningVariables);
1462 helpMtrx.
times( gamma.
at(i) );
1466 for (
int j = 1; j <= strSize; j++ ) {
1467 umat.
at(j, indx) += ( ( * loadGradSigVecPtr ) [ i - 1 ] ).at(j);
1471 if ( hasHardening ) {
1473 for (
int j = 1; j <= actSurf; j++ ) {
1474 gmat.
at(indx, j) = ( -1.0 ) * helpVector2.
at(j);
1482 gmat.
add(helpMtrx2);
1491 answer.
add(consistentModuli);
1506 FloatMatrix gmat, gmatInv, helpMtrx, helpMtrx2, kl, ks;
1508 FloatArray strainSpaceHardeningVariables, helpVector, helpVector2;
1509 std :: vector< FloatArray > yieldGradSigVec(this->
nsurf), loadGradSigVec(this->
nsurf), * loadGradSigVecPtr;
1510 std :: vector< FloatArray > yieldGradKVec(this->
nsurf), loadGradKVec(this->
nsurf);
1515 int strSize, indx, actSurf = 0;
1521 loadGradSigVecPtr = & yieldGradSigVec;
1523 loadGradSigVecPtr = & loadGradSigVec;
1542 for (
int i = 1; i <=
nsurf; i++ ) {
1543 if ( activeConditionMap.
at(i) ) {
1558 for (
int i = 1; i <=
nsurf; i++ ) {
1560 strainSpaceHardeningVariables);
1561 if ( hasHardening ) {
1563 strainSpaceHardeningVariables);
1568 for (
int i = 1; i <=
nsurf; i++ ) {
1570 strainSpaceHardeningVariables);
1571 if ( hasHardening ) {
1573 strainSpaceHardeningVariables);
1578 umat.
resize(strSize, actSurf);
1579 vmat.
resize(actSurf, strSize);
1580 gmat.
resize(actSurf, actSurf);
1582 if ( hasHardening ) {
1584 strainSpaceHardeningVariables, gamma);
1586 fullStressVector, strainSpaceHardeningVariables, gamma);
1589 for (
int i = 1; i <=
nsurf; i++ ) {
1590 if ( ( indx = activeConditionMap.
at(i) ) ) {
1591 if ( hasHardening ) {
1593 helpVector.
add(yieldGradSigVec [ i - 1 ]);
1594 for (
int j = 1; j <= strSize; j++ ) {
1595 vmat.
at(indx, j) = helpVector.
at(j);
1598 for (
int j = 1; j <= strSize; j++ ) {
1599 vmat.
at(indx, j) = yieldGradSigVec [ i - 1 ].at(j);
1603 for (
int j = 1; j <= strSize; j++ ) {
1604 umat.
at(j, indx) += ( * loadGradSigVecPtr ) [ i - 1 ].at(j);
1608 if ( hasHardening ) {
1610 for (
int j = 1; j <= actSurf; j++ ) {
1611 gmat.
at(indx, j) = ( -1.0 ) * helpVector2.
at(j);
1619 gmat.
add(helpMtrx2);
1627 answer.
add(elasticModuli);
1689 if ( originalMode != _3dMat ) {
1690 OOFEM_ERROR(
"Different stressStrain mode encountered");
1701 if ( mode == TangentStiffness ) {
1727 if ( mode == TangentStiffness ) {
1751 if ( mode == TangentStiffness ) {
1773 if ( mode == TangentStiffness ) {
1799 if ( mode == TangentStiffness ) {
1825 if ( mode == TangentStiffness ) {
1849 if ( mode == TangentStiffness ) {
1865 if ( type == IST_PlasticStrainTensor ) {
1870 }
else if ( type == IST_PrincipalPlasticStrainTensor ) {
1890 if ( size > (
int ) (
sizeof(
long ) * 8 ) ) {
1891 printf(
"MPlasticMaterial2: too many yield conditions");
1894 for (
int i = 1; i <= mask.
giveSize(); i++ ) {
1896 val |= ( 1L << ( i - 1 ) );
1931 int candDegree = 0, candSize = candidateMask.
giveSize();
1932 for (
int i = 1; i <= candSize; i++ ) {
1933 if ( candidateMask.
at(i) ) {
1941 if ( candDegree <= degree ) {
1948 result = candidateMask;
1954 IntArray candidateArray(candDegree);
1956 for (
int i = 1, j = 1; i <= candSize; i++ ) {
1957 if ( candidateMask.
at(i) ) {
1958 candidateArray.
at(j++) = i;
1963 int activeIndx = degree;
1964 for (
int i = 1; i <= degree; i++ ) {
1972 for (
int i = 1; i <= degree; i++ ) {
1973 ii = candidateArray.
at( ind.
at(i) );
1974 if ( !result.
at(ii) ) {
1975 result.
at(ii) = count++;
1981 for (
int i = 1; i <= size; i++ ) {
1982 if ( result.
at(i) ) {
1983 result.
at(i) = count++;
1995 activeIndx = degree;
1997 if ( ind.
at(activeIndx) < candDegree ) {
1998 ind.
at(activeIndx)++;
2001 ind.
at(activeIndx) = 1;
2003 if ( activeIndx > 0 ) {
2010 }
while ( activeIndx >= 1 );
2016 int activeIndx = degree;
2017 for (
int i = 1; i <= degree; i++ ) {
2025 for (
int i = 1; i <= degree; i++ ) {
2027 if ( !result.
at(ii) ) {
2028 result.
at(ii) = count++;
2034 for (
int i = 1; i <= size; i++ ) {
2035 if ( result.
at(i) ) {
2036 result.
at(i) = count++;
2048 activeIndx = degree;
2050 if ( ind.
at(activeIndx) < size ) {
2051 ind.
at(activeIndx)++;
2054 ind.
at(activeIndx) = 1;
2056 if ( activeIndx > 0 ) {
2063 }
while ( activeIndx >= 1 );
2076 strainSpaceHardeningVarsVector(statusSize), tempStrainSpaceHardeningVarsVector(statusSize),
2092 fprintf(file,
"status { ");
2095 fprintf(file,
" Yielding,");
2097 fprintf(file,
" Unloading,");
2100 fprintf(file,
" Plastic strains");
2102 fprintf( file,
" %.4e", val );
2106 fprintf(file,
" Strain space hardening vars");
2108 fprintf( file,
" %.4e", val );
2112 fprintf(file,
" ActiveConditionMap");
2114 fprintf( file,
" %d", val );
2118 fprintf(file,
"}\n");
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
virtual void computeReducedSSGradientMatrix(FloatMatrix &gradientMatrix, int i, GaussPoint *gp, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)=0
Computes second derivative of loading function with respect to stress.
virtual void givePlateLayerStiffMtrx(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d plate layer stiffness matrix of receiver.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
static void computePrincipalValues(FloatArray &answer, const FloatArray &s, stressStrainPrincMode mode)
Common functions for convenience.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
contextIOResultType storeYourself(DataStream &stream) const
Stores array to output stream.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
MPlasticMaterial2Status(int n, Domain *d, GaussPoint *g, int statusSize)
FloatArray gamma
Consistency parameter values (needed for algorithmic stiffness).
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
virtual void give1dStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d stiffness matrix of receiver.
void printYourself() const
Prints receiver on stdout.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
GaussPoint * gp
Associated integration point.
virtual void computeReducedSKGradientMatrix(FloatMatrix &gradientMatrix, int i, GaussPoint *gp, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)=0
Computes second derivative of loading function with respect to stress and hardening vars...
LinearElasticMaterial * linearElasticMaterial
Reference to bulk (undamaged) material.
bool iterativeUpdateOfActiveConds
Flag indicating whether iterative update of a set of active yield conditions takes place...
For computing principal strains from engineering strains.
virtual ~MPlasticMaterial2Status()
bool solveForRhs(const FloatArray &b, FloatArray &answer, bool transpose=false)
Solves the system of linear equations .
virtual void giveFiberStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d fiber stiffness matrix of receiver.
virtual void computeReducedElasticModuli(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
contextIOResultType storeYourself(DataStream &stream) const
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
int nsurf
Number of yield surfaces.
void zero()
Sets all component to zero.
double & at(int i)
Coefficient access function.
void computeReducedStressGradientVector(FloatArray &answer, functType ftype, int isurf, GaussPoint *gp, const FloatArray &stressVector, const FloatArray &strainSpaceHardeningVariables)
virtual void givePlaneStrainStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane strain stiffness matrix of receiver.
double sgn(double i)
Returns the signum of given value (if value is < 0 returns -1, otherwise returns 1) ...
virtual void computeTrialStressIncrement(FloatArray &answer, GaussPoint *gp, const FloatArray &strainIncrement, TimeStep *tStep)
Computes full-space trial stress increment (elastic).
This class implements a structural material status information.
virtual void computeKGradientVector(FloatArray &answer, functType ftype, int isurf, GaussPoint *gp, FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)=0
Computes the derivative of yield/loading function with respect to vector.
const FloatArray & giveTempGamma()
virtual void givePlateLayerStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d plate layer stiffness matrix of receiver.
#define PLASTIC_MATERIAL_MAX_ITERATIONS
Element * giveElement()
Returns corresponding element to receiver.
void negated()
Changes sign of receiver values.
enum oofem::MPlasticMaterial2::plastType plType
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
void cuttingPlaneReturn(FloatArray &answer, IntArray &activeConditionMap, FloatArray &gamma, GaussPoint *gp, const FloatArray &totalStrain, FloatArray &plasticStrainR, FloatArray &strainSpaceHardeningVariables, TimeStep *tStep)
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode)
Method for subtracting from reduced space strain vector its stress-independent parts (caused by tempe...
MaterialMode
Type representing material mode of integration point.
virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane stress stiffness matrix of receiver.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
This class implements associated Material Status to MPlasticMaterial.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
MatResponseMode
Describes the character of characteristic material matrix.
functType
Type that allows to distinguish between yield function and loading function.
virtual ~MPlasticMaterial2()
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
static void giveFullSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the reduced unsymmetric Voigt vector (2nd order tensor) to full form.
void letTempDamageBe(double v)
void letTempStateFlagBe(int v)
std::set< long > populationSet
Set for keeping record of generated populations of active yield conditions during return...
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
void letTempPlasticStrainVectorBe(FloatArray v)
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *, const FloatArray &, TimeStep *)
Computes the real stress vector for given total strain and integration point.
static void giveReducedSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full unsymmetric Voigt vector (2nd order tensor) to reduced form.
FloatArray strainSpaceHardeningVarsVector
Strain space hardening variables, e.g.
IntArray tempActiveConditionMap
void addNewPopulation(IntArray &mask)
int giveNumber()
Returns number of receiver.
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
void times(double f)
Multiplies receiver by factor f.
contextIOResultType restoreYourself(DataStream &stream)
FloatArray tempPlasticStrainVector
int state_flag
Yield function status indicator.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
enum oofem::MPlasticMaterial2::ReturnMappingAlgoType rmType
virtual void computeStressGradientVector(FloatArray &answer, functType ftype, int isurf, GaussPoint *gp, const FloatArray &stressVector, const FloatArray &strainSpaceHardeningVariables)=0
Computes the stress gradient of yield/loading function (df/d_sigma).
LinearElasticMaterial * giveLinearElasticMaterial()
Returns reference to undamaged (bulk) material.
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
long getPopulationSignature(IntArray &mask)
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
contextIOResultType restoreYourself(DataStream &stream)
Restores array from image on stream.
#define YIELD_TOL_SECONDARY
virtual void giveFiberStiffMtrx(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d fiber stiffness matrix of receiver.
Abstract base class representing a material status information.
Class representing vector of real numbers.
virtual void computeReducedHardeningVarsSigmaGradient(FloatMatrix &answer, GaussPoint *gp, const IntArray &activeConditionMap, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVars, const FloatArray &gamma)=0
Computes derivative of vector with respect to stress.
const FloatArray & giveTempStrainSpaceHardeningVarsVector() const
Returns the actual (temp) hardening variable vector.
void computeAlgorithmicModuli(FloatMatrix &answer, GaussPoint *gp, const FloatMatrix &elasticModuliInverse, const FloatArray &gamma, const IntArray &activeConditionMap, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)
Implementation of matrix containing floating point numbers.
IntArray activeConditionMap
Active set of yield functions (needed for algorithmic stiffness).
virtual double computeDamage(GaussPoint *gp, const FloatArray &strainSpaceHardeningVariables, TimeStep *tStep)
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
const FloatArray & giveStrainSpaceHardeningVars() const
Returns the equilibrated hardening variable vector.
const FloatArray & giveStressVector() const
Returns the const pointer to receiver's stress vector.
virtual void give1dStressStiffMtrx(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d stiffness matrix of receiver.
double computeNorm() const
Computes the norm (or length) of the vector.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual void printYourself() const
Print receiver on stdout.
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
void add(const FloatMatrix &a)
Adds matrix to the receiver.
void zero()
Zeroes all coefficients of receiver.
void setTempActiveConditionMap(IntArray v)
void closestPointReturn(FloatArray &answer, IntArray &activeConditionMap, FloatArray &gamma, GaussPoint *gp, const FloatArray &totalStrain, FloatArray &plasticStrainR, FloatArray &strainSpaceHardeningVariables, TimeStep *tStep)
void letTempStrainSpaceHardeningVarsVectorBe(FloatArray v)
virtual void computeReducedHardeningVarsLamGradient(FloatMatrix &answer, GaussPoint *gp, int actSurf, const IntArray &activeConditionMap, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVars, const FloatArray &gamma)=0
computes derivative of vector with respect to lambda vector
MPlasticMaterial2(int n, Domain *d)
void times(double s)
Multiplies receiver with scalar.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
virtual void givePlaneStrainStiffMtrx(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane strain stiffness matrix of receiver.
virtual void computeStrainHardeningVarsIncrement(FloatArray &answer, GaussPoint *gp, const FloatArray &stress, const FloatArray &dlambda, const FloatArray &dplasticStrain, const IntArray &activeConditionMap)=0
Computes the increment of strain-space hardening variables.
Abstract base class for all "structural" constitutive models.
void computeResidualVector(FloatArray &answer, GaussPoint *gp, const FloatArray &gamma, const IntArray &activeConditionMap, const FloatArray &plasticStrainVectorR, const FloatArray &strainSpaceHardeningVariables, std::vector< FloatArray > &gradVec)
void zero()
Zeroes all coefficient of receiver.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Domain * giveDomain() const
void clearPopulationSet()
virtual void give2dBeamLayerStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d beam layer stiffness matrix of receiver.
virtual double computeYieldValueAt(GaussPoint *gp, int isurf, const FloatArray &stressVector, const FloatArray &strainSpaceHardeningVariables)=0
Computes the value of yield function.
virtual void give2dBeamLayerStiffMtrx(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d beam layer stiffness matrix of receiver.
int testPopulation(long pop)
const IntArray & giveTempActiveConditionMap()
virtual void giveElastoPlasticStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
virtual int giveSizeOfReducedHardeningVarsVector(GaussPoint *) const
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
const FloatArray & giveTempStressVector() const
Returns the const pointer to receiver's temporary stress vector.
virtual int giveMaxNumberOfActiveYieldConds(GaussPoint *gp)=0
int giveSize() const
Returns the size of receiver.
void setTempGamma(FloatArray v)
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
virtual void giveConsistentStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
the oofem namespace is to define a context or scope in which all oofem names are defined.
FloatArray plasticStrainVector
Plastic strain vector.
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane stress stiffness matrix of receiver.
int giveNumberOfRows() const
Returns number of rows of receiver.
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
int getNewPopulation(IntArray &result, IntArray &candidateMask, int degree, int size)
Class representing integration point in finite element program.
#define OOFEM_WARNING(...)
const FloatArray & givePlasticStrainVector() const
Returns the equilibrated strain vector.
Class representing solution step.
void add(const FloatArray &src)
Adds array src to receiver.
virtual int hasHardening()=0
Indicates, whether receiver model has hardening/softening behavior or behaves according to perfect pl...
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
void resize(int s)
Resizes receiver towards requested size.
FloatArray tempStrainSpaceHardeningVarsVector