LifeV
DOFLocalPattern Class Reference

DOFLocalPattern - A class to store the "couplings" between the basis functions. More...

#include <DOFLocalPattern.hpp>

+ Inheritance diagram for DOFLocalPattern:
+ Collaboration diagram for DOFLocalPattern:

Private Attributes

UInt M_dim
 dimension of the element (3 for a tetrahedra for example). More...
 
UInt M_nbLocalDof
 Total number of degrees of freedom (equal to refEle::nbDof) More...
 
std::vector< UIntM_nbDofPerDimEntity
 Number of degrees of freedom per geometric entity. More...
 
DofPatternType M_patternType
 Type of the pattern stored. More...
 
std::vector< std::pair< UInt, UInt > > M_pattern
 Pairs of couplings to appear in the pattern. More...
 
UInt M_nbPattern
 Number of non-zero terms in the element matrix. More...
 
UInt M_nbDiag
 Number of diagonal terms in the element matrix. More...
 
UInt M_nbUpper
 Number of upper terms in the element matrix. More...
 

Constructor & Destructor

 DOFLocalPattern (const UInt &nbLocalDof, const UInt &nbDofPerVertex, const UInt &nbDofPerEdge, const UInt &nbDofPerFace, const UInt &nbDofPerVolume, const DofPatternType &patternType, UInt nbLocalCoor)
 Full constructor. More...
 
 DOFLocalPattern (const DOFLocalPattern &localDofPattern)
 Simple copy constructor. More...
 
virtual ~DOFLocalPattern ()
 Empty destructor. More...
 

Methods

const UIntpatternFirst (const UInt &i) const
 patternFirst(i): row index in the element matrix of the i-th term of the pattern (the index starts from 0, not from 1 !). More...
 
const UIntpatternSecond (const UInt &i) const
 patternSecond(i): column index in the element matrix of the i-th term of the pattern (the index starts from 0, not from 1 !). More...
 
void showMe (std::ostream &output=std::cout) const
 The showMe method for the pattern. More...
 

Get Methods

const UIntnbPattern () const
 Number of non-zero terms in the element matrix. More...
 
const UIntnbDiag () const
 Number of diagonal terms in the element matrix. More...
 
const UIntnbUpper () const
 Number of upper terms in the element matrix. More...
 
const UIntnbLocalDof () const
 Return the number of local degrees of freedom. More...
 
const UIntnbDofPerVertex () const
 Return the number of degrees of freedom located on the vertices (0D structures) More...
 
const UIntnbDofPerEdge () const
 Return the number of degrees of freedom located on the edges (1D structures) More...
 
UInt nbDofPerPeak () const
 Return the number of degrees of freedom located on the peak (vertex in 3D). More...
 
UInt nbDofPerRidge () const
 Return the number of degrees of freedom located on the ridge. (edge in 3D) More...
 
UInt nbDofPerFacet () const
 Return the number of degrees of freedom located on the facet. (face in 3D) More...
 
const UIntnbDofPerElement () const
 Return the number of degrees of freedom located on the element. (volume in 3D) More...
 
const UIntnbDofPerFace () const
 Return the number of degrees of freedom located on the faces (2D structures). More...
 
const UIntnbDofPerVolume () const
 Return the number of degrees of freedom located in the volume (3D structures). More...
 
const UIntnbDofPerDimStrut (const UInt &structDim) const
 Return the number of degrees of freedom located per structDim object. More...
 
const UIntnbDofPerCodimStrut (const UInt &structCodim) const
 Return the number of degrees of freedom located per structCodim object. More...
 

Private Methods

 DOFLocalPattern ()
 Default constructor disabled (because there is no setup/set method) More...
 
void setupStandardPattern ()
 Method to setup the standard pattern, i.e. with all degrees of freedom coupled. More...
 
void setupP1isoP2SegPattern ()
 Method for the P1isoP2 pattern for the segments (1D) More...
 
void setupP1isoP2TriaPattern ()
 Method for the P1isoP2 pattern for the triangles (2D) More...
 

Detailed Description

DOFLocalPattern - A class to store the "couplings" between the basis functions.

The aim of this class is to store the way the basis functions couple one with each other. This might seem useless, however, some "advanced" finite elements require this structure.

For example, consider the P1-iso-P2 element in 2D. This finite element is composed of 6 basis functions, based on the nodes with the same numbering as the P2 element. The reference triangle is split into 4 subtriangles using the nodes on the faces. Each basis function is build such that it is 1 on its node, 0 on all the other nodes and such that it is linear in each subtriangle.

See also
in "Numerical Approximation of Partial Differential Equations" by A. Quarteroni and A. Valli, p.311, for an illustration and further informations.

