Q1Quadrangle3DFiniteElement Class Reference

#include <Q1Quadrangle3DFiniteElement.hpp>

Inheritance diagram for Q1Quadrangle3DFiniteElement:

Inheritance graph
[legend]
Collaboration diagram for Q1Quadrangle3DFiniteElement:

Collaboration graph
[legend]

List of all members.

Public Types

enum  {
  numberOfDegreesOfFreedom = 4, numberOfVertexDegreesOfFreedom = 1, numberOfEdgeDegreesOfFreedom = 0, numberOfFaceDegreesOfFreedom = 0,
  numberOfVolumeDegreesOfFreedom = 0
}
enum  
typedef
QuadratureFormulaQ1Quadrangle3D 
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
 Q1Quadrangle3DFiniteElement ()
 ~Q1Quadrangle3DFiniteElement ()
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
Q1Quadrangle3DFiniteElement
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
Q1Quadrangle3DFiniteElement
__pInstance

Static Private Attributes

static TinyVector< 3, real_t > __massCenter


Detailed Description

Definition at line 32 of file Q1Quadrangle3DFiniteElement.hpp.


Member Typedef Documentation

default quadrature type

Definition at line 46 of file LagrangianFiniteElement.hpp.

typedef TinyVector<numberOfDegreesOfFreedom> LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::ElementaryVector [inherited]

type of elementary vector

Definition at line 54 of file LagrangianFiniteElement.hpp.

typedef TinyMatrix<numberOfDegreesOfFreedom, numberOfDegreesOfFreedom> LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::ElementaryMatrix [inherited]

type of elementary matrix

Definition at line 59 of file LagrangianFiniteElement.hpp.


Member Enumeration Documentation

anonymous enum

Enumerator:
numberOfDegreesOfFreedom 
numberOfVertexDegreesOfFreedom 
numberOfEdgeDegreesOfFreedom 
numberOfFaceDegreesOfFreedom 
numberOfVolumeDegreesOfFreedom 

Definition at line 41 of file Q1Quadrangle3DFiniteElement.hpp.

anonymous enum [inherited]

Definition at line 48 of file LagrangianFiniteElement.hpp.

00048        {
00049     numberOfQuadraturePoints = QuadratureType::numberOfQuadraturePoints
00050   };


Constructor & Destructor Documentation

Q1Quadrangle3DFiniteElement::Q1Quadrangle3DFiniteElement (  )  [inline]

Definition at line 107 of file Q1Quadrangle3DFiniteElement.hpp.

00108   {
00109     ;
00110   }

Q1Quadrangle3DFiniteElement::~Q1Quadrangle3DFiniteElement (  )  [inline]

Definition at line 112 of file Q1Quadrangle3DFiniteElement.hpp.

00113   {
00114     ;
00115   }


Member Function Documentation

static const TinyVector<3, real_t>& Q1Quadrangle3DFiniteElement::massCenter (  )  [inline, static]

returns the mass center of the reference element

Returns:
__massCenter

Definition at line 54 of file Q1Quadrangle3DFiniteElement.hpp.

References __massCenter.

00055   {
00056     return __massCenter;
00057   }

real_t Q1Quadrangle3DFiniteElement::W ( const size_t &  i,
const TinyVector< 3 > &  x 
) const

Computes a hat function at a given point

Parameters:
i the hat function number
x the evaluation point
Returns:
$ w_i(\mathbf{x}) $

Definition at line 25 of file Q1Quadrangle3DFiniteElement.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)*(1-y);
00033   }
00034   case 1: {
00035     return x*(1-y);
00036   }
00037   case 2: {
00038     return x*y;
00039   }
00040   case 3: {
00041     return (1-x)*y;
00042   }
00043   default: {
00044     throw ErrorHandler(__FILE__,__LINE__,
00045                        "unexpected basis function number",
00046                        ErrorHandler::unexpected);
00047     return 0.;
00048   }
00049   }
00050 }

real_t Q1Quadrangle3DFiniteElement::dxW ( const size_t &  i,
const TinyVector< 3 > &  x 
) const

Computes a hat function derivative at a given point

Parameters:
i the hat function number
x the evaluation point
Returns:
$ \partial_x w_i(\mathbf{x}) $

Definition at line 53 of file Q1Quadrangle3DFiniteElement.cpp.

References ErrorHandler::unexpected.

