#include <P1Triangle3DFiniteElement.hpp>


Public Types | |
| enum | { numberOfDegreesOfFreedom = 3, numberOfVertexDegreesOfFreedom = 1, numberOfEdgeDegreesOfFreedom = 0, numberOfFaceDegreesOfFreedom = 0, numberOfVolumeDegreesOfFreedom = 0 } |
| enum | |
| typedef QuadratureFormulaP1Triangle3D | QuadratureType |
| typedef TinyVector < numberOfDegreesOfFreedom > | ElementaryVector |
| typedef TinyMatrix < numberOfDegreesOfFreedom, numberOfDegreesOfFreedom > | ElementaryMatrix |
Public Member Functions | |
| real_t | W (const size_t &i, const TinyVector< 3 > &X) const |
| real_t | dxW (const size_t &i, const TinyVector< 3 > &X) const |
| real_t | dyW (const size_t &i, const TinyVector< 3 > &X) const |
| real_t | dzW (const size_t &i, const TinyVector< 3 > &X) const |
| const TinyVector < QuadratureType::numberOfQuadraturePoints, TinyVector< 3 > > & | integrationVertices () const |
| P1Triangle3DFiniteElement () | |
| ~P1Triangle3DFiniteElement () | |
| const real_t & | W (const size_t &i, const size_t &j) const |
| const real_t & | dxW (const size_t &i, const size_t &j) const |
| const real_t & | dyW (const size_t &i, const size_t &j) const |
| const real_t & | dzW (const size_t &i, const size_t &j) const |
| void | integrateWjWi (ElementaryMatrix &matElem, const ConformTransformation &T) const |
| void | integrateDWjWi (ElementaryMatrix &matElem, const size_t &n, const ConformTransformation &T) const |
| void | integrateWjDWi (ElementaryMatrix &matElem, const size_t &n, const ConformTransformation &T) const |
| void | integrateDWjDWi (ElementaryMatrix &matElem, const size_t &n, const size_t &m, const ConformTransformation &T) const |
| void | integrateWj (ElementaryVector &vectElem, const ConformTransformation &T, const TinyVector< numberOfQuadraturePoints, real_t > &f) const |
Static Public Member Functions | |
| static const TinyVector < 3, real_t > & | massCenter () |
| static P1Triangle3DFiniteElement & | instance () |
| static void | create () |
| static void | destroy () |
Protected Member Functions | |
| real_t | __W (const size_t &i, const size_t &j) |
| real_t | __dxW (const size_t &i, const size_t &j) |
| real_t | __dyW (const size_t &i, const size_t &j) |
| real_t | __dzW (const size_t &i, const size_t &j) |
Protected Attributes | |
| TinyMatrix < numberOfDegreesOfFreedom, numberOfQuadraturePoints > | __w |
| TinyMatrix < numberOfDegreesOfFreedom, numberOfQuadraturePoints > | __dxw |
| TinyMatrix < numberOfDegreesOfFreedom, numberOfQuadraturePoints > | __dyw |
| TinyMatrix < numberOfDegreesOfFreedom, numberOfQuadraturePoints > | __dzw |
Static Protected Attributes | |
| static P1Triangle3DFiniteElement * | __pInstance |
Static Private Attributes | |
| static TinyVector< 3, real_t > | __massCenter |
Definition at line 32 of file P1Triangle3DFiniteElement.hpp.
typedef QuadratureFormulaP1Triangle3D LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::QuadratureType [inherited] |
default quadrature type
Definition at line 46 of file LagrangianFiniteElement.hpp.
typedef TinyVector<numberOfDegreesOfFreedom> LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::ElementaryVector [inherited] |
type of elementary vector
Definition at line 54 of file LagrangianFiniteElement.hpp.
typedef TinyMatrix<numberOfDegreesOfFreedom, numberOfDegreesOfFreedom> LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::ElementaryMatrix [inherited] |
type of elementary matrix
Definition at line 59 of file LagrangianFiniteElement.hpp.
| anonymous enum |
| numberOfDegreesOfFreedom | |
| numberOfVertexDegreesOfFreedom | |
| numberOfEdgeDegreesOfFreedom | |
| numberOfFaceDegreesOfFreedom | |
| numberOfVolumeDegreesOfFreedom |
Definition at line 41 of file P1Triangle3DFiniteElement.hpp.
00041 { 00042 numberOfDegreesOfFreedom = 3, 00043 numberOfVertexDegreesOfFreedom = 1, 00044 numberOfEdgeDegreesOfFreedom = 0, 00045 numberOfFaceDegreesOfFreedom = 0, 00046 numberOfVolumeDegreesOfFreedom = 0 00047 };
anonymous enum [inherited] |
Definition at line 48 of file LagrangianFiniteElement.hpp.
00048 { 00049 numberOfQuadraturePoints = QuadratureType::numberOfQuadraturePoints 00050 };
| P1Triangle3DFiniteElement::P1Triangle3DFiniteElement | ( | ) | [inline] |
| P1Triangle3DFiniteElement::~P1Triangle3DFiniteElement | ( | ) | [inline] |
| static const TinyVector<3, real_t>& P1Triangle3DFiniteElement::massCenter | ( | ) | [inline, static] |
returns the mass center of the reference element
Definition at line 54 of file P1Triangle3DFiniteElement.hpp.
References __massCenter.
Referenced by MeshOfTriangles::buildLocalizationTools().
00055 { 00056 return __massCenter; 00057 }
| real_t P1Triangle3DFiniteElement::W | ( | const size_t & | i, | |
| const TinyVector< 3 > & | X | |||
| ) | const |
Definition at line 25 of file P1Triangle3DFiniteElement.cpp.
References ErrorHandler::unexpected.
00026 { 00027 const real_t& x = X[0]; 00028 const real_t& y = X[1]; 00029 00030 switch (i) { 00031 case 0: { 00032 return (1-x-y); 00033 } 00034 case 1: { 00035 return x; 00036 } 00037 case 2: { 00038 return y; 00039 } 00040 default: { 00041 throw ErrorHandler(__FILE__,__LINE__, 00042 "unexpected basis function number", 00043 ErrorHandler::unexpected); 00044 return 0.; 00045 } 00046 } 00047 }
| real_t P1Triangle3DFiniteElement::dxW | ( | const size_t & | i, | |
| const TinyVector< 3 > & | X | |||
| ) | const |
Definition at line 50 of file P1Triangle3DFiniteElement.cpp.
References ErrorHandler::unexpected.
00051 { 00052 switch (i) { 00053 case 0: { 00054 return -1; 00055 } 00056 case 1: { 00057 return 1; 00058 } 00059 case 2: { 00060 return 0; 00061 } 00062 default: { 00063 throw ErrorHandler(__FILE__,__LINE__, 00064 "unexpected basis function number", 00065 ErrorHandler::unexpected); 00066 return 0.; 00067 } 00068 } 00069 }
| real_t P1Triangle3DFiniteElement::dyW | ( | const size_t & | i, | |
| const TinyVector< 3 > & | X | |||
| ) | const |
Definition at line 72 of file P1Triangle3DFiniteElement.cpp.
References ErrorHandler::unexpected.
00073 { 00074 switch (i) { 00075 case 0: { 00076 return -1; 00077 } 00078 case 1: { 00079 return 0; 00080 } 00081 case 2: { 00082 return 1; 00083 } 00084 default: { 00085 throw ErrorHandler(__FILE__,__LINE__, 00086 "unexpected basis function number", 00087 ErrorHandler::unexpected); 00088 return 0.; 00089 } 00090 } 00091 }
| real_t P1Triangle3DFiniteElement::dzW | ( | const size_t & | i, | |
| const TinyVector< 3 > & | X | |||
| ) | const |
Definition at line 94 of file P1Triangle3DFiniteElement.cpp.
References ErrorHandler::unexpected.
00095 { 00096 switch (i) { 00097 case 0: { 00098 return 0; 00099 } 00100 case 1: { 00101 return 0; 00102 } 00103 case 2: { 00104 return 0; 00105 } 00106 default: { 00107 throw ErrorHandler(__FILE__,__LINE__, 00108 "unexpected basis function number", 00109 ErrorHandler::unexpected); 00110 return 0.; 00111 } 00112 } 00113 }
| const TinyVector<QuadratureType::numberOfQuadraturePoints, TinyVector<3> >& P1Triangle3DFiniteElement::integrationVertices | ( | ) | const [inline] |
Definition at line 68 of file P1Triangle3DFiniteElement.hpp.
References StaticBase< QuadratureFormulaP1Triangle3D >::instance(), and QuadratureFormulaP1Triangle3D::vertices().
00069 { 00070 return QuadratureType::instance().vertices(); 00071 }

