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::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar > Struct Template Reference

Multibody Tetrahedral Mesh System. More...

#include <MultibodyTetrahedralMeshSystem.h>

Public Types

using IndexType = TIndex
 Index type used in the multibody system.
 
using ScalarType = TScalar
 Scalar type used in the multibody system.
 

Public Member Functions

 MultibodyTetrahedralMeshSystem (Eigen::Ref< Eigen::Matrix< TScalar, 3, Eigen::Dynamic > > X, Eigen::Ref< Eigen::Matrix< IndexType, 4, Eigen::Dynamic > > T)
 Construct a new Multibody Tetrahedral Mesh System object.
 
void Construct (Eigen::Ref< Eigen::Matrix< TScalar, 3, Eigen::Dynamic > > X, Eigen::Ref< Eigen::Matrix< IndexType, 4, Eigen::Dynamic > > T, TScalar muS=0.4, TScalar muD=0.2)
 Construct a new Multibody Tetrahedral Mesh System object.
 
Eigen::Index NumBodies () const
 Get the number of bodies in the multibody system.
 
auto ContactVerticesOf (IndexType o) const
 Get vertices of body o
 
auto ContactEdgesOf (IndexType o) const
 Get edges of body o
 
auto ContactTrianglesOf (IndexType o) const
 Get triangles of body o
 
template<class TDerivedT>
auto TetrahedraOf (IndexType o, Eigen::DenseBase< TDerivedT > const &T) const
 Get tetrahedra of body o
 
template<class TDerivedX>
auto ContactVertexPositionsOf (IndexType o, Eigen::DenseBase< TDerivedX > const &X) const
 Get vertex positions of body o
 
auto BodyOfContactVertex (IndexType v) const
 Get the body associated with vertex v
 
auto BodyOfContactEdge (IndexType e) const
 Get the body associated with edge e
 
auto BodyOfContactTriangle (IndexType f) const
 Get the body associated with triangle f
 
template<class TDerivedT>
auto BodyOfTetrahedron (IndexType t, Eigen::DenseBase< TDerivedT > const &T) const
 Get the body associated with tetrahedron t
 
Eigen::Index NumContactVertices () const
 Get the number of contact vertices.
 
Eigen::Index NumContactEdges () const
 Get the number of contact edges.
 
Eigen::Index NumContactTriangles () const
 Get the number of contact triangles.
 
Eigen::Index NumTetrahedra () const
 Get the number of tetrahedra.
 
auto ContactVerticesRangeFor (IndexType o) const
 Get the range of contact vertices for body o
 
auto ContactEdgesRangeFor (IndexType o) const
 Get the range of contact edges for body o
 
auto ContactTrianglesRangeFor (IndexType o) const
 Get the range of contact triangles for body o
 
void SetMaterial (IndexType o, TScalar muS, TScalar muD)
 Set the friction coefficients for body o
 
void SetMaterial (TScalar muS, TScalar muD)
 Set the friction coefficients for all bodies.
 
auto TetrahedraRangeFor (IndexType o) const
 Get the range of tetrahedra for body o
 
void Serialize (io::Archive &archive) const
 Serialize the multibody tetrahedral mesh system to an HDF5 archive.
 
void Deserialize (io::Archive &archive)
 Deserialize the multibody tetrahedral mesh system from an HDF5 archive.
 

Public Attributes

Eigen::Vector< TIndex, Eigen::Dynamic > V
 |# contact vertices| x 1 indices into mesh vertices
 
Eigen::Matrix< TIndex, 2, Eigen::Dynamic > E
 2 x |# contact edges| edges into mesh vertices
 
Eigen::Matrix< TIndex, 3, Eigen::Dynamic > F
 3 x |# contact triangles| triangles into mesh vertices
 
Eigen::Vector< TIndex, Eigen::Dynamic > VP
 |# bodies + 1| x 1 prefix sum of vertex pointers into V
 
Eigen::Vector< TIndex, Eigen::Dynamic > EP
 |# bodies + 1| x 1 prefix sum of edge pointers into E
 
Eigen::Vector< TIndex, Eigen::Dynamic > FP
 |# bodies + 1| x 1 prefix sum of triangle pointers into F
 
