![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsFEMElement.cpp 00003 ******************************************************************************/ 00007 /****************************************************************************** 00008 SUKITTI PUNAK (12/15/2009) 00009 UPDATE (03/19/2010) 00010 ******************************************************************************/ 00011 #include "TAPsFEMElement.hpp" 00012 // Using Inclusion Model (i.e. definitions are included in declarations) 00013 // (this name.cpp is included in name.hpp) 00014 // Each friend is defined directly inside its declaration. 00015 00016 BEGIN_NAMESPACE_TAPs__FEM 00017 //============================================================================= 00018 // Constructors 00019 //----------------------------------------------------------------------------- 00020 template <typename T> 00021 Element<T>::Element ( 00022 std::vector< Vector3<T> > * deformedNodes, 00023 std::vector< Vector3<T> > * undeformedNodes, 00024 T _YoungModulus, 00025 T _PoissonRatio 00026 ) : 00027 pU( deformedNodes ), 00028 pX( undeformedNodes ), 00029 YoungModulus(_YoungModulus), 00030 PoissonRatio(_PoissonRatio), 00031 Volume(0), 00032 Ee(0), Ef(0), Eg(0) 00033 { 00034 } 00035 //----------------------------------------------------------------------------- 00036 //template <typename T> 00037 //Element<T>::Element ( Element<T> const &orig ) 00038 //{} 00039 //----------------------------------------------------------------------------- 00040 template <typename T> 00041 Element<T>::~Element () 00042 {} 00043 //----------------------------------------------------------------------------- 00044 //template <typename T> 00045 //std::string Element<T>::StrInfo () const 00046 //{} 00047 //----------------------------------------------------------------------------- 00048 //============================================================================= 00049 // Assignment Operator 00050 //----------------------------------------------------------------------------- 00051 //template <typename T> 00052 //Element<T> & Element<T>::operator= ( Element<T> const &orig ) 00053 //{} 00054 //----------------------------------------------------------------------------- 00055 00056 00057 //----------------------------------------------------------------------------- 00058 // Set Young's modulus 00059 template <typename T> 00060 void Element<T>::SetYoungModulus ( T t ) 00061 { 00062 YoungModulus = t; 00063 UpdateElasticMatrixElements(); 00064 } 00065 00066 //----------------------------------------------------------------------------- 00067 // Set Poisson's Ratio 00068 template <typename T> 00069 void Element<T>::SetPoissonRatio ( T t ) 00070 { 00071 PoissonRatio = t; 00072 UpdateElasticMatrixElements(); 00073 } 00074 00075 //----------------------------------------------------------------------------- 00077 template <typename T> 00078 void Element<T>::UpdateElasticMatrixElements () 00079 { 00080 // | e f f 0 0 0 | 00081 // | f e f 0 0 0 | 00082 // E = | f f e 0 0 0 | 00083 // | 0 0 0 g 0 0 | 00084 // | 0 0 0 0 g 0 | 00085 // | 0 0 0 0 0 g | 00086 00087 T VE = Volume*YoungModulus; 00088 T scale = VE / ((1+PoissonRatio)*(1-2*PoissonRatio)); 00089 Ee = (1-PoissonRatio) * scale; 00090 Ef = PoissonRatio * scale; 00091 Eg = (0.5-PoissonRatio) * scale; 00092 00093 // DEBUG 00094 //std::cout << "Volume, Young Modulus, Poisson Ratio: " << Volume << ", " << YoungModulus << ", " << PoissonRatio << "\n"; 00095 //std::cout << "Ee, Ef, Eg: " << Ee << ", " << Ef << ", " << Eg << "\n"; 00096 } 00097 00098 //============================================================================= 00099 END_NAMESPACE_TAPs__FEM 00100 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00101 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----