00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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
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
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
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