Eigen::Vector< TIndex, Eigen::Dynamic > TP
 pointers into input tetrahedral mesh T
 
Eigen::Vector< TIndex, Eigen::Dynamic > CC
 |# mesh vertices| x 1 connected component map
 
Eigen::Matrix< TScalar, 2, Eigen::Dynamic > muF
 coefficients at contact faces
 

Detailed Description

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
struct pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >

Multibody Tetrahedral Mesh System.

Holds a common representation of a multibody system composed of tetrahedral meshes.

Constructor & Destructor Documentation

◆ MultibodyTetrahedralMeshSystem()

template<common::CIndex TIndex, common::CArithmetic TScalar>
pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::MultibodyTetrahedralMeshSystem ( Eigen::Ref< Eigen::Matrix< TScalar, 3, Eigen::Dynamic > > X,
Eigen::Ref< Eigen::Matrix< IndexType, 4, Eigen::Dynamic > > T )
inline

Construct a new Multibody Tetrahedral Mesh System object.

Parameters
X3 x |# mesh vertices| matrix of vertex positions
T4 x |# tetrahedra| tetrahedral mesh elements/connectivity
Postcondition
The input mesh vertex positions and element indices will be sorted by body.

Member Function Documentation

◆ BodyOfContactEdge()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::BodyOfContactEdge ( IndexType e) const
inline

Get the body associated with edge e

Parameters
eIndex of the edge
Returns
Body index of edge e

◆ BodyOfContactTriangle()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::BodyOfContactTriangle ( IndexType f) const
inline

Get the body associated with triangle f

Parameters
fIndex of the triangle
Returns
Body index of triangle f

◆ BodyOfContactVertex()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::BodyOfContactVertex ( IndexType v) const
inline

Get the body associated with vertex v

Parameters
vIndex of the vertex
Returns
Body index of vertex v

◆ BodyOfTetrahedron()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
template<class TDerivedT>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::BodyOfTetrahedron ( IndexType t,
Eigen::DenseBase< TDerivedT > const & T ) const
inline

Get the body associated with tetrahedron t

Parameters
tIndex of the tetrahedron
T4 x |# tetrahedra| tetrahedral mesh elements/connectivity
Returns
Body index of tetrahedron t

◆ Construct()

template<common::CIndex TIndex, common::CArithmetic TScalar>
void pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::Construct ( Eigen::Ref< Eigen::Matrix< TScalar, 3, Eigen::Dynamic > > X,
Eigen::Ref< Eigen::Matrix< IndexType, 4, Eigen::Dynamic > > T,
TScalar muS = 0.4,
TScalar muD = 0.2 )
inline

Construct a new Multibody Tetrahedral Mesh System object.

Parameters
X3 x |# mesh vertices| matrix of vertex positions
T4 x |# tetrahedra| tetrahedral mesh elements/connectivity
muSUniform static friction coefficient
muDUniform dynamic friction coefficient
Postcondition
The input mesh vertex positions and element indices will be sorted by body.

◆ ContactEdgesOf()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::ContactEdgesOf ( IndexType o) const
inline

Get edges of body o

Parameters
oIndex of the body
Returns
2 x |# contact edges of body o| edges into mesh vertices

◆ ContactEdgesRangeFor()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::ContactEdgesRangeFor ( IndexType o) const
inline

Get the range of contact edges for body o

Parameters
oIndex of the body
Returns
A tuple (ebegin, eend) containing the start (inclusive) and end (exclusive) indices of contact edges for body o

◆ ContactTrianglesOf()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::ContactTrianglesOf ( IndexType o) const
inline

Get triangles of body o

Parameters
oIndex of the body
Returns
3 x |# contact triangles of body o| triangles into mesh vertices

◆ ContactTrianglesRangeFor()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::ContactTrianglesRangeFor ( IndexType o) const
inline

Get the range of contact triangles for body o

Parameters
oIndex of the body
Returns
A tuple (fbegin, fend) containing the start (inclusive) and end (exclusive) indices of contact triangles for body o

◆ ContactVertexPositionsOf()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
template<class TDerivedX>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::ContactVertexPositionsOf ( IndexType o,
Eigen::DenseBase< TDerivedX > const & X ) const
inline

