J2PlaneStrain.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 ** ****************************************************************** */
00015                                                                         
00016 // $Revision: 1.6 $
00017 // $Date: 2004/02/24 22:53:34 $
00018 // $Source: /usr/local/cvs/OpenSees/SRC/material/nD/J2PlaneStrain.cpp,v $
00019 
00020 // Written: Ed "C++" Love
00021 //
00022 // J2PlaneStrain isotropic hardening material class
00023 // 
00024 //  Elastic Model
00025 //  sigma = K*trace(epsilion_elastic) + (2*G)*dev(epsilon_elastic)
00026 //
00027 //  Yield Function
00028 //  phi(sigma,q) = || dev(sigma) ||  - sqrt(2/3)*q(xi) 
00029 //
00030 //  Saturation Isotropic Hardening with linear term
00031 //  q(xi) = simga_infty + (sigma_0 - sigma_infty)*exp(-delta*xi) + H*xi 
00032 //
00033 //  Flow Rules
00034 //  \dot{epsilon_p} =  gamma * d_phi/d_sigma
00035 //  \dot{xi}        = -gamma * d_phi/d_q 
00036 //
00037 //  Linear Viscosity 
00038 //  gamma = phi / eta  ( if phi > 0 ) 
00039 //
00040 //  Backward Euler Integration Routine 
00041 //  Yield condition enforced at time n+1 
00042 //
00043 //  Send strains in following format :
00044 // 
00045 //     strain_vec = {   eps_00
00046 //                      eps_11
00047 //                    2 eps_01   }   <--- note the 2
00048 // 
00049 //  set eta := 0 for rate independent case
00050 //
00051 
00052 #include <J2PlaneStrain.h>
00053 #include <Channel.h>
00054 #include  <FEM_ObjectBroker.h>
00055 
00056 //static vectors and matrices
00057 Vector J2PlaneStrain :: strain_vec(3) ;
00058 Vector J2PlaneStrain :: stress_vec(3) ;
00059 Matrix J2PlaneStrain :: tangent_matrix(3,3) ;
00060 
00061 
00062 //null constructor
00063 J2PlaneStrain ::  J2PlaneStrain( ) : 
00064 J2Plasticity( ) 
00065 {  }
00066 
00067 
00068 //full constructor
00069 J2PlaneStrain :: 
00070 J2PlaneStrain(   int    tag, 
00071                  double K,
00072                  double G,
00073                  double yield0,
00074                  double yield_infty,
00075                  double d,
00076                  double H,
00077                  double viscosity ) : 
00078 J2Plasticity( tag, ND_TAG_J2PlaneStrain, 
00079              K, G, yield0, yield_infty, d, H, viscosity )
00080 { 
00081 
00082 }
00083 
00084 
00085 //elastic constructor
00086 J2PlaneStrain :: 
00087 J2PlaneStrain(   int    tag, 
00088                  double K, 
00089                  double G ) :
00090 J2Plasticity( tag, ND_TAG_J2PlaneStrain, K, G )
00091 { 
00092 
00093 }
00094 
00095 
00096 
00097 //destructor
00098 J2PlaneStrain :: ~J2PlaneStrain( ) 
00099 { 
00100 
00101 } 
00102 
00103 
00104 //make a clone of this material
00105 NDMaterial* J2PlaneStrain :: getCopy( ) 
00106 { 
00107   J2PlaneStrain  *clone;
00108   clone = new J2PlaneStrain() ;   //new instance of this class
00109   *clone = *this ;          //asignment to make copy
00110   return clone ;
00111 }
00112 
00113 
00114 
00115 //send back type of material
00116 const char* J2PlaneStrain :: getType( ) const 
00117 {
00118   return "PlaneStrain" ;
00119 }
00120 
00121 
00122 //send back order of strain in vector form
00123 int J2PlaneStrain :: getOrder( ) const 
00124 { 
00125   return 3 ; 
00126 } 
00127 
00128 
00129 //get the strain and integrate plasticity equations
00130 int J2PlaneStrain :: setTrialStrain( const Vector &strain_from_element) 
00131 {
00132   strain.Zero( ) ;
00133 
00134   strain(0,0) =        strain_from_element(0) ;
00135   strain(1,1) =        strain_from_element(1) ;
00136   strain(0,1) = 0.50 * strain_from_element(2) ;
00137   strain(1,0) =        strain(0,1) ;
00138 
00139   this->plastic_integrator( ) ;
00140 
00141   return 0 ;
00142 }
00143 
00144 
00145 //unused trial strain functions
00146 int J2PlaneStrain :: setTrialStrain( const Vector &v, const Vector &r )
00147 { 
00148    return this->setTrialStrain( v ) ;
00149 } 
00150 
00151 int J2PlaneStrain :: setTrialStrainIncr( const Vector &v ) 
00152 {
00153   static Vector newStrain(3);
00154   newStrain(0) = strain(0,0) + v(0);
00155   newStrain(1) = strain(1,1) + v(1);
00156   newStrain(2) = 2.0 * strain(0,1) + v(2);
00157 
00158   return this->setTrialStrain(newStrain);  
00159 }
00160 
00161 int J2PlaneStrain :: setTrialStrainIncr( const Vector &v, const Vector &r ) 
00162 {
00163     return this->setTrialStrainIncr(v);
00164 }
00165 
00166 
00167 //send back the strain
00168 const Vector& J2PlaneStrain :: getStrain( ) 
00169 {
00170   strain_vec(0) =       strain(0,0) ;
00171   strain_vec(1) =       strain(1,1) ;
00172   strain_vec(2) = 2.0 * strain(0,1) ;
00173 
00174   return strain_vec ;
00175 } 
00176 
00177 
00178 //send back the stress 
00179 const Vector& J2PlaneStrain :: getStress( ) 
00180 {
00181   stress_vec(0) = stress(0,0) ;
00182   stress_vec(1) = stress(1,1) ;
00183   stress_vec(2) = stress(0,1) ;
00184 
00185   return stress_vec ;
00186 }
00187 
00188 //send back the tangent 
00189 const Matrix& J2PlaneStrain :: getTangent( ) 
00190 {
00191   // matrix to tensor mapping
00192   //  Matrix      Tensor
00193   // -------     -------
00194   //   0           0 0
00195   //   1           1 1
00196   //   2           0 1  ( or 1 0 ) 
00197   // 
00198        
00199   tangent_matrix(0,0) = tangent [0][0] [0][0] ;
00200   tangent_matrix(1,1) = tangent [1][1] [1][1] ;
00201   tangent_matrix(2,2) = tangent [0][1] [0][1] ;
00202 
00203   tangent_matrix(0,1) = tangent [0][0] [1][1] ;
00204   tangent_matrix(1,0) = tangent [1][1] [0][0] ;
00205 
00206   tangent_matrix(0,2) = tangent [0][0] [0][1] ;
00207   tangent_matrix(2,0) = tangent [0][1] [0][0] ;
00208 
00209   tangent_matrix(1,2) = tangent [1][1] [0][1] ;
00210   tangent_matrix(2,1) = tangent [0][1] [1][1] ;
00211 
00212   return tangent_matrix ;
00213 } 
00214 
00215 
00216 //send back the tangent 
00217 const Matrix& J2PlaneStrain :: getInitialTangent( ) 
00218 {
00219   // matrix to tensor mapping
00220   //  Matrix      Tensor
00221   // -------     -------
00222   //   0           0 0
00223   //   1           1 1
00224   //   2           0 1  ( or 1 0 ) 
00225   // 
00226 
00227   this->doInitialTangent();
00228 
00229   tangent_matrix(0,0) = initialTangent [0][0] [0][0] ;
00230   tangent_matrix(1,1) = initialTangent [1][1] [1][1] ;
00231   tangent_matrix(2,2) = initialTangent [0][1] [0][1] ;
00232 
00233   tangent_matrix(0,1) = initialTangent [0][0] [1][1] ;
00234   tangent_matrix(1,0) = initialTangent [1][1] [0][0] ;
00235 
00236   tangent_matrix(0,2) = initialTangent [0][0] [0][1] ;
00237   tangent_matrix(2,0) = initialTangent [0][1] [0][0] ;
00238 
00239   tangent_matrix(1,2) = initialTangent [1][1] [0][1] ;
00240   tangent_matrix(2,1) = initialTangent [0][1] [1][1] ;
00241 
00242   return tangent_matrix ;
00243 } 
00244 
00245 //this is mike's problem
00246 int J2PlaneStrain :: setTrialStrain(const Tensor &v) 
00247 {
00248   return -1 ;
00249 }
00250 
00251 int J2PlaneStrain :: setTrialStrain(const Tensor &v, const Tensor &r)     
00252 {
00253   return -1 ;
00254 }
00255 
00256 int J2PlaneStrain :: setTrialStrainIncr(const Tensor &v) 
00257 {
00258   return -1 ;
00259 }
00260 
00261 int J2PlaneStrain :: setTrialStrainIncr(const Tensor &v, const Tensor &r) 
00262 {
00263   return -1 ;
00264 }
00265 
00266 const Tensor& J2PlaneStrain :: getTangentTensor( ) 
00267 {
00268   return rank4 ;
00269 }
00270 
00271 //jeremic@ucdavis.edu 22jan2001const Tensor& J2PlaneStrain :: getStressTensor( ) 
00272 //jeremic@ucdavis.edu 22jan2001{
00273 //jeremic@ucdavis.edu 22jan2001  return rank2 ;
00274 //jeremic@ucdavis.edu 22jan2001}
00275 //jeremic@ucdavis.edu 22jan2001
00276 //jeremic@ucdavis.edu 22jan2001const Tensor& J2PlaneStrain :: getStrainTensor( ) 
00277 //jeremic@ucdavis.edu 22jan2001{
00278 //jeremic@ucdavis.edu 22jan2001  return rank2 ;
00279 //jeremic@ucdavis.edu 22jan2001}
00280 
00281 int 
00282 J2PlaneStrain::commitState( ) 
00283 {
00284   epsilon_p_n = epsilon_p_nplus1;
00285   xi_n        = xi_nplus1;
00286 
00287   return 0;
00288 }
00289 
00290 int 
00291 J2PlaneStrain::revertToLastCommit( ) {
00292 
00293   return 0;
00294 }
00295 
00296 
00297 int 
00298 J2PlaneStrain::revertToStart( ) 
00299 {
00300   this->zero( ) ;
00301 
00302   return 0;
00303 }
00304 
00305 int
00306 J2PlaneStrain::sendSelf (int commitTag, Channel &theChannel)
00307 {
00308   // we place all the data needed to define material and it's state
00309   // int a vector object
00310   static Vector data(18);
00311   int cnt = 0;
00312   data(cnt++) = this->getTag();
00313   data(cnt++) = bulk;
00314   data(cnt++) = shear;
00315   data(cnt++) = sigma_0;
00316   data(cnt++) = sigma_infty;
00317   data(cnt++) = delta;
00318   data(cnt++) = Hard;
00319   data(cnt++) = eta;
00320   data(cnt++) = xi_n;
00321 
00322   //  data(cnt++) = commitEps22;
00323   for (int i=0; i<3; i++)
00324     for (int j=0; j<3; j++)
00325       data(cnt++) = epsilon_p_n(i,j);
00326 
00327   // send the vector object to the channel
00328   if (theChannel.sendVector(this->getDbTag(), commitTag, data) < 0) {
00329     opserr << "J2PlaneStrain::sendSelf - failed to send vector to channel\n";
00330     return -1;
00331   }
00332   return 0;
00333 }
00334 
00335 int
00336 J2PlaneStrain::recvSelf (int commitTag, Channel &theChannel, 
00337                          FEM_ObjectBroker &theBroker)
00338 {
00339 
00340   // recv the vector object from the channel which defines material param and state
00341   static Vector data(18);
00342   if (theChannel.recvVector(this->getDbTag(), commitTag, data) < 0) {
00343     opserr << "J2PlaneStrain::recvSelf - failed to sned vectorto channel\n";
00344     return -1;
00345   }
00346 
00347   // set the material parameters and state variables
00348   int cnt = 0;
00349   this->setTag(data(cnt++));
00350   bulk = data(cnt++);
00351   shear = data(cnt++);
00352   sigma_0 = data(cnt++);
00353   sigma_infty = data(cnt++);
00354   delta = data(cnt++);
00355   Hard = data(cnt++);
00356   eta = data(cnt++);
00357   xi_n = data(cnt++);
00358   for (int i=0; i<3; i++)
00359     for (int j=0; j<3; j++) 
00360       epsilon_p_n(i,j) = data(cnt++);
00361 
00362   epsilon_p_nplus1 = epsilon_p_n;
00363   xi_nplus1        = xi_n;
00364 
00365   return 0;
00366 }
00367 
00368 
00369 
00370 
00371 
00372 
00373 
00374 

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