| static P1Triangle3DFiniteElement & StaticBase< P1Triangle3DFiniteElement >::instance | ( | ) | [inline, static, inherited] |
Access to auto instanciated static;
Definition at line 46 of file StaticBase.hpp.
00047 { 00048 return *__pInstance; 00049 }
| static void StaticBase< P1Triangle3DFiniteElement >::create | ( | ) | [inline, static, inherited] |
Creates __pInstance in Embedding class.
Definition at line 55 of file StaticBase.hpp.
Referenced by ThreadStaticCenter::ThreadStaticCenter().
00056 { 00057 __pInstance = new EmbeddingClass(); 00058 }
| static void StaticBase< P1Triangle3DFiniteElement >::destroy | ( | ) | [inline, static, inherited] |
Destroyes __autoInstanciated in Embedding class.
Definition at line 64 of file StaticBase.hpp.
Referenced by ThreadStaticCenter::~ThreadStaticCenter().
00065 { 00066 delete __pInstance; 00067 }
| real_t LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::__W | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | [inline, protected, inherited] |
Computes hat function value at quadrature point
| i | the hat function number | |
| j | the number of quadrature point |
Definition at line 81 of file LagrangianFiniteElement.hpp.
00082 { 00083 return self().W(i,self().integrationVertices()[j]); 00084 }
| real_t LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::__dxW | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | [inline, protected, inherited] |
Computes hat function derivative by x at quadrature point
| i | the hat function number | |
| j | the number of quadrature point |
Definition at line 94 of file LagrangianFiniteElement.hpp.
00095 { 00096 return self().dxW(i,self().integrationVertices()[j]); 00097 }
| real_t LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::__dyW | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | [inline, protected, inherited] |
Computes hat function derivative by y at quadrature point
| i | the hat function number | |
| j | the number of quadrature point |
Definition at line 107 of file LagrangianFiniteElement.hpp.
00108 { 00109 return self().dyW(i,self().integrationVertices()[j]); 00110 }
| real_t LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::__dzW | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | [inline, protected, inherited] |
Computes hat function derivative by z at quadrature point
| i | the hat function number | |
| j | the number of quadrature point |
Definition at line 120 of file LagrangianFiniteElement.hpp.
00121 { 00122 return self().dzW(i,self().integrationVertices()[j]); 00123 }
| const real_t& LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::W | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | const [inline, inherited] |
Read-only access to hat function value at a quadrature point
| i | the hat function number | |
| j | the number of quadrature point |
Definition at line 147 of file LagrangianFiniteElement.hpp.
00148 { 00149 return __w(i,j); 00150 }
| const real_t& LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::dxW | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | const [inline, inherited] |
Read-only access to hat function's derivative by x value at a quadrature point
| i | the hat function number | |
| j | the number of quadrature point |
Definition at line 161 of file LagrangianFiniteElement.hpp.
00162 { 00163 return __dxw(i,j); 00164 }
| const real_t& LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::dyW | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | const [inline, inherited] |
Read-only access to hat function's derivative by y value at a quadrature point
| i | the hat function number | |
| j | the number of quadrature point |
Definition at line 175 of file LagrangianFiniteElement.hpp.
00176 { 00177 return __dyw(i,j); 00178 }
| const real_t& LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::dzW | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | const [inline, inherited] |
Read-only access to hat function's derivative by z value at a quadrature point
| i | the hat function number | |
| j | the number of quadrature point |
Definition at line 189 of file LagrangianFiniteElement.hpp.
00190 { 00191 return __dzw(i,j); 00192 }
| void LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::integrateWjWi | ( | ElementaryMatrix & | matElem, | |
| const ConformTransformation & | T | |||
| ) | const [inline, inherited] |
Computes elementary matrix associated to
on a given element using the associated conform transformation
| matElem | the elementary matrix | |
| T | the given transformation |
Definition at line 203 of file LagrangianFiniteElement.hpp.
00205 { 00206 ElementaryMatrix tmp = 0; 00207 00208 for (size_t k=0; k<numberOfQuadraturePoints; ++k) { // Loop on integration vertices 00209 for (size_t j=0; j<numberOfDegreesOfFreedom; ++j) { 00210 for (size_t i=0; i<=j; ++i) { 00211 tmp(i,j) 00212 += W(i,k) * W(j,k) * QuadratureType::instance().weight(k); 00213 } 00214 } 00215 } 00216 00217 // for this operator, matElem is symetric. 00218 for (size_t j=0; j<numberOfDegreesOfFreedom; ++j) 00219 for (size_t i=j+1; i<numberOfDegreesOfFreedom; ++i) 00220 tmp(i,j) = tmp(j,i); 00221 00222 matElem += tmp; 00223 }
| void LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::integrateDWjWi | ( | ElementaryMatrix & | matElem, | |
| const size_t & | n, | |||
| const ConformTransformation & | T | |||
| ) | const [inline, inherited] |
Computes elementary matrix associated to
on a given element using the associated conform transformation
| matElem | the elementary matrix | |
| n | the in | |
| T | the given transformation |
Definition at line 235 of file LagrangianFiniteElement.hpp.
00238 { 00239 ElementaryMatrix tmp = 0; 00240 00241 for (size_t k=0; k<numberOfQuadraturePoints; ++k) { // Loop on integration vertices 00242 for (size_t j=0; j<numberOfDegreesOfFreedom; ++j) { 00243 const real_t fj 00244 = dxW(j,k)*T.invJacobian(0,n) 00245 + dyW(j,k)*T.invJacobian(1,n) 00246 + dzW(j,k)*T.invJacobian(2,n); 00247 for (size_t i=0; i<numberOfDegreesOfFreedom; ++i) { 00248 tmp(i,j) 00249 += fj * W(i,k) * QuadratureType::instance().weight(k); 00250 } 00251 } 00252 } 00253 matElem += tmp; 00254 }
| void LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::integrateWjDWi | ( | ElementaryMatrix & | matElem, | |
| const size_t & | n, | |||
| const ConformTransformation & | T | |||
| ) | const [inline, inherited] |
Computes elementary matrix associated to
on a given element using the associated conform transformation
| matElem | the elementary matrix | |
| n | the in | |
| T | the given transformation |
Definition at line 266 of file LagrangianFiniteElement.hpp.
00269 { 00270 ElementaryMatrix tmp = 0; 00271 00272 for (size_t k=0; k<numberOfQuadraturePoints; ++k) { // Loop on integration vertices 00273 for (size_t i=0; i<numberOfDegreesOfFreedom; ++i) { 00274 const real_t fi 00275 = dxW(i,k)*T.invJacobian(0,n) 00276 + dyW(i,k)*T.invJacobian(1,n) 00277 + dzW(i,k)*T.invJacobian(2,n); 00278 for (size_t j=0; j<numberOfDegreesOfFreedom; ++j) { 00279 tmp(i,j) 00280 += fi * W(j,k) * QuadratureType::instance().weight(k); 00281 } 00282 } 00283 } 00284 matElem += tmp; 00285 }
| void LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::integrateDWjDWi | ( | ElementaryMatrix & | matElem, | |
| const size_t & | n, | |||
| const size_t & | m, | |||
| const ConformTransformation & | T | |||
| ) | const [inline, inherited] |
Computes elementary matrix associated to
on a given element using the associated conform transformation
| matElem | the elementary matrix | |
| n | the in | |
| m | the in | |
| T | the given transformation |
Definition at line 298 of file LagrangianFiniteElement.hpp.
00302 { 00303 ElementaryMatrix tmp = 0; 00304 00305 for (size_t k=0; k<numberOfQuadraturePoints; ++k) { // Loop on integration vertices 00306 for (size_t j=0; j<numberOfDegreesOfFreedom; ++j) { 00307 const real_t fj 00308 = dxW(j,k)*T.invJacobian(0,n) 00309 + dyW(j,k)*T.invJacobian(1,n) 00310 + dzW(j,k)*T.invJacobian(2,n); 00311 for (size_t i=0; i<numberOfDegreesOfFreedom; ++i) { 00312 tmp(i,j) 00313 += fj 00314 * ( dxW(i,k)*T.invJacobian(0,m) 00315 + dyW(i,k)*T.invJacobian(1,m) 00316 + dzW(i,k)*T.invJacobian(2,m) ) 00317 * QuadratureType::instance().weight(k); 00318 } 00319 } 00320 } 00321 00322 matElem += tmp; 00323 }
| void LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::integrateWj | ( | ElementaryVector & | vectElem, | |
| const ConformTransformation & | T, | |||
| const TinyVector< numberOfQuadraturePoints, real_t > & | f | |||
| ) | const [inline, inherited] |
Computes elementary vector associated to
on a given element using the associated conform transformation
| vectElem | the elementary vector | |
| T | the given transformation | |
| f | values at quadrature points |
Definition at line 334 of file LagrangianFiniteElement.hpp.
00337 { 00338 vectElem = 0; 00339 00340 for (size_t k=0; k<numberOfQuadraturePoints; ++k) 00341 for (size_t j=0; j<numberOfDegreesOfFreedom; ++j) { 00342 vectElem[j] 00343 += W(j,k) 00344 * f[k] 00345 * QuadratureType::instance().weight(k); 00346 } 00347 }
TinyVector< 3, real_t > P1Triangle3DFiniteElement::__massCenter [static, private] |
mass center of the reference element
Definition at line 38 of file P1Triangle3DFiniteElement.hpp.
Referenced by massCenter().
P1Triangle3DFiniteElement * StaticBase< P1Triangle3DFiniteElement >::__pInstance [static, protected, inherited] |
The static variable
Definition at line 37 of file StaticBase.hpp.
TinyMatrix<numberOfDegreesOfFreedom,numberOfQuadraturePoints> LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::__w [protected, inherited] |
hat function values at quadrature points
Definition at line 127 of file LagrangianFiniteElement.hpp.
TinyMatrix<numberOfDegreesOfFreedom,numberOfQuadraturePoints> LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::__dxw [protected, inherited] |
hat function dx values at quadrature points
Definition at line 130 of file LagrangianFiniteElement.hpp.
TinyMatrix<numberOfDegreesOfFreedom,numberOfQuadraturePoints> LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::__dyw [protected, inherited] |
hat function dy values at quadrature points
Definition at line 133 of file LagrangianFiniteElement.hpp.
TinyMatrix<numberOfDegreesOfFreedom,numberOfQuadraturePoints> LagrangianFiniteElement< numberOfDegreesOfFreedom, P1Triangle3DFiniteElement , QuadratureFormulaP1Triangle3D >::__dzw [protected, inherited] |
hat function dz values at quadrature points
Definition at line 136 of file LagrangianFiniteElement.hpp.
1.5.6