Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Concrete01.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.2 $
00022 // $Date: 2001/05/03 06:38:16 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/material/uniaxial/Concrete01.cpp,v $
00024                                                                         
00025                                                                         
00026 // File: ~/material/Concrete01.C
00027 //
00028 // Written: MHS 
00029 // Created: 06/99
00030 // Revision: A
00031 //
00032 // Description: This file contains the class implementation for 
00033 // Concrete01. 
00034 //
00035 // What: "@(#) Concrete01.C, revA"
00036 
00037 
00038 #include <Concrete01.h>
00039 #include <Vector.h>
00040 #include <Channel.h>
00041 #include <math.h>
00042 #include <float.h>
00043 
00044 Concrete01::Concrete01
00045 (int tag, double FPC, double EPSC0, double FPCU, double EPSCU)
00046   :UniaxialMaterial(tag, MAT_TAG_Concrete01),
00047    fpc(FPC), epsc0(EPSC0), fpcu(FPCU), epscu(EPSCU), 
00048    Cstrain(0.0), Cstress(0.0), 
00049    CminStrain(0.0), CendStrain(0.0)
00050 {
00051  // Make all concrete parameters negative
00052  if (fpc > 0.0)
00053   fpc = -fpc;
00054 
00055  if (epsc0 > 0.0)
00056   epsc0 = -epsc0;
00057 
00058  if (fpcu > 0.0)
00059   fpcu = -fpcu;
00060 
00061  if (epscu > 0.0)
00062   epscu = -epscu;
00063 
00064  // Initial tangent
00065  Ec0 = 2*fpc/epsc0;
00066  Ctangent = Ec0;
00067  CunloadSlope = Ec0;
00068  Ttangent = Ec0;
00069 
00070  // Set trial values
00071  this->revertToLastCommit();
00072 }
00073 
00074 Concrete01::Concrete01():UniaxialMaterial(0, MAT_TAG_Concrete01),
00075  fpc(0.0), epsc0(0.0), fpcu(0.0), epscu(0.0),
00076  Cstrain(0.0), Cstress(0.0), CminStrain(0.0), CunloadSlope(0.0),
00077  CendStrain(0.0)
00078 {
00079  // Set trial values
00080  this->revertToLastCommit();
00081 }
00082 
00083 Concrete01::~Concrete01 ()
00084 {
00085    // Does nothing
00086 }
00087 
00088 int Concrete01::setTrialStrain (double strain, double strainRate)
00089 {
00090  // Set trial strain
00091  Tstrain = strain;
00092 
00093  // check for a quick return
00094  if (Tstrain > 0.0) {
00095    Tstress = 0;
00096    Ttangent = 0;
00097    return 0;
00098  }
00099 
00100  // Determine change in strain from last converged state
00101  double dStrain = Tstrain - Cstrain;
00102 
00103  // Calculate the trial state given the change in strain
00104  // determineTrialState (dStrain);
00105  TunloadSlope = CunloadSlope;
00106 
00107  double tempStress = Cstress + TunloadSlope*dStrain;
00108 
00109  // Material goes further into compression
00110  if (dStrain <= 0.0) {
00111          TminStrain = CminStrain;
00112          TendStrain = CendStrain;
00113   
00114   reload ();
00115   
00116   if (tempStress > Tstress) {
00117    Tstress = tempStress;
00118    Ttangent = TunloadSlope;
00119   }
00120  }
00121 
00122  // Material goes TOWARD tension
00123  else if (tempStress <= 0.0) {
00124   Tstress = tempStress;
00125   Ttangent = TunloadSlope;
00126  }
00127 
00128  // Made it into tension
00129  else {
00130   Tstress = 0.0;
00131   Ttangent = 0.0;
00132  }
00133 
00134  return 0;
00135 }
00136 
00137 
00138 
00139 int 
00140 Concrete01::setTrial (double strain, double &stress, double &tangent, double strainRate)
00141 {
00142  // Set trial strain
00143  Tstrain = strain;
00144 
00145  // check for a quick return
00146  if (Tstrain > 0.0) {
00147    Tstress = 0;
00148    Ttangent = 0;
00149    stress = 0;
00150    tangent = 0;
00151    return 0;
00152  }
00153 
00154  // Determine change in strain from last converged state
00155  double dStrain = Tstrain - Cstrain;
00156 
00157  // Calculate the trial state given the change in strain
00158  // determineTrialState (dStrain);
00159  TunloadSlope = CunloadSlope;
00160 
00161  double tempStress = Cstress + TunloadSlope*dStrain;
00162 
00163  // Material goes further into compression
00164  if (dStrain <= 0.0) {
00165          TminStrain = CminStrain;
00166          TendStrain = CendStrain;
00167   
00168   reload ();
00169   
00170   if (tempStress > Tstress) {
00171    Tstress = tempStress;
00172    Ttangent = TunloadSlope;
00173   }
00174  }
00175 
00176  // Material goes TOWARD tension
00177  else if (tempStress <= 0.0) {
00178   Tstress = tempStress;
00179   Ttangent = TunloadSlope;
00180  }
00181 
00182  // Made it into tension
00183  else {
00184   Tstress = 0.0;
00185   Ttangent = 0.0;
00186  }
00187  stress = Tstress;
00188  tangent =  Ttangent;
00189 
00190  return 0;
00191 }
00192 
00193 void Concrete01::determineTrialState (double dStrain)
00194 {  
00195  TminStrain = CminStrain;
00196  TendStrain = CendStrain;
00197  TunloadSlope = CunloadSlope;
00198 
00199  double tempStress = Cstress + TunloadSlope*dStrain;
00200 
00201  // Material goes further into compression
00202  if (dStrain <= 0.0) {
00203   
00204   reload ();
00205   
00206   if (tempStress > Tstress) {
00207    Tstress = tempStress;
00208    Ttangent = TunloadSlope;
00209   }
00210  }
00211 
00212  // Material goes TOWARD tension
00213  else if (tempStress <= 0.0) {
00214   Tstress = tempStress;
00215   Ttangent = TunloadSlope;
00216  }
00217 
00218  // Made it into tension
00219  else {
00220          Tstress = 0.0;
00221   Ttangent = 0.0;
00222  }
00223 
00224 }
00225 
00226 void Concrete01::reload ()
00227 {
00228  if (Tstrain <= TminStrain) {
00229 
00230   TminStrain = Tstrain;
00231 
00232   // Determine point on envelope
00233   envelope ();
00234 
00235   unload ();
00236  }
00237  else if (Tstrain <= TendStrain) {
00238   Ttangent = TunloadSlope;
00239   Tstress = Ttangent*(Tstrain-TendStrain);
00240  }
00241  else {
00242   Tstress = 0.0;
00243   Ttangent = 0.0;
00244  }
00245 }
00246 
00247 void Concrete01::envelope ()
00248 {
00249  if (Tstrain > epsc0) {
00250   double eta = Tstrain/epsc0;
00251   Tstress = fpc*(2*eta-eta*eta);
00252   Ttangent = Ec0*(1.0-eta);
00253  }
00254  else if (Tstrain > epscu) {
00255   Ttangent = (fpc-fpcu)/(epsc0-epscu);
00256   Tstress = fpc + Ttangent*(Tstrain-epsc0);
00257  }
00258  else {
00259   Tstress = fpcu;
00260   Ttangent = 0.0;
00261  }
00262 }
00263 
00264 void Concrete01::unload ()
00265 {
00266  double tempStrain = TminStrain;
00267 
00268  if (tempStrain < epscu)
00269   tempStrain = epscu;
00270 
00271  double eta = tempStrain/epsc0;
00272 
00273  double ratio = 0.707*(eta-2.0) + 0.834;
00274 
00275  if (eta < 2.0)
00276   ratio = 0.145*eta*eta + 0.13*eta;
00277 
00278  TendStrain = ratio*epsc0;
00279 
00280  double temp1 = TminStrain - TendStrain;
00281 
00282  double temp2 = Tstress/Ec0;
00283 
00284  if (temp1 > -DBL_EPSILON) { // temp1 should always be negative
00285   TunloadSlope = Ec0;
00286  }
00287  else if (temp1 <= temp2) {
00288   TendStrain = TminStrain - temp1;
00289   TunloadSlope = Tstress/temp1;
00290  }
00291  else {
00292   TendStrain = TminStrain - temp2;
00293   TunloadSlope = Ec0;
00294  }
00295 }
00296 
00297 double Concrete01::getStress ()
00298 {
00299    return Tstress;
00300 }
00301 
00302 double Concrete01::getStrain ()
00303 {
00304    return Tstrain;
00305 }
00306 
00307 double Concrete01::getTangent ()
00308 {
00309    return Ttangent;
00310 }
00311 
00312 double Concrete01::getSecant ()
00313 {
00314  if (fabs(Tstrain) > DBL_EPSILON)
00315   return Tstress/Tstrain;
00316  else
00317   return Ttangent;
00318 }
00319 
00320 
00321 int Concrete01::commitState ()
00322 {
00323    // History variables
00324    CminStrain = TminStrain;
00325    CunloadSlope = TunloadSlope;
00326    CendStrain = TendStrain;
00327 
00328    // State variables
00329    Cstrain = Tstrain;
00330    Cstress = Tstress;
00331    Ctangent = Ttangent;
00332 
00333    return 0;
00334 }
00335 
00336 int Concrete01::revertToLastCommit ()
00337 {
00338    // Reset trial history variables to last committed state
00339    TminStrain = CminStrain;
00340    TendStrain = CendStrain;
00341    TunloadSlope = CunloadSlope;
00342 
00343    // Recompute trial stress and tangent
00344    Tstrain = Cstrain;
00345    Tstress = Cstress;
00346    Ttangent = Ctangent;
00347 
00348    return 0;
00349 }
00350 
00351 int Concrete01::revertToStart ()
00352 {
00353    // History variables
00354    CminStrain = 0.0;
00355    CunloadSlope = Ec0;
00356    CendStrain = 0.0;
00357 
00358    // State variables
00359    Cstrain = 0.0;
00360    Cstress = 0.0;
00361    Ctangent = Ec0;
00362 
00363    // Reset trial variables and state
00364    this->revertToLastCommit();
00365 
00366    return 0;
00367 }
00368 
00369 UniaxialMaterial* Concrete01::getCopy ()
00370 {
00371    Concrete01* theCopy = new Concrete01(this->getTag(),
00372                                     fpc, epsc0, fpcu, epscu);
00373 
00374    // Converged history variables
00375    theCopy->CminStrain = CminStrain;
00376    theCopy->CunloadSlope = CunloadSlope;
00377    theCopy->CendStrain = CendStrain;
00378 
00379    // Converged state variables
00380    theCopy->Cstrain = Cstrain;
00381    theCopy->Cstress = Cstress;
00382    theCopy->Ctangent = Ctangent;
00383 
00384    return theCopy;
00385 }
00386 
00387 int Concrete01::sendSelf (int commitTag, Channel& theChannel)
00388 {
00389    int res = 0;
00390    static Vector data(11);
00391    data(0) = this->getTag();
00392 
00393    // Material properties
00394    data(1) = fpc;
00395    data(2) = epsc0;
00396    data(3) = fpcu;
00397    data(4) = epscu;
00398 
00399    // History variables from last converged state
00400    data(5) = CminStrain;
00401    data(6) = CunloadSlope;
00402    data(7) = CendStrain;
00403 
00404    // State variables from last converged state
00405    data(8) = Cstrain;
00406    data(9) = Cstress;
00407    data(10) = Ctangent;
00408 
00409    // Data is only sent after convergence, so no trial variables
00410    // need to be sent through data vector
00411 
00412    res = theChannel.sendVector(this->getDbTag(), commitTag, data);
00413    if (res < 0) 
00414       cerr << "Concrete01::sendSelf() - failed to send data\n";
00415 
00416    return res;
00417 }
00418 
00419 int Concrete01::recvSelf (int commitTag, Channel& theChannel,
00420                                  FEM_ObjectBroker& theBroker)
00421 {
00422    int res = 0;
00423    static Vector data(11);
00424    res = theChannel.recvVector(this->getDbTag(), commitTag, data);
00425 
00426    if (res < 0) {
00427       cerr << "Concrete01::recvSelf() - failed to receive data\n";
00428       this->setTag(0);      
00429    }
00430    else {
00431       this->setTag(int(data(0)));
00432 
00433       // Material properties 
00434       fpc = data(1);
00435       epsc0 = data(2);
00436       fpcu = data(3);
00437       epscu = data(4);
00438 
00439       Ec0 = 2*fpc/epsc0;
00440 
00441       // History variables from last converged state
00442       CminStrain = data(5);
00443       CunloadSlope = data(6);
00444       CendStrain = data(7);
00445 
00446       // State variables from last converged state
00447       Cstrain = data(8);
00448       Cstress = data(9);
00449       Ctangent = data(10);
00450 
00451       // Set trial state variables
00452       Tstrain = Cstrain;
00453       Tstress = Cstress;
00454       Ttangent = Ctangent;
00455    }
00456 
00457    return res;
00458 }
00459 
00460 void Concrete01::Print (ostream& s, int flag)
00461 {
00462    s << "Concrete01, tag: " << this->getTag() << endl;
00463    s << "  fpc: " << fpc << endl;
00464    s << "  epsc0: " << epsc0 << endl;
00465    s << "  fpcu: " << fpcu << endl;
00466    s << "  epscu: " << epscu << endl;
00467 }
Copyright Contact Us