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 #include <ShearCurve.h>
00029 #include <G3Globals.h>
00030 #include <math.h>
00031 #include <ElementResponse.h>
00032 #include <Element.h>
00033 #include <Node.h>
00034 #include <Domain.h>
00035 #include <Vector.h>
00036 #include <Parameter.h>
00037
00038 #include <float.h>
00039
00040 #include <DummyStream.h>
00041
00042
00043 ShearCurve::ShearCurve(int tag, int eTag, Domain *theDom,
00044 double r, double f, double B, double H, double D, double Fsw,
00045 double Kd, double Fr,
00046 int dType, int fType,
00047 int ni, int nj, int df, int dirn, double dd):
00048 LimitCurve(tag, TAG_ShearCurve), eleTag(eTag), theDomain(theDom), theElement(0),
00049 Kdeg(Kd), Fres(Fr), defType(dType), forType(fType),
00050 rho(r), fc(f), b(B), h(H), d(D), Fsw(Fsw),
00051 ndI(ni), ndJ(nj), dof(df), perpDirn(dirn), delta(dd)
00052 {
00053 stateFlag = 0;
00054
00055 theta1 = 0.037;
00056 theta4 = -0.027;
00057 theta5 = -0.034;
00058 sigma = 0.3;
00059 eps_normal = 0.0;
00060 }
00061
00062 ShearCurve::ShearCurve():
00063 LimitCurve(0, TAG_ShearCurve), eleTag(0), theDomain(0), theElement(0),
00064 Kdeg(0), Fres(0), defType(0), forType(0),
00065 rho(0), fc(0), b(0), d(0), h(0), Fsw(0)
00066 {
00067
00068 }
00069
00070 ShearCurve::~ShearCurve()
00071 {
00072
00073 }
00074
00075
00076 LimitCurve*
00077 ShearCurve::getCopy(void)
00078 {
00079 ShearCurve *theCopy = new ShearCurve(this->getTag(),
00080 eleTag, theDomain, rho, fc, b, h, d, Fsw,
00081 Kdeg, Fres, defType, forType, ndI, ndJ, dof, perpDirn, delta);
00082
00083 theCopy->stateFlag = stateFlag;
00084 theCopy->theta1 = theta1;
00085 theCopy->theta4 = theta4;
00086 theCopy->theta5 = theta5;
00087 theCopy->sigma = sigma;
00088 theCopy->eps_normal = eps_normal;
00089
00090 return theCopy;
00091 }
00092
00093
00094
00095 int
00096 ShearCurve::checkElementState(double springForce)
00097 {
00098 DummyStream dummy;
00099
00100 if (theElement == 0)
00101 {
00102 theElement = theDomain->getElement(eleTag);
00103
00104 if (theElement == 0) {
00105
00106 }
00107
00108 if (defType == 2)
00109 {
00110 Node *nodeI = theDomain->getNode(ndI);
00111 Node *nodeJ = theDomain->getNode(ndJ);
00112
00113 const Vector &crdI = nodeI->getCrds();
00114 const Vector &crdJ = nodeJ->getCrds();
00115
00116 if (crdI(perpDirn) == crdJ(perpDirn)) {
00117
00118
00119
00120 oneOverL = 0.0;
00121 }
00122 else
00123 oneOverL = 1.0/fabs(crdJ(perpDirn) - crdI(perpDirn));
00124 }
00125 }
00126
00127 double deform;
00128 double force;
00129 int result;
00130
00131
00132
00133
00134 if (defType == 1)
00135 {
00136
00137 Response *theRotations =0;
00138
00139 const char *r[1] = {"basicDeformations"};
00140
00141 Information *rotInfoObject =0;
00142
00143 Vector *rotVec;
00144
00145
00146 theRotations = theElement->setResponse(r, 1, *rotInfoObject, dummy);
00147
00148
00149 result = theRotations->getResponse();
00150
00151
00152 Information &theInfo = theRotations->getInformation();
00153 rotVec = (theInfo.theVector);
00154
00155 deform = (fabs((*rotVec)(1)) > fabs((*rotVec)(2))) ?
00156 fabs((*rotVec)(1)) : fabs((*rotVec)(2));
00157 }
00158 else if (defType == 2)
00159 {
00160
00161 Node *nodeI = theDomain->getNode(ndI);
00162 Node *nodeJ = theDomain->getNode(ndJ);
00163
00164
00165
00166 const Vector &dispI = nodeI->getTrialDisp();
00167 const Vector &dispJ = nodeJ->getTrialDisp();
00168
00169
00170
00171
00172
00173
00174 double dx = fabs(dispJ(dof)-dispI(dof));
00175 deform = dx*oneOverL;
00176 }
00177 else {
00178
00179 }
00180
00181 Response *theForces =0;
00182
00183 const char *f[1] = {"localForce"};
00184
00185
00186 Information *forInfoObject =0;
00187
00188 Vector *forceVec;
00189
00190
00191 theForces = theElement->setResponse(f, 1, *forInfoObject, dummy);
00192
00193
00194 result += theForces->getResponse();
00195
00196
00197 Information &theInfo = theForces->getInformation();
00198 forceVec = (theInfo.theVector);
00199
00200
00201 if (forType == 0)
00202 force = fabs(springForce);
00203 else if (forType == 1)
00204 force = fabs((*forceVec)(1));
00205 else if (forType == 2)
00206 force = fabs((*forceVec)(0));
00207 else {
00208
00209 }
00210
00211 P = fabs((*forceVec)(0));
00212
00213
00214
00215
00216 double forceSurface = findLimit(deform);
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228 if (stateFlag == 0)
00229 {
00230 if (force >= forceSurface)
00231
00232
00233 {
00234 stateFlag = 1;
00235 setDegSlope(force, deform);
00236
00237
00238 opserr << "ShearCurve - failure detected....."<< endln;
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248 }
00249 else
00250 {
00251 stateFlag = 0;
00252 }
00253 }
00254 else
00255 {
00256 if (force >= forceSurface)
00257
00258 {
00259 stateFlag = 2;
00260 }
00261 else
00262 {
00263 stateFlag = 3;
00264 }
00265 }
00266
00267 return stateFlag;
00268 }
00269
00270
00271 double
00272 ShearCurve::getDegSlope(void)
00273 {
00274 return Kdeg;
00275 }
00276
00277
00278 double
00279 ShearCurve::getResForce(void)
00280 {
00281 return Fres;
00282 }
00283
00284 double
00285 ShearCurve::getUnbalanceForce(void)
00286 {
00287
00288 return 0.0;
00289 }
00290
00291 int
00292 ShearCurve::sendSelf(int commitTag, Channel &theChannel)
00293 {
00294 return -1;
00295 }
00296
00297 int
00298 ShearCurve::recvSelf(int commitTag, Channel &theChannel,
00299 FEM_ObjectBroker &theBroker)
00300 {
00301 return -1;
00302 }
00303
00304 void
00305 ShearCurve::Print(OPS_Stream &s, int flag)
00306 {
00307 s << "Shear Limit Curve, tag: " << this->getTag() << endln;
00308 s << "rho: " << rho << endln;
00309 s << "fc: " << fc <<" psi" << endln;
00310 s << "b,d: " << b <<" in., "<< d << " in." << endln;
00311 s << "eleTag: " << eleTag << endln;
00312 s << "nodeI: " << ndI << endln;
00313 s << "nodeJ: " << ndJ << endln;
00314 s << "deform: " << defType << endln;
00315 s << "force: " << forType << endln;
00316 }
00317
00318
00319
00320
00321
00322 void
00323 ShearCurve::setDegSlope(double V, double Dshear)
00324 {
00325 if (Kdeg > 0.0)
00326 {
00327
00328
00329
00330
00331 double mu = 0.0;
00332 double theta = 65.0*PI/180.0;
00333 double Daxial;
00334
00335
00336
00337
00338
00339 Daxial = 0.04*(1+tan(theta)*tan(theta))/(tan(theta)+P/Fsw/tan(theta));
00340
00341
00342
00343
00344 if (defType == 2)
00345 {
00346 double K = -V/(Daxial-Dshear)*oneOverL;
00347 Kdeg = 1/(1/K - 1/Kdeg);
00348 }
00349 else {
00350
00351 }
00352
00353 }
00354
00355 }
00356
00357
00358 double
00359 ShearCurve::findLimit(double DR)
00360
00361 {
00362
00363 double V = 0.0;
00364
00365
00366 if (DR < 0.01)
00367 V = 9.9e9;
00368 else {
00369
00370 V = 500*(0.03+delta+4*rho-DR-0.025*P/b/h/(fc/1000))*(b*d*sqrt(fc)/1000);
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388 }
00389 if (V < 0.0)
00390 V = 0.0;
00391
00392
00393 return V;
00394
00395 }
00396
00397
00398
00399
00400
00401
00402
00403
00404 int
00405 ShearCurve::setParameter(const char **argv, int argc, Parameter ¶m)
00406 {
00407 if (argc < 1)
00408 return 0;
00409
00410 if (strcmp(argv[0],"theta1") == 0)
00411 return param.addObject(1, this);
00412
00413 if (strcmp(argv[0],"theta4") == 0)
00414 return param.addObject(2, this);
00415
00416 if (strcmp(argv[0],"theta5") == 0)
00417 return param.addObject(3, this);
00418
00419 if (strcmp(argv[0],"sigma") == 0)
00420 return param.addObject(4, this);
00421
00422 if (strcmp(argv[0],"eps_normal") == 0)
00423 return param.addObject(5, this);
00424
00425 if (strcmp(argv[0],"fc") == 0)
00426 return param.addObject(6, this);
00427
00428 else
00429 opserr << "WARNING: Could not set parameter in Shear Curve. " << endln;
00430
00431 return 0;
00432 }
00433
00434
00435
00436 int
00437 ShearCurve::updateParameter(int parameterID, Information &info)
00438 {
00439 switch (parameterID) {
00440 case -1:
00441 return -1;
00442 case 1:
00443 this->theta1 = info.theDouble;
00444 break;
00445 case 2:
00446 this->theta4 = info.theDouble;
00447 break;
00448 case 3:
00449 this->theta5 = info.theDouble;
00450 break;
00451 case 4:
00452 this->sigma = info.theDouble;
00453 break;
00454 case 5:
00455 this->eps_normal = info.theDouble;
00456 break;
00457 case 6:
00458 this->fc = info.theDouble;
00459 break;
00460
00461 default:
00462 return -1;
00463 }
00464
00465
00466 return 0;
00467 }
00468
00469
00470
00471 int ShearCurve::revertToStart ()
00472 {
00473 stateFlag = 0;
00474 return 0;
00475 }