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

HardeningMaterial.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.1.1.1 $
00022 // $Date: 2000/09/15 08:23:22 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/material/uniaxial/HardeningMaterial.cpp,v $
00024                                                                         
00025                                                                         
00026 // File: ~/material/HardeningMaterial.C
00027 //
00028 // Written: MHS
00029 // Created: May 2000
00030 // Revision: A
00031 //
00032 // Description: This file contains the class implementation for 
00033 // HardeningMaterial. 
00034 //
00035 // What: "@(#) HardeningMaterial.C, revA"
00036 
00037 #include <HardeningMaterial.h>
00038 #include <Vector.h>
00039 #include <Channel.h>
00040 #include <math.h>
00041 
00042 HardeningMaterial::HardeningMaterial(int tag, double e, double s,
00043      double k, double h)
00044 :UniaxialMaterial(tag,MAT_TAG_Hardening),
00045  E(e), sigmaY(s), K(k), H(h)
00046 {
00047     this->revertToStart();
00048  this->revertToLastCommit();
00049 }
00050 
00051 HardeningMaterial::HardeningMaterial()
00052 :UniaxialMaterial(0,MAT_TAG_Hardening),
00053  E(0.0), sigmaY(0.0), K(0.0), H(0.0)
00054 {
00055  this->revertToStart();
00056  this->revertToLastCommit();
00057 }
00058 
00059 HardeningMaterial::~HardeningMaterial()
00060 {
00061     // does nothing
00062 }
00063 
00064 int 
00065 HardeningMaterial::setTrialStrain (double strain, double strainRate)
00066 {
00067     // Set total strain
00068     Tstrain = strain;
00069     
00070     // Elastic trial stress
00071     Tstress = E * (Tstrain-CplasticStrain);
00072     
00073     // Compute trial stress relative to committed back stress
00074     double xsi = Tstress - CbackStress;
00075 
00076     // Compute yield criterion
00077     double f = fabs(xsi) - (sigmaY + K*Chardening);
00078     
00079     // Elastic step ... no updates required
00080     if (f <= 0.0)
00081     {
00082  // Set trial tangent
00083  Ttangent = E;
00084     }
00085     // Plastic step ... perform return mapping algorithm
00086     else
00087     {
00088  // Compute consistency parameter
00089  double dGamma = f / (E+K+H);
00090 
00091  // Find sign of xsi
00092  int sign = (xsi < 0) ? -1 : 1;
00093 
00094  // Bring trial stress back to yield surface
00095  Tstress -= dGamma*E*sign;
00096  
00097  // Update plastic strain
00098  TplasticStrain = CplasticStrain + dGamma*sign;
00099  
00100  // Update back stress
00101  TbackStress = CbackStress + dGamma*H*sign;
00102  
00103  // Update internal hardening variable
00104  Thardening = Chardening + dGamma;
00105  
00106  // Set trial tangent
00107  Ttangent = E*(H+K) / (E+H+K);
00108     }
00109 
00110     return 0;
00111 }
00112 
00113 double 
00114 HardeningMaterial::getStress(void)
00115 {
00116     return Tstress;
00117 }
00118 
00119 double 
00120 HardeningMaterial::getTangent(void)
00121 {
00122     return Ttangent;
00123 }
00124 
00125 double
00126 HardeningMaterial::getSecant (void)
00127 {
00128     if (Tstrain != 0.0)
00129  return Tstress/Tstrain;
00130     else
00131  return E;
00132 }
00133 
00134 double 
00135 HardeningMaterial::getStrain(void)
00136 {
00137     return Tstrain;
00138 }
00139 
00140 int 
00141 HardeningMaterial::commitState(void)
00142 {
00143     // Commit trial state variables
00144     Cstrain = Tstrain;
00145     CplasticStrain = TplasticStrain;
00146     CbackStress = TbackStress;
00147     Chardening = Thardening;
00148 
00149     // Do not need to commit the trial stress or trial tangent
00150     
00151     return 0;
00152 }
00153 
00154 int 
00155 HardeningMaterial::revertToLastCommit(void)
00156 {
00157     // Set trial state to last committed state
00158     Tstrain = Cstrain;
00159     TplasticStrain = CplasticStrain;
00160     TbackStress = CbackStress;
00161     Thardening = Chardening;
00162 
00163     // Recompute trial stress and trial tangent
00164  this->setTrialStrain(Cstrain);
00165 
00166     return 0;
00167 }
00168 
00169 int 
00170 HardeningMaterial::revertToStart(void)
00171 {
00172     // Reset committed state variables
00173     Cstrain = 0.0;
00174     CplasticStrain = 0.0;
00175     CbackStress = 0.0;
00176     Chardening = 0.0;
00177 
00178     // Reset the trial state
00179     this->revertToLastCommit();    
00180     
00181     return 0;
00182 }
00183 
00184 UniaxialMaterial *
00185 HardeningMaterial::getCopy(void)
00186 {
00187     HardeningMaterial *theCopy =
00188  new HardeningMaterial(this->getTag(), E, sigmaY, K, H);
00189 
00190     // Copy trial state variables
00191     theCopy->Tstrain = Tstrain;
00192     theCopy->Tstress = Tstress;
00193     theCopy->Ttangent = Ttangent;
00194     theCopy->TplasticStrain = TplasticStrain;
00195     theCopy->TbackStress = TbackStress;
00196     theCopy->Thardening = Thardening;
00197     
00198     // Copy committed state variables
00199     theCopy->Cstrain = Cstrain;
00200     theCopy->CplasticStrain = CplasticStrain;
00201     theCopy->CbackStress = CbackStress;
00202     theCopy->Chardening = Chardening;
00203     
00204     return theCopy;
00205 }
00206 
00207 int 
00208 HardeningMaterial::sendSelf(int cTag, Channel &theChannel)
00209 {
00210   int res = 0;
00211   
00212   static Vector data(9);
00213   
00214   data(0) = this->getTag();
00215   data(1) = E;
00216   data(2) = sigmaY;
00217   data(3) = K;
00218   data(4) = H;
00219   data(5) = Cstrain;
00220   data(6) = CplasticStrain;
00221   data(7) = CbackStress;
00222   data(8) = Chardening;
00223   
00224   res = theChannel.sendVector(this->getDbTag(), cTag, data);
00225   if (res < 0) 
00226     cerr << "HardeningMaterial::sendSelf() - failed to send data\n";
00227 
00228   return res;
00229 }
00230 
00231 int 
00232 HardeningMaterial::recvSelf(int cTag, Channel &theChannel, 
00233           FEM_ObjectBroker &theBroker)
00234 {
00235   int res = 0;
00236   
00237   static Vector data(9);
00238   res = theChannel.recvVector(this->getDbTag(), cTag, data);
00239   
00240   if (res < 0) {
00241       cerr << "HardeningMaterial::recvSelf() - failed to receive data\n";
00242       E = 0; 
00243       this->setTag(0);      
00244   }
00245   else {
00246     this->setTag((int)data(0));
00247     E = data(1);
00248     sigmaY = data(2);
00249     K = data(3);
00250     H = data(4);
00251     Cstrain = data(5);
00252     CplasticStrain = data(6);
00253     CbackStress = data(7);
00254     Chardening = data(8);
00255 
00256     // Set the trial state variables
00257     revertToLastCommit();
00258   }
00259     
00260   return res;
00261 }
00262 
00263 void 
00264 HardeningMaterial::Print(ostream &s, int flag)
00265 {
00266     s << "HardeningMaterial, tag: " << this->getTag() << endl;
00267     s << "  E: " << E << endl;
00268     s << "  sigmaY: " << sigmaY << endl;
00269     s << "  K: " << K << endl;
00270     s << "  H: " << H << endl;
00271 }
00272 
00273 
Copyright Contact Us