LifeV
|
DOFLocalPattern - A class to store the "couplings" between the basis functions. More...
#include <DOFLocalPattern.hpp>
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< UInt > | M_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 UInt & | patternFirst (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 UInt & | patternSecond (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 UInt & | nbPattern () const |
Number of non-zero terms in the element matrix. More... | |
const UInt & | nbDiag () const |
Number of diagonal terms in the element matrix. More... | |
const UInt & | nbUpper () const |
Number of upper terms in the element matrix. More... | |
const UInt & | nbLocalDof () const |
Return the number of local degrees of freedom. More... | |
const UInt & | nbDofPerVertex () const |
Return the number of degrees of freedom located on the vertices (0D structures) More... | |
const UInt & | nbDofPerEdge () 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 UInt & | nbDofPerElement () const |
Return the number of degrees of freedom located on the element. (volume in 3D) More... | |
const UInt & | nbDofPerFace () const |
Return the number of degrees of freedom located on the faces (2D structures). More... | |
const UInt & | nbDofPerVolume () const |
Return the number of degrees of freedom located in the volume (3D structures). More... | |
const UInt & | nbDofPerDimStrut (const UInt &structDim) const |
Return the number of degrees of freedom located per structDim object. More... | |
const UInt & | nbDofPerCodimStrut (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... | |
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.
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 such that if the basis functions and have a common support, otherwise it is . This matrix is symmetric.
For the P1-iso-P2 element, this matrix would be:
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.
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.
DOFLocalPattern | ( | const DOFLocalPattern & | localDofPattern | ) |
Simple copy constructor.
Definition at line 78 of file DOFLocalPattern.cpp.
|
inlinevirtual |
Empty destructor.
Definition at line 122 of file DOFLocalPattern.hpp.
|
private |
Default constructor disabled (because there is no setup/set method)
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(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.
void showMe | ( | std::ostream & | output = std::cout | ) | const |
The showMe method for the pattern.
Definition at line 93 of file DOFLocalPattern.cpp.
|
inline |
Number of non-zero terms in the element matrix.
Definition at line 155 of file DOFLocalPattern.hpp.
|
inline |
Number of diagonal terms in the element matrix.
Definition at line 161 of file DOFLocalPattern.hpp.
|
inline |
Number of upper terms in the element matrix.
Definition at line 167 of file DOFLocalPattern.hpp.
|
inline |
Return the number of local degrees of freedom.
Definition at line 173 of file DOFLocalPattern.hpp.
|
inline |
Return the number of degrees of freedom located on the vertices (0D structures)
Definition at line 179 of file DOFLocalPattern.hpp.
|
inline |
Return the number of degrees of freedom located on the edges (1D structures)
Definition at line 185 of file DOFLocalPattern.hpp.
|
inline |
Return the number of degrees of freedom located on the peak (vertex in 3D).
Definition at line 191 of file DOFLocalPattern.hpp.
|
inline |
Return the number of degrees of freedom located on the ridge. (edge in 3D)
Definition at line 197 of file DOFLocalPattern.hpp.
|
inline |
Return the number of degrees of freedom located on the facet. (face in 3D)
Definition at line 203 of file DOFLocalPattern.hpp.
|
inline |
Return the number of degrees of freedom located on the element. (volume in 3D)
Definition at line 209 of file DOFLocalPattern.hpp.
|
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.
|
inline |
Return the number of degrees of freedom located in the volume (3D structures).
Definition at line 224 of file DOFLocalPattern.hpp.
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.
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.
|
private |
Method to setup the standard pattern, i.e. with all degrees of freedom coupled.
Definition at line 109 of file DOFLocalPattern.cpp.
|
private |
Method for the P1isoP2 pattern for the segments (1D)
Definition at line 152 of file DOFLocalPattern.cpp.
|
private |
Method for the P1isoP2 pattern for the triangles (2D)
Definition at line 180 of file DOFLocalPattern.cpp.
|
private |
dimension of the element (3 for a tetrahedra for example).
Definition at line 276 of file DOFLocalPattern.hpp.
|
private |
Total number of degrees of freedom (equal to refEle::nbDof)
Definition at line 279 of file DOFLocalPattern.hpp.
|
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.
|
private |
Type of the pattern stored.
Definition at line 293 of file DOFLocalPattern.hpp.
Pairs of couplings to appear in the pattern.
Definition at line 296 of file DOFLocalPattern.hpp.
|
private |
Number of non-zero terms in the element matrix.
Definition at line 299 of file DOFLocalPattern.hpp.
|
private |
Number of diagonal terms in the element matrix.
Definition at line 302 of file DOFLocalPattern.hpp.
|
private |
Number of upper terms in the element matrix.
Definition at line 305 of file DOFLocalPattern.hpp.