void stressDensity::getCurrentStress(void) { // -------- elastic stage (theStage = 0) ---------------------------------------- if (theStage !=1) { stressNext = stressCurrent + currentTangent*(strainNext-strainCurrent); return; } // -------- elastoplastic stage (theStage == 1) --------------------------------- // // strsg is the current stress at the start of the step strsg[0] = -stressCurrent(0); strsg[1] = -stressCurrent(1); strsg[2] = stressCurrent(2); strsg[3] = -0.5*(stressCurrent(0)+stressCurrent(1)); // stran is the strain increment for this step stran[0] = -(strainNext(0) - strainCurrent(0)); stran[1] = -(strainNext(1) - strainCurrent(1)); stran[2] = (strainNext(2) - strainCurrent(2))/2.0; // alter behaviour based on number of iterations if (iiter <= 3) { for (int i=0; i<4; i++) { strhs0[i] = strsg[i]; strhs0[i+4] = stran[i]; } for (int i=8; i<33; i++) { strhs0[i] = strhs[i-8]; } for (int i=0; i<3; i++) { for (int j=0; j<80; j++) { int m = i*80+40+j; strhs0[m] = hdp[j][i]; } } // don't engage the constitutive model when change in strain is very small if (iiter == 3) { if (abs(stran[0]) < 1.0e-10 && abs(stran[1]) < 1.0e-10 && abs(stran[2]) < 1.0e-10) { stressNext = stressCurrent + currentTangent*(strainNext-strainCurrent); return; } } } else { for (int i=0; i<4; i++) { strsg[i] = strhs0[i]; stran[i] = strhs0[i+4]; } for (int i=0; i<25; i++) { strhs[i] = strhs0[i+8]; } } // send this information to sdmuc in oths oths[10] = iiter; oths[11] = istep; // FORTRAN subroutine for stress integration sdmuc_(strhs, strsg, props, stran, nmats, nstrp, istep, iiter, ielem, strhs0, etahs, hdp, oths); // update iteration counter variable iiter++; // update member stress variable from FORTRAN results stressNext(0) = -strsg[0]; stressNext(1) = -strsg[1]; stressNext(2) = strsg[2]; // update material tangent coefficient materialParam(2) = props[5]; // get updated tangent pInit = -0.5*(stressNext(0)+stressNext(1)); this->calInitialTangent(); currentTangent = initialTangent; }
int stressDensity::recvSelf(int commitTag, Channel &theChannel,FEM_ObjectBroker &theBroker) { int res = 0; // place data in a vector static Vector vData(798); res = theChannel.recvVector(this->getDbTag(), commitTag, vData); if (res < 0) { opserr << "stressDensity::recvSelf() - failed to recv vData\n"; return -1; } this->setTag((int)vData(0)); theStage = (int)vData(1); massDensity = vData(2); materialParam(0) = vData(3); materialParam(1) = vData(4); materialParam(2) = vData(5); materialParam(3) = vData(6); materialParam(4) = vData(7); materialParam(5) = vData(8); materialParam(6) = vData(9); materialParam(7) = vData(10); materialParam(8) = vData(11); materialParam(9) = vData(12); materialParam(10) = vData(13); materialParam(11) = vData(14); materialParam(12) = vData(15); materialParam(13) = vData(16); materialParam(14) = vData(17); materialParam(15) = vData(18); materialParam(16) = vData(19); materialParam(17) = vData(20); materialParam(18) = vData(21); materialParam(19) = vData(22); materialParam(20) = vData(23); materialParam(21) = vData(24); materialParam(22) = vData(25); materialParam(23) = vData(26); materialParam(24) = vData(27); pFlag = (int)vData(28); pInit = vData(29); for (int i=0; i<12; i++) { oths[i] = vData(30+i); } for (int i=0; i<100; i++) { strhs[i] = vData(42+i); } for (int i=0; i<280; i++) { strhs0[i] = vData(142+i); } for (int i=0; i<40; i++) { etahs[i][0] = vData(422); etahs[i][1] = vData(462); etahs[i][2] = vData(502); } for (int i=0; i<80; i++) { hdp[i][0] = vData(542); hdp[i][1] = vData(622); hdp[i][2] = vData(702); } stressCurrent(0) = vData(782); stressCurrent(1) = vData(783); stressCurrent(2) = vData(784); strainCurrent(0) = vData(785); strainCurrent(1) = vData(786); strainCurrent(2) = vData(787); initialTangent(0,0) = vData(788); initialTangent(0,1) = vData(789); initialTangent(0,2) = vData(790); initialTangent(1,0) = vData(791); initialTangent(1,1) = vData(792); initialTangent(1,2) = vData(793); initialTangent(2,0) = vData(794); initialTangent(2,1) = vData(795); initialTangent(2,2) = vData(796); istep = vData(797); // set current tangent currentTangent = initialTangent; // populate props with model parameters (not all indices used in SDM-UC) props[3] = materialParam(1); props[5] = materialParam(2); props[27] = materialParam(3); props[28] = materialParam(4); props[29] = materialParam(5); props[26] = materialParam(6); props[30] = materialParam(7); props[32] = materialParam(8); props[31] = materialParam(9); props[34] = materialParam(10); props[33] = materialParam(11); props[36] = materialParam(12); props[35] = materialParam(13); props[37] = materialParam(14); props[38] = materialParam(15); props[39] = materialParam(16); props[40] = materialParam(17); props[41] = materialParam(18); props[42] = materialParam(19); props[43] = materialParam(20); props[44] = materialParam(21); props[45] = materialParam(22); props[46] = materialParam(23); props[10] = materialParam(0)/(1.0 + materialParam(0)); return 0; }
int stressDensity::sendSelf(int commitTag, Channel &theChannel) { int res = 0; static Vector vData(798); vData(0) = this->getTag(); vData(1) = theStage; vData(2) = massDensity; vData(3) = materialParam(0); vData(4) = materialParam(1); vData(5) = materialParam(2); vData(6) = materialParam(3); vData(7) = materialParam(4); vData(8) = materialParam(5); vData(9) = materialParam(6); vData(10) = materialParam(7); vData(11) = materialParam(8); vData(12) = materialParam(9); vData(13) = materialParam(10); vData(14) = materialParam(11); vData(15) = materialParam(12); vData(16) = materialParam(13); vData(17) = materialParam(14); vData(18) = materialParam(15); vData(19) = materialParam(16); vData(20) = materialParam(17); vData(21) = materialParam(18); vData(22) = materialParam(19); vData(23) = materialParam(20); vData(24) = materialParam(21); vData(25) = materialParam(22); vData(26) = materialParam(23); vData(27) = materialParam(24); vData(28) = pFlag; vData(29) = pInit; for (int i=0; i<12; i++) { vData(30+i) = oths[i]; } for (int i=0; i<100; i++) { vData(42+i) = strhs[i]; } for (int i=0; i<280; i++) { vData(142+i) = strhs0[i]; } for (int i=0; i<40; i++) { vData(422) = etahs[i][0]; vData(462) = etahs[i][1]; vData(502) = etahs[i][2]; } for (int i=0; i<80; i++) { vData(542) = hdp[i][0]; vData(622) = hdp[i][1]; vData(702) = hdp[i][2]; } vData(782) = stressCurrent(0); vData(783) = stressCurrent(1); vData(784) = stressCurrent(2); vData(785) = strainCurrent(0); vData(786) = strainCurrent(1); vData(787) = strainCurrent(2); vData(788) = initialTangent(0,0); vData(789) = initialTangent(0,1); vData(790) = initialTangent(0,2); vData(791) = initialTangent(1,0); vData(792) = initialTangent(1,1); vData(793) = initialTangent(1,2); vData(794) = initialTangent(2,0); vData(795) = initialTangent(2,1); vData(796) = initialTangent(2,2); vData(797) = istep; res = theChannel.sendVector(this->getDbTag(), commitTag, vData); if (res < 0) { opserr << "stressDensity::sendSelf() - failed to send vData\n"; return -1; } return 0; }
/*----------------------------------------------------------------------------------- This method calculates current stress from a given current strain but does not update the model. The intial state remains the same during iteration. The intial state is stored in class members. The class members are nor directly passed to the FORTRAN subroutine. They are first copied in temporary variables (of static construct and hence are the same for all instances of this class) and then passed to FORTRAN subroutine. If the state is committed, the class members are updated from these temporary variables; else not. The temporary variables have an underscore as the prefix. -----------------------------------------------------------------------------------*/ void StressDilatancyModel2D::GetCurrentStress(void){ // Elastic // --------- if (theStage!=1){ stressNext=stressCurrent+currentTangent*(strainNext-strainCurrent); return; } // Plastic // --------- // Copy the temporary variables // Change the sign of the input data from OPENSEES // Compressive (normal) stress and strain is +ve for(int i=0;i<2;i++)_stress_current[i] = -stressCurrent(i); for(int i=2;i<3;i++)_stress_current[i] = stressCurrent(i); for(int i=0;i<2;i++)_strain_current[i] = -strainCurrent(i); for(int i=2;i<3;i++)_strain_current[i] = strainCurrent(i)/2.; //convert to true strain for(int i=0;i<2;i++)_strain_next[i] = -strainNext(i); for(int i=2;i<3;i++)_strain_next[i] = strainNext(i)/2.; // convert to true strain for(int i=0;i<16;i++)_model_parameter[i] = modelParameter[i]; for(int i=0;i<10;i++)_ssl_void_ratio[i] = sslVoidratio[i]; for(int i=0;i<10;i++)_ssl_pressure[i] = refPressure[i]; for(int i=0;i<10;i++)_hsl_void_ratio[i] = hslVoidratio[i]; for(int i=0;i<10;i++)_hsl_pressure[i] = refPressure[i]; for(int i=0;i<Nsurface*7+3;i++) { _hard_para_real[i] = hard_para_real[i]; } for(int i=0;i<2;i++) { _hard_para_int[i] = hard_para_int[i]; } for(int i=0;i<2;i++)_anisotropy[i] = refOrigin[i]; // in Fortran the double-scripted arrays will be transposed for(int i=0;i<3;i++) { for(int j=0;j<3;j++) _tangent[j][i]=currentTangent(i,j); } //Fortran subroutine for stress integration... sdm2d_(_stress_current, _strain_current, _strain_next, _model_parameter, _ssl_void_ratio, _ssl_pressure, _hsl_void_ratio, _hsl_pressure, _hard_para_real, _hard_para_int, _tangent); //Update the stress variable only as the state is not committed for(int i=0;i<2;i++) stressNext(i) = -_stress_current[i]; for(int i=2;i<3;i++) stressNext(i) = _stress_current[i]; // in Fortran the double-scripted arrays will be transposed // in this section tangent is calculated for the Full-Newton-Raphson scheme for(int i=0;i<3;i++) { for(int j=0;j<3;j++) currentTangent(i,j) = _tangent[j][i]; } }
int StressDilatancyModel2D::recvSelf(int commitTag, Channel &theChannel,FEM_ObjectBroker &theBroker) { int res = 0; // place data in a vector static Vector vData(317); res = theChannel.recvVector(this->getDbTag(), commitTag, vData); if (res < 0) { opserr << "StressDilatancyModel::recvSelf() - failed to recv vData\n"; return -1; } this->setTag((int)vData(0)); theStage = (int)vData(1); hard_para_int[0] = (int)vData(2); hard_para_int[1] = (int)vData(3); theDensity = vData(4); modelParameter[0] = vData(5); modelParameter[1] = vData(6); modelParameter[2] = vData(7); modelParameter[3] = vData(8); modelParameter[4] = vData(9); modelParameter[5] = vData(10); modelParameter[6] = vData(11); modelParameter[7] = vData(12); modelParameter[8] = vData(13); modelParameter[9] = vData(14); modelParameter[10] = vData(15); modelParameter[11] = vData(16); modelParameter[12] = vData(17); modelParameter[13] = vData(18); modelParameter[14] = vData(19); modelParameter[15] = vData(20); sslVoidratio[0] = vData(21); hslVoidratio[0] = vData(31); refPressure[0] = vData(41); sslVoidratio[1] = vData(22); hslVoidratio[1] = vData(32); refPressure[1] = vData(42); sslVoidratio[2] = vData(23); hslVoidratio[2] = vData(33); refPressure[2] = vData(43); sslVoidratio[3] = vData(24); hslVoidratio[3] = vData(34); refPressure[3] = vData(44); sslVoidratio[4] = vData(25); hslVoidratio[4] = vData(35); refPressure[4] = vData(45); sslVoidratio[5] = vData(26); hslVoidratio[5] = vData(36); refPressure[5] = vData(46); sslVoidratio[6] = vData(27); hslVoidratio[6] = vData(37); refPressure[6] = vData(47); sslVoidratio[7] = vData(28); hslVoidratio[7] = vData(38); refPressure[7] = vData(48); sslVoidratio[8] = vData(29); hslVoidratio[8] = vData(39); refPressure[8] = vData(49); sslVoidratio[9] = vData(30); hslVoidratio[9] = vData(40); refPressure[9] = vData(50); refOrigin[0] = vData(51); stressCurrent(0) = vData(54); strainCurrent(0) = vData(57); refOrigin[1] = vData(52); stressCurrent(1) = vData(55); strainCurrent(1) = vData(58); refOrigin[2] = vData(53); stressCurrent(2) = vData(56); strainCurrent(2) = vData(59); currentTangent(0,0) = vData(60); currentTangent(0,1) = vData(63); currentTangent(0,2) = vData(66); currentTangent(1,0) = vData(61); currentTangent(1,1) = vData(64); currentTangent(1,2) = vData(67); currentTangent(2,0) = vData(62); currentTangent(2,1) = vData(65); currentTangent(2,2) = vData(68); for (int i=0;i<Nsurface*7+3;i++) { hard_para_real[i] = vData(69+i); } return 0; }
int StressDilatancyModel2D::sendSelf(int commitTag, Channel &theChannel) { int res = 0; // place data in a vector static Vector vData(317); vData(0) = this->getTag(); vData(1) = theStage; vData(2) = hard_para_int[0]; vData(3) = hard_para_int[1]; vData(4) = theDensity; vData(5) = modelParameter[0]; vData(6) = modelParameter[1]; vData(7) = modelParameter[2]; vData(8) = modelParameter[3]; vData(9) = modelParameter[4]; vData(10) = modelParameter[5]; vData(11) = modelParameter[6]; vData(12) = modelParameter[7]; vData(13) = modelParameter[8]; vData(14) = modelParameter[9]; vData(15) = modelParameter[10]; vData(16) = modelParameter[11]; vData(17) = modelParameter[12]; vData(18) = modelParameter[13]; vData(19) = modelParameter[14]; vData(20) = modelParameter[15]; vData(21) = sslVoidratio[0]; vData(31) = hslVoidratio[0]; vData(41) = refPressure[0]; vData(22) = sslVoidratio[1]; vData(32) = hslVoidratio[1]; vData(42) = refPressure[1]; vData(23) = sslVoidratio[2]; vData(33) = hslVoidratio[2]; vData(43) = refPressure[2]; vData(24) = sslVoidratio[3]; vData(34) = hslVoidratio[3]; vData(44) = refPressure[3]; vData(25) = sslVoidratio[4]; vData(35) = hslVoidratio[4]; vData(45) = refPressure[4]; vData(26) = sslVoidratio[5]; vData(36) = hslVoidratio[5]; vData(46) = refPressure[5]; vData(27) = sslVoidratio[6]; vData(37) = hslVoidratio[6]; vData(47) = refPressure[6]; vData(28) = sslVoidratio[7]; vData(38) = hslVoidratio[7]; vData(48) = refPressure[7]; vData(29) = sslVoidratio[8]; vData(39) = hslVoidratio[8]; vData(49) = refPressure[8]; vData(30) = sslVoidratio[9]; vData(40) = hslVoidratio[9]; vData(50) = refPressure[9]; vData(51) = refOrigin[0]; vData(54) = stressCurrent(0); vData(57) = strainCurrent(0); vData(52) = refOrigin[1]; vData(55) = stressCurrent(1); vData(58) = strainCurrent(1); vData(53) = refOrigin[2]; vData(56) = stressCurrent(2); vData(59) = strainCurrent(2); vData(60) = currentTangent(0,0); vData(63) = currentTangent(0,1); vData(66) = currentTangent(0,2); vData(61) = currentTangent(1,0); vData(64) = currentTangent(1,1); vData(67) = currentTangent(1,2); vData(62) = currentTangent(2,0); vData(65) = currentTangent(2,1); vData(68) = currentTangent(2,2); for (int i=0;i<Nsurface*7+3;i++) { vData(69+i) = hard_para_real[i]; } res = theChannel.sendVector(this->getDbTag(), commitTag, vData); if (res < 0) { opserr << "StressDilatancyModel::sendSelf() - failed to send vData\n"; return -1; } return 0; }