00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef Q2_HEXAHEDRON_FINITE_ELEMENT_HPP
00021 #define Q2_HEXAHEDRON_FINITE_ELEMENT_HPP
00022
00023 #include <TinyVector.hpp>
00024 #include <TinyMatrix.hpp>
00025
00026 #include <QuadratureFormula.hpp>
00027 #include <ConformTransformation.hpp>
00028
00029 #include <LagrangianFiniteElement.hpp>
00030 #include <ThreadStaticBase.hpp>
00031
00032 class Q2HexahedronFiniteElement
00033 : public ThreadStaticBase<Q2HexahedronFiniteElement>,
00034 public LagrangianFiniteElement<27, Q2HexahedronFiniteElement,
00035 QuadratureFormulaQ2Hexahedron>
00036 {
00037 private:
00038 static TinyVector<3, real_t> __massCenter;
00040 inline real_t __w1(const real_t& x) const
00041 {
00042 return (x-1)*(2*x-1);
00043 }
00044
00045 inline real_t __w2(const real_t& x) const
00046 {
00047 return 4*x*(1-x);
00048 }
00049
00050 inline real_t __w3(const real_t& x) const
00051 {
00052 return x*(2*x-1);
00053 }
00054
00055 inline real_t __dw1(const real_t& x) const
00056 {
00057 return 4*x-3;
00058 }
00059
00060 inline real_t __dw2(const real_t& x) const
00061 {
00062 return 4-8*x;
00063 }
00064
00065 inline real_t __dw3(const real_t& x) const
00066 {
00067 return 4*x-1;
00068 }
00069
00070 public:
00071 enum {
00072 numberOfDegreesOfFreedom = 27,
00073 numberOfVertexDegreesOfFreedom = 1,
00074 numberOfEdgeDegreesOfFreedom = 1,
00075 numberOfFaceDegreesOfFreedom = 1,
00076 numberOfVolumeDegreesOfFreedom = 1,
00077 numberOfFaceLivingDegreesOfFreedom = 9
00078 };
00079
00083 static const size_t facesDOF[Hexahedron::NumberOfFaces][numberOfFaceLivingDegreesOfFreedom];
00084
00090 static const TinyVector<3, real_t>& massCenter()
00091 {
00092 return __massCenter;
00093 }
00094
00103 real_t W (const size_t& i, const TinyVector<3, real_t>& x) const;
00104
00113 real_t dxW(const size_t& i, const TinyVector<3, real_t>& x) const;
00114
00123 real_t dyW(const size_t& i, const TinyVector<3, real_t>& x) const;
00124
00133 real_t dzW(const size_t& i, const TinyVector<3, real_t>& x) const;
00134
00135 inline const
00136 TinyVector<QuadratureType::numberOfQuadraturePoints,
00137 TinyVector<3, real_t> >&
00138 integrationVertices() const
00139 {
00140 return QuadratureType::instance().vertices();
00141 }
00142
00143 Q2HexahedronFiniteElement()
00144 {
00145 ;
00146 }
00147
00148 ~Q2HexahedronFiniteElement()
00149 {
00150 ;
00151 }
00152 };
00153
00154 #endif // Q2_HEXAHEDRON_FINITE_ELEMENT_HPP
00155