Get vertex positions of body o

Template Parameters
TDerivedXEigen type of the input vertex positions
Parameters
oIndex of the body
X3 x |# mesh vertices| matrix of vertex positions
Returns
3 x |# contact vertices of body o| matrix of vertex positions

◆ ContactVerticesOf()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::ContactVerticesOf ( IndexType o) const
inline

Get vertices of body o

Parameters
oIndex of the body
Returns
|# contact vertices of body o| x 1 indices into mesh vertices

◆ ContactVerticesRangeFor()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::ContactVerticesRangeFor ( IndexType o) const
inline

Get the range of contact vertices for body o

Parameters
oIndex of the body
Returns
A tuple (vbegin, vend) containing the start (inclusive) and end (exclusive) indices of contact vertices for body o

◆ Deserialize()

template<common::CIndex TIndex, common::CArithmetic TScalar>
void pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::Deserialize ( io::Archive & archive)

Deserialize the multibody tetrahedral mesh system from an HDF5 archive.

Parameters
archiveThe HDF5 archive to deserialize from

◆ NumBodies()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
Eigen::Index pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::NumBodies ( ) const
inline

Get the number of bodies in the multibody system.

Returns
The number of bodies

◆ NumContactEdges()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
Eigen::Index pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::NumContactEdges ( ) const
inline

Get the number of contact edges.

Returns
Number of contact edges

◆ NumContactTriangles()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
Eigen::Index pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::NumContactTriangles ( ) const
inline

Get the number of contact triangles.

Returns
Number of contact triangles

◆ NumContactVertices()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
Eigen::Index pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::NumContactVertices ( ) const
inline

Get the number of contact vertices.

Returns
Number of contact vertices

◆ NumTetrahedra()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
Eigen::Index pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::NumTetrahedra ( ) const
inline

Get the number of tetrahedra.

Returns
Number of tetrahedra

◆ Serialize()

template<common::CIndex TIndex, common::CArithmetic TScalar>
void pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::Serialize ( io::Archive & archive) const

Serialize the multibody tetrahedral mesh system to an HDF5 archive.

Parameters
archiveThe HDF5 archive to serialize to

◆ SetMaterial() [1/2]

template<common::CIndex TIndex, common::CArithmetic TScalar>
void pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::SetMaterial ( IndexType o,
TScalar muS,
TScalar muD )
inline

Set the friction coefficients for body o

Parameters
oIndex of the body
muSStatic friction coefficient
muDDynamic friction coefficient

◆ SetMaterial() [2/2]

template<common::CIndex TIndex, common::CArithmetic TScalar>
void pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::SetMaterial ( TScalar muS,
TScalar muD )
inline

Set the friction coefficients for all bodies.

Parameters
muSStatic friction coefficient
muDDynamic friction coefficient

◆ TetrahedraOf()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
template<class TDerivedT>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::TetrahedraOf ( IndexType o,
Eigen::DenseBase< TDerivedT > const & T ) const
inline

Get tetrahedra of body o

Template Parameters
TDerivedTEigen type of the input tetrahedral mesh
Parameters
oIndex of the body
T4 x |# tetrahedra| tetrahedral mesh elements/connectivity
Returns
4 x |# contact tetrahedra of body o| tetrahedra into input tetrahedral mesh T

◆ TetrahedraRangeFor()

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
auto pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::TetrahedraRangeFor ( IndexType o) const
inline

Get the range of tetrahedra for body o

Parameters
oIndex of the body
Returns
A tuple (tbegin, tend) containing the start (inclusive) and end (exclusive) indices of tetrahedra for body o

Member Data Documentation

◆ muF

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
Eigen::Matrix<TScalar, 2, Eigen::Dynamic> pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::muF

coefficients at contact faces

2 x |# contact faces| matrix of static (row 0) and dynamic (row 1) friction

◆ TP

template<common::CIndex TIndex = Index, common::CArithmetic TScalar = Scalar>
Eigen::Vector<TIndex, Eigen::Dynamic> pbat::sim::contact::MultibodyTetrahedralMeshSystem< TIndex, TScalar >::TP

pointers into input tetrahedral mesh T

|# bodies + 1| x 1 prefix sum of tetrahedron


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