Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
model::LagrangeElement< _dim, degree, MappingType > Class Template Reference

Class template for a Lagrange finite element of degree p on a d-dimensional Simplex. More...

#include <LagrangeElement.h>

Inheritance diagram for model::LagrangeElement< _dim, degree, MappingType >:
Collaboration diagram for model::LagrangeElement< _dim, degree, MappingType >:

Public Types

typedef LagrangeNode< ElementType > NodeType
typedef Eigen::Matrix< double, 1, dim+1 > BaryType

Public Member Functions

 LagrangeElement (const Simplex< dim, dim > &s, std::deque< NodeType > &nodeContainer, std::map< Eigen::Matrix< double, dim, 1 >, NodeType *const, CompareVectorsByComponent< double, dim, float > > &nodeFinder, std::map< size_t, const NodeType *const > &mesh2femIDmap)
template<typename TrialFunctionType>
TypeTraits< TrialFunctionType >::ShapeFunctionGradMatrixType sfmGrad (const BaryType &bary) const
template<typename TrialFunctionType>
TypeTraits< TrialFunctionType >::ShapeFunctionDefMatrixType sfmDef (const BaryType &bary) const
const NodeType & node (const size_t &n) const
NodeType & node (const size_t &n)
Eigen::Matrix< double, dim, 1 > position (const BaryType &bary) const
Eigen::Matrix< double, _dim, _dim > Fs (const BaryType &bary) const
double absJ (const BaryType &bary) const
Eigen::Matrix< double, _dim, _dim > Gs (const BaryType &bary) const
Eigen::Matrix< double, dim, 1 > jGN (const BaryType &bary, const int &n) const
bool isBoundaryElement () const
std::vector< int > boundaryFaces () const

Static Public Member Functions

static constexpr int dofPerNode (int c)
static Eigen::Matrix< double, 1, nodesPerElement > sf (const BaryType &bary)
template<typename TrialFunctionType>
static TypeTraits< TrialFunctionType >::ShapeFunctionMatrixType sfm (const BaryType &bary)
static Eigen::Matrix< double, dim+1, nodesPerElement > diff (const BaryType &bary)
static Eigen::Matrix< double, dim, nodesPerElement > gradS (const BaryType &bary)

Public Attributes

const Simplex< dim, dim > & simplex
 A const reference to the Simplex that this element refers to.
Eigen::Matrix< double, _dim, nodesPerElement > Xe
 The matrix of nodal coordinates.

Static Public Attributes

static constexpr int dim =_dim
static constexpr int order =degree
static constexpr int nodesPerElement =CombinationWithRepetition<_dim+1,degree>::value
static const Eigen::Matrix< int,CombinationWithRepetition< _dim+1, degree >::value, _dim+1 > baryStarsAndBars
static const Eigen::Matrix< double, CombinationWithRepetition< _dim+1, degree >::value, _dim+1 > baryNodalCoordinates
static const std::vector< Eigen::Matrix< double, _dim+1, degree+1 > > sfCoeffsVector

Detailed Description

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
class model::LagrangeElement< _dim, degree, MappingType >

Class template for a Lagrange finite element of degree p on a d-dimensional Simplex.

The degrees of freedom for a LagrangeElement are the functinal values computed at the nodes (LagrangeNode). In a d-dimensional Simplex, each node is identified by a set of (d+1) positive integers \(I_k\) which satisfy the Diophantine equation:

\[ \sum_{k=0}^{d+1}I_k=p \]

These integeres are found using the StarsAndBars algorithm. The baricentric (area) coordinate of node \(\{I_k\}\) are obtained as \(A_k=I_k/p\).

The shape function of node \(\{I_k\}\) are:

\[ N_{\{I_k\}}(A_0,\dots A_{d})=\prod_{k=0}^{d+1}\frac{1}{I_k!}\prod_{i=0}^{I_k-1}\left(pA_k-i\right) \]

This can also be written as:

\[ N_{\{I_k\}}(A_0,\dots A_{d})=\prod_{i=0}^{d+1}\left([c_{i0},\dots,c_{ip}]\cdot[A_i^0,\dots,A_i^p]\right) \]

The matrix \(c_{ij}\) is stored in the field sfCoeffs;

Definition at line 58 of file LagrangeElement.h.

Member Typedef Documentation

◆ BaryType

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
typedef Eigen::Matrix<double,1,dim+1> model::LagrangeElement< _dim, degree, MappingType >::BaryType

Definition at line 71 of file LagrangeElement.h.

