ShearCurve.cpp

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020 
00021 // $Revision: 1.3 $
00022 // $Date: 2006/09/05 22:39:58 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/material/uniaxial/limitState/limitCurve/ShearCurve.cpp,v $
00024                                                                         
00025 // Written: KJE
00026 // Created: Sept 2002
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, //SDK
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 //VOID//
00068 }
00069 
00070 ShearCurve::~ShearCurve()
00071 {
00072 //VOID//
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 // check if limit state surface has been reached
00095 int
00096 ShearCurve::checkElementState(double springForce)
00097 {
00098   DummyStream dummy;
00099         // find associated beam-column elementon first visit
00100         if (theElement == 0)
00101         {
00102                 theElement = theDomain->getElement(eleTag);
00103 
00104                 if (theElement == 0) {
00105 //                      g3ErrorHandler->fatal("WARNING ShearCurve - no element with tag %i exists in Domain",eleTag);
00106                 }
00107                 // find length between nodes if drift is desired
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 //                              g3ErrorHandler->warning("%s -- Nodal projection has zero component along chosen direction",
00118 //                                              "AxialCurve::AxialCurve");
00119 
00120                                 oneOverL = 0.0;
00121                         }
00122                         else 
00123                                 oneOverL = 1.0/fabs(crdJ(perpDirn) - crdI(perpDirn));
00124                 }
00125         }
00126 
00127         double deform;  // value of deformation parameter from element
00128         double force;   // value of force parameter from element
00129         int result;             //junk variable
00130 
00131 
00132         // Based on "defType" and "forType" calculate 
00133         // the desired response parameters "deform" and "force"
00134         if (defType == 1) // maximum chord rotations
00135         {
00136 
00137                 Response *theRotations =0; // integer element returns in setResponse
00138 
00139                 const char *r[1] = {"basicDeformations"}; // must be implemented in element
00140 
00141                 Information     *rotInfoObject =0;   
00142 
00143                 Vector *rotVec; //vector of chord rotations at beam-column ends
00144 
00145                 // set type of beam-column element response desired
00146                 theRotations = theElement->setResponse(r, 1, *rotInfoObject, dummy);
00147 
00148                 // put element response in the vector of "myInfo"
00149                 result = theRotations->getResponse();
00150 
00151                 // access the myInfo vector containing the response (new for Version 1.2)
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));  //use larger of two end rotations
00157         }
00158         else if (defType == 2) // interstory drift
00159         {
00160                 // find associated nodes 
00161                 Node *nodeI = theDomain->getNode(ndI);
00162                 Node *nodeJ = theDomain->getNode(ndJ);
00163 
00164 
00165                 // get displacements
00166                 const Vector &dispI = nodeI->getTrialDisp();
00167                 const Vector &dispJ = nodeJ->getTrialDisp();
00168 
00169 //opserr << "Drift ndI: " << dispI(dof) << endln;
00170 //opserr << "Drift ndJ: " << dispJ(dof) << endln;
00171 
00172                 
00173                 // calc drift
00174                 double dx = fabs(dispJ(dof)-dispI(dof));
00175                 deform = dx*oneOverL;
00176         }
00177         else {
00178 //              g3ErrorHandler->fatal("WARNING ShearCurve - deformation type flag %i not implemented",defType);
00179         }
00180 
00181                 Response *theForces =0;
00182 
00183                 const char *f[1] = {"localForce"}; // does not include influence of P-delta
00184                                                                      // for P-delta use forType = 0
00185 
00186                 Information     *forInfoObject =0;
00187 
00188                 Vector *forceVec; //vector of basic forces from beam column
00189 
00190                 // set type of beam-column element response desired
00191                 theForces    = theElement->setResponse(f, 1, *forInfoObject, dummy);
00192 
00193                 // put element response in the vector of "myInfo"
00194                 result += theForces->getResponse();
00195 
00196                 // access the myInfo vector containing the response (new for Version 1.2)
00197                 Information &theInfo = theForces->getInformation();
00198                 forceVec = (theInfo.theVector);
00199 
00200         // Local forces (assuming no element loads)
00201         if (forType == 0)
00202                 force = fabs(springForce);    // force in associated LimitState material
00203         else if (forType == 1) 
00204                 force = fabs((*forceVec)(1)); // shear
00205         else if (forType == 2) 
00206                 force = fabs((*forceVec)(0)); // axial
00207         else {
00208 //              g3ErrorHandler->fatal("WARNING ShearCurve - force type flag %i not implemented",forType);
00209         }
00210 
00211         P = fabs((*forceVec)(0));
00212 
00213         // Determine if (deform,force) is outside limit state surface.
00214         // 
00215         // Use absolute value of deform and force
00216         double forceSurface = findLimit(deform); // force on surface at deform
00217 
00218 //      double deformSurface = findLimit(force); // deform on surface at force  SDK
00219 
00220 
00221 //opserr << "The shear force in the element is: " << force << endln;
00222 
00223 
00224 //opserr << "State flag............................:" << stateFlag << endln;
00225 //opserr << "Shear force in the column.........: " << force << endln;
00226 //opserr << "forceSurface: " << forceSurface << endln;
00227 
00228         if (stateFlag == 0) //prior to failure
00229         {
00230                 if (force >= forceSurface) // on/outside failure surface
00231         //        if (deform >= deformSurface) // on/outside failure surface    SDK
00232 
00233                 {       
00234                         stateFlag = 1;
00235                         setDegSlope(force, deform);
00236 //                      g3ErrorHandler->warning("ShearCurve - failure detected at deform = %f (Kdeg = %f) ", deform, Kdeg);
00237 //opserr << "*********************" << endln;
00238         opserr << "ShearCurve - failure detected....."<< endln;//SDK
00239 
00240        // opserr << "deformSurface: " << deformSurface << endln; //SDK
00241   
00242       
00243 
00244 
00245 
00246 //opserr << "Capacity: " << forceSurface << endln;
00247 //opserr << "*********************" << endln;
00248                 }
00249                 else // inside failure surface
00250                 {
00251                         stateFlag = 0;
00252                 }
00253         }
00254         else //after failure
00255         {
00256                 if (force >= forceSurface) // on/outside failure surface
00257                 //  if (deform >= deformSurface) // on/outside failure surface SDK
00258                 {       
00259                         stateFlag = 2;
00260                 }
00261                 else // inside failure surface
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         //Do nothing for this class
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 // Private Functions
00321 
00322 void
00323 ShearCurve::setDegSlope(double V, double Dshear)
00324 {
00325         if (Kdeg > 0.0)
00326         {
00327                 // Calculate degrading slope based on point of shear failure and 
00328                 // calculated deformation at axial failure based on current axial 
00329                 // load and axial failure model by Elwood (2002).
00330                 // If positive, Kdeg is assumed equal to the flexural stiffness
00331                 double mu = 0.0;
00332                 double theta = 65.0*PI/180.0;
00333                 double Daxial;
00334                 //double Fsw = 0.0; //SDK
00335 
00336 
00337 
00338                 //Fsw = Ast * fyt * dc/s;
00339                 Daxial = 0.04*(1+tan(theta)*tan(theta))/(tan(theta)+P/Fsw/tan(theta));
00340                 
00341                 //mu = ((P/Fsw)-1)/(P/Fsw/tan(theta)+ tan(theta)); //SDK
00342                 //Daxial = 0.184*exp(-1.45*mu); //SDK
00343 
00344                 if (defType == 2)
00345                 {
00346                         double K = -V/(Daxial-Dshear)*oneOverL;
00347                         Kdeg = 1/(1/K - 1/Kdeg);
00348                 }
00349                 else {
00350 //                      g3ErrorHandler->fatal("WARNING ShearCurve - must use defType = 2 for calculated degrading slope");
00351                 }
00352                 
00353         }
00354 
00355 }
00356 
00357 // Empirical drift capacity model at shear failure from Elwood (2002)
00358 double
00359 ShearCurve::findLimit(double DR) //SDK
00360 
00361 {
00362 
00363         double V = 0.0; //Shear in kips!!
00364         //double DR = 0.0; // drift SDK
00365         
00366         if (DR < 0.01)
00367                 V = 9.9e9; //no shear failure below drift ratio of 1%
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 /*/ This is Ling's probabilistic capacity model:                
00373                 double s_over_d = 0.75; // hoop spacing to depth ration
00374                 double a_over_d = 0.5*58.0/d; // aspect ratio
00375                 
00376 
00377                 //V = (exp(-sigma*eps_normal)*DR - theta1 - theta4*P/b/h/fc/1000 - theta5*s_over_d 
00378                 //      - (0.015-0.21*theta1)*a_over_d ) 
00379                 //      * b*d*6.0*sqrt(fc)/1000 / (0.0053-0.42*theta1);
00380 
00381 
00382 
00383                 DR = (theta1 + (0.0053-0.42*theta1)* V*1000/ b/d/6.0/sqrt(fc)+ theta4*P/b/h/fc/1000 
00384                         + theta5*s_over_d + (0.015-0.21*theta1)*a_over_d )*exp(sigma*eps_normal); //SDK
00385 */                              
00386 
00387 
00388         }
00389         if (V < 0.0)
00390                 V = 0.0;
00391 
00392 
00393         return V;
00394 //      return DR; //SDK
00395 }
00396 
00397 
00398 
00399 
00400 
00401 
00402 
00403 // AddingSensitivity:BEGIN ///////////////////////////////////
00404 int
00405 ShearCurve::setParameter(const char **argv, int argc, Parameter &param)
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 }

Generated on Mon Oct 23 15:05:20 2006 for OpenSees by doxygen 1.5.0