PressureDependentElastic3D.cpp

Go to the documentation of this file.
00001 //===============================================================================
00002 //# COPYRIGHT (C): Woody's license (by BJ):
00003 //                 ``This    source  code is Copyrighted in
00004 //                 U.S.,  for  an  indefinite  period,  and anybody
00005 //                 caught  using it without our permission, will be
00006 //                 mighty good friends of ourn, cause we don't give
00007 //                 a  darn.  Hack it. Compile it. Debug it. Run it.
00008 //                 Yodel  it.  Enjoy it. We wrote it, that's all we
00009 //                 wanted to do.''
00010 //
00011 //# PROJECT:           Object Oriented Finite Element Program
00012 //# PURPOSE:           Pressure dependent elastic isotropic material implementation:
00013 //# CLASS:             PressureDependentElastic3D
00014 //#
00015 //# VERSION:           0.61803398874989 (golden section)
00016 //# LANGUAGE:          C++
00017 //# TARGET OS:         all...
00018 //# DESIGN:            Zhaohui Yang, Boris Jeremic (jeremic@ucdavis.edu)
00019 //# PROGRAMMER(S):     Zhaohui Yang, Boris Jeremic
00020 //#
00021 //#
00022 //# DATE:              07July2001
00023 //# UPDATE HISTORY:    22Nov2002 small fixes, formating...
00024 //#
00025 //#
00026 //===============================================================================
00027 
00028 
00029 
00030 #include <PressureDependentElastic3D.h>
00031 
00032 
00033 Tensor PressureDependentElastic3D::Dt(4, def_dim_4, 0.0 );
00034 stresstensor PressureDependentElastic3D::Stress;
00035 
00036 PressureDependentElastic3D::PressureDependentElastic3D
00037 (int tag, double E, double nu, double rhop, double expp, double pr, double pop):
00038  ElasticIsotropicMaterial (tag, ND_TAG_PressureDependentElastic3D, E, nu, rhop),
00039  exp0(expp), p_ref(pr), p_cutoff(pop)
00040 {
00041 
00042 }
00043 
00044 PressureDependentElastic3D::PressureDependentElastic3D():
00045  ElasticIsotropicMaterial (0, ND_TAG_PressureDependentElastic3D, 0.0, 0.0, 0.0)
00046 {
00047 
00048 }
00049 
00050 PressureDependentElastic3D::~PressureDependentElastic3D ()
00051 {
00052 
00053 }
00054 
00055 int PressureDependentElastic3D::setTrialStrain (const Tensor &v)
00056 {
00057     Strain = v;
00058     return 0;
00059 }
00060 
00061 int PressureDependentElastic3D::setTrialStrain (const Tensor &v, const Tensor &r)
00062 {
00063     Strain = v;
00064     return 0;
00065 }
00066 
00067 int PressureDependentElastic3D::setTrialStrainIncr (const Tensor &v)
00068 {
00069     Strain += v;
00070     return 0;
00071 }
00072 
00073 int PressureDependentElastic3D::setTrialStrainIncr (const Tensor &v, const Tensor &r)
00074 {
00075     Strain += v;
00076     return 0;
00077 }
00078 
00079 const Tensor& PressureDependentElastic3D::getTangentTensor (void)
00080 {
00081     return  ComputeElasticStiffness();
00082 }
00083 
00084 const stresstensor& PressureDependentElastic3D::getStressTensor (void)
00085 {
00086     tensor Dt0 = this->getTangentTensor();
00087         straintensor Da = Strain - CStrain;
00088         stresstensor De = Dt0("ijkl") * Da("kl");
00089                 De.null_indices();
00090         Stress = CStress + De;
00091         
00092     return Stress;
00093 }
00094 
00095 const straintensor& PressureDependentElastic3D::getStrainTensor (void)
00096 {
00097     return Strain;
00098 }
00099 
00100 int PressureDependentElastic3D::commitState (void)
00101 {
00102         CStress = Stress;
00103         CStrain = Strain;
00104 
00105     return 0;
00106 }
00107 
00108 int PressureDependentElastic3D::revertToLastCommit (void)
00109 {
00110         Stress = CStress;
00111         Strain = CStrain;
00112 
00113     return 0;
00114 }
00115 
00116 int PressureDependentElastic3D::revertToStart (void)
00117 {
00118         Stress = Stress*0.0;
00119         Strain = Strain*0.0;
00120 
00121     return 0;
00122 }
00123 
00124 NDMaterial* PressureDependentElastic3D::getCopy (void)
00125 {
00126     PressureDependentElastic3D *theCopy =
00127                 new PressureDependentElastic3D (this->getTag(), E, v, rho, exp0, p_ref, p_cutoff);
00128 
00129     return theCopy;
00130 }
00131 
00132 const char* PressureDependentElastic3D::getType (void) const
00133 {
00134     return "ThreeDimensional";
00135 }
00136 
00137 
00138 int PressureDependentElastic3D::sendSelf(int commitTag, Channel &theChannel)
00139 {
00140     int res = 0;
00141 
00142     static Vector data(6);
00143 
00144     data(0) = this->getTag();
00145     data(1) = E;
00146     data(2) = v;
00147     data(3) = exp0;
00148     data(4) = p_ref;
00149     data(5) = p_cutoff;
00150 
00151     res += theChannel.sendVector(this->getDbTag(), commitTag, data);
00152     if (res < 0)
00153       {
00154         opserr << "PressureDependentElastic3D::sendSelf -- could not send Vector\n";
00155         return res;
00156       }
00157 
00158     return res;
00159   }
00160 
00161 int PressureDependentElastic3D::recvSelf(int commitTag,
00162                                          Channel &theChannel,
00163                                          FEM_ObjectBroker &theBroker)
00164   {
00165     int res = 0;
00166 
00167     static Vector data(6);
00168 
00169     res += theChannel.recvVector(this->getDbTag(), commitTag, data);
00170     if (res < 0)
00171       {
00172         opserr << "PressureDependentElastic3D::recvSelf -- could not recv Vector\n";
00173         return res;
00174       }
00175 
00176     this->setTag((int)data(0));
00177     E = data(1);
00178     v = data(2);
00179     exp0 = data(3);
00180     p_ref = data(4);
00181     p_cutoff = data(5);
00182 
00183     return res;
00184   }
00185 
00186 void PressureDependentElastic3D::Print(OPS_Stream &s, int flag)
00187 {
00188     s << "PressureDependentElastic3D" << "\n";
00189     s << "tag: " << this->getTag() << "\n";
00190     s << "E: " << E << "\n";
00191     s << "v: " << v << "\n";
00192     s << "exp: " << exp0 << "\n";
00193     s << "p_ref: " << p_ref << "\n";
00194     s << "p_cutoff: " << p_cutoff << "\n";
00195 }
00196 
00197 
00198 //================================================================================
00199 const Tensor& PressureDependentElastic3D::ComputeElasticStiffness(void)
00200 {
00201     tensor I21("I", 2, def_dim_2);
00202     tensor I22("I", 2, def_dim_2);
00203     tensor I_ijkl = I21("ij")*I22("kl");
00204       I_ijkl.null_indices();
00205     tensor I_ikjl = I_ijkl.transpose0110();
00206     tensor I_iljk = I_ijkl.transpose0111();
00207     tensor I4s = (I_ikjl+I_iljk)*0.5;
00208    
00209         double p = CStress.p_hydrostatic();
00210     if (p <= p_cutoff)
00211                 p = p_cutoff;
00212     double Eo = E * pow(p/p_ref, exp0);
00213 
00214     Dt = I_ijkl*( Eo*v / ( (1.0+v)*(1.0 - 2.0*v) ) ) + I4s*( Eo / (1.0 + v) );
00215     
00216         return Dt;
00217 }
00218 
00219 //================================================================================
00220 int PressureDependentElastic3D::setStressTensor(const Tensor& stressIn)
00221 {
00222         CStress = stressIn;
00223 
00224         return 0;
00225 }
00226 

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