00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include <Steel01.h>
00039 #include <Vector.h>
00040 #include <Channel.h>
00041 #include <Information.h>
00042 #include <math.h>
00043 #include <float.h>
00044
00045 Steel01::Steel01
00046 (int tag, double FY, double E, double B,
00047 double A1, double A2, double A3, double A4,
00048 double min, double max) :
00049 UniaxialMaterial(tag,MAT_TAG_Steel01),
00050 fy(FY), E0(E), b(B), a1(A1), a2(A2), a3(A3), a4(A4),
00051 epsmin(min), epsmax(max)
00052 {
00053
00054 epsy = fy/E0;
00055 Esh = b*E0;
00056
00057
00058 revertToStart ();
00059
00060
00061 Ttangent = E0;
00062 }
00063
00064 Steel01::Steel01():UniaxialMaterial(0,MAT_TAG_Steel01),
00065 fy(0.0), E0(0.0), b(0.0), a1(0.0), a2(0.0), a3(0.0), a4(0.0),
00066 epsmin(0.0), epsmax(0.0)
00067 {
00068
00069 }
00070
00071 Steel01::~Steel01 ()
00072 {
00073
00074 }
00075
00076 void Steel01::setHistoryVariables ()
00077 {
00078 TminStrain = CminStrain;
00079 TmaxStrain = CmaxStrain;
00080 TshiftP = CshiftP;
00081 TshiftN = CshiftN;
00082 Tloading = Cloading;
00083 Tfailed = Cfailed;
00084 }
00085
00086 int Steel01::setTrialStrain (double strain, double strainRate)
00087 {
00088
00089 setHistoryVariables ();
00090
00091
00092 Tstrain = strain;
00093
00094
00095 double dStrain = Tstrain - Cstrain;
00096
00097
00098 if (fabs(dStrain) > DBL_EPSILON)
00099 determineTrialState (dStrain);
00100
00101 return 0;
00102 }
00103
00104 int Steel01::setTrial (double strain, double &stress, double &tangent, double strainRate)
00105 {
00106
00107 setHistoryVariables ();
00108
00109
00110 Tstrain = strain;
00111
00112
00113 double dStrain = Tstrain - Cstrain;
00114
00115
00116 if (fabs(dStrain) > DBL_EPSILON)
00117 determineTrialState (dStrain);
00118
00119 stress = Tstress;
00120 tangent = Ttangent;
00121
00122 return 0;
00123 }
00124
00125 void Steel01::determineTrialState (double dStrain)
00126 {
00127 if (Tstrain <= epsmin || Tstrain >= epsmax)
00128 Tfailed = 1;
00129
00130 if (Tfailed) {
00131 Tstress = 0.0;
00132 Ttangent = 0.0;
00133 } else {
00134
00135 double c, c1, c2, c3;
00136
00137 c = Cstress + E0*dStrain;
00138
00139 double fyOneMinusB = fy * (1.0 - b);
00140
00141 c1 = Esh*Tstrain;
00142
00143 c2 = TshiftN*fyOneMinusB;
00144
00145 c3 = TshiftP*fyOneMinusB;
00146
00147 double c1c3 = c1+c3;
00148
00149 if (c1c3 < c)
00150 Tstress = c1c3;
00151 else
00152 Tstress = c;
00153
00154 double c1c2=c1-c2;
00155 if (c1c2 > Tstress)
00156 Tstress = c1c2;
00157
00158 if (fabs(Tstress-c) < 1.0e-15)
00159 Ttangent = E0;
00160 else
00161 Ttangent = Esh;
00162
00163
00164 detectLoadReversal (dStrain);
00165
00166 }
00167 }
00168
00169 void Steel01::detectLoadReversal (double dStrain)
00170 {
00171
00172 if (Tloading == 0 && dStrain != 0.0)
00173 {
00174 if (dStrain > 0.0)
00175 Tloading = 1;
00176 else
00177 Tloading = -1;
00178 }
00179
00180
00181
00182 if (Tloading == 1 && dStrain < 0.0)
00183 {
00184 Tloading = -1;
00185 if (Cstrain > TmaxStrain)
00186 TmaxStrain = Cstrain;
00187 TshiftN = 1 + a1*pow((TmaxStrain-TminStrain)/(2.0*a2*epsy),0.8);
00188 }
00189
00190
00191
00192 if (Tloading == -1 && dStrain > 0.0)
00193 {
00194 Tloading = 1;
00195 if (Cstrain < TminStrain)
00196 TminStrain = Cstrain;
00197 TshiftP = 1 + a3*pow((TmaxStrain-TminStrain)/(2.0*a4*epsy),0.8);
00198 }
00199 }
00200
00201 double Steel01::getStrain ()
00202 {
00203 return Tstrain;
00204 }
00205
00206 double Steel01::getStress ()
00207 {
00208 return Tstress;
00209 }
00210
00211 double Steel01::getTangent ()
00212 {
00213 return Ttangent;
00214 }
00215
00216 double Steel01::getSecant ()
00217 {
00218 if (fabs(Tstrain) > DBL_EPSILON)
00219 return Tstress/Tstrain;
00220 else
00221 return Ttangent;
00222 }
00223
00224 int Steel01::commitState ()
00225 {
00226
00227 CminStrain = TminStrain;
00228 CmaxStrain = TmaxStrain;
00229 CshiftP = TshiftP;
00230 CshiftN = TshiftN;
00231 Cloading = Tloading;
00232 Cfailed = Tfailed;
00233
00234
00235 Cstrain = Tstrain;
00236 Cstress = Tstress;
00237 Ctangent = Ttangent;
00238
00239 return 0;
00240 }
00241
00242 int Steel01::revertToLastCommit ()
00243 {
00244
00245 setHistoryVariables();
00246
00247
00248 Tstrain = Cstrain;
00249 Tstress = Cstress;
00250 Ttangent = Ctangent;
00251
00252 return 0;
00253 }
00254
00255 int Steel01::revertToStart ()
00256 {
00257
00258 CminStrain = 0.0;
00259 CmaxStrain = 0.0;
00260 CshiftP = 1.0;
00261 CshiftN = 1.0;
00262 Cloading = 0;
00263 Cfailed = 0;
00264
00265 setHistoryVariables ();
00266
00267
00268 Cstrain = 0.0;
00269 Cstress = 0.0;
00270 Ctangent = E0;
00271
00272 Tstrain = 0.0;
00273 Tstress = 0.0;
00274 Ttangent = E0;
00275
00276 return 0;
00277 }
00278
00279 UniaxialMaterial* Steel01::getCopy ()
00280 {
00281 Steel01* theCopy = new Steel01(this->getTag(), fy, E0, b,
00282 a1, a2, a3, a4, epsmin, epsmax);
00283
00284
00285 theCopy->epsy = epsy;
00286 theCopy->Esh = Esh;
00287
00288
00289 theCopy->CminStrain = CminStrain;
00290 theCopy->CmaxStrain = CmaxStrain;
00291 theCopy->CshiftP = CshiftP;
00292 theCopy->CshiftN = CshiftN;
00293 theCopy->Cloading = Cloading;
00294 theCopy->Cfailed = Cfailed;
00295
00296
00297 theCopy->setHistoryVariables();
00298
00299
00300 theCopy->Cstrain = Cstrain;
00301 theCopy->Cstress = Cstress;
00302 theCopy->Ctangent = Ctangent;
00303
00304
00305 theCopy->Tstrain = Tstrain;
00306 theCopy->Tstress = Tstress;
00307 theCopy->Ttangent = Ttangent;
00308
00309 return theCopy;
00310 }
00311
00312 int Steel01::sendSelf (int commitTag, Channel& theChannel)
00313 {
00314 int res = 0;
00315 static Vector data(19);
00316 data(0) = this->getTag();
00317
00318
00319 data(1) = fy;
00320 data(2) = E0;
00321 data(3) = b;
00322 data(4) = a1;
00323 data(5) = a2;
00324 data(6) = a3;
00325 data(7) = a4;
00326 data(8) = epsmin;
00327 data(9) = epsmax;
00328
00329
00330 data(10) = CminStrain;
00331 data(11) = CmaxStrain;
00332 data(12) = CshiftP;
00333 data(13) = CshiftN;
00334 data(14) = Cloading;
00335 data(15) = Cfailed;
00336
00337
00338 data(16) = Cstrain;
00339 data(17) = Cstress;
00340 data(18) = Ctangent;
00341
00342
00343
00344
00345 res = theChannel.sendVector(this->getDbTag(), commitTag, data);
00346 if (res < 0)
00347 cerr << "Steel01::sendSelf() - failed to send data\n";
00348
00349 return res;
00350 }
00351
00352 int Steel01::recvSelf (int commitTag, Channel& theChannel,
00353 FEM_ObjectBroker& theBroker)
00354 {
00355 int res = 0;
00356 static Vector data(19);
00357 res = theChannel.recvVector(this->getDbTag(), commitTag, data);
00358
00359 if (res < 0) {
00360 cerr << "Steel01::recvSelf() - failed to receive data\n";
00361 this->setTag(0);
00362 }
00363 else {
00364 this->setTag(int(data(0)));
00365
00366
00367 fy = data(1);
00368 E0 = data(2);
00369 b = data(3);
00370 a1 = data(4);
00371 a2 = data(5);
00372 a3 = data(6);
00373 a4 = data(7);
00374 epsmin = data(8);
00375 epsmax = data(9);
00376
00377 epsy = fy/E0;
00378 Esh = b*E0;
00379
00380
00381 CminStrain = data(10);
00382 CmaxStrain = data(11);
00383 CshiftP = data(12);
00384 CshiftN = data(13);
00385 Cloading = int(data(14));
00386 Cfailed = int(data(15));
00387
00388
00389
00390 setHistoryVariables ();
00391
00392
00393 Cstrain = data(16);
00394 Cstress = data(17);
00395 Ctangent = data(18);
00396
00397
00398 Tstrain = Cstrain;
00399 Tstress = Cstress;
00400 Ttangent = Ctangent;
00401 }
00402
00403 return res;
00404 }
00405
00406 void Steel01::Print (ostream& s, int flag)
00407 {
00408 s << "Steel01 tag: " << this->getTag() << endl;
00409 s << " fy: " << fy << endl;
00410 s << " E0: " << E0 << endl;
00411 s << " b: " << b << endl;
00412 s << " a1: " << a1 << endl;
00413 s << " a2: " << a2 << endl;
00414 s << " a3: " << a3 << endl;
00415 s << " a4: " << a4 << endl;
00416 if (epsmin != NEG_INF_STRAIN)
00417 s << " epsmin: " << epsmin << endl;
00418 if (epsmax != POS_INF_STRAIN)
00419 s << " epsmax: " << epsmax << endl;
00420 }
00421
00422 int
00423 Steel01::setParameter(char **argv, int argc, Information &info)
00424 {
00425 if (argc < 1)
00426 return -1;
00427
00428 if (strcmp(argv[0],"fy") == 0) {
00429 info.theType = DoubleType;
00430 return 1;
00431 }
00432 if (strcmp(argv[0],"E0") == 0) {
00433 info.theType = DoubleType;
00434 return 2;
00435 }
00436 if (strcmp(argv[0],"b") == 0) {
00437 info.theType = DoubleType;
00438 return 3;
00439 }
00440 if (strcmp(argv[0],"a1") == 0) {
00441 info.theType = DoubleType;
00442 return 4;
00443 }
00444 if (strcmp(argv[0],"a2") == 0) {
00445 info.theType = DoubleType;
00446 return 5;
00447 }
00448 if (strcmp(argv[0],"a3") == 0) {
00449 info.theType = DoubleType;
00450 return 6;
00451 }
00452 if (strcmp(argv[0],"a4") == 0) {
00453 info.theType = DoubleType;
00454 return 7;
00455 }
00456 if (strcmp(argv[0],"epsmin") == 0) {
00457 info.theType = DoubleType;
00458 return 8;
00459 }
00460 if (strcmp(argv[0],"epsmax") == 0) {
00461 info.theType = DoubleType;
00462 return 9;
00463 }
00464 else
00465 cerr << "WARNING: Could not set parameter in Steel01. " << endl;
00466
00467 return -1;
00468 }
00469
00470 int
00471 Steel01::updateParameter(int parameterID, Information &info)
00472 {
00473 switch (parameterID) {
00474 case -1:
00475 return -1;
00476 case 1:
00477 this->fy = info.theDouble;
00478 break;
00479 case 2:
00480 this->E0 = info.theDouble;
00481 break;
00482 case 3:
00483 this->b = info.theDouble;
00484 break;
00485 case 4:
00486 this->a1 = info.theDouble;
00487 break;
00488 case 5:
00489 this->a2 = info.theDouble;
00490 break;
00491 case 6:
00492 this->a3 = info.theDouble;
00493 break;
00494 case 7:
00495 this->a4 = info.theDouble;
00496 break;
00497 case 8:
00498 this->epsmin = info.theDouble;
00499 break;
00500 case 9:
00501 this->epsmax = info.theDouble;
00502 break;
00503 default:
00504 return -1;
00505 }
00506
00507 epsy = fy/E0;
00508 Esh = b*E0;
00509 Ttangent = E0;
00510
00511 return 0;
00512 }