EPPGapMaterial.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.10 $
00022 // $Date: 2005/06/16 21:41:03 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/material/uniaxial/EPPGapMaterial.cpp,v $
00024 
00025 // File: ~/material/EPPGapMaterial.C
00026 //
00027 // Written: krm 
00028 // Created: 07/2000
00029 // Revision: A
00030 //
00031 // Description: This file contains the class implementation for 
00032 // ElasticMaterial. 
00033 //
00034 // What: "@(#) EPPGapMaterial.C, revA"
00035 
00036 #include <stdlib.h>
00037 
00038 #include <EPPGapMaterial.h>
00039 #include <Vector.h>
00040 #include <Channel.h>
00041 #include <math.h>
00042 #include <float.h>
00043 
00044 #include <OPS_Globals.h>
00045 
00046 EPPGapMaterial::EPPGapMaterial(int tag, double e, double fyl, double gap0, double eta0, int accum)
00047 :UniaxialMaterial(tag,MAT_TAG_EPPGap),
00048  commitStrain(0.0), trialStrain(0.0), E(e), fy(fyl), gap(gap0), eta(eta0),
00049  minElasticYieldStrain(gap0),damage(accum)
00050 {
00051         if (E == 0.0) {
00052           opserr << "EPPGapMaterial::EPPGapMaterial -- E is zero, continuing with E = fy/0.002\n";
00053           if (fy != 0.0)
00054             E = fabs(fy)/0.002;
00055           else {
00056             opserr << "EPPGapMaterial::EPPGapMaterial -- E and fy are zero\n";
00057             exit(-1);
00058           }
00059         }
00060         else
00061           maxElasticYieldStrain = fy/E + gap;
00062 
00063         if (fy*gap<0) {
00064           opserr << "EPPGapMaterial::EPPGapMaterial -- Alternate signs on fy and E encountered, continuing anyway\n";
00065         }
00066         
00067         if ( (eta >= 1) || (eta <= -1) ) {
00068           opserr << "EPPGapMaterial::EPPGapMaterial -- value of eta must be -1 <= eta <= 1, setting eta to 0\n";
00069           eta = 0;
00070         }
00071         
00072         if ( (damage < 0) || (damage > 1) ) {
00073           opserr << "%s -- damage switch must be 0 or 1\n";
00074         }
00075 }
00076 
00077 EPPGapMaterial::EPPGapMaterial()
00078 :UniaxialMaterial(0,MAT_TAG_EPPGap),
00079  E(0.0), fy(0.0), gap(0.0), eta(0.0), minElasticYieldStrain(0.0), damage(0)
00080 {
00081 
00082 }
00083 
00084 EPPGapMaterial::~EPPGapMaterial()
00085 {
00086   // does nothing
00087 }
00088 
00089 int 
00090 EPPGapMaterial::setTrialStrain(double strain, double strainRate)
00091 {
00092   // set the trial strain
00093   trialStrain = strain;
00094 
00095   // determine trial stress and tangent
00096   if (fy >= 0) {
00097     if (trialStrain > maxElasticYieldStrain) {
00098       trialStress = fy+(trialStrain-gap-fy/E)*eta*E;
00099       trialTangent = eta*E;
00100     } else if (trialStrain < minElasticYieldStrain) {
00101       trialStress = 0;
00102       trialTangent = 0;
00103     } else {
00104       trialStress =  E*(trialStrain-minElasticYieldStrain);
00105       trialTangent = E;
00106     }
00107   } else {
00108     if (trialStrain < maxElasticYieldStrain) {
00109       trialStress =  fy+(trialStrain-gap-fy/E)*eta*E;
00110       trialTangent = eta*E;
00111     } else if (trialStrain > minElasticYieldStrain) {
00112       trialStress =  0;
00113       trialTangent = 0;
00114     } else {
00115       trialStress =  E*(trialStrain-minElasticYieldStrain);
00116       trialTangent = E;
00117     }
00118   }
00119 
00120   return 0;
00121 }
00122 
00123 double 
00124 EPPGapMaterial::getStrain(void)
00125 {
00126     return trialStrain;
00127 }
00128 
00129 double 
00130 EPPGapMaterial::getStress(void)
00131 {
00132   return trialStress;
00133 
00134 }
00135 
00136 double 
00137 EPPGapMaterial::getTangent(void)
00138 {
00139   return trialTangent;
00140 }
00141 
00142 double 
00143 EPPGapMaterial::getInitialTangent(void)
00144 {
00145   if (gap > 0.0) 
00146     return 0.0; 
00147   else 
00148     return E;
00149 }
00150 
00151 int 
00152 EPPGapMaterial::commitState(void)
00153 {
00154     if (fy >= 0) {
00155        if (trialStrain > maxElasticYieldStrain)  {
00156            maxElasticYieldStrain = trialStrain;
00157            minElasticYieldStrain = trialStrain-trialStress/E;
00158        }
00159        else if (trialStrain < minElasticYieldStrain && trialStrain > gap
00160                 && damage == 0 )  {
00161            maxElasticYieldStrain = (trialStrain-eta*gap)/(1-eta)+fy/E;
00162            minElasticYieldStrain = trialStrain;
00163        }
00164     }
00165     else {
00166        if (trialStrain < maxElasticYieldStrain)  {
00167            maxElasticYieldStrain = trialStrain;
00168            minElasticYieldStrain = trialStrain-trialStress/E;
00169        }
00170        else if (trialStrain > minElasticYieldStrain && trialStrain < gap
00171                 && damage == 0 )  {
00172            maxElasticYieldStrain = (trialStrain-eta*gap)/(1-eta)+fy/E;
00173            minElasticYieldStrain = trialStrain;
00174        }
00175     }
00176 
00177     commitStrain = trialStrain;
00178 
00179     return 0;
00180 }
00181 
00182 
00183 int 
00184 EPPGapMaterial::revertToLastCommit(void)
00185 {
00186     trialStrain = commitStrain;
00187 
00188     return 0;
00189 }
00190 
00191 
00192 int 
00193 EPPGapMaterial::revertToStart(void)
00194 {
00195     commitStrain = 0.0;
00196     trialStrain = 0.0;
00197     maxElasticYieldStrain = fy/E+gap;
00198     minElasticYieldStrain = gap;
00199 
00200     return 0;
00201 }
00202 
00203 
00204 UniaxialMaterial *
00205 EPPGapMaterial::getCopy(void)
00206 {
00207     EPPGapMaterial *theCopy = new EPPGapMaterial(this->getTag(),E,fy,gap,eta,damage);
00208     theCopy->trialStrain = trialStrain;
00209     theCopy->maxElasticYieldStrain = maxElasticYieldStrain;
00210     theCopy->minElasticYieldStrain = minElasticYieldStrain;
00211     return theCopy;
00212 }
00213 
00214 
00215 int 
00216 EPPGapMaterial::sendSelf(int cTag, Channel &theChannel)
00217 {
00218   int res = 0;
00219   static Vector data(9);
00220   data(0) = this->getTag();
00221   data(1) = commitStrain;
00222   data(2) = E;
00223   data(3) = fy;
00224   data(4) = gap;
00225   data(5) = eta;
00226   data(6) = maxElasticYieldStrain;
00227   data(7) = minElasticYieldStrain;
00228   data(8) = damage;
00229 
00230   res = theChannel.sendVector(this->getDbTag(), cTag, data);
00231   if (res < 0) 
00232     opserr << "EPPGapMaterial::sendSelf() - failed to send data\n";
00233 
00234   return res;
00235 }
00236 
00237 int 
00238 EPPGapMaterial::recvSelf(int cTag, Channel &theChannel, 
00239                                  FEM_ObjectBroker &theBroker)
00240 {
00241   int res = 0;
00242   static Vector data(9);
00243   res = theChannel.recvVector(this->getDbTag(), cTag, data);
00244   if (res < 0)
00245     opserr << "EPPGapMaterial::recvSelf() - failed to recv data\n";
00246   else {
00247     this->setTag((int)data(0));
00248     commitStrain = data(1);
00249     trialStrain = commitStrain;
00250     E = data(2);
00251     fy = data(3);
00252     gap = data(4);
00253     eta = data(5);
00254     maxElasticYieldStrain = data(6);
00255     minElasticYieldStrain = data(7);
00256     damage = (int)data(8);
00257   }
00258 
00259   return res;
00260 }
00261 
00262 void 
00263 EPPGapMaterial::Print(OPS_Stream &s, int flag)
00264 {
00265     s << "EPPGap tag: " << this->getTag() << endln;
00266     s << "  E: " << E << ", kinematic hardening ratio: " << eta << endln;
00267     s << "  fy: " << fy << endln;
00268     s << "  initial gap: " << gap << endln;
00269     if (damage == 1)
00270         s << "  damage accumulation specified" << endln;
00271 }

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