CC_Ev.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_Ev_CPP
00035 #define CC_Ev_CPP
00036 
00037 #include "CC_Ev.h"
00038 
00039 CC_Ev::CC_Ev(int lambda_index_in, 
00040              int kappa_index_in,
00041              int e0_index_in,
00042              int p0_index_in)
00043 : lambda_index(lambda_index_in), 
00044   kappa_index(kappa_index_in),
00045   e0_index(e0_index_in),
00046   p0_index(p0_index_in)
00047 {
00048 
00049 }
00050 
00051 ScalarEvolution* CC_Ev::newObj()
00052 {
00053     ScalarEvolution* nObj = new CC_Ev(this->lambda_index,
00054                                       this->kappa_index,
00055                                       this->e0_index,
00056                                       this->p0_index);
00057     return nObj;
00058 }
00059 
00060 double CC_Ev::H(const straintensor& plastic_flow, const stresstensor& Stre, 
00061                 const straintensor& Stra, const MaterialParameter& material_parameter)
00062 {
00063     double d_Ev = - plastic_flow.Iinvariant1(); // note "minus"
00064     double p0 = getp0(material_parameter);
00065     double lambda = getlambda(material_parameter);
00066     double kappa = getkappa(material_parameter);
00067     double e0 = gete0(material_parameter);
00068     
00069     double e = e0 + (1.0 + e0) *Stra.Iinvariant1();
00070 
00071     return (1.0 + e) * p0 * d_Ev / (lambda - kappa);
00072 }
00073 
00074 // Get lambda
00075 double CC_Ev::getlambda(const MaterialParameter& material_parameter) const
00076 {
00077     if ( lambda_index <= material_parameter.getNum_Material_Parameter() && lambda_index > 0)
00078         return material_parameter.getMaterial_Parameter(lambda_index-1);
00079     else {
00080         opserr << "CC_Ev: Invalid Input of " << lambda_index << endln;
00081         exit (1);
00082     }
00083 }
00084 
00085 // Get kappa
00086 double CC_Ev::getkappa(const MaterialParameter& material_parameter) const
00087 {
00088     if ( kappa_index <= material_parameter.getNum_Material_Parameter() && kappa_index > 0)
00089         return material_parameter.getMaterial_Parameter(kappa_index-1);
00090     else {
00091         opserr << "CC_Ev: Invalid Input of " << kappa_index << endln;
00092         exit (1);
00093     }
00094 }
00095 
00096 // Get e0
00097 double CC_Ev::gete0(const MaterialParameter& material_parameter) const
00098 {
00099     if ( e0_index <= material_parameter.getNum_Material_Parameter() && e0_index > 0)
00100         return material_parameter.getMaterial_Parameter(e0_index-1);
00101     else {
00102         opserr << "CC_Ev: Invalid Input of " << e0_index << endln;
00103         exit (1);
00104     }
00105 }
00106 
00107 // Get p0
00108 double CC_Ev::getp0(const MaterialParameter& material_parameter) const
00109 {
00110     if ( p0_index <= material_parameter.getNum_Internal_Scalar() && p0_index > 0)
00111         return material_parameter.getInternal_Scalar(p0_index-1);
00112     else {
00113         opserr << "CC_Ev: Invalid Input of " << p0_index << endln;
00114         exit (1);
00115     }
00116 }
00117 
00118 #endif
00119 

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