TAPs 0.7.7.3
TAPsFEMTetrahedron.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsFEMTetrahedron.hpp
00003 ******************************************************************************/
00009 /******************************************************************************
00010 SUKITTI PUNAK   (12/15/2009)
00011 UPDATE          (05/01/2010)
00012 ******************************************************************************/
00013 #ifndef TAPs_FEM_TETRAHEDRON_HPP
00014 #define TAPs_FEM_TETRAHEDRON_HPP
00015 
00016 #include "TAPsFEMElement.hpp"
00017 
00018 //  Node Numbering Convention
00019 //
00020 //             3
00021 //           / |\
00022 //         /   | \
00023 //      /      |  \
00024 //   /        |    \
00025 //  2---------|-----1
00026 //   \        |    /
00027 //    \      |    /
00028 //     \     |   /
00029 //      \    |  /
00030 //       \  |  /
00031 //        \ | /
00032 //         \|/
00033 //          0
00034 
00035 BEGIN_NAMESPACE_TAPs__FEM
00036 //=============================================================================
00037 // Forward declaration
00038 template <typename T> class MeshTetrahedra;
00039 
00040 template <typename T>
00041 class Tetrahedron : public Element<T> {
00042 //=============================================================================
00043     friend  class MeshTetrahedra<T>;
00044 public:
00045     // Member Functions -------------------------------------------------------
00047     friend std::ostream & operator<< ( std::ostream &output, Tetrahedron<T> const &obj )
00048     {
00049         output << obj.StrInfo();
00050         return output;
00051     }
00052     //-------------------------------------------------------------------------
00054     Tetrahedron ( 
00055         std::vector< Vector3<T> > * deformedNodes,      
00056         std::vector< Vector3<T> > * undeformedNodes,    
00057         T YoungModulus,     
00058         T PoissionRatio,    
00059         unsigned int globalNode0,   
00060         unsigned int globalNode1,   
00061         unsigned int globalNode2,   
00062         unsigned int globalNode3    
00063     );
00065     //Tetrahedron ( Tetrahedron<T> const &orig );
00067     virtual ~Tetrahedron ();
00068     //-------------------------------------------------------------------------
00070     virtual std::string StrInfo () const;
00071     //-------------------------------------------------------------------------
00073     //Tetrahedron<T> & operator= ( Tetrahedron<T> const &orig );
00074 
00075     //-------------------------------------------------------------------------
00076     // Get/Set Functions
00077 
00079     inline Matrix3x3<T> const & GetStiffnessMatrix ( unsigned int n, unsigned int m ) const;
00080 
00081     //-------------------------------------------------------------------------
00082     // Operations
00083 
00085     virtual inline Vector3<T> * const DeformedNode ( unsigned int i );
00086 
00088     virtual inline Vector3<T> * const UndeformedNode ( unsigned int i );
00089 
00091     inline Vector3<T> ComputeDeformedPositionBasedOnCoordinates ( T coord0, T coord1, T coord2, T coord3 );
00092 
00094     inline Vector3<T> ComputeUndeformedPositionBasedOnCoordinates ( T coord0, T coord1, T coord2, T coord3 );
00095 
00096     //---------------------------------------------------------------
00097     // Inherited from FEMElement class
00098     //---------------------------------------------------------------
00100     inline void SetNode ( unsigned int i, unsigned int globalNodeNumber );
00101 
00103     //inline virtual void ResetToDeformedState ();
00104 
00106     inline virtual void ResetToUndeformedState ();
00107 
00109     inline virtual T    CalDeformedVolume () const;
00110 
00112     inline virtual T    CalUndeformedVolume ();
00113 
00115     virtual void UpdateStrainDisplacementMatrixElements ();
00116 
00118     virtual void UpdateStiffnessMatrixElements ();
00119 
00121     inline unsigned int GetGlobalNodeNumberFromLocalNode ( unsigned int i ) const
00122     {
00123         assert( 0 <= i && i <= 3 );
00124         return ids[i];
00125     }
00126     //---------------------------------------------------------------
00127     // Calculations
00128 
00129     //-------------------------------------------------------------------------
00130     // Data Members -----------------------------------------------------------
00131 //=============================================================================
00132 protected:
00133     // Member Functions -------------------------------------------------------
00134 
00135     // Data Members -----------------------------------------------------------
00136 
00137     unsigned int    ids[4]; 
00138 
00139     // Element's properties
00140     T   b[4];   
00141     T   c[4];   
00142     T   d[4];   
00143 
00144     // Stiffness matrix
00145     // The tetrahedron stiffness matrix is a 12x12 matrix which can be broken into 4x4 of 3x3 matrices
00146     Matrix3x3<T>    Ke[4][4];   
00147 
00148 //=============================================================================
00149 private:
00150     // Member Functions -------------------------------------------------------
00151     // Data Members -----------------------------------------------------------
00152 //=============================================================================
00153 
00154 #if defined(__gl_h_) || defined(__GL_H__)
00155 public:
00157     virtual void Draw ();
00158 
00160     virtual void DrawUndeformedMesh ();
00161 
00163     virtual void DrawDeformedMesh ();
00164 #endif
00165 
00166 //=============================================================================
00167 }; // END CLASS Tetrahedron
00168 //=============================================================================
00169 END_NAMESPACE_TAPs__FEM
00170 //-----------------------------------------------------------------------------
00172 #include "TAPsFEMTetrahedron.cpp"
00173 
00175 // Include definition if TAPs_USE_EXPORT is not defined
00176 //#if !defined( TAPs_USE_EXPORT )
00177 //  #include "TAPsFEMTetrahedron.cpp"
00178 //#endif
00179 //-----------------------------------------------------------------------------
00180 #endif
00181 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00182 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines