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::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex > Struct Template Reference

Finite Element Elasto-Dynamics initial value problem with Dirichlet boundary conditions using BDF (backward differentiation formula) as the time discretization. More...

#include <FemElastoDynamics.h>

Public Types

using MeshType = fem::Mesh<TElement, Dims, TScalar, TIndex>
 Mesh type.
 
using ElementType = TElement
 Element type.
 
using ElasticEnergyType = THyperElasticEnergy
 Elastic energy type.
 
using BdfType = integration::Bdf<TScalar, TIndex>
 BDF time integrator type.
 
using ScalarType = TScalar
 Floating point scalar type.
 
using IndexType = TIndex
 Integer index type.
 

Public Member Functions

 FemElastoDynamics ()=default
 Construct an empty FemElastoDynamics problem.
 
 FemElastoDynamics (Eigen::Ref< Eigen::Matrix< ScalarType, Eigen::Dynamic, Eigen::Dynamic > const > const &V, Eigen::Ref< Eigen::Matrix< IndexType, Eigen::Dynamic, Eigen::Dynamic > const > const &C)
 Construct an FemElastoDynamics problem on the mesh domain (V,C).
 
void Construct (Eigen::Ref< Eigen::Matrix< ScalarType, Eigen::Dynamic, Eigen::Dynamic > const > const &V, Eigen::Ref< Eigen::Matrix< IndexType, Eigen::Dynamic, Eigen::Dynamic > const > const &C)
 Construct an FemElastoDynamics problem on the mesh domain (V,C).
 
template<class TDerivedX0, class TDerivedV0>
void SetInitialConditions (Eigen::DenseBase< TDerivedX0 > const &x0, Eigen::DenseBase< TDerivedV0 > const &v0)
 Set the initial conditions for the initial value problem.
 
void SetMassMatrix (ScalarType rho)
 Compute, lump and set the mass matrix with homogeneous density \( \rho \).
 
void SetElasticEnergy (ScalarType mu, ScalarType lambda)
 Set the elastic energy quadrature for a homogeneous material with Lame coefficients \( \mu \) and \( \lambda \).
 
void SetExternalLoad (Eigen::Vector< ScalarType, kDims > const &b)
 Compute and set the external load vector given by fixed body forces \( b \).
 
void SetTimeIntegrationScheme (ScalarType dt=ScalarType(1e-2), int s=1)
 Set the BDF (backward differentiation formula) time integration scheme.
 
template<typename TDerivedDirichletMask>
void Constrain (Eigen::DenseBase< TDerivedDirichletMask > const &D)
 Set the Dirichlet boundary conditions.
 
template<class TDerivedEg, class TDerivedWg, class TDerivedXg, class TDerivedRhog>
void SetMassMatrix (Eigen::DenseBase< TDerivedEg > const &eg, Eigen::MatrixBase< TDerivedWg > const &wg, Eigen::MatrixBase< TDerivedXg > const &Xg, Eigen::MatrixBase< TDerivedRhog > const &rhog)
 Compute, lump and set the mass matrix with variable density \( \rho(X) \) at quadrature points \( X_g \) of the given quadrature rule \( (w_g, X_g) \).
 
template<class TDerivedEg, class TDerivedWg, class TDerivedXg, class TDerivedMug, class TDerivedLambdag>
void SetElasticEnergy (Eigen::DenseBase< TDerivedEg > const &eg, Eigen::DenseBase< TDerivedWg > const &wg, Eigen::MatrixBase< TDerivedXg > const &Xg, Eigen::DenseBase< TDerivedMug > const &mug, Eigen::DenseBase< TDerivedLambdag > const &lambdag)
 Compute and set the elastic energy quadrature for a heterogeneous material with variable Lame coefficients \( \mu(X) \) and \( \lambda(X) \) at quadrature points \( X_g \) of the given quadrature rule \( (w_g, X_g) \).
 
template<class TDerivedEg, class TDerivedWg, class TDerivedXg, class TDerivedBg>
void SetExternalLoad (Eigen::DenseBase< TDerivedEg > const &eg, Eigen::MatrixBase< TDerivedWg > const &wg, Eigen::MatrixBase< TDerivedXg > const &Xg, Eigen::MatrixBase< TDerivedBg > const &bg)
 Compute and set the external load vector given by variable body forces \( b(X) \) at quadrature points \( X_g \) of the given quadrature rule \( (w_g, X_g) \).
 
void SetupTimeIntegrationOptimization ()
 Set the BDF inertial target for elasto dynamics.
 
void ComputeElasticEnergy (int eElasticComputationFlags, fem::EHyperElasticSpdCorrection eSpdCorrectionFlags)
 Compute the quadrature point elastic energies of the current configuration into Ug, Gg, Hg.
 
auto M () const
 k-dimensional mass matrix
 
auto aext () const
 External acceleration.
 
bool IsDirichletNode (IndexType node) const
 Check if a node is Dirichlet constrained.
 
bool IsDirichletDof (IndexType i) const
 Check if a coordinate is Dirichlet constrained.
 
auto DirichletNodes () const
 Array of Dirichlet constrained nodes.
 
auto DirichletCoordinates () const
 Dirichlet nodal positions.
 
auto DirichletVelocities () const
 Dirichlet nodal velocities.
 
auto DirichletCoordinates ()
 Dirichlet nodal positions.
 
auto DirichletVelocities ()
 Dirichlet nodal velocities.
 
auto FreeNodes () const
 Array of unconstrained nodes.
 
auto FreeCoordinates () const
 Free nodal positions.
 
auto FreeVelocities () const
 Free nodal velocities.
 
auto FreeCoordinates ()
 Free nodal positions.
 
auto FreeVelocities ()
 Free nodal velocities.
 
void Serialize (io::Archive &archive) const
 Serialize to HDF5 group.
 
void Deserialize (io::Archive const &archive)
 Deserialize from HDF5 group.
 

Public Attributes

MeshType mesh
 FEM mesh.
 
BdfType bdf
 BDF time integration scheme.
 
Eigen::Matrix< ScalarType, kDims, Eigen::Dynamic > fext
 kDims x |# nodes| matrix of external forces at nodes
 
Eigen::Vector< ScalarType, Eigen::Dynamic > m
 |# nodes| x 1 lumped mass matrix
 
Eigen::Matrix< ScalarType, kDims, Eigen::Dynamic > xtilde
 kDims x |# nodes| inertial targets
 
Eigen::Matrix< ScalarType, kDims, Eigen::Dynamic > x
 kDims x |# nodes| positions
 
Eigen::Matrix< ScalarType, kDims, Eigen::Dynamic > v
 kDims x |# nodes| velocities
 
Eigen::Vector< IndexType, Eigen::Dynamic > egU
 
Eigen::Vector< ScalarType, Eigen::Dynamic > wgU
 |# quad.pts.| x 1 vector of quadrature weights for elastic potential
 
Eigen::Matrix< ScalarType, Eigen::Dynamic, Eigen::Dynamic > GNegU
 
Eigen::Matrix< ScalarType, Eigen::Dynamic, Eigen::Dynamic > lamegU
 2 x |# quad.pts.| matrix of Lame coefficients at quadrature points
 
Eigen::Vector< ScalarType, Eigen::Dynamic > UgU
 |# quad.pts.| x 1 vector of elastic energy density at quadrature points
 
Eigen::Matrix< ScalarType, kDims *ElementType::kNodes, Eigen::Dynamic > GgU
 
Eigen::Matrix< ScalarType, kDims *ElementType::kNodes, Eigen::Dynamic > HgU
 
IndexType ndbc
 Number of Dirichlet constrained nodes.
 
Eigen::Vector< IndexType, Eigen::Dynamic > dbc
 
Eigen::Vector< bool, Eigen::Dynamic > dmask
 

Static Public Attributes

static auto constexpr kDims = Dims
 Dimensionality of the mesh.
 

Detailed Description

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
struct pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >

Finite Element Elasto-Dynamics initial value problem with Dirichlet boundary conditions using BDF (backward differentiation formula) as the time discretization.

Represents the problem

\[\min_x \frac{1}{2} || x - \tilde{x} ||_M^2 + \tilde{\beta}_\text{bdf-s}^2 U(x) , \]

where \( M \) is the mass matrix, \( \tilde{x} \) is the BDF inertial target, \( \tilde{\beta}_\text{bdf-s} \) is the forcing term's coefficient, and \( U(x) \) is the hyper-elastic potential.

