PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
|
VBD simulation configuration. More...
#include <Data.h>
Public Member Functions | |
PBAT_API Data & | WithVolumeMesh (Eigen::Ref< MatrixX const > const &X, Eigen::Ref< IndexMatrixX const > const &E) |
Simulation mesh. | |
PBAT_API Data & | WithSurfaceMesh (Eigen::Ref< IndexVectorX const > const &V, Eigen::Ref< IndexMatrixX const > const &F) |
Collision mesh. | |
PBAT_API Data & | WithBodies (Eigen::Ref< IndexVectorX const > const &B) |
Multibody map. | |
PBAT_API Data & | WithVelocity (Eigen::Ref< MatrixX const > const &v) |
Vertex velocities. | |
PBAT_API Data & | WithAcceleration (Eigen::Ref< MatrixX const > const &aext) |
Vertex external accelerations. | |
PBAT_API Data & | WithMaterial (Eigen::Ref< VectorX const > const &rhoe, Eigen::Ref< VectorX const > const &mue, Eigen::Ref< VectorX const > const &lambdae) |
Element material parameters. | |
PBAT_API Data & | WithDirichletConstrainedVertices (IndexVectorX const &dbc, Scalar muD=Scalar(1), bool bDbcSorted=false) |
Set Dirichlet constrained vertices. | |
PBAT_API Data & | WithVertexColoringStrategy (graph::EGreedyColorOrderingStrategy eOrdering, graph::EGreedyColorSelectionStrategy eSelection) |
Vertex graph coloring strategy to use. | |
PBAT_API Data & | WithInitializationStrategy (EInitializationStrategy strategy) |
BCD optimization initialization strategy. | |
PBAT_API Data & | WithRayleighDamping (Scalar kD) |
Uniform damping coefficient. | |
PBAT_API Data & | WithContactParameters (Scalar muC, Scalar muF, Scalar epsv) |
Normal and frictional contact parameters. | |
PBAT_API Data & | WithActiveSetUpdateFrequency (Index activeSetUpdateFrequency) |
Active set update frequency. | |
PBAT_API Data & | WithHessianDeterminantZeroUnder (Scalar zero) |
Numerical zero for hessian pseudo-singularity check. | |
PBAT_API Data & | WithChebyshevAcceleration (Scalar rho) |
Use Chebyshev acceleration. | |
PBAT_API Data & | WithAndersonAcceleration (Index window) |
Use Anderson acceleration. | |
PBAT_API Data & | WithBroydenMethod (Index window) |
Use Broyden method. | |
PBAT_API Data & | WithNesterovAcceleration (Scalar L, Index start=3) |
Use Nesterov acceleration. | |
PBAT_API Data & | WithTrustRegionAcceleration (Scalar eta, Scalar tau, bool bCurved=true) |
Use Trust Region acceleration. | |
PBAT_API Data & | Construct (bool bValidate=true) |
Construct the simulation data. | |
Public Attributes | |
Matrix< kDims, Eigen::Dynamic > | X |
3x|# verts| FEM nodal positions | |
IndexMatrix< 4, Eigen::Dynamic > | E |
4x|# elems| FEM linear tetrahedral elements | |
IndexVectorX | B |
|# verts| array of body indices | |
IndexVectorX | V |
Collision vertices. | |
IndexMatrix< 3, Eigen::Dynamic > | F |
3x|#collision triangles| collision triangles (on the boundary of T) | |
VectorX | XVA |
VectorX | FA |
|# collision triangles| triangle areas | |
Matrix< kDims, Eigen::Dynamic > | x |
3x|# verts| vertex positions | |
Matrix< kDims, Eigen::Dynamic > | v |
3x|# verts| vertex velocities | |
Matrix< kDims, Eigen::Dynamic > | aext |
3x|# verts| vertex external accelerations | |
VectorX | m |
|# verts| vertex masses | |
Matrix< kDims, Eigen::Dynamic > | xt |
3x|# verts| previous vertex positions | |
Matrix< kDims, Eigen::Dynamic > | xtilde |
3x|# verts| inertial target positions | |
Matrix< kDims, Eigen::Dynamic > | vt |
3x|# verts| previous vertex velocities | |
VectorX | wg |
|# elems| quadrature weights | |
Matrix< 4, Eigen::Dynamic > | GP |
|# elem.nodes|x|# dims*# elems| shape function gradients at elems | |
VectorX | rhoe |
|# elems| mass densities | |
Matrix< 2, Eigen::Dynamic > | lame |
2x|# elems| Lame coefficients | |
IndexVectorX | GVGp |
|# verts+1| prefixes into GVGg | |
IndexVectorX | GVGe |
IndexVectorX | GVGilocal |
Scalar | muD {1} |
Dirichlet penalty coefficient. | |
IndexVectorX | dbc |
Dirichlet constrained vertices (sorted) | |
graph::EGreedyColorOrderingStrategy | eOrdering |
graph::EGreedyColorSelectionStrategy | eSelection |
IndexVectorX | colors |
|# vertices| map of vertex colors | |
IndexVectorX | Pptr |
IndexVectorX | Padj |
|# verts| partition vertices | |
EInitializationStrategy | strategy |
BCD optimization initialization strategy. | |
Scalar | kD {0} |
Uniform damping coefficient. | |
Scalar | muC {1e6} |
Uniform collision penalty. | |
Scalar | muF {0.3} |
Uniform friction coefficient. | |
Scalar | epsv {1e-3} |
Index | mActiveSetUpdateFrequency {1} |
Active set update frequency. | |
Scalar | detHZero {1e-7} |
Numerical zero for hessian pseudo-singularity check. | |
EAccelerationStrategy | eAcceleration {EAccelerationStrategy::None} |
Acceleration strategy. | |
Scalar | rho {1} |
Chebyshev acceleration estimated spectral radius. | |
Index | mWindowSize {5} |
Anderson acceleration window size. | |
Scalar | mNesterovLipschitzConstant {1} |
Nesterov acceleration Lipschitz constant. | |
Index | mNesterovAccelerationStart {3} |
Nesterov acceleration start iteration. | |
Scalar | eta {0.2} |
Trust Region energy reduction accuracy threshold. | |
Scalar | tau {2} |
Trust Region radius increase factor. | |
bool | bCurved {true} |
Use curved accelerated path, otherwise use linear path. | |
Static Public Attributes | |
static auto constexpr | kDims = 3 |
Number of spatial dimensions. | |
VBD simulation configuration.
Data & pbat::sim::vbd::Data::Construct | ( | bool | bValidate = true | ) |
Construct the simulation data.
bValidate | Throw on detected ill-formed inputs |
Vertex external accelerations.
aext | 3x|# verts| vertex external accelerations |
Active set update frequency.
activeSetUpdateFrequency | Active set update frequency |
Use Anderson acceleration.
window | Anderson acceleration window size |
Data & pbat::sim::vbd::Data::WithBodies | ( | Eigen::Ref< IndexVectorX const > const & | B | ) |
Multibody map.
B | |# vertices| array of body indices s.t. B[i] is the body index of vertex i |
Use Broyden method.
window | Broyden method window size |
Use Chebyshev acceleration.
rho | Chebyshev acceleration estimated spectral radius |
Data & pbat::sim::vbd::Data::WithDirichletConstrainedVertices | ( | IndexVectorX const & | dbc, |
Scalar | muD = Scalar(1), | ||
bool | bDbcSorted = false ) |
Set Dirichlet constrained vertices.
dbc | Dirichlet constrained vertices |
muD | Dirichlet penalty coefficient |
bDbcSorted | If false, dbc will be sorted |
Numerical zero for hessian pseudo-singularity check.
zero | Numerical zero |
Data & pbat::sim::vbd::Data::WithInitializationStrategy | ( | EInitializationStrategy | strategy | ) |
BCD optimization initialization strategy.
strategy | Initialization strategy |
Data & pbat::sim::vbd::Data::WithMaterial | ( | Eigen::Ref< VectorX const > const & | rhoe, |
Eigen::Ref< VectorX const > const & | mue, | ||
Eigen::Ref< VectorX const > const & | lambdae ) |
Element material parameters.
rhoe | |# elems| mass densities |
mue | |# elems| 1st Lame coefficients |
lambdae | |# elems| 2nd Lame coefficients |
Use Nesterov acceleration.
L | Lipschitz constant estimation for the gradient |
start | Start iteration for Nesterov acceleration |
Uniform damping coefficient.
kD | Damping coefficient |
Data & pbat::sim::vbd::Data::WithSurfaceMesh | ( | Eigen::Ref< IndexVectorX const > const & | V, |
Eigen::Ref< IndexMatrixX const > const & | F ) |
Collision mesh.
V | Collision vertices |
F | 3x|# collision triangles| collision triangles (on the boundary of T) |
Data & pbat::sim::vbd::Data::WithTrustRegionAcceleration | ( | Scalar | eta, |
Scalar | tau, | ||
bool | bCurved = true ) |
Use Trust Region acceleration.
eta | Trust Region energy reduction accuracy threshold |
tau | Trust Region radius increase factor |
bCurved | Use curved accelerated path, otherwise use linear path. Default is true. |
tau > 1
and eta > 0
Vertex velocities.
v | 3x|# verts| vertex velocities |
Data & pbat::sim::vbd::Data::WithVertexColoringStrategy | ( | graph::EGreedyColorOrderingStrategy | eOrdering, |
graph::EGreedyColorSelectionStrategy | eSelection ) |
Vertex graph coloring strategy to use.
eOrdering | Vertex visiting order |
eSelection | Color selection strategy |
Data & pbat::sim::vbd::Data::WithVolumeMesh | ( | Eigen::Ref< MatrixX const > const & | X, |
Eigen::Ref< IndexMatrixX const > const & | E ) |
Simulation mesh.
If body map has not been set, all vertices are assumed to belong to the same body.
X | 3x|# vertices| vertex positions |
E | 4x|# elements| tetrahedra |
graph::EGreedyColorOrderingStrategy pbat::sim::vbd::Data::eOrdering |
Vertex graph coloring ordering strategy
Scalar pbat::sim::vbd::Data::epsv {1e-3} |
IPC [8] 's relative velocity threshold for static to dynamic friction's smooth transition
graph::EGreedyColorSelectionStrategy pbat::sim::vbd::Data::eSelection |
Vertex graph coloring selection strategy
IndexVectorX pbat::sim::vbd::Data::GVGe |
|# of vertex-elems adjacencies|
element indices s.t. GVGe[k] for GVGp[i] <= k < GVGp[i+1]
gives the element e
adjacent to vertex i
IndexVectorX pbat::sim::vbd::Data::GVGilocal |
|# of vertex-elems adjacencies|
local vertex indices s.t. GVGilocal[k] for GVGp[i] <= k < GVGp[i+1]
gives the local vertex index of vertex i
in element e=GVGe[k]
IndexVectorX pbat::sim::vbd::Data::Pptr |
|# partitions+1|
partition pointers, s.t. the range [Pptr[p], /< Pptr[p+1])
indexes into Padj from partition p
EInitializationStrategy pbat::sim::vbd::Data::strategy |
BCD optimization initialization strategy.
VectorX pbat::sim::vbd::Data::XVA |
|# verts|
vertex areas (i.e. triangle areas distributed onto vertices for boundary integration)