CableMaterial.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.7 $
00022 // $Date: 2003/02/25 23:33:37 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/material/uniaxial/CableMaterial.cpp,v $
00024                                                                         
00025 // Written: Charles Chadwell 
00026 // Created: 07/01
00027 //
00028 // Description: This file contains the class definition for 
00029 // CableMaterial. CableMaterial provides the abstraction
00030 // of an elastic uniaxial material,
00031 //
00032 // The input parameters are the Prestress, E, Effective Self Weight (gravity component of 
00033 // Weight per volume transverse to the cable), and Length of the cable.
00034 //
00035 // The cable Force Displacement is converted to Stress Strain material for use 
00036 // with the truss element.  The stress strain ranges from slack (large strain at zero 
00037 // stress) to taught (linear with modulus E).  The material has no history and is not
00038 // path dependent.
00039 //
00040 //
00041 // What: "@(#) CableMaterial.cpp, revA"
00042 
00043 #include <CableMaterial.h>
00044 #include <Vector.h>
00045 #include <Channel.h>
00046 #include <Information.h>
00047 
00048 
00049 CableMaterial::CableMaterial(int tag, double PRESTRESS, double e, double UNIT_WEIGHT_EFF, double L_Element)
00050 :UniaxialMaterial(tag,MAT_TAG_CableMaterial),
00051  Ps(PRESTRESS), E(e), Mue(UNIT_WEIGHT_EFF), 
00052  L(L_Element), trialStrain(0.0)
00053 {
00054 
00055 }
00056 
00057 CableMaterial::CableMaterial()
00058 :UniaxialMaterial(0,MAT_TAG_CableMaterial),
00059  Ps(0.0), E(0.0), Mue(0.0), 
00060  L(0.0), trialStrain(0.0)
00061 {
00062 
00063 }
00064 
00065 CableMaterial::~CableMaterial()
00066 {
00067   // does nothing
00068 }
00069 
00070 int 
00071 CableMaterial::setTrialStrain(double strain, double strainRate)
00072 {
00073   trialStrain     = strain;
00074 
00075   double derivE, derivG, stress;
00076 
00077   // Check if out side the range of inportance 
00078   double testStress, dP, curstrain, e0;
00079   int i = 0;
00080     
00081   // Perameters for bisection
00082   double L_bound = 0, U_bound, middle = 0;
00083         
00084         
00085   if (trialStrain < 0) 
00086     U_bound = Ps;
00087   else {
00088     U_bound = E * trialStrain + Ps;
00089     testStress = U_bound;
00090   }
00091     
00092   // Check if slack in cable has been taken out and it is a bar
00093   e0 = Mue*Mue*L*L/(24*Ps*Ps) - Ps/E;
00094   if (trialStrain > 0 && abs(trialStrain - evalStress((trialStrain - e0)*E)) < 10e-9) 
00095     trialStress =  (trialStrain - e0)*E;
00096 
00097   // Check if all slack
00098   if (trialStrain < - Ps/E*10.0) 
00099     trialStress =  0.0; 
00100 
00101   // if stress is in between then do itterations -- Bisection
00102   dP = U_bound - L_bound;
00103     
00104   while (abs(dP)/U_bound > 0.00000001 && i < 100) {
00105 
00106     middle = .5 * (U_bound + L_bound);
00107     curstrain = evalStress(middle);
00108         
00109     if (curstrain <= trialStrain) {
00110       L_bound = middle;
00111     } else {
00112       U_bound = middle;
00113     }
00114     dP = U_bound - L_bound;
00115     i++;
00116   }
00117         
00118   // if it did not converge - return near zero stress
00119   if (i == 100) 
00120     trialStress =  0.0;
00121   else 
00122     trialStress = middle;
00123 
00124   if (stress <= 0.0) 
00125     trialTangent = 0.0;
00126         
00127   // Elastic Part
00128   derivE = 1 / E * (1. - Mue * Mue * L * L / (24. * stress * stress) * (1. - 2. * Ps / stress));
00129   // Geometric Part
00130   derivG = 1 / 12. * Mue * Mue * L * L / (stress * stress * stress);
00131   
00132   if (derivE + derivG != 0.0)
00133     trialTangent =  1.0 / (derivE + derivG);
00134   else 
00135     trialTangent =  1e-8;
00136   
00137   return 0;
00138 }
00139 
00140 
00141 int 
00142 CableMaterial::setTrial(double strain, double &stress, double &tangent, double strainRate)
00143 {
00144   this->setTrialStrain(strain, strainRate);
00145 
00146   // set the return values
00147   stress = trialStress;
00148   tangent = trialTangent;
00149 
00150   return 0;
00151 }
00152 
00153 double 
00154 CableMaterial::getStress(void)
00155 {
00156   return trialStress;
00157 
00158 }
00159 
00160 double 
00161 CableMaterial::evalStress(double stress)
00162 {
00163     double strainG, strainE;
00164     
00165     // Should never be zero or less than zero
00166     if (stress <= 0) {return -10;}
00167                 
00168     // Elastic Part
00169     strainE = 1 / E * (stress - Ps) * (1 + Mue * Mue * L * L / (24 * stress));
00170 
00171     // Geometric Part
00172     strainG = 1 / 24 * Mue * Mue * L * L * (1 / (Ps * Ps) - 1 / (stress * stress));
00173 
00174     return strainE + strainG;
00175 }
00176 
00177 
00178 double 
00179 CableMaterial::getTangent(void) 
00180 {
00181 
00182   return trialTangent;
00183 
00184 };
00185  
00186 int 
00187 CableMaterial::commitState(void)
00188 {
00189     return 0;
00190 }
00191 
00192 int 
00193 CableMaterial::revertToLastCommit(void)
00194 {
00195     return 0;
00196 }
00197 
00198 int 
00199 CableMaterial::revertToStart(void)
00200 {
00201   trialStrain = 0.0;
00202 
00203   return 0;
00204 }
00205 
00206 UniaxialMaterial *
00207 CableMaterial::getCopy(void)
00208 {
00209     CableMaterial *theCopy = new CableMaterial(this->getTag(), Ps, E, Mue, L);
00210     theCopy->trialStrain = trialStrain;
00211     return theCopy;
00212 }
00213 
00214 int 
00215 CableMaterial::sendSelf(int cTag, Channel &theChannel)
00216 {
00217   int res = 0;
00218   static Vector data(5);
00219   data(0) = this->getTag();
00220   data(1) = Ps;
00221   data(2) = E;
00222   data(3) = Mue;
00223   data(4) = L;
00224 
00225   res = theChannel.sendVector(this->getDbTag(), cTag, data);
00226   if (res < 0) 
00227     opserr << "CableMaterial::sendSelf() - failed to send data\n";
00228 
00229   return res;
00230 }
00231 
00232 int 
00233 CableMaterial::recvSelf(int cTag, Channel &theChannel, 
00234                                FEM_ObjectBroker &theBroker)
00235 {
00236   int res = 0;
00237   static Vector data(5);
00238   res = theChannel.recvVector(this->getDbTag(), cTag, data);
00239   
00240   if (res < 0) {
00241       opserr << "CableMaterial::recvSelf() - failed to receive data\n";
00242       E = 0; 
00243       this->setTag(0);      
00244       return res;
00245   }
00246 
00247   this->setTag(data(0));
00248   Ps   = data(1);
00249   E = data(2);
00250   Mue     = data(3);
00251   L = data(4);
00252     
00253   return res;
00254 }
00255 
00256 void 
00257 CableMaterial::Print(OPS_Stream &s, int flag)
00258 {
00259    s << "CableMaterial tag: " << this->getTag() << endln;
00260     s << "  E: " << E << " Prestress: " << Ps << endln;
00261 }
00262 
00263 //int
00264 //CableMaterial::setParameter(const char **argv, int argc, Information &info)
00265 //{
00266 //      if (strcmp(argv[0],"E") == 0) {
00267 //              info.theType = DoubleType;
00269 //      }
00270 //      else if (strcmp(argv[0],"eta") == 0) {
00271 //              info.theType = DoubleType;
00272 //              return 2;
00273 //      }
00274 //      else
00275 //              return -1;
00276 //}
00277 //
00278 //int 
00279 //CableMaterial::updateParameter(int parameterID, Information &info)
00280 //{
00281 //      switch(parameterID) {
00282 //      case -1:
00283 //              return -1;
00284 //      case 1:
00285 //              E = info.theDouble;
00286 //              return 0;
00287 //      case 2:
00288 //              eta = info.theDouble;
00289 //              return 0;
00290 //      default:
00291 //              return -1;
00292 //      }
00293 //}
00294 
00295  
00296 double 
00297 CableMaterial::abs(double value)
00298 {
00299         if (value < 0) return -value;
00300         else return value;
00301 }

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