J2AxiSymm.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: 2003/02/14 23:01:25 $
00018 // $Source: /usr/local/cvs/OpenSees/SRC/material/nD/J2AxiSymm.cpp,v $
00019 
00020 // Written: Ed "C++" Love
00021 //
00022 // J2AxiSymmetric 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_0 + (sigma_infty - sigma_0)*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 //                      eps_22                
00048 //                    2 eps_01   }   <--- note the 2
00049 // 
00050 //  set eta := 0 for rate independent case
00051 //
00052 
00053 #include <J2AxiSymm.h>
00054 #include <Channel.h>
00055 #include <FEM_ObjectBroker.h>
00056 
00057 //static vectors and matrices
00058 Vector J2AxiSymm :: strain_vec(4) ;
00059 Vector J2AxiSymm :: stress_vec(4) ;
00060 Matrix J2AxiSymm :: tangent_matrix(4,4) ;
00061 
00062 
00063 //null constructor
00064 J2AxiSymm ::  J2AxiSymm( ) : 
00065 J2Plasticity( ) 
00066 {  }
00067 
00068 
00069 //full constructor
00070 J2AxiSymm :: 
00071 J2AxiSymm(   int    tag, 
00072                  double K,
00073                  double G,
00074                  double yield0,
00075                  double yield_infty,
00076                  double d,
00077                  double H,
00078                  double viscosity ) : 
00079 J2Plasticity( tag, ND_TAG_J2AxiSymm, 
00080              K, G, yield0, yield_infty, d, H, viscosity )
00081 { 
00082 
00083 }
00084 
00085 
00086 //elastic constructor
00087 J2AxiSymm :: 
00088 J2AxiSymm(   int    tag, 
00089                  double K, 
00090                  double G ) :
00091 J2Plasticity( tag, ND_TAG_J2AxiSymm, K, G )
00092 { 
00093 
00094 }
00095 
00096 
00097 
00098 //destructor
00099 J2AxiSymm :: ~J2AxiSymm( ) 
00100 { } 
00101 
00102 
00103 //make a clone of this material
00104 NDMaterial* J2AxiSymm :: getCopy( ) 
00105 { 
00106   J2AxiSymm  *clone;
00107   clone = new J2AxiSymm() ;   //new instance of this class
00108   *clone = *this ;          //asignment to make copy
00109   return clone ;
00110 }
00111 
00112 
00113 //send back type of material
00114 const char* J2AxiSymm :: getType( ) const 
00115 {
00116   return "AxiSymmetric2D" ;
00117 }
00118 
00119 
00120 //send back order of strain in vector form
00121 int J2AxiSymm :: getOrder( ) const 
00122 { 
00123   return 4 ; 
00124 } 
00125 
00126 
00127 //get the strain and integrate plasticity equations
00128 int J2AxiSymm :: setTrialStrain( const Vector &strain_from_element) 
00129 {
00130   strain.Zero( ) ;
00131 
00132   strain(0,0) =        strain_from_element(0) ;
00133   strain(1,1) =        strain_from_element(1) ;
00134   strain(2,2) =        strain_from_element(2) ;
00135 
00136   strain(0,1) = 0.50 * strain_from_element(3) ;
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 J2AxiSymm :: setTrialStrain( const Vector &v, const Vector &r )
00147 { 
00148    return this->setTrialStrain( v ) ;
00149 } 
00150 
00151 int J2AxiSymm :: setTrialStrainIncr( const Vector &v ) 
00152 {
00153     return -1 ;
00154 }
00155 
00156 int J2AxiSymm :: setTrialStrainIncr( const Vector &v, const Vector &r ) 
00157 {
00158     return -1 ;
00159 }
00160 
00161 
00162 
00163 //send back the strain
00164 const Vector& J2AxiSymm :: getStrain( ) 
00165 {
00166   strain_vec(0) =       strain(0,0) ;
00167   strain_vec(1) =       strain(1,1) ;
00168   strain_vec(2) =       strain(2,2) ;
00169 
00170   strain_vec(3) = 2.0 * strain(0,1) ;
00171 
00172   return strain_vec ;
00173 } 
00174 
00175 
00176 //send back the stress 
00177 const Vector& J2AxiSymm :: getStress( ) 
00178 {
00179   stress_vec(0) = stress(0,0) ;
00180   stress_vec(1) = stress(1,1) ;
00181   stress_vec(2) = stress(2,2) ;
00182 
00183   stress_vec(3) = stress(0,1) ;
00184 
00185   return stress_vec ;
00186 }
00187 
00188 //send back the tangent 
00189 const Matrix& J2AxiSymm :: getTangent( ) 
00190 {
00191   // matrix to tensor mapping
00192   //  Matrix      Tensor
00193   // -------     -------
00194   //   0           0 0
00195   //   1           1 1
00196   //   2           2 2   
00197   //   3           0 1  ( or 1 0 )
00198   
00199   int ii, jj ;
00200   int i, j, k, l ;
00201 
00202   for ( ii = 0; ii < 4; ii++ ) {
00203     for ( jj = 0; jj < 4; jj++ ) {
00204 
00205       index_map( ii, i, j ) ;
00206       index_map( jj, k, l ) ;
00207 
00208       tangent_matrix(ii,jj) = tangent[i][j][k][l] ;
00209 
00210     } //end for j
00211   } //end for i
00212 
00213   return tangent_matrix ;
00214 } 
00215 
00216 //send back the tangent 
00217 const Matrix& J2AxiSymm :: getInitialTangent( ) 
00218 {
00219   // matrix to tensor mapping
00220   //  Matrix      Tensor
00221   // -------     -------
00222   //   0           0 0
00223   //   1           1 1
00224   //   2           2 2   
00225   //   3           0 1  ( or 1 0 )
00226 
00227   this->doInitialTangent();
00228 
00229   int ii, jj ;
00230   int i, j, k, l ;
00231 
00232   for ( ii = 0; ii < 4; ii++ ) {
00233     for ( jj = 0; jj < 4; jj++ ) {
00234 
00235       index_map( ii, i, j ) ;
00236       index_map( jj, k, l ) ;
00237 
00238       tangent_matrix(ii,jj) = initialTangent[i][j][k][l] ;
00239 
00240     } //end for j
00241   } //end for i
00242 
00243   return tangent_matrix ;
00244 } 
00245 
00246 //this is mike's problem
00247 int J2AxiSymm :: setTrialStrain(const Tensor &v) 
00248 {
00249   return -1 ;
00250 }
00251 
00252 int J2AxiSymm :: setTrialStrain(const Tensor &v, const Tensor &r)     
00253 {
00254   return -1 ;
00255 }
00256 
00257 int J2AxiSymm :: setTrialStrainIncr(const Tensor &v) 
00258 {
00259   return -1 ;
00260 }
00261 
00262 int J2AxiSymm :: setTrialStrainIncr(const Tensor &v, const Tensor &r) 
00263 {
00264   return -1 ;
00265 }
00266 
00267 const Tensor& J2AxiSymm :: getTangentTensor( ) 
00268 {
00269   return rank4 ;
00270 }
00271 
00272 //jeremic@ucdavis.edu 22jan2001const Tensor& J2AxiSymm :: getStressTensor( ) 
00273 //jeremic@ucdavis.edu 22jan2001{
00274 //jeremic@ucdavis.edu 22jan2001  return rank2 ;
00275 //jeremic@ucdavis.edu 22jan2001}
00276 //jeremic@ucdavis.edu 22jan2001
00277 //jeremic@ucdavis.edu 22jan2001const Tensor& J2AxiSymm :: getStrainTensor( ) 
00278 //jeremic@ucdavis.edu 22jan2001{
00279 //jeremic@ucdavis.edu 22jan2001  return rank2 ;
00280 //jeremic@ucdavis.edu 22jan2001}
00281 
00282 //swap history variables
00283 int J2AxiSymm :: commitState( )  
00284 {
00285   epsilon_p_n = epsilon_p_nplus1 ;
00286   xi_n        = xi_nplus1 ;
00287 
00288   return 0 ;
00289 }
00290 
00291 
00292 //revert to last saved state
00293 int J2AxiSymm :: revertToLastCommit( )
00294 { 
00295   return 0 ;
00296 } 
00297 
00298 //revert to start
00299 int J2AxiSymm :: revertToStart( ) 
00300 
00301 {  
00302   this->zero( ) ;
00303   return 0 ;
00304 }
00305 
00306 int
00307 J2AxiSymm::sendSelf (int commitTag, Channel &theChannel)
00308 {
00309   // we place all the data needed to define material and it's state
00310   // int a vector object
00311   static Vector data(9+9);
00312   int cnt = 0;
00313   data(cnt++) = this->getTag();
00314   data(cnt++) = bulk;
00315   data(cnt++) = shear;
00316   data(cnt++) = sigma_0;
00317   data(cnt++) = sigma_infty;
00318   data(cnt++) = delta;
00319   data(cnt++) = Hard;
00320   data(cnt++) = eta;
00321   data(cnt++) = xi_n;
00322   for (int i=0; i<3; i++)
00323     for (int j=0; j<3; j++)
00324       data(cnt++) = epsilon_p_n(i,j);
00325 
00326   // send the vector object to the channel
00327   if (theChannel.sendVector(this->getDbTag(), commitTag, data) < 0) {
00328     opserr << "J2AxiSymm::recvSelf - failed to send vector to channel\n";
00329     return -1;
00330   }
00331 
00332   return 0;
00333 }
00334 
00335 int
00336 J2AxiSymm::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(9+9);
00342   if (theChannel.recvVector(this->getDbTag(), commitTag, data) < 0) {
00343     opserr << "J2AxiSymm::recvSelf - failed to recv vector from 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 
00375 
00376 
00377 
00378 

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