00054 {
00055   const real_t& y = X[1];
00056 
00057   switch (i) {
00058   case 0: {
00059     return -(1-y);
00060   }
00061   case 1: {
00062     return (1-y);
00063   }
00064   case 2: {
00065     return y;
00066   }
00067   case 3: {
00068     return -y;
00069   }
00070   default: {
00071     throw ErrorHandler(__FILE__,__LINE__,
00072                        "unexpected basis function number",
00073                        ErrorHandler::unexpected);
00074     return 0.;
00075   }
00076   }
00077 }

real_t Q1Quadrangle3DFiniteElement::dyW ( const size_t &  i,
const TinyVector< 3 > &  x 
) const

Computes a hat function derivative at a given point

Parameters:
i the hat function number
x the evaluation point
Returns:
$ \partial_y w_i(\mathbf{x}) $

Definition at line 80 of file Q1Quadrangle3DFiniteElement.cpp.

References ErrorHandler::unexpected.

00081 {
00082   const real_t& x = X[0];
00083 
00084   switch (i) {
00085   case 0: {
00086     return -(1-x);
00087   }
00088   case 1: {
00089     return -x;
00090   }
00091   case 2: {
00092     return x;
00093   }
00094   case 3: {
00095     return (1-x);
00096   }
00097   default: {
00098     throw ErrorHandler(__FILE__,__LINE__,
00099                        "unexpected basis function number",
00100                        ErrorHandler::unexpected);
00101     return 0.;
00102   }
00103   }
00104 }

real_t Q1Quadrangle3DFiniteElement::dzW ( const size_t &  i,
const TinyVector< 3 > &  x 
) const

Computes a hat function derivative at a given point

Parameters:
i the hat function number
x the evaluation point
Returns:
$ \partial_z w_i(\mathbf{x}) $

Definition at line 107 of file Q1Quadrangle3DFiniteElement.cpp.

References ErrorHandler::unexpected.

00108 {
00109   switch (i) {
00110   case 0:
00111   case 1:
00112   case 2:
00113   case 3: {
00114     return 0;
00115   }
00116   default: {
00117     throw ErrorHandler(__FILE__,__LINE__,
00118                        "unexpected basis function number",
00119                        ErrorHandler::unexpected);
00120     return 0.;
00121   }
00122   }
00123 }

const TinyVector<QuadratureType::numberOfQuadraturePoints, TinyVector<3> >& Q1Quadrangle3DFiniteElement::integrationVertices (  )  const [inline]

Definition at line 102 of file Q1Quadrangle3DFiniteElement.hpp.

References StaticBase< QuadratureFormulaQ1Quadrangle3D >::instance(), and QuadratureFormulaQ1Quadrangle3D::vertices().

00103   {
00104     return QuadratureType::instance().vertices();
00105   }

Here is the call graph for this function:

static Q1Quadrangle3DFiniteElement & StaticBase< Q1Quadrangle3DFiniteElement >::instance (  )  [inline, static, inherited]

Access to auto instanciated static;

Returns:
*__pInstance

Definition at line 46 of file StaticBase.hpp.

00047   {
00048     return *__pInstance;
00049   }

static void StaticBase< Q1Quadrangle3DFiniteElement >::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< Q1Quadrangle3DFiniteElement >::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, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::__W ( const size_t &  i,
const size_t &  j 
) [inline, protected, inherited]

Computes hat function value at quadrature point

Parameters:
i the hat function number
j the number of quadrature point
Returns:
the function value

Definition at line 81 of file LagrangianFiniteElement.hpp.

00082   {
00083     return self().W(i,self().integrationVertices()[j]);
00084   }

real_t LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::__dxW ( const size_t &  i,
const size_t &  j 
) [inline, protected, inherited]

Computes hat function derivative by x at quadrature point

Parameters:
i the hat function number
j the number of quadrature point
Returns:
the function's derivative value

Definition at line 94 of file LagrangianFiniteElement.hpp.

00095   {
00096     return self().dxW(i,self().integrationVertices()[j]);
00097   }

real_t LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::__dyW ( const size_t &  i,
const size_t &  j 
) [inline, protected, inherited]

Computes hat function derivative by y at quadrature point

Parameters:
i the hat function number
j the number of quadrature point
Returns:
the function's derivative value

Definition at line 107 of file LagrangianFiniteElement.hpp.

00108   {
00109     return self().dyW(i,self().integrationVertices()[j]);
00110   }

real_t LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::__dzW ( const size_t &  i,
const size_t &  j 
) [inline, protected, inherited]

Computes hat function derivative by z at quadrature point

Parameters:
i the hat function number
j the number of quadrature point
Returns:
the function's derivative value