With this definition of the P1-iso-P2 finite element, we see that the basis functions 1 and 2 have no common support. So, they are not directly coupled.

In order to represent the couplings between the basis functions, we can use a matrix $ C $ such that $ C_{ij} = 1 $ if the basis functions $ i $ and $ j $ have a common support, otherwise it is $ 0 $. This matrix is symmetric.

For the P1-iso-P2 element, this matrix would be:

\[ \begin{array}{|c||cccccc|} \hline & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline \hline 1 & 1 & 0 & 0 & 1 & 0 & 1 \\ 2 & 0 & 1 & 0 & 1 & 1 & 0 \\ 3 & 0 & 0 & 1 & 0 & 1 & 1 \\ 4 & 1 & 1 & 0 & 1 & 1 & 1 \\ 5 & 0 & 1 & 1 & 1 & 1 & 1 \\ 6 & 1 & 0 & 1 & 1 & 1 & 1 \\ \hline \end{array} \]

When references to diagonal or upper part are made, it is with respect to this matrix. For most of the finite elements, this matrix is full (lagrangian FE, lagrangian FE with bubbles,...).

Instead of this representation with a matrix, we usually prefer to get the DoFs that are coupled in a list. This is the implemented in this class and the list of pairs (patternFirst(i),patternSecond(i)) represents all the DoFs that are coupled.

Note: The documentation of this class (and some improvements) has been done by Samuel Quinodoz (15.01.2010), but its original implementation was prior the documentation and no name of author or date was available.

Definition at line 106 of file DOFLocalPattern.hpp.

Constructor & Destructor Documentation

◆ DOFLocalPattern() [1/3]

DOFLocalPattern ( const UInt nbLocalDof,
const UInt nbDofPerVertex,
const UInt nbDofPerEdge,
const UInt nbDofPerFace,
const UInt nbDofPerVolume,
const DofPatternType patternType,
UInt  nbLocalCoor 
)

Full constructor.

Definition at line 45 of file DOFLocalPattern.cpp.

+ Here is the caller graph for this function:

◆ DOFLocalPattern() [2/3]

DOFLocalPattern ( const DOFLocalPattern localDofPattern)

Simple copy constructor.

Definition at line 78 of file DOFLocalPattern.cpp.

+ Here is the caller graph for this function:

◆ ~DOFLocalPattern()

virtual ~DOFLocalPattern ( )
inlinevirtual

Empty destructor.

Definition at line 122 of file DOFLocalPattern.hpp.

◆ DOFLocalPattern() [3/3]

DOFLocalPattern ( )
private

Default constructor disabled (because there is no setup/set method)

Member Function Documentation

◆ patternFirst()

const UInt& patternFirst ( const UInt i) const
inline

patternFirst(i): row index in the element matrix of the i-th term of the pattern (the index starts from 0, not from 1 !).

Definition at line 132 of file DOFLocalPattern.hpp.

◆ patternSecond()

const UInt& patternSecond ( const UInt i) const
inline

patternSecond(i): column index in the element matrix of the i-th term of the pattern (the index starts from 0, not from 1 !).

Definition at line 139 of file DOFLocalPattern.hpp.

◆ showMe()

void showMe ( std::ostream &  output = std::cout) const

The showMe method for the pattern.

Definition at line 93 of file DOFLocalPattern.cpp.

◆ nbPattern()

const UInt& nbPattern ( ) const
inline

Number of non-zero terms in the element matrix.

Definition at line 155 of file DOFLocalPattern.hpp.

◆ nbDiag()

const UInt& nbDiag ( ) const
inline

Number of diagonal terms in the element matrix.

Definition at line 161 of file DOFLocalPattern.hpp.

◆ nbUpper()

const UInt& nbUpper ( ) const
inline

Number of upper terms in the element matrix.

Definition at line 167 of file DOFLocalPattern.hpp.

◆ nbLocalDof()

const UInt& nbLocalDof ( ) const
inline

Return the number of local degrees of freedom.

Definition at line 173 of file DOFLocalPattern.hpp.

+ Here is the caller graph for this function:

◆ nbDofPerVertex()

const UInt& nbDofPerVertex ( ) const
inline

Return the number of degrees of freedom located on the vertices (0D structures)

Definition at line 179 of file DOFLocalPattern.hpp.

+ Here is the caller graph for this function:

◆ nbDofPerEdge()

const UInt& nbDofPerEdge ( ) const
inline

Return the number of degrees of freedom located on the edges (1D structures)

Definition at line 185 of file DOFLocalPattern.hpp.

+ Here is the caller graph for this function:

◆ nbDofPerPeak()

UInt nbDofPerPeak ( ) const
inline

Return the number of degrees of freedom located on the peak (vertex in 3D).

