CC_PF.cpp

Go to the documentation of this file.
00001 
00002 //   COPYLEFT (C): Woody's viral GPL-like 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 //
00012 // COPYRIGHT (C):     :-))
00013 // PROJECT:           Object Oriented Finite Element Program
00014 // FILE:              
00015 // CLASS:             
00016 // MEMBER FUNCTIONS:
00017 //
00018 // MEMBER VARIABLES
00019 //
00020 // PURPOSE:           
00021 //
00022 // RETURN:
00023 // VERSION:
00024 // LANGUAGE:          C++
00025 // TARGET OS:         
00026 // DESIGNER:          Zhao Cheng, Boris Jeremic
00027 // PROGRAMMER:        Zhao Cheng, 
00028 // DATE:              Fall 2005
00029 // UPDATE HISTORY:    
00030 //
00032 //
00033 
00034 #ifndef CC_PF_CPP
00035 #define CC_PF_CPP
00036 
00037 #include "CC_PF.h"
00038 #include <OPS_Globals.h>
00039 
00040 straintensor CC_PF::CCm;
00041 
00042 //================================================================================
00043 CC_PF::CC_PF(int M_which_in, int index_M_in, 
00044              int p0_which_in, int index_p0_in)
00045 : M_which(M_which_in), index_M(index_M_in),
00046   p0_which(p0_which_in), index_p0(index_p0_in)
00047 {
00048 
00049 }
00050 
00051 //================================================================================
00052 CC_PF::~CC_PF() 
00053 {  
00054 
00055 }
00056 
00057 //================================================================================
00058 PlasticFlow* CC_PF::newObj() 
00059 {  
00060      PlasticFlow  *new_PF = new CC_PF(M_which, index_M, p0_which, index_p0);
00061      
00062      return new_PF;
00063 }
00064 
00065 //================================================================================
00066 const straintensor& CC_PF::PlasticFlowTensor(const stresstensor &Stre, 
00067                                              const straintensor &Stra, 
00068                                              const MaterialParameter &MaterialParameter_in) const
00069 {
00070         // Q = q*q - M*M*p*(po - p) = 0
00071     
00072     double M = getM(MaterialParameter_in);
00073         double p0 = getP0(MaterialParameter_in);
00074         double p = Stre.p_hydrostatic();
00075         double q = Stre.q_deviatoric();
00076         double dFoverdp = -1.0*M*M*( p0 - 2.0*p );
00077         double dFoverdq = 2.0*q;
00078         BJtensor DpoDs = Stre.dpoverds();
00079         if (q != 0.0) {
00080                 BJtensor DqoDs = Stre.dqoverds();
00081                 CCm = DpoDs  *dFoverdp + DqoDs  *dFoverdq;
00082         }
00083         else
00084                 CCm = DpoDs  *dFoverdp;
00085         
00086         return CCm;
00087 }
00088 
00089 //================================================================================   
00090 double CC_PF::getM(const MaterialParameter &MaterialParameter_in) const
00091 {
00092         // to get M
00093         if ( M_which == 0 && index_M <= MaterialParameter_in.getNum_Material_Parameter() && index_M > 0)
00094                 return MaterialParameter_in.getMaterial_Parameter(index_M-1);
00095         else {
00096                 opserr << "Warning!! CC_PF: Invalid Input (M). " << endln;
00097                 exit (1);
00098         }
00099 }
00100 
00101 //================================================================================ 
00102 double CC_PF::getP0(const MaterialParameter &MaterialParameter_in) const
00103 {
00104         //to get P0
00105         if ( p0_which == 1 && index_p0 <= MaterialParameter_in.getNum_Internal_Scalar() && index_p0 > 0)
00106                 return MaterialParameter_in.getInternal_Scalar(index_p0-1);
00107         else {
00108                 opserr << "Warning!! CC_PF: Invalid Input (po). " << endln;
00109                 exit (1);
00110         }
00111 }
00112 
00113 #endif
00114 

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