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

ElasticPPMaterial.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: 2001/03/29 05:59:54 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/material/uniaxial/ElasticPPMaterial.cpp,v $
00024                                                                         
00025                                                                         
00026 // File: ~/material/ElasticPPMaterial.C
00027 //
00028 // Written: fmk 
00029 // Created: 07/98
00030 // Revision: A
00031 //
00032 // Description: This file contains the class implementation for 
00033 // ElasticMaterial. 
00034 //
00035 // What: "@(#) ElasticPPMaterial.C, revA"
00036 
00037 
00038 #include <ElasticPPMaterial.h>
00039 #include <Vector.h>
00040 #include <Channel.h>
00041 #include <math.h>
00042 #include <float.h>
00043 
00044 
00045 ElasticPPMaterial::ElasticPPMaterial(int tag, double e, double eyp)
00046 :UniaxialMaterial(tag,MAT_TAG_ElasticPPMaterial),
00047  ezero(0.0), E(e), trialStrain(0.0), eptrial(0.0), ep(0.0)
00048 {
00049  fyp = E*eyp;
00050  fyn = -fyp;
00051 }
00052 
00053 ElasticPPMaterial::ElasticPPMaterial(int tag, double e, double eyp,
00054          double eyn, double ez )
00055 :UniaxialMaterial(tag,MAT_TAG_ElasticPPMaterial),
00056  ezero(ez), E(e), trialStrain(0.0), eptrial(0.0), ep(0.0)
00057 {
00058     if (eyp < 0) {
00059  cerr << "ElasticPPMaterial::ElasticPPMaterial() - eyp < 0, setting > 0\n";
00060  eyp *= -1.;
00061     }
00062     if (eyn > 0) {
00063  cerr << "ElasticPPMaterial::ElasticPPMaterial() - eyn > 0, setting < 0\n";
00064  eyn *= -1.;
00065     }    
00066     
00067     fyp = E*eyp;
00068     fyn = E*eyn;
00069 }
00070 
00071 ElasticPPMaterial::ElasticPPMaterial()
00072 :UniaxialMaterial(0,MAT_TAG_ElasticPPMaterial),
00073  fyp(0.0), fyn(0.0), ezero(0.0), E(0.0), trialStrain(0.0), eptrial(0.0), ep(0.0)
00074 {
00075 
00076 }
00077 
00078 ElasticPPMaterial::~ElasticPPMaterial()
00079 {
00080   // does nothing
00081 }
00082 
00083 int 
00084 ElasticPPMaterial::setTrialStrain(double strain, double strainRate)
00085 {
00086     trialStrain = strain;
00087     return 0;
00088 }
00089 
00090 double 
00091 ElasticPPMaterial::getStrain(void)
00092 {
00093     return trialStrain;
00094 }
00095 
00096 double 
00097 ElasticPPMaterial::getStress(void)
00098 {
00099     double sigtrial; // trial stress
00100     double f;  // yield function
00101     double sig;  // stress
00102 
00103     // compute trial stress
00104     sigtrial = E * ( trialStrain - ezero - ep );
00105 
00106     // evaluate yield function
00107     if ( sigtrial >= 0.0 )
00108  f =  sigtrial - fyp;
00109     else
00110  f = -sigtrial + fyn;
00111 
00112     if ( f <= 0.0 )
00113  // elastic
00114         sig = sigtrial;
00115 
00116     else
00117     {
00118  // plastic
00119  if ( sigtrial > 0.0 )
00120  {
00121     sig = fyp;
00122     eptrial = ep + f / E;
00123  }
00124  else
00125  {
00126     sig = fyn;
00127     eptrial = ep - f / E;
00128  }
00129     }
00130     
00131     return sig;
00132 }
00133 
00134 
00135 double 
00136 ElasticPPMaterial::getTangent(void)
00137 {
00138     double sigtrial; // trial stress
00139     double f;  // yield function
00140 
00141     // compute trial stress
00142     sigtrial = E * ( trialStrain - ezero - ep );
00143 
00144     // evaluate yield function
00145     if ( sigtrial >= 0 )
00146  f =  sigtrial - fyp;
00147     else
00148  f = -sigtrial + fyn;
00149 
00150     double fYieldSurface = - E * DBL_EPSILON;
00151     return ( f < fYieldSurface) ? E : 0.0;
00152 
00153 }
00154 
00155 double ElasticPPMaterial::getSecant ()
00156 {
00157     if (trialStrain != 0.0)
00158  return this->getStress()/trialStrain;
00159     else
00160  return E; 
00161 }
00162 
00163 int 
00164 ElasticPPMaterial::commitState(void)
00165 {
00166     ep = eptrial;
00167     return 0;
00168 } 
00169 
00170 
00171 int 
00172 ElasticPPMaterial::revertToLastCommit(void)
00173 {
00174     return 0;
00175 }
00176 
00177 
00178 int 
00179 ElasticPPMaterial::revertToStart(void)
00180 {
00181     ep = 0.0;
00182     return 0;
00183 }
00184 
00185 
00186 UniaxialMaterial *
00187 ElasticPPMaterial::getCopy(void)
00188 {
00189     ElasticPPMaterial *theCopy =
00190   new ElasticPPMaterial(this->getTag(),E,fyp/E,fyn/E,ezero);
00191     theCopy->ep = 0.0;
00192     return theCopy;
00193 }
00194 
00195 
00196 int 
00197 ElasticPPMaterial::sendSelf(int cTag, Channel &theChannel)
00198 {
00199   int res = 0;
00200   static Vector data(6);
00201   data(0) = this->getTag();
00202   data(1) = ep;
00203   data(2) = E;
00204   data(3) = ezero;
00205   data(4) = fyp;
00206   data(5) = fyn;
00207   res = theChannel.sendVector(this->getDbTag(), cTag, data);
00208   if (res < 0) 
00209     cerr << "ElasticPPMaterial::sendSelf() - failed to send data\n";
00210 
00211   return res;
00212 }
00213 
00214 int 
00215 ElasticPPMaterial::recvSelf(int cTag, Channel &theChannel, 
00216      FEM_ObjectBroker &theBroker)
00217 {
00218   int res = 0;
00219   static Vector data(6);
00220   res = theChannel.recvVector(this->getDbTag(), cTag, data);
00221   if (res < 0)
00222     cerr << "ElasticPPMaterial::recvSelf() - failed to recv data\n";
00223   else {
00224     this->setTag(data(0));
00225     ep    = data(1);
00226     E     = data(2);
00227     ezero = data(3);
00228     fyp   = data(4);
00229     fyn   = data(5);    
00230   }
00231 
00232   return res;
00233 }
00234 
00235 void 
00236 ElasticPPMaterial::Print(ostream &s, int flag)
00237 {
00238     s << "ElasticPP tag: " << this->getTag() << endl;
00239     s << "  E: " << E << endl;
00240     s << "  ep: " << ep << endl;
00241 }
00242 
00243 
Copyright Contact Us