Definition at line 191 of file DOFLocalPattern.hpp.

+ Here is the caller graph for this function:

◆ nbDofPerRidge()

UInt nbDofPerRidge ( ) const
inline

Return the number of degrees of freedom located on the ridge. (edge in 3D)

Definition at line 197 of file DOFLocalPattern.hpp.

+ Here is the caller graph for this function:

◆ nbDofPerFacet()

UInt nbDofPerFacet ( ) const
inline

Return the number of degrees of freedom located on the facet. (face in 3D)

Definition at line 203 of file DOFLocalPattern.hpp.

+ Here is the caller graph for this function:

◆ nbDofPerElement()

const UInt& nbDofPerElement ( ) const
inline

Return the number of degrees of freedom located on the element. (volume in 3D)

Definition at line 209 of file DOFLocalPattern.hpp.

+ Here is the caller graph for this function:

◆ nbDofPerFace()

const UInt& nbDofPerFace ( ) const
inline

Return the number of degrees of freedom located on the faces (2D structures).

Beware that in the 2D case, the face of a triangle is the triangle itself (use edges or vertices if you want to access substructures).

Definition at line 218 of file DOFLocalPattern.hpp.

+ Here is the caller graph for this function:

◆ nbDofPerVolume()

const UInt& nbDofPerVolume ( ) const
inline

Return the number of degrees of freedom located in the volume (3D structures).

Definition at line 224 of file DOFLocalPattern.hpp.

◆ nbDofPerDimStrut()

const UInt& nbDofPerDimStrut ( const UInt structDim) const
inline

Return the number of degrees of freedom located per structDim object.

For example, if we want to access the vertices, structDim should be 0, if we want the edges, then it should be 1,...

Definition at line 233 of file DOFLocalPattern.hpp.

◆ nbDofPerCodimStrut()

const UInt& nbDofPerCodimStrut ( const UInt structCodim) const
inline

Return the number of degrees of freedom located per structCodim object.

The codimension of a structure is the full dimension of the element minus the dimension of the structure. For example, in 3D, faces have codimension 1, edges 2 and vertices 3. This method could be useful to code "dimension-free" code. (for example, IP is built on edges in 2D, faces in 3D, so on objects with codimension 1).

Definition at line 245 of file DOFLocalPattern.hpp.

◆ setupStandardPattern()

void setupStandardPattern ( )
private

Method to setup the standard pattern, i.e. with all degrees of freedom coupled.

Definition at line 109 of file DOFLocalPattern.cpp.

+ Here is the caller graph for this function:

◆ setupP1isoP2SegPattern()

void setupP1isoP2SegPattern ( )
private

Method for the P1isoP2 pattern for the segments (1D)

Definition at line 152 of file DOFLocalPattern.cpp.

◆ setupP1isoP2TriaPattern()

void setupP1isoP2TriaPattern ( )
private

Method for the P1isoP2 pattern for the triangles (2D)

Definition at line 180 of file DOFLocalPattern.cpp.

Field Documentation

◆ M_dim

UInt M_dim
private

dimension of the element (3 for a tetrahedra for example).

Definition at line 276 of file DOFLocalPattern.hpp.

◆ M_nbLocalDof

UInt M_nbLocalDof
private

Total number of degrees of freedom (equal to refEle::nbDof)

Definition at line 279 of file DOFLocalPattern.hpp.

◆ M_nbDofPerDimEntity

std::vector< UInt> M_nbDofPerDimEntity
private

Number of degrees of freedom per geometric entity.

In this vector, we store all the number of degrees of freedom sorted by the dimension of the object where they lie. For example, the number of DoF per vertex (dimension 0) is stored as the 0th element. Then, for edges (dimension 1), it is stored in the 1st element of the vector,... This enables a n-dimensional implementation (not only 3D)

Definition at line 289 of file DOFLocalPattern.hpp.

◆ M_patternType

DofPatternType M_patternType
private

Type of the pattern stored.

Definition at line 293 of file DOFLocalPattern.hpp.

◆ M_pattern

std::vector< std::pair< UInt, UInt > > M_pattern
private

Pairs of couplings to appear in the pattern.

Definition at line 296 of file DOFLocalPattern.hpp.

◆ M_nbPattern

UInt M_nbPattern
private

Number of non-zero terms in the element matrix.

Definition at line 299 of file DOFLocalPattern.hpp.

◆ M_nbDiag

UInt M_nbDiag
private

Number of diagonal terms in the element matrix.

Definition at line 302 of file DOFLocalPattern.hpp.

◆ M_nbUpper

UInt M_nbUpper
private

Number of upper terms in the element matrix.

Definition at line 305 of file DOFLocalPattern.hpp.


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