PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
|
Public API of the GPU XPBD integrator. More...
#include <Integrator.h>
Public Types | |
using | Data = pbat::sim::xpbd::Data |
Input XPBD data constructor parameter object short name. | |
using | EConstraint = pbat::sim::xpbd::EConstraint |
Constraint type enumeration short name. | |
Public Member Functions | |
PBAT_API | Integrator (Data const &data) |
Construct a new Integrator object from the input XPBD data. | |
Integrator (Integrator const &)=delete | |
Integrator & | operator= (Integrator const &)=delete |
PBAT_API | Integrator (Integrator &&) noexcept |
Move constructor. | |
PBAT_API Integrator & | operator= (Integrator &&) noexcept |
Move assignment operator. | |
PBAT_API void | Step (GpuScalar dt, GpuIndex iterations, GpuIndex substeps) |
Step once in time. | |
PBAT_API GpuMatrixX | Positions () const |
Fetch the current positions from the GPU. | |
PBAT_API void | SetPositions (Eigen::Ref< GpuMatrixX const > const &X) |
Set the GPU vertex positions from the input CPU vertex positions. | |
PBAT_API void | SetVelocities (Eigen::Ref< GpuMatrixX const > const &v) |
Set the GPU vertex velocities from the input CPU vertex velocities. | |
PBAT_API void | SetExternalAcceleration (Eigen::Ref< GpuMatrixX const > const &aext) |
Set the GPU external acceleration from the input CPU external acceleration. | |
PBAT_API void | SetMassInverse (Eigen::Ref< GpuMatrixX const > const &minv) |
Set the GPU mass inverse from the input CPU mass inverse. | |
PBAT_API void | SetLameCoefficients (Eigen::Ref< GpuMatrixX const > const &l) |
Set the GPU Lame coefficients from the input CPU Lame coefficients. | |
PBAT_API void | SetCompliance (Eigen::Ref< GpuMatrixX const > const &alpha, EConstraint eConstraint) |
Set the GPU constraint compliances from the input CPU constraint compliances. | |
PBAT_API void | SetFrictionCoefficients (GpuScalar muS, GpuScalar muK) |
Set the friction coefficients to use for contact handling. | |
PBAT_API void | SetSceneBoundingBox (Eigen::Vector< GpuScalar, 3 > const &min, Eigen::Vector< GpuScalar, 3 > const &max) |
Set the world bounding box for the current time step. | |
PBAT_API GpuMatrixX | GetVelocity () const |
Fetch the vertex velocities from the GPU. | |
PBAT_API GpuMatrixX | GetExternalAcceleration () const |
Fetch the external acceleration from the GPU. | |
PBAT_API GpuVectorX | GetMassInverse () const |
Fetch the mass inverse from the GPU. | |
PBAT_API GpuMatrixX | GetLameCoefficients () const |
Fetch the Lame coefficients from the GPU. | |
PBAT_API GpuMatrixX | GetShapeMatrixInverse () const |
Fetch the shape matrix inverses from the GPU. | |
PBAT_API GpuMatrixX | GetRestStableGamma () const |
Fetch the Stable Neo-Hookean rest-stable gamma from the GPU [12]. | |
PBAT_API GpuMatrixX | GetLagrangeMultiplier (EConstraint eConstraint) const |
Fetch the Lagrange multipliers from the GPU. | |
PBAT_API GpuMatrixX | GetCompliance (EConstraint eConstraint) const |
Fetch the compliance from the GPU. | |
Public API of the GPU XPBD integrator.
pbat::gpu::xpbd::Integrator::Integrator | ( | Data const & | data | ) |
Construct a new Integrator object from the input XPBD data.
data | Input XPBD data |
|
noexcept |
Move constructor.
other | Integrator to move from |
GpuMatrixX pbat::gpu::xpbd::Integrator::GetCompliance | ( | EConstraint | eConstraint | ) | const |
Fetch the compliance from the GPU.
eConstraint | Type of constraint |
|# constraints|
vector of compliance for the given constraint type GpuMatrixX pbat::gpu::xpbd::Integrator::GetExternalAcceleration | ( | ) | const |
Fetch the external acceleration from the GPU.
3x|# vertices|
matrix of external accelerations GpuMatrixX pbat::gpu::xpbd::Integrator::GetLagrangeMultiplier | ( | EConstraint | eConstraint | ) | const |
Fetch the Lagrange multipliers from the GPU.
eConstraint | Type of constraint |
|# constraints|
vector of Lagrange multipliers for the given constraint type GpuMatrixX pbat::gpu::xpbd::Integrator::GetLameCoefficients | ( | ) | const |
Fetch the Lame coefficients from the GPU.
2x|# elements|
vector of Lame coefficients GpuVectorX pbat::gpu::xpbd::Integrator::GetMassInverse | ( | ) | const |
Fetch the mass inverse from the GPU.
|# vertices|
vector of mass inverses GpuMatrixX pbat::gpu::xpbd::Integrator::GetRestStableGamma | ( | ) | const |
Fetch the Stable Neo-Hookean rest-stable gamma from the GPU [12].
|# elements|
vector of rest-stable gamma GpuMatrixX pbat::gpu::xpbd::Integrator::GetShapeMatrixInverse | ( | ) | const |
Fetch the shape matrix inverses from the GPU.
3x3x|# elements|
matrix of shape matrix inverses GpuMatrixX pbat::gpu::xpbd::Integrator::GetVelocity | ( | ) | const |
Fetch the vertex velocities from the GPU.
3x|# vertices|
matrix of vertex velocities
|
noexcept |
Move assignment operator.
other | Integrator to move from |
GpuMatrixX pbat::gpu::xpbd::Integrator::Positions | ( | ) | const |
Fetch the current positions from the GPU.
3x|# vertices|
matrix of vertex positions void pbat::gpu::xpbd::Integrator::SetCompliance | ( | Eigen::Ref< GpuMatrixX const > const & | alpha, |
EConstraint | eConstraint ) |
Set the GPU constraint compliances from the input CPU constraint compliances.
alpha | |# constraints| matrix of constraint compliances of type eConstraint |
eConstraint | Type of constraint |
void pbat::gpu::xpbd::Integrator::SetExternalAcceleration | ( | Eigen::Ref< GpuMatrixX const > const & | aext | ) |
Set the GPU external acceleration from the input CPU external acceleration.
aext | 3x|# vertices| matrix of external accelerations |
Set the friction coefficients to use for contact handling.
muS | Static friction coefficient |
muK | Kinetic friction coefficient |
void pbat::gpu::xpbd::Integrator::SetLameCoefficients | ( | Eigen::Ref< GpuMatrixX const > const & | l | ) |
Set the GPU Lame coefficients from the input CPU Lame coefficients.
l | 2x|# elements| vector of Lame coefficients |
void pbat::gpu::xpbd::Integrator::SetMassInverse | ( | Eigen::Ref< GpuMatrixX const > const & | minv | ) |
Set the GPU mass inverse from the input CPU mass inverse.
minv | |# vertices| vector of mass inverses |
void pbat::gpu::xpbd::Integrator::SetPositions | ( | Eigen::Ref< GpuMatrixX const > const & | X | ) |
Set the GPU vertex positions from the input CPU vertex positions.
X | 3x|# vertices| matrix of vertex positions |
void pbat::gpu::xpbd::Integrator::SetSceneBoundingBox | ( | Eigen::Vector< GpuScalar, 3 > const & | min, |
Eigen::Vector< GpuScalar, 3 > const & | max ) |
Set the world bounding box for the current time step.
min | World bounding box minimum |
max | World bounding box maximum |
void pbat::gpu::xpbd::Integrator::SetVelocities | ( | Eigen::Ref< GpuMatrixX const > const & | v | ) |
Set the GPU vertex velocities from the input CPU vertex velocities.
v | 3x|# vertices| matrix of vertex velocities |
Step once in time.
dt | Time step |
iterations | Number of solver loop iterations @params substeps Number of substeps |