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

ElasticIsotropic3D.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.8 $                                                              
00022 // $Date: 2001/07/13 22:09:24 $                                                                  
00023 // $Source: /usr/local/cvs/OpenSees/SRC/material/nD/ElasticIsotropic3D.cpp,v $                                                                
00024 
00025 //Boris Jeremic and Zhaohui Yang ___ 02-10-2000
00026                                                                        
00027                                                                         
00028 #include <ElasticIsotropic3D.h>
00029 #include <Channel.h>
00030 #include <Tensor.h>
00031 
00032 Matrix ElasticIsotropic3D::D(6,6);
00033 Vector ElasticIsotropic3D::sigma(6);
00034 
00035 ElasticIsotropic3D::ElasticIsotropic3D
00036 (int tag, double E, double nu, double expp, double pr, double pop):
00037  ElasticIsotropicMaterial (tag, ND_TAG_ElasticIsotropic3D, E, nu),
00038  epsilon(6), exp(expp), p_ref(pr), po(pop) 
00039 {
00040  // Set up the elastic constant matrix for 3D elastic isotropic 
00041  Dt = tensor( 4, def_dim_4, 0.0 ); 
00042  setInitElasticStiffness();
00043 }
00044 
00045 ElasticIsotropic3D::ElasticIsotropic3D():
00046  ElasticIsotropicMaterial (0, ND_TAG_ElasticIsotropic3D, 0.0, 0.0),
00047  epsilon(6)
00048 {
00049        Dt = tensor( 4, def_dim_4, 0.0 );
00050 }
00051 
00052 ElasticIsotropic3D::~ElasticIsotropic3D ()
00053 {
00054 
00055 }
00056 
00057 int
00058 ElasticIsotropic3D::setTrialStrain (const Vector &v)
00059 {
00060  epsilon = v;
00061 
00062  return 0;
00063 }
00064 
00065 int
00066 ElasticIsotropic3D::setTrialStrain (const Vector &v, const Vector &r)
00067 {
00068  epsilon = v;
00069 
00070  return 0;
00071 }
00072 
00073 int
00074 ElasticIsotropic3D::setTrialStrainIncr (const Vector &v)
00075 {
00076  epsilon += v;
00077 
00078  return 0;
00079 }
00080 
00081 int
00082 ElasticIsotropic3D::setTrialStrainIncr (const Vector &v, const Vector &r)
00083 {
00084  epsilon += v;
00085 
00086  return 0;
00087 }
00088 
00089 const Matrix&
00090 ElasticIsotropic3D::getTangent (void)
00091 {
00092  double mu2 = E/(1.0+v);
00093  double lam = v*mu2/(1.0-2.0*v);
00094  double mu = 0.50*mu2;
00095 
00096  for (int i = 0; i < 3; i++) {
00097   for (int j = 0; j < 3; j++)
00098    D(j,i) = lam;
00099   D(i,i) += mu2;
00100   D(i+3,i+3) = mu;
00101  }
00102 
00103  return D;
00104 }
00105 
00106 const Vector&
00107 ElasticIsotropic3D::getStress (void)
00108 {
00109  double mu2 = E/(1.0+v);
00110  double lam = v*mu2/(1.0-2.0*v);
00111  double mu = 0.50*mu2;
00112 
00113  double tmp1 = lam+mu2;
00114  
00115  double eps0 = epsilon(0);
00116  double eps1 = epsilon(1);
00117  double eps2 = epsilon(2);
00118 
00119  sigma(0) = tmp1*eps0 + lam*(eps1+eps2);
00120  sigma(1) = tmp1*eps1 + lam*(eps2+eps0);
00121  sigma(2) = tmp1*eps2 + lam*(eps0+eps1);
00122 
00123  sigma(3) = mu*epsilon(3);
00124  sigma(4) = mu*epsilon(4);
00125  sigma(5) = mu*epsilon(5);
00126 
00127  return sigma;
00128 }
00129 
00130 const Vector&
00131 ElasticIsotropic3D::getStrain (void)
00132 {
00133  return epsilon;
00134 }
00135 
00136 int
00137 ElasticIsotropic3D::setTrialStrain (const Tensor &v)
00138 {
00139     Strain = v;
00140     return 0;
00141 }
00142 
00143 int
00144 ElasticIsotropic3D::setTrialStrain (const Tensor &v, const Tensor &r)
00145 {
00146     Strain = v;
00147     return 0;
00148 }
00149 
00150 int
00151 ElasticIsotropic3D::setTrialStrainIncr (const Tensor &v)
00152 {
00153     //cerr << " before set Tri St Incr " << Strain;
00154     //cerr << " Strain Incr " << v << endln;
00155     Strain = Strain + v;
00156     //cerr << " after setTrialStrainIncr  " << Strain << endln;
00157     return 0;
00158 }
00159 
00160 int
00161 ElasticIsotropic3D::setTrialStrainIncr (const Tensor &v, const Tensor &r)
00162 {
00163     Strain = Strain + v;
00164     return 0;
00165 }
00166 
00167 const Tensor&
00168 ElasticIsotropic3D::getTangentTensor (void)
00169 {
00170     //setElasticStiffness();
00171     //return Dt;
00172     return Dt_commit;
00173 }
00174 
00175 const stresstensor ElasticIsotropic3D::getStressTensor (void)
00176 {
00177     Stress = Dt("ijkl") * Strain("kl");
00178     //setElasticStiffness();
00179     return Stress;
00180 }
00181 
00182 const Tensor&
00183 ElasticIsotropic3D::getStrainTensor (void)
00184 {
00185     return Strain;
00186 }
00187 
00188 int
00189 ElasticIsotropic3D::commitState (void)
00190 {
00191     //Set the new Elastic constants
00192     tensor ret( 4, def_dim_4, 0.0 );
00193                
00194     // Kronecker delta tensor
00195     tensor I2("I", 2, def_dim_2);
00196 
00197     tensor I_ijkl = I2("ij")*I2("kl");
00198 
00199 
00200     //I_ijkl.null_indices();
00201     tensor I_ikjl = I_ijkl.transpose0110();
00202     tensor I_iljk = I_ijkl.transpose0111();
00203     tensor I4s = (I_ikjl+I_iljk)*0.5;
00204     
00205     //Update E according to 
00206     Stress = getStressTensor();
00207     //Dt("ijkl") * Strain("kl");
00208     double p = Stress.p_hydrostatic();
00209     //cerr << " p = " <<  p;
00210 
00211     if (p <= 0.5) 
00212       p = 0.5;
00213 
00214     double Ec = E * pow(p/p_ref, exp);
00215     //cerr << " Eo = " << E << " Ec = " << Ec << endln;
00216 
00217     // Building elasticity tensor
00218     ret = I_ijkl*( Ec*v / ( (1.0+v)*(1.0 - 2.0*v) ) ) + I4s*( Ec / (1.0 + v) );
00219     
00220     //ret.print();
00221     Dt_commit = ret;
00222     Dt = ret;
00223     
00224     return 0;
00225 
00226 }
00227 
00228 int
00229 ElasticIsotropic3D::revertToLastCommit (void)
00230 {
00231  // Nothing was previously committed
00232  return 0;
00233 }
00234 
00235 int
00236 ElasticIsotropic3D::revertToStart (void)
00237 {
00238  // Nothing was previously committed
00239  return 0;
00240 }
00241 
00242 NDMaterial*
00243 ElasticIsotropic3D::getCopy (void)
00244 {
00245  ElasticIsotropic3D *theCopy =
00246   new ElasticIsotropic3D (this->getTag(), E, v);
00247  theCopy->epsilon = this->epsilon;
00248  theCopy->Strain = this->Strain;
00249  theCopy->Stress = this->Stress;
00250  // D and Dt are created in the constructor call
00251 
00252  return theCopy;
00253 }
00254 
00255 const char*
00256 ElasticIsotropic3D::getType (void) const
00257 {
00258  return "ThreeDimensional";
00259 }
00260 
00261 int
00262 ElasticIsotropic3D::getOrder (void) const
00263 {
00264  return 6;
00265 }
00266 
00267 int 
00268 ElasticIsotropic3D::sendSelf(int commitTag, Channel &theChannel)
00269 {
00270  int res = 0;
00271 
00272  static Vector data(3);
00273 
00274  data(0) = this->getTag();
00275  data(1) = E;
00276  data(2) = v;
00277 
00278      res += theChannel.sendVector(this->getDbTag(), commitTag, data);
00279  if (res < 0) {
00280   g3ErrorHandler->warning("%s -- could not send Vector",
00281    "ElasticIsotropic3D::sendSelf");
00282   return res;
00283  }
00284 
00285  return res;
00286 }
00287 
00288 int
00289 ElasticIsotropic3D::recvSelf(int commitTag, Channel &theChannel, 
00290    FEM_ObjectBroker &theBroker)
00291 {
00292  int res = 0;
00293 
00294  static Vector data(6);
00295 
00296  res += theChannel.recvVector(this->getDbTag(), commitTag, data);
00297  if (res < 0) {
00298   g3ErrorHandler->warning("%s -- could not receive Vector",
00299    "ElasticIsotropic3D::recvSelf");
00300   return res;
00301  }
00302     
00303  this->setTag((int)data(0));
00304      E = data(1);
00305  v = data(2);
00306 
00307  // Set up the elastic constant matrix for 3D elastic isotropic
00308  D.Zero();
00309  //setElasticStiffness();
00310  
00311  return res;
00312 }
00313     
00314 void
00315 ElasticIsotropic3D::Print(ostream &s, int flag)
00316 {
00317  s << "ElasticIsotropic3D" << endl;
00318  s << "\ttag: " << this->getTag() << endl;
00319  s << "\tE: " << E << endl;
00320  s << "\tv: " << v << endl;
00321  s << "\texp: " << exp << endl;
00322  s << "\tp_ref: " << p_ref << endl;
00323  //s << "\tD: " << D << endl;
00324 }
00325 
00326 
00327 //================================================================================
00328 void ElasticIsotropic3D::setInitElasticStiffness(void)
00329 {    
00330     tensor ret( 4, def_dim_4, 0.0 );
00331                
00332     // Kronecker delta tensor
00333     tensor I2("I", 2, def_dim_2);
00334 
00335     tensor I_ijkl = I2("ij")*I2("kl");
00336 
00337 
00338     //I_ijkl.null_indices();
00339     tensor I_ikjl = I_ijkl.transpose0110();
00340     tensor I_iljk = I_ijkl.transpose0111();
00341     tensor I4s = (I_ikjl+I_iljk)*0.5;
00342     
00343     //Initialize E according to initial pressure in the gauss point
00344     //Stress = getStressTensor();
00345     //Dt("ijkl") * Strain("kl");
00346     //double po = Stress.p_hydrostatic();
00347 
00348     //cerr << " p_ref = " <<  p_ref << " po = " << po << endln;
00349     //double po = 100.0; //kPa
00350     if (po <= 0.5) 
00351       po = 0.5;
00352     double Eo;
00353     if (p_ref != 0.0)
00354         Eo = E * pow(po/p_ref, exp);
00355     else
00356         Eo = E;
00357 
00358     //cerr << " E@ref = " << E << " Eo = " << Eo << endln;
00359 
00360     // Building elasticity tensor
00361     ret = I_ijkl*( Eo*v / ( (1.0+v)*(1.0 - 2.0*v) ) ) + I4s*( Eo / (1.0 + v) );
00362     
00363     //ret.print();
00364     Dt = ret;
00365     Dt_commit = ret;
00366 
00367     //D = Dt;
00368 
00369     return;
00370 
00371 }
00372 
00373 
Copyright Contact Us