◆ NodeType

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
typedef LagrangeNode<ElementType> model::LagrangeElement< _dim, degree, MappingType >::NodeType

Definition at line 70 of file LagrangeElement.h.

Constructor & Destructor Documentation

◆ LagrangeElement()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
model::LagrangeElement< _dim, degree, MappingType >::LagrangeElement ( const Simplex< dim, dim > & s,
std::deque< NodeType > & nodeContainer,
std::map< Eigen::Matrix< double, dim, 1 >, NodeType *const, CompareVectorsByComponent< double, dim, float > > & nodeFinder,
std::map< size_t, const NodeType *const > & mesh2femIDmap )
inline
Parameters
[in]sA const reference to a Simplex<dim,dim>

Definition at line 209 of file LagrangeElement.h.

Member Function Documentation

◆ absJ()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
double model::LagrangeElement< _dim, degree, MappingType >::absJ ( const BaryType & bary) const
inline
Parameters
barythe vector of baricentric coordinates
Returns
the absolute value of the determinant of the Jacobian matrix dx_i / ds_j, evaulated at bary.

Definition at line 413 of file LagrangeElement.h.

◆ boundaryFaces()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
std::vector< int > model::LagrangeElement< _dim, degree, MappingType >::boundaryFaces ( ) const
inline
Returns
a vector of IDs of the faces of *this that are on the boundary

Definition at line 443 of file LagrangeElement.h.

◆ diff()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
Eigen::Matrix< double, dim+1, nodesPerElement > model::LagrangeElement< _dim, degree, MappingType >::diff ( const BaryType & bary)
inlinestatic
Parameters
[in]barythe barycentric coordinate
Returns
the value of the derivatives of this shape-function with respect to the baricentric coordinates, computed at bary. This is:

\[ dN_{\{I_k\}}/dA_j(A_0,\dots A_{d}) \]

Definition at line 315 of file LagrangeElement.h.

◆ dofPerNode()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
constexpr int model::LagrangeElement< _dim, degree, MappingType >::dofPerNode ( int c)
inlinestaticconstexpr

Definition at line 68 of file LagrangeElement.h.

◆ Fs()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
Eigen::Matrix< double, _dim, _dim > model::LagrangeElement< _dim, degree, MappingType >::Fs ( const BaryType & bary) const
inline
Parameters
barythe vector of baricentric coordinates
Returns
the Jacobian matrix dx_i / ds_j, evaulated at bary.

Definition at line 405 of file LagrangeElement.h.

◆ gradS()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
Eigen::Matrix< double, dim, nodesPerElement > model::LagrangeElement< _dim, degree, MappingType >::gradS ( const BaryType & bary)
inlinestatic
Parameters
[in]barythe barycentric coordinate
Returns
the gradient of this shape-function with respect to the standard coordinates, computed at bary. This is:

\[ dN_{\{I_k\}}/dS_j(A_0,\dots A_{d}) \]

Definition at line 340 of file LagrangeElement.h.

◆ Gs()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
Eigen::Matrix< double, _dim, _dim > model::LagrangeElement< _dim, degree, MappingType >::Gs ( const BaryType & bary) const
inline
Parameters
barythe vector of baricentric coordinates
Returns
the inverse Jacobian matrix ds_i / dx_j, evaulated at bary.

Definition at line 422 of file LagrangeElement.h.

◆ isBoundaryElement()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
bool model::LagrangeElement< _dim, degree, MappingType >::isBoundaryElement ( ) const
inline
Returns
true if *this is a boundary element

Definition at line 436 of file LagrangeElement.h.

◆ jGN()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
Eigen::Matrix< double, dim, 1 > model::LagrangeElement< _dim, degree, MappingType >::jGN ( const BaryType & bary,
const int & n ) const
inline

Definition at line 430 of file LagrangeElement.h.

◆ node() [1/2]

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
NodeType & model::LagrangeElement< _dim, degree, MappingType >::node ( const size_t & n)
inline
Parameters
[in]thelocal node ID in the element
Returns
a reference to the n-th LagrangeNode

Definition at line 388 of file LagrangeElement.h.

◆ node() [2/2]

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
const NodeType & model::LagrangeElement< _dim, degree, MappingType >::node ( const size_t & n) const
inline
Parameters
[in]thelocal node ID in the element
Returns
a reference to the n-th LagrangeNode

Definition at line 379 of file LagrangeElement.h.