Template Parameters
TElementElement type
DimsDimensionality of the mesh
THyperElasticEnergyHyper elastic energy type
TScalarFloating point scalar type
TIndexInteger index type

Constructor & Destructor Documentation

◆ FemElastoDynamics()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::FemElastoDynamics ( Eigen::Ref< Eigen::Matrix< ScalarType, Eigen::Dynamic, Eigen::Dynamic > const > const & V,
Eigen::Ref< Eigen::Matrix< IndexType, Eigen::Dynamic, Eigen::Dynamic > const > const & C )
inline

Construct an FemElastoDynamics problem on the mesh domain (V,C).

All FemElastoDynamics quantities are initialized to sensible defaults, i.e. rest pose positions, zero velocities, homogeneous rubber-like material properties, and gravitational load.

Parameters
VkDims x |# verts| matrix of mesh vertex positions
C|# cell nodes| x |# cells| matrix of mesh cells

Member Function Documentation

◆ aext()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::aext ( ) const
inline

External acceleration.

Returns
kDims x |# nodes| external acceleration

◆ ComputeElasticEnergy()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::ComputeElasticEnergy ( int eElasticComputationFlags,
fem::EHyperElasticSpdCorrection eSpdCorrectionFlags )
inline

Compute the quadrature point elastic energies of the current configuration into Ug, Gg, Hg.

Parameters
eElasticComputationFlagsFlags for computing elastic potential, gradient, and/or hessian
eSpdCorrectionFlagsFlags for SPD correction of element hessians

◆ Constrain()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
template<typename TDerivedDirichletMask>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::Constrain ( Eigen::DenseBase< TDerivedDirichletMask > const & D)
inline

Set the Dirichlet boundary conditions.

Parameters
D|# nodes| x 1 mask of Dirichlet boundary conditions s.t. D(i) == true if node i is constrained
Precondition
D.size() == mesh.X.cols()

◆ Construct()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::Construct ( Eigen::Ref< Eigen::Matrix< ScalarType, Eigen::Dynamic, Eigen::Dynamic > const > const & V,
Eigen::Ref< Eigen::Matrix< IndexType, Eigen::Dynamic, Eigen::Dynamic > const > const & C )
inline

Construct an FemElastoDynamics problem on the mesh domain (V,C).

All FemElastoDynamics quantities are initialized to sensible defaults, i.e. rest pose positions, zero velocities, homogeneous rubber-like material properties, and gravitational load.

Parameters
VkDims x |# verts| matrix of mesh vertex positions
C|# cell nodes| x |# cells| matrix of mesh cells

◆ Deserialize()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::Deserialize ( io::Archive const & archive)
inline

Deserialize from HDF5 group.

Parameters
archiveArchive to deserialize from

