J2ThreeDimensional.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: 2005/03/25 00:34:40 $
00018 // $Source: /usr/local/cvs/OpenSees/SRC/material/nD/J2ThreeDimensional.cpp,v $
00019 
00020 // Written: Ed "C++" Love
00021 // Do not ask Prashant about this code.  He has no clue. 
00022 //
00023 // J2ThreeDimensional isotropic hardening material class
00024 // 
00025 //  Elastic Model
00026 //  sigma = K*trace(epsilion_elastic) + (2*G)*dev(epsilon_elastic)
00027 //
00028 //  Yield Function
00029 //  phi(sigma,q) = || dev(sigma) ||  - sqrt(2/3)*q(xi) 
00030 //
00031 //  Saturation Isotropic Hardening with linear term
00032 //  q(xi) = simga_0 + (sigma_infty - sigma_0)*exp(-delta*xi) + H*xi 
00033 //
00034 //  Flow Rules
00035 //  \dot{epsilon_p} =  gamma * d_phi/d_sigma
00036 //  \dot{xi}        = -gamma * d_phi/d_q 
00037 //
00038 //  Linear Viscosity 
00039 //  gamma = phi / eta  ( if phi > 0 ) 
00040 //
00041 //  Backward Euler Integration Routine 
00042 //  Yield condition enforced at time n+1 
00043 //
00044 //  Send strains in following format :
00045 // 
00046 //     strain_vec = {   eps_00
00047 //                      eps_11
00048 //                      eps_22                
00049 //                    2 eps_01   
00050 //                    2 eps_12   
00051 //                    2 eps_20    }   <--- note the 2
00052 // 
00053 //  set eta := 0 for rate independent case
00054 //
00055 
00056 #include <J2ThreeDimensional.h>
00057 #include <Channel.h>
00058 #include <FEM_ObjectBroker.h>
00059 
00060 //static vectors and matrices
00061 Vector J2ThreeDimensional :: strain_vec(6) ;
00062 Vector J2ThreeDimensional :: stress_vec(6) ;
00063 Matrix J2ThreeDimensional :: tangent_matrix(6,6) ;
00064 
00065 
00066 //null constructor
00067 J2ThreeDimensional ::  J2ThreeDimensional( ) : 
00068 J2Plasticity( ) 
00069 {  }
00070 
00071 
00072 //full constructor
00073 J2ThreeDimensional :: 
00074 J2ThreeDimensional(   int    tag, 
00075                  double K,
00076                  double G,
00077                  double yield0,
00078                  double yield_infty,
00079                  double d,
00080                  double H,
00081                  double viscosity ) : 
00082 J2Plasticity( tag, ND_TAG_J2ThreeDimensional, 
00083              K, G, yield0, yield_infty, d, H, viscosity )
00084 { 
00085 
00086 }
00087 
00088 
00089 //elastic constructor
00090 J2ThreeDimensional :: 
00091 J2ThreeDimensional(   int    tag, 
00092                  double K, 
00093                  double G ) :
00094 J2Plasticity( tag, ND_TAG_J2ThreeDimensional, K, G )
00095 { 
00096 
00097 }
00098 
00099 
00100 
00101 //destructor
00102 J2ThreeDimensional :: ~J2ThreeDimensional( ) 
00103 { } 
00104 
00105 
00106 //make a clone of this material
00107 NDMaterial* J2ThreeDimensional :: getCopy( ) 
00108 { 
00109   J2ThreeDimensional  *clone;
00110   clone = new J2ThreeDimensional( ) ;   //new instance of this class
00111   *clone = *this ;          //asignment to make copy
00112   return clone ;
00113 }
00114 
00115 
00116 //send back type of material
00117 const char* J2ThreeDimensional :: getType( ) const 
00118 {
00119   return "ThreeDimensional" ;
00120 }
00121 
00122 
00123 //send back order of strain in vector form
00124 int J2ThreeDimensional :: getOrder( ) const 
00125 { 
00126   return 6 ; 
00127 } 
00128 
00129 
00130 //get the strain and integrate plasticity equations
00131 int J2ThreeDimensional :: setTrialStrain( const Vector &strain_from_element) 
00132 {
00133   strain.Zero( ) ;
00134 
00135   strain(0,0) =        strain_from_element(0) ;
00136   strain(1,1) =        strain_from_element(1) ;
00137   strain(2,2) =        strain_from_element(2) ;
00138 
00139   strain(0,1) = 0.50 * strain_from_element(3) ;
00140   strain(1,0) =        strain(0,1) ;
00141 
00142   strain(1,2) = 0.50 * strain_from_element(4) ;
00143   strain(2,1) =        strain(1,2) ;
00144   
00145   strain(2,0) = 0.50 * strain_from_element(5) ;
00146   strain(0,2) =        strain(2,0) ;
00147 
00148   this->plastic_integrator( ) ;
00149 
00150   return 0 ;
00151 }
00152 
00153 
00154 //unused trial strain functions
00155 int J2ThreeDimensional :: setTrialStrain( const Vector &v, const Vector &r )
00156 { 
00157    return this->setTrialStrain( v ) ;
00158 } 
00159 
00160 int J2ThreeDimensional :: setTrialStrainIncr( const Vector &v ) 
00161 {
00162   static Vector newStrain(6);
00163   newStrain(0) = strain(0,0) + v(0);
00164   newStrain(1) = strain(1,1) + v(1);
00165   newStrain(2) = strain(2,2) + v(2);
00166   newStrain(3) = 2.0*strain(0,1) + v(3);
00167   newStrain(4) = 2.0*strain(1,2) + v(4);
00168   newStrain(5) = 2.0*strain(2,0) + v(5);
00169   
00170   return this->setTrialStrain(newStrain);
00171 }
00172 
00173 int J2ThreeDimensional :: setTrialStrainIncr( const Vector &v, const Vector &r ) 
00174 {
00175   return this->setTrialStrainIncr(v);
00176 }
00177 
00178 
00179 
00180 //send back the strain
00181 const Vector& J2ThreeDimensional :: getStrain( ) 
00182 {
00183   strain_vec(0) =       strain(0,0) ;
00184   strain_vec(1) =       strain(1,1) ;
00185   strain_vec(2) =       strain(2,2) ;
00186 
00187   strain_vec(3) = 2.0 * strain(0,1) ;
00188 
00189   strain_vec(4) = 2.0 * strain(1,2) ;
00190 
00191   strain_vec(5) = 2.0 * strain(2,0) ;
00192 
00193   return strain_vec ;
00194 } 
00195 
00196 
00197 //send back the stress 
00198 const Vector& J2ThreeDimensional :: getStress( ) 
00199 {
00200   stress_vec(0) = stress(0,0) ;
00201   stress_vec(1) = stress(1,1) ;
00202   stress_vec(2) = stress(2,2) ;
00203 
00204   stress_vec(3) = stress(0,1) ;
00205 
00206   stress_vec(4) = stress(1,2) ;
00207   
00208   stress_vec(5) = stress(2,0) ;
00209 
00210   return stress_vec ;
00211 }
00212 
00213 //send back the tangent 
00214 const Matrix& J2ThreeDimensional :: getTangent( ) 
00215 {
00216   // matrix to tensor mapping
00217   //  Matrix      Tensor
00218   // -------     -------
00219   //   0           0 0
00220   //   1           1 1
00221   //   2           2 2   
00222   //   3           0 1  ( or 1 0 )
00223   //   4           1 2  ( or 2 1 )
00224   //   5           2 0  ( or 0 2 ) 
00225     
00226   int ii, jj ;
00227   int i, j, k, l ;
00228 
00229   for ( ii = 0; ii < 6; ii++ ) {
00230     for ( jj = 0; jj < 6; jj++ ) {
00231 
00232       index_map( ii, i, j ) ;
00233       index_map( jj, k, l ) ;
00234 
00235       tangent_matrix(ii,jj) = tangent[i][j][k][l] ;
00236 
00237     } //end for j
00238   } //end for i
00239 
00240 
00241   return tangent_matrix ;
00242 } 
00243 
00244 //send back the tangent 
00245 const Matrix& J2ThreeDimensional :: getInitialTangent( ) 
00246 {
00247   // matrix to tensor mapping
00248   //  Matrix      Tensor
00249   // -------     -------
00250   //   0           0 0
00251   //   1           1 1
00252   //   2           2 2   
00253   //   3           0 1  ( or 1 0 )
00254   //   4           1 2  ( or 2 1 )
00255   //   5           2 0  ( or 0 2 ) 
00256     
00257   int ii, jj ;
00258   int i, j, k, l ;
00259 
00260   this->doInitialTangent();
00261 
00262   for ( ii = 0; ii < 6; ii++ ) {
00263     for ( jj = 0; jj < 6; jj++ ) {
00264 
00265       index_map( ii, i, j ) ;
00266       index_map( jj, k, l ) ;
00267 
00268       tangent_matrix(ii,jj) = initialTangent[i][j][k][l] ;
00269 
00270     } //end for j
00271   } //end for i
00272 
00273   return tangent_matrix ;
00274 } 
00275 
00276 //this is mike's problem
00277 int J2ThreeDimensional :: setTrialStrain(const Tensor &v) 
00278 {
00279   return -1 ;
00280 }
00281 
00282 int J2ThreeDimensional :: setTrialStrain(const Tensor &v, const Tensor &r)     
00283 {
00284   return -1 ;
00285 }
00286 
00287 int J2ThreeDimensional :: setTrialStrainIncr(const Tensor &v) 
00288 {
00289   return -1 ;
00290 }
00291 
00292 int J2ThreeDimensional :: setTrialStrainIncr(const Tensor &v, const Tensor &r) 
00293 {
00294   return -1 ;
00295 }
00296 
00297 const Tensor& J2ThreeDimensional :: getTangentTensor( ) 
00298 {
00299   return rank4 ;
00300 }
00301 
00302 //jeremic@ucdavis.edu 22jan2001const Tensor& J2ThreeDimensional :: getStressTensor( ) 
00303 //jeremic@ucdavis.edu 22jan2001{
00304 //jeremic@ucdavis.edu 22jan2001  return rank2 ;
00305 //jeremic@ucdavis.edu 22jan2001}
00306 //jeremic@ucdavis.edu 22jan2001
00307 //jeremic@ucdavis.edu 22jan2001const Tensor& J2ThreeDimensional :: getStrainTensor( ) 
00308 //jeremic@ucdavis.edu 22jan2001{
00309 //jeremic@ucdavis.edu 22jan2001  return rank2 ;
00310 //jeremic@ucdavis.edu 22jan2001}
00311 
00312 
00313 
00314 
00315 
00316 
00317 

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