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::gpu::xpbd::Integrator Class Reference

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
 
Integratoroperator= (Integrator const &)=delete
 
PBAT_API Integrator (Integrator &&) noexcept
 Move constructor.
 
PBAT_API Integratoroperator= (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.
 

Detailed Description

Public API of the GPU XPBD integrator.

Constructor & Destructor Documentation

◆ Integrator() [1/2]

pbat::gpu::xpbd::Integrator::Integrator ( Data const & data)

Construct a new Integrator object from the input XPBD data.

Parameters
dataInput XPBD data

◆ Integrator() [2/2]

pbat::gpu::xpbd::Integrator::Integrator ( Integrator && other)
noexcept

Move constructor.

Parameters
otherIntegrator to move from

Member Function Documentation

◆ GetCompliance()

GpuMatrixX pbat::gpu::xpbd::Integrator::GetCompliance ( EConstraint eConstraint) const

Fetch the compliance from the GPU.

Parameters
eConstraintType of constraint
Returns
|# constraints| vector of compliance for the given constraint type

◆ GetExternalAcceleration()

GpuMatrixX pbat::gpu::xpbd::Integrator::GetExternalAcceleration ( ) const

Fetch the external acceleration from the GPU.

Returns
3x|# vertices| matrix of external accelerations

◆ GetLagrangeMultiplier()

GpuMatrixX pbat::gpu::xpbd::Integrator::GetLagrangeMultiplier ( EConstraint eConstraint) const

Fetch the Lagrange multipliers from the GPU.

Parameters
eConstraintType of constraint
Returns
|# constraints| vector of Lagrange multipliers for the given constraint type

◆ GetLameCoefficients()

GpuMatrixX pbat::gpu::xpbd::Integrator::GetLameCoefficients ( ) const

Fetch the Lame coefficients from the GPU.

Returns
2x|# elements| vector of Lame coefficients

◆ GetMassInverse()

GpuVectorX pbat::gpu::xpbd::Integrator::GetMassInverse ( ) const

Fetch the mass inverse from the GPU.

Returns
|# vertices| vector of mass inverses

◆ GetRestStableGamma()

GpuMatrixX pbat::gpu::xpbd::Integrator::GetRestStableGamma ( ) const

Fetch the Stable Neo-Hookean rest-stable gamma from the GPU [12].

Returns
|# elements| vector of rest-stable gamma

◆ GetShapeMatrixInverse()

GpuMatrixX pbat::gpu::xpbd::Integrator::GetShapeMatrixInverse ( ) const

Fetch the shape matrix inverses from the GPU.

Returns
3x3x|# elements| matrix of shape matrix inverses

◆ GetVelocity()

GpuMatrixX pbat::gpu::xpbd::Integrator::GetVelocity ( ) const

Fetch the vertex velocities from the GPU.

Returns
3x|# vertices| matrix of vertex velocities

◆ operator=()

Integrator & pbat::gpu::xpbd::Integrator::operator= ( Integrator && other)
noexcept

Move assignment operator.

Parameters
otherIntegrator to move from
Returns
Reference to this Integrator

◆ Positions()

GpuMatrixX pbat::gpu::xpbd::Integrator::Positions ( ) const

Fetch the current positions from the GPU.

Returns
3x|# vertices| matrix of vertex positions

◆ SetCompliance()

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.

Parameters
alpha|# constraints| matrix of constraint compliances of type eConstraint
eConstraintType of constraint

◆ SetExternalAcceleration()

void pbat::gpu::xpbd::Integrator::SetExternalAcceleration ( Eigen::Ref< GpuMatrixX const > const & aext)

Set the GPU external acceleration from the input CPU external acceleration.

Parameters
aext3x|# vertices| matrix of external accelerations

◆ SetFrictionCoefficients()

void pbat::gpu::xpbd::Integrator::SetFrictionCoefficients ( GpuScalar muS,
GpuScalar muK )

Set the friction coefficients to use for contact handling.

Parameters
muSStatic friction coefficient
muKKinetic friction coefficient

◆ SetLameCoefficients()

void pbat::gpu::xpbd::Integrator::SetLameCoefficients ( Eigen::Ref< GpuMatrixX const > const & l)

Set the GPU Lame coefficients from the input CPU Lame coefficients.

Parameters
l2x|# elements| vector of Lame coefficients

◆ SetMassInverse()

void pbat::gpu::xpbd::Integrator::SetMassInverse ( Eigen::Ref< GpuMatrixX const > const & minv)

Set the GPU mass inverse from the input CPU mass inverse.

Parameters
minv|# vertices| vector of mass inverses

◆ SetPositions()

void pbat::gpu::xpbd::Integrator::SetPositions ( Eigen::Ref< GpuMatrixX const > const & X)

Set the GPU vertex positions from the input CPU vertex positions.

Parameters
X3x|# vertices| matrix of vertex positions

◆ SetSceneBoundingBox()

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.

Parameters
minWorld bounding box minimum
maxWorld bounding box maximum

◆ SetVelocities()

void pbat::gpu::xpbd::Integrator::SetVelocities ( Eigen::Ref< GpuMatrixX const > const & v)

Set the GPU vertex velocities from the input CPU vertex velocities.

Parameters
v3x|# vertices| matrix of vertex velocities

◆ Step()

void pbat::gpu::xpbd::Integrator::Step ( GpuScalar dt,
GpuIndex iterations,
GpuIndex substeps )

Step once in time.

Parameters
dtTime step
iterationsNumber of solver loop iterations @params substeps Number of substeps

The documentation for this class was generated from the following files: