VM_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 VM_PF_CPP
00035 #define VM_PF_CPP
00036 
00037 #include "VM_PF.h"
00038 
00039 straintensor VM_PF::VMm;
00040 stresstensor VM_PF::VMb;
00041 
00042 //================================================================================
00043 VM_PF::VM_PF(int alpha_which_in, int index_alpha_in)
00044 : alpha_which(alpha_which_in), index_alpha(index_alpha_in)
00045 {
00046 
00047 }
00048 
00049 //================================================================================
00050 VM_PF::~VM_PF() 
00051 {  
00052 
00053 }
00054 
00055 //================================================================================
00056 PlasticFlow* VM_PF::newObj() 
00057 {  
00058      PlasticFlow  *new_PF = new VM_PF(alpha_which, index_alpha);
00059      
00060      return new_PF;
00061 }
00062 
00063 //================================================================================
00064 const straintensor& VM_PF::PlasticFlowTensor(const stresstensor &Stre, 
00065                                              const straintensor &Stra, 
00066                                              const MaterialParameter &MaterialParameter_in) const
00067 {
00068         if (alpha_which == -1) {
00069                 VMm = Stre.deviator() *3.0;
00070                 return VMm;
00071         }
00072         if (alpha_which == 2) {
00073                 stresstensor s_back = getalpha(MaterialParameter_in);
00074                 stresstensor s_bar = Stre.deviator() - s_back;
00075                 VMm = s_bar *3.0;
00076                 return VMm;
00077         }
00078         else {
00079                 opserr << "Warning!! VM_PF: Invalid Input Parameter. " << endln;
00080                 exit (1);
00081         }
00082 }
00083 
00084 //================================================================================ 
00085 const stresstensor& VM_PF::getalpha(const MaterialParameter &MaterialParameter_in) const
00086 {
00087         //to get alpha (backstress)
00088         if ( alpha_which == 2 && index_alpha <= MaterialParameter_in.getNum_Internal_Tensor() && index_alpha > 0) {
00089                 VMb = MaterialParameter_in.getInternal_Tensor(index_alpha-1);
00090                 return VMb;
00091         }
00092         
00093         opserr << "Warning!! VM_PF: Invalid Input. " << endln;
00094         exit (1);
00095 }
00096 
00097 #endif
00098 

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