Definition at line 120 of file LagrangianFiniteElement.hpp.

00121   {
00122     return self().dzW(i,self().integrationVertices()[j]);
00123   }

const real_t& LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::W ( const size_t &  i,
const size_t &  j 
) const [inline, inherited]

Read-only access to hat function value at a quadrature point

Parameters:
i the hat function number
j the number of quadrature point
Returns:
the function's value

Definition at line 147 of file LagrangianFiniteElement.hpp.

00148   {
00149     return __w(i,j);
00150   }

const real_t& LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::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

Parameters:
i the hat function number
j the number of quadrature point
Returns:
the function's value

Definition at line 161 of file LagrangianFiniteElement.hpp.

00162   {
00163     return __dxw(i,j);
00164   }

const real_t& LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::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

Parameters:
i the hat function number
j the number of quadrature point
Returns:
the function's value

Definition at line 175 of file LagrangianFiniteElement.hpp.

00176   {
00177     return __dyw(i,j);
00178   }

const real_t& LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::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

Parameters:
i the hat function number
j the number of quadrature point
Returns:
the function's value

Definition at line 189 of file LagrangianFiniteElement.hpp.

00190   {
00191     return __dzw(i,j);
00192   }

void LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::integrateWjWi ( ElementaryMatrix matElem,
const ConformTransformation &  T 
) const [inline, inherited]

Computes elementary matrix associated to $ \int w_j w_i $ on a given element using the associated conform transformation

Parameters:
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, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::integrateDWjWi ( ElementaryMatrix matElem,
const size_t &  n,
const ConformTransformation &  T 
) const [inline, inherited]

Computes elementary matrix associated to $ \int \partial_{x_n} w_j w_i $ on a given element using the associated conform transformation

Parameters:
matElem the elementary matrix
n the $ n $ in $ \partial_{x_n} $
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, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::integrateWjDWi ( ElementaryMatrix matElem,
const size_t &  n,
const ConformTransformation &  T 
) const [inline, inherited]

Computes elementary matrix associated to $ \int w_j \partial_{x_n} w_i $ on a given element using the associated conform transformation

Parameters:
matElem the elementary matrix
n the $ n $ in $ \partial_{x_n} $
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, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::integrateDWjDWi ( ElementaryMatrix matElem,
const size_t &  n,
const size_t &  m,
const ConformTransformation &  T 
) const [inline, inherited]

Computes elementary matrix associated to $ \int \partial_{x_n} w_j \partial_{x_m} w_i $ on a given element using the associated conform transformation

Parameters:
matElem the elementary matrix
n the $ n $ in $ \partial_{x_n} $
m the $ m $ in $ \partial_{x_m} $
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, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::integrateWj ( ElementaryVector vectElem,
const ConformTransformation &  T,
const TinyVector< numberOfQuadraturePoints, real_t > &  f 
) const [inline, inherited]

Computes elementary vector associated to $ \int f w_i $ on a given element using the associated conform transformation

Parameters:
vectElem the elementary vector
T the given transformation
f $ 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   }


Member Data Documentation

TinyVector< 3, real_t > Q1Quadrangle3DFiniteElement::__massCenter [static, private]

mass center of the reference element

Definition at line 38 of file Q1Quadrangle3DFiniteElement.hpp.

Referenced by massCenter().

The static variable

Definition at line 37 of file StaticBase.hpp.

TinyMatrix<numberOfDegreesOfFreedom,numberOfQuadraturePoints> LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::__w [protected, inherited]

hat function values at quadrature points

Definition at line 127 of file LagrangianFiniteElement.hpp.

TinyMatrix<numberOfDegreesOfFreedom,numberOfQuadraturePoints> LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::__dxw [protected, inherited]

hat function dx values at quadrature points

Definition at line 130 of file LagrangianFiniteElement.hpp.

TinyMatrix<numberOfDegreesOfFreedom,numberOfQuadraturePoints> LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::__dyw [protected, inherited]

hat function dy values at quadrature points

Definition at line 133 of file LagrangianFiniteElement.hpp.

TinyMatrix<numberOfDegreesOfFreedom,numberOfQuadraturePoints> LagrangianFiniteElement< numberOfDegreesOfFreedom, Q1Quadrangle3DFiniteElement , QuadratureFormulaQ1Quadrangle3D >::__dzw [protected, inherited]

hat function dz values at quadrature points

Definition at line 136 of file LagrangianFiniteElement.hpp.


The documentation for this class was generated from the following files:

Generated on Wed Nov 19 00:12:00 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6