PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
pbat::fem::Mesh< TElement, Dims, TScalar, TIndex > Struct Template Reference

A generic stateful finite element mesh representation. More...

#include <Mesh.h>

Public Types

using ElementType = TElement
 Underlying finite element type.
 
using ScalarType = TScalar
 Floating point type.
 
using IndexType = TIndex
 Index type.
 
using NodeMatrix
 Node positions matrix type.
 
using ElementMatrix
 Element indices matrix type.
 

Public Member Functions

template<class TDerivedV, class TDerivedC>
 Mesh (Eigen::MatrixBase< TDerivedV > const &V, Eigen::DenseBase< TDerivedC > const &C)
 Constructs a finite element mesh given some input geometric mesh.
 
template<class TDerivedV, class TDerivedC>
void Construct (Eigen::MatrixBase< TDerivedV > const &V, Eigen::DenseBase< TDerivedC > const &C)
 Constructs a finite element mesh given some input geometric mesh.
 
template<int QuadratureOrder>
auto QuadraturePoints () const -> Eigen::Matrix< ScalarType, Eigen::Dynamic, Eigen::Dynamic >
 Compute quadrature points in domain space on this mesh.
 
template<int QuadratureOrder, int kPoints = TElement::template QuadratureType<QuadratureOrder, ScalarType>::kPoints>
auto QuadratureWeights () const -> Eigen::Vector< ScalarType, kPoints >
 Obtain quadrature weights on the reference element of this mesh.
 
void Serialize (io::Archive &archive) const
 Serialize to HDF5 group.
 
void Deserialize (io::Archive const &archive)
 Deserialize from HDF5 group.
 
template<int QuadratureOrder>
Eigen::Matrix< TScalar, Eigen::Dynamic, Eigen::Dynamic > QuadraturePoints () const
 
template<int QuadratureOrder, int kPoints>
Eigen::Vector< TScalar, kPoints > QuadratureWeights () const
 

Public Attributes

NodeMatrix X
 kDims x |# nodes| nodal positions
 
ElementMatrix E
 |Element::Nodes| x |# elements| element nodal indices
 

Static Public Attributes

static int constexpr kDims = Dims
 Embedding dimensions of the mesh.
 
static int constexpr kOrder = ElementType::kOrder
 Shape function order.
 
static int constexpr kNodesPerElement = ElementType::kNodes
 Number of nodes per element.
 

Detailed Description

template<CElement TElement, int Dims, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
struct pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >

A generic stateful finite element mesh representation.

Template Parameters
TElementType satisfying concept CElement
DimsEmbedding dimensions of the mesh
TScalarFloating point type, defaults to Scalar
TIndexIndex type, defaults to Index

Member Typedef Documentation

◆ ElementMatrix

template<CElement TElement, int Dims, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
using pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >::ElementMatrix
Initial value:
Eigen::Matrix<IndexType, kNodesPerElement, Eigen::Dynamic>

Element indices matrix type.

◆ NodeMatrix

template<CElement TElement, int Dims, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
using pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >::NodeMatrix
Initial value:
Eigen::Matrix<ScalarType, kDims, Eigen::Dynamic>

Node positions matrix type.

Constructor & Destructor Documentation

◆ Mesh()

template<CElement TElement, int Dims, common::CFloatingPoint TScalar, common::CIndex TIndex>
template<class TDerivedV, class TDerivedC>
pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >::Mesh ( Eigen::MatrixBase< TDerivedV > const & V,
Eigen::DenseBase< TDerivedC > const & C )
inline

Constructs a finite element mesh given some input geometric mesh.

Warning
The cells of the input mesh should list its vertices in Lagrange order.
Template Parameters
TDerivedVType of the vertex positions matrix
TDerivedCType of the cell vertex indices matrix
Parameters
VDims x |# vertices| matrix of vertex positions
C|Element::AffineBase::Vertices| x |# cells| matrix of cell vertex indices into V

Member Function Documentation

◆ Construct()

template<CElement TElement, int Dims, common::CFloatingPoint TScalar, common::CIndex TIndex>
template<class TDerivedV, class TDerivedC>
void pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >::Construct ( Eigen::MatrixBase< TDerivedV > const & V,
Eigen::DenseBase< TDerivedC > const & C )
inline

Constructs a finite element mesh given some input geometric mesh.

Warning
The cells of the input mesh should list its vertices in Lagrange order.
Template Parameters
TDerivedVType of the vertex positions matrix
TDerivedCType of the cell vertex indices matrix
Parameters
VDims x |# vertices| matrix of vertex positions
C|Element::AffineBase::Vertices| x |# cells| matrix of cell vertex indices into V

◆ Deserialize()

template<CElement TElement, int Dims, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >::Deserialize ( io::Archive const & archive)

Deserialize from HDF5 group.

Parameters
archiveArchive to deserialize from

◆ QuadraturePoints()

template<CElement TElement, int Dims, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
template<int QuadratureOrder>
auto pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >::QuadraturePoints ( ) const -> Eigen::Matrix< ScalarType, Eigen::Dynamic, Eigen::Dynamic >

Compute quadrature points in domain space on this mesh.

Template Parameters
QuadratureOrderQuadrature order
Returns
kDims x |# element quad.pts.| matrix of quadrature points

◆ QuadratureWeights()

template<CElement TElement, int Dims, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
template<int QuadratureOrder, int kPoints = TElement::template QuadratureType<QuadratureOrder, ScalarType>::kPoints>
auto pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >::QuadratureWeights ( ) const -> Eigen::Vector< ScalarType, kPoints >

Obtain quadrature weights on the reference element of this mesh.

Template Parameters
QuadratureOrderQuadrature order
Parameters
kPointsNumber of quadrature points, defaults to Element::template QuadratureType<QuadratureOrder>::kPoints. This template parameter should not be specified, it is there to enhance readability.
Returns
|# element quad.pts.| vector of quadrature weights

◆ Serialize()

template<CElement TElement, int Dims, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::fem::Mesh< TElement, Dims, TScalar, TIndex >::Serialize ( io::Archive & archive) const

Serialize to HDF5 group.

Parameters
archiveArchive to serialize to

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