◆ position()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
Eigen::Matrix< double, dim, 1 > model::LagrangeElement< _dim, degree, MappingType >::position ( const BaryType & bary) const
inline
Parameters
[in]barythe vector of barycentric coordinate
Returns
the position vector corresponding to bary

Definition at line 397 of file LagrangeElement.h.

◆ sf()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
Eigen::Matrix< double, 1, nodesPerElement > model::LagrangeElement< _dim, degree, MappingType >::sf ( const BaryType & bary)
inlinestatic
Parameters
[in]barythe vector of barycentric coordinates
Returns
a row vector of the the shape-functions, evaluated at bary. This is:

\[ N_{\{I_k\}}(A_0,\dots A_{d})=\prod_{i=0}^{d+1}\left([c_{i0},\dots,c_{ip}]\cdot[A_i^0,\dots,A_i^p]\right) \]

Definition at line 285 of file LagrangeElement.h.

◆ sfm()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
template<typename TrialFunctionType>
TypeTraits< TrialFunctionType >::ShapeFunctionMatrixType model::LagrangeElement< _dim, degree, MappingType >::sfm ( const BaryType & bary)
inlinestatic
Parameters
[in]barythe vector of barycentric coordinates
Returns
a row vector of the the shape-functions, evaluated at bary. This is:

\[ N_{\{I_k\}}(A_0,\dots A_{d})=\prod_{i=0}^{d+1}\left([c_{i0},\dots,c_{ip}]\cdot[A_i^0,\dots,A_i^p]\right) \]

Definition at line 303 of file LagrangeElement.h.

◆ sfmDef()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
template<typename TrialFunctionType>
TypeTraits< TrialFunctionType >::ShapeFunctionDefMatrixType model::LagrangeElement< _dim, degree, MappingType >::sfmDef ( const BaryType & bary) const
inline
Parameters
[in]barythe vector of barycentric coordinates
Returns
A matrix of the symmetric gradient of the shape-functions, evaluated at bary. Symmetric gradients are interpreted in egineering sense.

Definition at line 368 of file LagrangeElement.h.

◆ sfmGrad()

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
template<typename TrialFunctionType>
TypeTraits< TrialFunctionType >::ShapeFunctionGradMatrixType model::LagrangeElement< _dim, degree, MappingType >::sfmGrad ( const BaryType & bary) const
inline
Parameters
[in]barythe vector of barycentric coordinates
Returns
the gradient of the shape-functions, evaluated at bary. This is the matrix :

\[ M_{ij}=\frac{\partial N_j}{\partial x_i} \]

Definition at line 353 of file LagrangeElement.h.

Member Data Documentation

◆ baryNodalCoordinates

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
const Eigen::Matrix<double,CombinationWithRepetition<_dim+1,degree>::value,_dim+1> model::LagrangeElement< _dim, degree, MappingType >::baryNodalCoordinates
static

Definition at line 198 of file LagrangeElement.h.

◆ baryStarsAndBars

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
const Eigen::Matrix<int ,CombinationWithRepetition<_dim+1,degree>::value,_dim+1> model::LagrangeElement< _dim, degree, MappingType >::baryStarsAndBars
static

Definition at line 197 of file LagrangeElement.h.

◆ dim

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
int model::LagrangeElement< _dim, degree, MappingType >::dim =_dim
staticconstexpr

Definition at line 65 of file LagrangeElement.h.

◆ nodesPerElement

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
int model::LagrangeElement< _dim, degree, MappingType >::nodesPerElement =CombinationWithRepetition<_dim+1,degree>::value
staticconstexpr

Definition at line 67 of file LagrangeElement.h.

◆ order

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
int model::LagrangeElement< _dim, degree, MappingType >::order =degree
staticconstexpr

Definition at line 66 of file LagrangeElement.h.

◆ sfCoeffsVector

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
const std::vector<Eigen::Matrix<double,_dim+1,degree+1> > model::LagrangeElement< _dim, degree, MappingType >::sfCoeffsVector
static

Definition at line 199 of file LagrangeElement.h.

◆ simplex

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
const Simplex<dim,dim>& model::LagrangeElement< _dim, degree, MappingType >::simplex

A const reference to the Simplex that this element refers to.

Definition at line 202 of file LagrangeElement.h.

◆ Xe

template<int _dim, int degree, template< typename T > class MappingType = IsoparametricMapping>
Eigen::Matrix<double,_dim,nodesPerElement> model::LagrangeElement< _dim, degree, MappingType >::Xe

The matrix of nodal coordinates.

Definition at line 205 of file LagrangeElement.h.


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