DM04_z_Eij.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 // Ref: Dafalias and Manzari 2004: J. Eng. Mech. 130(6), pp 622-634
00035 // Parameters:
00036 //  1- m:         parameter in the yield function;
00037 //  2- c_z:       parameter
00038 //  3- z_max      parameter
00039 //  4- alpha:     "back-stress" tensor in yield function; (the 1st tensorial internal variable);
00040 //  5- z:         fabric dilation internal tensor (the 2nd tensorial internal variable); 
00041 
00042 #ifndef DM04_z_Eij_CPP
00043 #define DM04_z_Eij_CPP
00044 
00045 #include "DM04_z_Eij.h"
00046 
00047 stresstensor DM04_z_Eij::DM04_z_t;
00048 
00049 DM04_z_Eij::DM04_z_Eij(int m_index_in,
00050                        int c_z_index_in,
00051                        int z_max_index_in,
00052                        int alpha_index_in,
00053                        int z_index_in)
00054 : m_index(m_index_in), 
00055   c_z_index(c_z_index_in), 
00056   z_max_index(z_max_index_in),
00057   alpha_index(alpha_index_in), 
00058   z_index(z_index_in)
00059 {
00060 
00061 }
00062 
00063 TensorEvolution* DM04_z_Eij::newObj()
00064 {
00065     TensorEvolution* nObj = new DM04_z_Eij(this->m_index,
00066                                            this->c_z_index,
00067                                            this->z_max_index,
00068                                            this->alpha_index,
00069                                            this->z_index);
00070 
00071     return nObj;
00072 }
00073 
00074 const straintensor& DM04_z_Eij::Hij(const straintensor& plastic_flow, const stresstensor& Stre, 
00075                                     const straintensor& Stra, const MaterialParameter& material_parameter)
00076 {
00077     double m = getm(material_parameter);
00078     double c_z = getc_z(material_parameter);
00079     double z_max = getz_max(material_parameter);        
00080     stresstensor alpha = getalpha(material_parameter);
00081     stresstensor z = getz(material_parameter);
00082     
00083     double p = Stre.p_hydrostatic();
00084     stresstensor s = Stre.deviator();
00085 
00086     stresstensor n;
00087     
00088     stresstensor s_bar = Stre.deviator() - (alpha *p);
00089     double _s_bar_ = sqrt( (s_bar("ij")*s_bar("ij")).trace() );
00090     if (p > 0.0 && _s_bar_ > 0.0)
00091         n = s_bar * (1.0/_s_bar_);
00092     
00093     // here d_Ev has different sign assumption from the ref.
00094     // hence no "negative" sign for d_Ev in the following line
00095     double d_Ev = plastic_flow.Iinvariant1();
00096     if (d_Ev < 0.0) 
00097       d_Ev = 0.0;  
00098    
00099     TensorEvolution::TensorEvolutionHij = ((n *z_max) +z) *(-c_z*d_Ev); 
00100     
00101     return TensorEvolution::TensorEvolutionHij;
00102 }
00103 
00104 // to get m
00105 //================================================================================
00106 double DM04_z_Eij::getm(const MaterialParameter& material_parameter) const
00107 {
00108     if ( m_index <= material_parameter.getNum_Material_Parameter() && m_index > 0)
00109         return material_parameter.getMaterial_Parameter(m_index-1);
00110     else {
00111         opserr << "DM04_alpha: Invalid Input. " << endln;
00112         exit (1);
00113     }
00114 }
00115 
00116 // to get c_z
00117 //================================================================================
00118 double DM04_z_Eij::getc_z(const MaterialParameter& material_parameter) const
00119 {
00120     if ( c_z_index <= material_parameter.getNum_Material_Parameter() && c_z_index > 0)
00121         return material_parameter.getMaterial_Parameter(c_z_index-1);
00122     else {
00123         opserr << "DM04_alpha: Invalid Input. " << endln;
00124         exit (1);
00125     }
00126 }
00127 
00128 // to get c
00129 //================================================================================
00130 double DM04_z_Eij::getz_max(const MaterialParameter& material_parameter) const
00131 {
00132     if ( z_max_index <= material_parameter.getNum_Material_Parameter() && z_max_index > 0)
00133         return material_parameter.getMaterial_Parameter(z_max_index-1);
00134     else {
00135         opserr << "DM04_alpha: Invalid Input. " << endln;
00136         exit (1);
00137     }
00138 }
00139 
00140 // to get alpha
00141 //================================================================================
00142 const stresstensor& DM04_z_Eij::getalpha(const MaterialParameter& material_parameter) const
00143 {
00144     if ( alpha_index <= material_parameter.getNum_Internal_Tensor() && alpha_index > 0) {
00145         DM04_z_Eij::DM04_z_t = material_parameter.getInternal_Tensor(alpha_index-1);
00146         return DM04_z_Eij::DM04_z_t;
00147     }
00148     else {
00149         opserr << "DM04_z: Invalid Input. " << endln;
00150         exit (1);
00151     }
00152 }
00153 
00154 // to get z
00155 //================================================================================
00156 const stresstensor& DM04_z_Eij::getz(const MaterialParameter& material_parameter) const
00157 {
00158     if ( z_index <= material_parameter.getNum_Internal_Tensor() && z_index > 0) {
00159         DM04_z_Eij::DM04_z_t = material_parameter.getInternal_Tensor(z_index-1);
00160         return DM04_z_Eij::DM04_z_t;
00161     }
00162     else {
00163         opserr << "DM04_z: Invalid Input. " << endln;
00164         exit (1);
00165     }
00166 }
00167 
00168 #endif
00169 

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