CAM_PS.cpp

Go to the documentation of this file.
00001 //================================================================================
00002 //# COPYRIGHT (C):     :-))                                                      #
00003 //# PROJECT:           Object Oriented Finite Element Program                    #
00004 //# PURPOSE:           Cam Clay potential criterion                             #
00005 //#                      (Ref. Wood p113)                           #
00006 //# CLASS:             CAMPotentialSurface                                       #
00007 //#                                                                              #
00008 //# VERSION:                                                                     #
00009 //# LANGUAGE:          C++.ver >= 2.0 ( Borland C++ ver=3.00, SUN C++ ver=2.1 )  #
00010 //# TARGET OS:         DOS || UNIX || . . .                                      #
00011 //# PROGRAMMER(S):     Boris Jeremic, ZHaohui Yang                               #
00012 //#                                                                              #
00013 //#                                                                              #
00014 //# DATE:              Mar. 28, 2001                                             #
00015 //# UPDATE HISTORY:                                                              #
00016 //#                                                                              #
00017 //#                                                                              #
00018 //#                                                                              #
00019 //#                                                                              #
00020 //#                                                                              #
00021 //================================================================================
00022 
00023 
00024 #ifndef CAM_PS_CPP
00025 #define CAM_PS_CPP
00026 
00027 #include "CAM_PS.h"
00028 #include <basics.h>
00029 
00030 
00031 //================================================================================
00032 // Normal constructor
00033 //================================================================================
00034 
00035 CAMPotentialSurface::CAMPotentialSurface(double Mp )  
00036 {
00037    M = Mp;
00038 } 
00039 
00040 
00041 //================================================================================
00042 //create a colne of itself
00043 //================================================================================
00044 
00045 PotentialSurface * CAMPotentialSurface::newObj() {  
00046 
00047      PotentialSurface  *new_YS = new CAMPotentialSurface(M);
00048      return new_YS;
00049 
00050 }
00051 
00052 //================================================================================
00053 // Copy constrstructor
00054 //================================================================================
00055 //
00056 //CAMPotentialSurface::CAMPotentialSurface(CAMPotentialSurface &CAMYS ) { }
00057 //
00058 
00059 //================================================================================
00060 // tensor dQ/dsigma_ij  the normal to the potential surface
00061 //================================================================================
00062 
00063 tensor CAMPotentialSurface::dQods(const EPState *EPS) const {
00064   
00065   tensor dQoverds( 2, def_dim_2, 0.0);
00066   tensor I2("I", 2, def_dim_2);
00067 
00068   double p = EPS->getStress().p_hydrostatic();
00069   double q = EPS->getStress().q_deviatoric();
00070   double po = EPS->getScalarVar( 1 );
00071    tensor DpoDs = EPS->getStress().dpoverds();
00072    tensor DqoDs = EPS->getStress().dqoverds();
00073 
00074   double dQoverdp = -1.0*M*M*( po - 2.0*p );
00075   double dQoverdq = 2.0*q;
00076 
00077   dQoverds = DpoDs  * dQoverdp +
00078              DqoDs  * dQoverdq;
00079 
00080   return dQoverds;
00081 
00082 }
00083 
00084 //================================================================================
00085 // tensor d2Q/ds2  the normal to the potential surface
00086 //================================================================================
00087 
00088 tensor CAMPotentialSurface::d2Qods2(const EPState *EPS) const 
00089 {  
00090   tensor d2Qoverds2(4, def_dim_4, 0.0);
00091   return d2Qoverds2;
00092 }
00093 
00094 
00095 // For Consistent Algorithm, Z Cheng, Jan 2004
00096 tensor CAMPotentialSurface::d2Qodsds1(const EPState *EPS) const 
00097 {  
00098   tensor d2Qoverdsds1(2, def_dim_2, 0.0);
00099   tensor DpoDs = EPS->getStress().dpoverds();
00100   double D2QoDpDs1 = -M*M;
00101   d2Qoverdsds1 = DpoDs * D2QoDpDs1;
00102   return d2Qoverdsds1;
00103 }
00104        
00105 // moved to stresstensor Boris Jeremic@ucdavis.edu 21Aug2001
00106 // // I took these functions from mmodel.cpp, programmed by Dr. Jeremic
00107 // //#############################################################################
00108 // tensor CAMPotentialSurface::dpoverds( ) const
00109 //   {
00110 //     tensor ret(2, def_dim_2, 0.0);
00111 //     tensor I2("I", 2, def_dim_2);
00112 //     ret = I2*(-1.0/3.0);
00113 //     ret.null_indices();
00114 //     return ret;
00115 //   }
00116 // 
00117 // //#############################################################################
00118 // tensor CAMPotentialSurface::dqoverds(const EPState *EPS) const
00119 //   {
00120 //     
00121 //     stresstensor stress = EPS->getStress();
00122 //     
00123 //     tensor ret(2, def_dim_2, 0.0);
00124 //     double q = stress.q_deviatoric();
00125 //     stresstensor s( 0.0);
00126 // //...    double J2D = stress.Jinvariant2();
00127 // //...    double temp1 = sqrt(J2D);
00128 // //...    double temp2 = sqrt(3.0)/(2.0*temp1);
00129 //     double temp2 = (3.0/2.0)*(1/q);
00130 //     s = stress.deviator();
00131 //     ret = s*temp2;
00132 //     ret.null_indices();
00133 //     return ret;
00134 //   }
00135 // 
00136 // //#############################################################################
00137 // tensor CAMPotentialSurface::dthetaoverds(const EPState *EPS) const
00138 //   {
00139 //     stresstensor stress = EPS->getStress();
00140 // 
00141 //     tensor ret(2, def_dim_2, 0.0);
00142 //     stresstensor s( 0.0);
00143 //     stresstensor t( 0.0);
00144 //     tensor I2("I", 2, def_dim_2);
00145 // 
00146 // //    double EPS = pow(d_macheps(),(1./3.));
00147 //     double J2D = stress.Jinvariant2();
00148 //     double q     = stress.q_deviatoric();
00149 //     double theta = stress.theta();
00150 // 
00151 // //out    while ( theta >= 2.0*PI )
00152 // //out      theta = theta - 2.0*PI; // if bigger than full cycle
00153 // //out    while ( theta >= 4.0*PI/3.0 )
00154 // //out      theta = theta - 4.0*PI/3.0; // if bigger than four thirds of half cycle
00155 // //out    while ( theta >= 2.0*PI/3.0 )
00156 // //out      theta = theta - 2.0*PI/3.0; // if bigger than two third of half cycle
00157 // //out    while ( theta >= PI/3.0 )
00158 // //out      theta = 2.0*PI/3.0 - theta; // if bigger than one third of half cycle
00159 // //out
00160 // //out    if ( theta < 0.0001 )
00161 // //out      {
00162 // //out        ::printf("theta = %.10e in CAMPotentialSurface::dthetaoverds(stress)\n",
00163 // //out                           theta);
00164 // //out//>><<>><<>><<        return ret;
00165 // //out      }
00166 // 
00167 //     double c3t = cos(3.0*theta);
00168 //     double s3t = sin(3.0*theta);
00169 // 
00170 //     double tempS = (3.0/2.0)*(c3t/(q*q*s3t));
00171 //     double tempT = (9.0/2.0)*(1.0/(q*q*q*s3t));
00172 // 
00173 //     s = stress.deviator();
00174 //     t = s("qk")*s("kp") - I2*(J2D*(2.0/3.0));
00175 // 
00176 //     s.null_indices();
00177 //     t.null_indices();
00178 // 
00179 //     ret = s*tempS - t*tempT;
00180 //     ret.null_indices();
00181 //     return ret;
00182 //   }
00183 // 
00184 // //#############################################################################
00185 // //!..........................................................................
00186 // //!  tensor d2poverds2( 4, def_dim_4, 0.0); //second derivative of p over
00187 // //!                                         // d sigma_pq  d sigma_mn
00188 // //!  d2poverds2 = 0.0; //IDENTICALLY EQUAL TO ZERO
00189 // //!..........................................................................
00190 // //#############################################################################
00191 // tensor CAMPotentialSurface::d2poverds2( void ) const
00192 //   {
00193 //     tensor ret(4, def_dim_4, 0.0);
00194 //     return ret;
00195 //     //!!!!! this one is equivalent to zero at all times so no need to call it !!!
00196 //   }
00197 // 
00198 // 
00199 // //#############################################################################
00200 // tensor CAMPotentialSurface::d2qoverds2(const EPState *EPS) const
00201 //   {
00202 //     stresstensor stress = EPS->getStress();
00203 // 
00204 // 
00205 //     //first the return tensor in order not to fragment the memory
00206 //     tensor ret( 4, def_dim_4, 0.0); //  second derivative of q over
00207 //                                     //  d sigma_pq  d sigma_mn
00208 //     //setting up some constants
00209 // 
00210 //     tensor I2("I", 2, def_dim_2);      // To check out this three fourth-order
00211 //     tensor I_pqmn("I", 4, def_dim_4);  // isotropic tensor please see
00212 //     I_pqmn = I2("pq")*I2("mn");        // W.Michael Lai, David Rubin,
00213 //     I_pqmn.null_indices();
00214 //     tensor I_pmqn("I", 4, def_dim_4);  // Erhard Krempl
00215 //     I_pmqn = I_pqmn.transpose0110();   // " Introduction to Continuum Mechanics"
00216 //                                        // QA808.2  ;   ISBN 0-08-022699-X
00217 // 
00218 //     double q_dev   = stress.q_deviatoric();
00219 // 
00220 //     stresstensor s = stress.deviator();
00221 //     s.null_indices();
00222 // 
00223 //     tensor iso1( 4, def_dim_4, 0.0); //this will be d_pm*d_nq-d_pq*d_nm*(1/3)
00224 //     iso1 = I_pmqn  - I_pqmn*(1.0/3.0);
00225 // 
00226 //     double tempiso1  = (3.0/2.0)*(1/q_dev);
00227 //     double tempss    = (9.0/4.0)*(1.0/( q_dev * q_dev * q_dev ));
00228 // 
00229 //     ret = iso1*tempiso1 - (s("pq")*s("mn"))*tempss;
00230 //     ret.null_indices();
00231 //     return ret;
00232 //   }
00233 // 
00234 // 
00235 // //#############################################################################
00236 // tensor CAMPotentialSurface::d2thetaoverds2(const EPState *EPS) const
00237 //   {
00238 //     stresstensor stress = EPS->getStress();
00239 // 
00240 //     tensor ret( 4, def_dim_4, 0.0);
00241 // 
00242 //     tensor I2("I", 2, def_dim_2);
00243 //     tensor I_pqmn("I", 4, def_dim_4);  // To check out this three fourth-order
00244 //     I_pqmn = I2("pq")*I2("mn");        // isotropic tensor please see
00245 //     I_pqmn.null_indices();
00246 //     tensor I_pmqn("I", 4, def_dim_4);  // W.Michael Lai, David Rubin,
00247 //     I_pmqn = I_pqmn.transpose0110();   // Erhard Krempl
00248 // //no    tensor I_pnqm("I", 4, def_dim_4);  // " Introduction to Continuum Mechanics"
00249 // //no    I_pnqm = I_pqmn.transpose0111();   // QA808.2  ;   ISBN 0-08-022699-X
00250 // 
00251 //     double J2D = stress.Jinvariant2();
00252 // 
00253 // //    double EPS = pow(d_macheps(),(1./3.));
00254 // 
00255 //     tensor s( 2, def_dim_2, 0.0);
00256 //     tensor t( 2, def_dim_2, 0.0);
00257 //     s = stress.deviator();
00258 //     t = s("qk")*s("kp") - I2*(J2D*(2.0/3.0));
00259 // //s.print("s"," \n\n tensor s \n\n");
00260 // //t.print("t"," \n\n tensor t \n\n");
00261 //     s.null_indices();
00262 //     t.null_indices();
00263 // 
00264 //     tensor p( 4, def_dim_4, 0.0); //this will be d_mp*d_nq - d_pq*d_nm*(1/3)
00265 //     tensor w( 4, def_dim_4, 0.0);
00266 // 
00267 //     double theta = stress.theta();
00268 // //out    while ( theta >= 2.0*PI )
00269 // //out      theta = theta - 2.0*PI; // if bigger than full cycle
00270 // //out    while ( theta >= 4.0*PI/3.0 )
00271 // //out      theta = theta - 4.0*PI/3.0; // if bigger than four thirds of half cycle
00272 // //out    while ( theta >= 2.0*PI/3.0 )
00273 // //out      theta = theta - 2.0*PI/3.0; // if bigger than two third of half cycle
00274 // //out    while ( theta >= PI/3.0 )
00275 // //out      theta = 2.0*PI/3.0 - theta; // if bigger than one third of half cycle
00276 // //out
00277 // //out    if ( theta < 0.0001 )
00278 // //out      {
00279 // //out        ::printf("\n\ntheta = %.10e in CAMPotentialSurface::d2thetaoverds2(stress)\n",
00280 // //out                           theta);
00281 // //out//>><<>><<>><<        return ret;
00282 // //out      }
00283 // //out
00284 // 
00285 //     double q_dev = stress.q_deviatoric();
00286 // 
00287 //   //setting up some constants
00288 // //......    double sqrt3 = sqrt(3.0);
00289 //     double c3t    = cos(3*theta);
00290 //     double s3t    = sin(3*theta);
00291 //     double s3t3   = s3t*s3t*s3t;
00292 //     double q3     = q_dev * q_dev * q_dev;
00293 //     double q4     = q_dev * q_dev * q_dev * q_dev;
00294 //     double q5     = q_dev * q_dev * q_dev * q_dev * q_dev;
00295 //     double q6     = q_dev * q_dev * q_dev * q_dev * q_dev * q_dev;
00296 // 
00297 // 
00298 //     double tempss = - (9.0/2.0)*(c3t)/(q4*s3t) - (27.0/4.0)*(c3t/(s3t3*q4));
00299 // 
00300 //     double tempst = (81.0/4.0)*(1.0)/(s3t3*q5);
00301 // 
00302 //     double tempts = (81.0/4.0)*(1.0/(s3t*q5)) + (81.0/4.0)*(c3t*c3t)/(s3t3*q5);
00303 // 
00304 //     double temptt = - (243.0/4.0)*(c3t/(s3t3*q6));
00305 // 
00306 //     double tempp  = +(3.0/2.0)*(c3t/(s3t*q_dev*q_dev));
00307 // 
00308 //     double tempw  = -(9.0/2.0)*(1.0/(s3t*q3));
00309 // 
00310 // 
00311 // //))))))))
00312 // //))))))))    double tempss = 0.0;
00313 // //))))))))
00314 // //))))))))    double tempst = 0.0;
00315 // //))))))))
00316 // //))))))))    double tempts = 0.0;
00317 // //))))))))
00318 // //))))))))    double temptt = 0.0;
00319 // //))))))))
00320 // //))))))))    double tempp  = 0.0;
00321 // //))))))))
00322 // //))))))))    double tempw  = 0.0;
00323 // //))))))))
00324 // 
00325 // 
00326 // // fourth order tensors in the final equation for second derivative
00327 // // of theta over ( d \sigma_{pq} d \sigma_{mn} )
00328 // // BE CAREFULL order is   PQ MN
00329 // 
00330 //     tensor s_pq_d_mn( 4, def_dim_4, 0.0);
00331 //     tensor s_pn_d_mq( 4, def_dim_4, 0.0);
00332 // //...    tensor s_pm_d_nq( 4, def_dim_4, 0.0);
00333 // 
00334 //     tensor d_pq_s_mn( 4, def_dim_4, 0.0);
00335 //     tensor d_pn_s_mq( 4, def_dim_4, 0.0);
00336 // //...    tensor d_pm_s_nq( 4, def_dim_4, 0.0);
00337 // 
00338 //     p = I_pmqn  - I_pqmn*(1.0/3.0);
00339 // 
00340 // // privremena stampa
00341 // //..........................................................................
00342 // //.......p.print("p"," tensor p = I_pmqn  - I_pqmn*(1.0/3.0)");
00343 // 
00344 // 
00345 //     s_pq_d_mn = s("pq")*I2("mn");
00346 //     s_pq_d_mn.null_indices();
00347 //     s_pn_d_mq = s_pq_d_mn.transpose0101();
00348 // //...    s_pm_d_nq = s_pn_d_mq.transpose0110();
00349 // 
00350 //     d_pq_s_mn = I2("pq")*s("mn");
00351 //     d_pq_s_mn.null_indices();
00352 //     d_pn_s_mq = d_pq_s_mn.transpose0101();
00353 // //...    d_pm_s_nq = d_pn_s_mq.transpose0110();
00354 // 
00355 // //// privremena stampa
00356 // ////..........................................................................
00357 // //s_pq_d_mn.print("sd"," tensor s_pq_d_mn = s(\"pq\")*I2(\"mn\") ");
00358 // //s_pn_d_mq.print("sd"," tensor s_pn_d_mq = s_pq_d_mn.transpose0101()");
00359 // ////s_pm_d_nq.print("sd"," tensor s_pm_d_nq = s_pn_d_mq.transpose0110()");
00360 // //d_pq_s_mn.print("ds"," tensor d_pq_s_mn = I2(\"pq\")*s(\"mn\") ");
00361 // //d_pn_s_mq.print("ds"," tensor d_pn_s_mq = d_pq_s_mn.transpose0101()");
00362 // ////d_pm_s_nq.print("ds"," tensor d_pm_s_nq = d_pn_s_mq.transpose0110()");
00363 // ////..........................................................................
00364 // 
00365 //     w =  s_pn_d_mq + d_pn_s_mq - s_pq_d_mn*(2.0/3.0) - d_pq_s_mn*(2.0/3.0);
00366 // 
00367 // //.....// symmetric w
00368 // //.....    w = ( s_pn_d_mq + s_pm_d_nq ) * 0.5 +
00369 // //.....        ( d_pn_s_mq + d_pm_s_nq ) * 0.5
00370 // //.....        - s_pq_d_mn*(2.0/3.0) - d_pq_s_mn*(2.0/3.0);
00371 // //.....
00372 // 
00373 // //// privremena stampa
00374 // ////..........................................................................
00375 // //w.print("w","w=s_pn_d_mq+d_pn_s_mq-s_pq_d_mn*(2.0/3.0)-d_pq_s_mn*(2.0/3.0)");
00376 // ////..........................................................................
00377 // 
00378 // ////...// privremena stampa
00379 // ////...//..........................................................................
00380 // //tensor ss = s("pq")*s("mn");
00381 // //tensor st = s("pq")*t("mn");
00382 // //tensor ts = t("pq")*s("mn");
00383 // //tensor tt = t("pq")*t("mn");
00384 // //ss.print("ss","\n tensor ss ");
00385 // //st.print("st","\n tensor st ");
00386 // //ts.print("ts","\n tensor ts ");
00387 // //tt.print("tt","\n tensor tt ");
00388 // ////...
00389 // 
00390 // // finally
00391 //     ret = (   s("pq")*s("mn") * tempss
00392 //             + s("pq")*t("mn") * tempst
00393 //             + t("pq")*s("mn") * tempts
00394 //             + t("pq")*t("mn") * temptt
00395 //             + p               * tempp
00396 //             + w               * tempw );
00397 //           
00398 //     ret.null_indices();
00399 //     return ret;
00400 //   }
00401 
00402 //================================================================================
00403 double CAMPotentialSurface::getM() const
00404 {       
00405     return M;
00406 }
00407 
00408 
00409 OPS_Stream& operator<< (OPS_Stream& os, const CAMPotentialSurface & YS)
00410 {
00411    os << "Cam Clay Potential Surface Parameters: " << endln;
00412    os << "M = " << YS.M << endln;
00413    return os;
00414 }
00415 
00416 #endif
00417 

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