◆ DirichletCoordinates() [1/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::DirichletCoordinates ( )
inline

Dirichlet nodal positions.

Returns
kDims x ndbc matrix of Dirichlet constrained nodal positions

◆ DirichletCoordinates() [2/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::DirichletCoordinates ( ) const
inline

Dirichlet nodal positions.

Returns
kDims x ndbc matrix of Dirichlet constrained nodal positions

◆ DirichletNodes()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::DirichletNodes ( ) const
inline

Array of Dirichlet constrained nodes.

Returns
ndbc x 1 array of Dirichlet constrained nodes

◆ DirichletVelocities() [1/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::DirichletVelocities ( )
inline

Dirichlet nodal velocities.

Returns
kDims x ndbc matrix of Dirichlet constrained nodal velocities

◆ DirichletVelocities() [2/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::DirichletVelocities ( ) const
inline

Dirichlet nodal velocities.

Returns
kDims x ndbc matrix of Dirichlet constrained nodal velocities

◆ FreeCoordinates() [1/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::FreeCoordinates ( )
inline

Free nodal positions.

Returns
kDims x |# nodes - ndbc| matrix of unconstrained nodal positions

◆ FreeCoordinates() [2/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::FreeCoordinates ( ) const
inline

Free nodal positions.

Returns
kDims x |# nodes - ndbc| matrix of unconstrained nodal positions

◆ FreeNodes()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::FreeNodes ( ) const
inline

Array of unconstrained nodes.

Returns
|# nodes - ndbc| x 1 array of unconstrained nodes

◆ FreeVelocities() [1/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::FreeVelocities ( )
inline

Free nodal velocities.

Returns
kDims x |# nodes - ndbc| matrix of unconstrained nodal velocities

◆ FreeVelocities() [2/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::FreeVelocities ( ) const
inline

Free nodal velocities.

Returns
kDims x |# nodes - ndbc| matrix of unconstrained nodal velocities

◆ IsDirichletDof()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
bool pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::IsDirichletDof ( IndexType i) const
inline

Check if a coordinate is Dirichlet constrained.

Parameters
iCoordinate index
Returns
true if the coordinate is Dirichlet constrained, false otherwise

◆ IsDirichletNode()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
bool pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::IsDirichletNode ( IndexType node) const
inline

Check if a node is Dirichlet constrained.

Parameters
nodeNode index
Returns
true if the node is Dirichlet constrained, false otherwise

◆ M()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
auto pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::M ( ) const
inline

k-dimensional mass matrix

Returns
kDims * |#nodes| x 1 vector of the kDims-dimensional lumped mass matrix diagonal coefficients

◆ Serialize()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::Serialize ( io::Archive & archive) const
inline

Serialize to HDF5 group.

Parameters
archiveArchive to serialize to

◆ SetElasticEnergy() [1/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
template<class TDerivedEg, class TDerivedWg, class TDerivedXg, class TDerivedMug, class TDerivedLambdag>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::SetElasticEnergy ( Eigen::DenseBase< TDerivedEg > const & eg,
Eigen::DenseBase< TDerivedWg > const & wg,
Eigen::MatrixBase< TDerivedXg > const & Xg,
Eigen::DenseBase< TDerivedMug > const & mug,
Eigen::DenseBase< TDerivedLambdag > const & lambdag )
inline

Compute and set the elastic energy quadrature for a heterogeneous material with variable Lame coefficients \( \mu(X) \) and \( \lambda(X) \) at quadrature points \( X_g \) of the given quadrature rule \( (w_g, X_g) \).

Template Parameters
TDerivedEgEigen dense expression type for element indices
TDerivedWgEigen dense expression type for quadrature weights
TDerivedXgEigen dense expression type for quadrature points
TDerivedMugEigen dense expression type for 1st Lame coefficients
TDerivedLambdagEigen dense expression type for 2nd Lame coefficients
Parameters
eg|# quad.pts.| x 1 vector of element indices at quadrature points
wg|# quad.pts.| x 1 vector of quadrature weights
Xg|# dims| x |# quad.pts.| matrix of quadrature points
mug|# quad.pts.| x 1 vector of 1st Lame coefficients at quadrature points
lambdag|# quad.pts.| x 1 vector of 2nd Lame coefficients at quadrature points

◆ SetElasticEnergy() [2/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::SetElasticEnergy ( ScalarType mu,
ScalarType lambda )
inline

Set the elastic energy quadrature for a homogeneous material with Lame coefficients \( \mu \) and \( \lambda \).

Parameters
mu1st Lame coefficient \( \mu \)
lambda2nd Lame coefficient \( \lambda \)

◆ SetExternalLoad() [1/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
template<class TDerivedEg, class TDerivedWg, class TDerivedXg, class TDerivedBg>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::SetExternalLoad ( Eigen::DenseBase< TDerivedEg > const & eg,
Eigen::MatrixBase< TDerivedWg > const & wg,
Eigen::MatrixBase< TDerivedXg > const & Xg,
Eigen::MatrixBase< TDerivedBg > const & bg )
inline

Compute and set the external load vector given by variable body forces \( b(X) \) at quadrature points \( X_g \) of the given quadrature rule \( (w_g, X_g) \).

Template Parameters
TDerivedEgEigen dense expression type for element indices
TDerivedWgEigen dense expression type for quadrature weights
TDerivedXgEigen dense expression type for quadrature points
TDerivedBgEigen dense expression type for body forces
Parameters
eg|# quad.pts.| x 1 vector of element indices at quadrature points
wg|# quad.pts.| x 1 vector of quadrature weights
Xg|# dims| x |# quad.pts.| matrix of quadrature points
bgkDims x |# quad.pts.| matrix of body forces at quadrature points

◆ SetExternalLoad() [2/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::SetExternalLoad ( Eigen::Vector< ScalarType, kDims > const & b)
inline

Compute and set the external load vector given by fixed body forces \( b \).

Parameters
bkDims x 1 fixed body forces

◆ SetInitialConditions()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
template<class TDerivedX0, class TDerivedV0>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::SetInitialConditions ( Eigen::DenseBase< TDerivedX0 > const & x0,
Eigen::DenseBase< TDerivedV0 > const & v0 )
inline

Set the initial conditions for the initial value problem.

Parameters
x0kDims x |# nodes| matrix of initial nodal coordinates
v0kDims x |# nodes| matrix of initial nodal velocities

◆ SetMassMatrix() [1/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
template<class TDerivedEg, class TDerivedWg, class TDerivedXg, class TDerivedRhog>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::SetMassMatrix ( Eigen::DenseBase< TDerivedEg > const & eg,
Eigen::MatrixBase< TDerivedWg > const & wg,
Eigen::MatrixBase< TDerivedXg > const & Xg,
Eigen::MatrixBase< TDerivedRhog > const & rhog )
inline

Compute, lump and set the mass matrix with variable density \( \rho(X) \) at quadrature points \( X_g \) of the given quadrature rule \( (w_g, X_g) \).

Template Parameters
TDerivedEgEigen dense expression type for element indices
TDerivedWgEigen dense expression type for quadrature weights
TDerivedXgEigen dense expression type for quadrature points
TDerivedRhogEigen dense expression type for mass density
Parameters
eg|# quad.pts.| x 1 vector of element indices at quadrature points
wg|# quad.pts.| x 1 vector of quadrature weights
Xg|# dims| x |# quad.pts.| matrix of quadrature points
rhog|# quad.pts.| x 1 vector of mass density at quadrature points

◆ SetMassMatrix() [2/2]

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::SetMassMatrix ( ScalarType rho)
inline

Compute, lump and set the mass matrix with homogeneous density \( \rho \).

Parameters
rhoMass density of the material

◆ SetTimeIntegrationScheme()

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar, common::CIndex TIndex>
void pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::SetTimeIntegrationScheme ( ScalarType dt = ScalarType(1e-2),
int s = 1 )
inline

Set the BDF (backward differentiation formula) time integration scheme.

Parameters
dtTime step size
sStep of the BDF scheme

Member Data Documentation

◆ dbc

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
Eigen::Vector<IndexType, Eigen::Dynamic> pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::dbc

|# nodes| x 1 concatenated vector of Dirichlet unconstrained and constrained nodes, partitioned as [ dbc(0 : |#nodes|-ndbc), dbc(|# nodes|-ndbc : |# nodes|) ]

◆ dmask

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
Eigen::Vector<bool, Eigen::Dynamic> pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::dmask

|# nodes| x 1 mask of Dirichlet boundary conditions s.t. dmask(i) == true if node i is constrained

◆ egU

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
Eigen::Vector<IndexType, Eigen::Dynamic> pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::egU

|# quad.pts.| x 1 vector of element indices for quadrature points of elastic potential

◆ GgU

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
Eigen::Matrix<ScalarType, kDims * ElementType::kNodes, Eigen::Dynamic> pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::GgU

|# dims * # elem nodes| x |# quad.pts.| matrix of element elastic gradient vectors at quadrature points

◆ GNegU

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
Eigen::Matrix<ScalarType, Eigen::Dynamic, Eigen::Dynamic> pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::GNegU

|ElementType::kNodes| x |kDims * # quad.pts.| matrix of shape function gradients at quadrature points

◆ HgU

template<fem::CElement TElement, int Dims, physics::CHyperElasticEnergy THyperElasticEnergy, common::CFloatingPoint TScalar = Scalar, common::CIndex TIndex = Index>
Eigen::Matrix<ScalarType, kDims * ElementType::kNodes, Eigen::Dynamic> pbat::sim::dynamics::FemElastoDynamics< TElement, Dims, THyperElasticEnergy, TScalar, TIndex >::HgU

|# dims * # elem nodes| x |# dims * # elem nodes * # quad.pts.| matrix of element elastic hessian matrices at quadrature points


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