PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
|
The VBD public API wrapper around the VBD integrator implementation. [2]. More...
#include <Integrator.h>
Public Types | |
using | EInitializationStrategy |
Initialization strategy. | |
using | Data = pbat::sim::vbd::Data |
VBD data. | |
Public Member Functions | |
PBAT_API | Integrator (Data const &data) |
Construct a new Integrator object. | |
Integrator (Integrator const &)=delete | |
Integrator & | operator= (Integrator const &)=delete |
PBAT_API | Integrator (Integrator &&other) noexcept |
Move constructor. | |
PBAT_API Integrator & | operator= (Integrator &&other) noexcept |
Move assignment operator. | |
PBAT_API | ~Integrator () |
Destructor. | |
PBAT_API void | Step (GpuScalar dt, GpuIndex iterations, GpuIndex substeps=GpuIndex{1}) |
Execute one simulation step. | |
PBAT_API void | TracedStep (GpuScalar dt, GpuIndex iterations, GpuIndex substeps, GpuIndex t, std::string_view dir=".") |
Execute one simulation step and trace the result. | |
PBAT_API void | SetPositions (Eigen::Ref< GpuMatrixX const > const &X) |
Set the vertex positions. | |
PBAT_API void | SetVelocities (Eigen::Ref< GpuMatrixX const > const &v) |
Set the vertex velocities. | |
PBAT_API void | SetExternalAcceleration (Eigen::Ref< GpuMatrixX const > const &aext) |
Set the external accelerations. | |
PBAT_API void | SetNumericalZeroForHessianDeterminant (GpuScalar zero) |
Set threshold for zero determinant check. | |
PBAT_API void | SetRayleighDampingCoefficient (GpuScalar kD) |
Set the damping coefficient for Rayleigh damping. | |
PBAT_API void | SetInitializationStrategy (EInitializationStrategy strategy) |
Sets the initialization strategy to kick-start the time step minimization. | |
PBAT_API void | SetBlockSize (GpuIndex blockSize) |
Sets the GPU thread block size, for the BDF1 minimization. | |
PBAT_API void | SetSceneBoundingBox (Eigen::Vector< GpuScalar, 3 > const &min, Eigen::Vector< GpuScalar, 3 > const &max) |
Sets the scene bounding box. | |
PBAT_API GpuMatrixX | GetPositions () const |
Get the vertex positions. | |
PBAT_API GpuMatrixX | GetVelocities () const |
Get the vertex velocities. | |
The VBD public API wrapper around the VBD integrator implementation. [2].
Initialization strategy.
pbat::gpu::vbd::Integrator::Integrator | ( | Data const & | data | ) |
Construct a new Integrator object.
data | VBD data |
|
noexcept |
Move constructor.
other | Other object |
GpuMatrixX pbat::gpu::vbd::Integrator::GetPositions | ( | ) | const |
Get the vertex positions.
|# dims|x|# vertices|
array of vertex positions GpuMatrixX pbat::gpu::vbd::Integrator::GetVelocities | ( | ) | const |
Get the vertex velocities.
|# dims|x|# vertices|
array of vertex velocities
|
noexcept |
Move assignment operator.
other | Other object |
void pbat::gpu::vbd::Integrator::SetBlockSize | ( | GpuIndex | blockSize | ) |
Sets the GPU thread block size, for the BDF1 minimization.
blockSize | # threads per block, should be a multiple of 32 |
void pbat::gpu::vbd::Integrator::SetExternalAcceleration | ( | Eigen::Ref< GpuMatrixX const > const & | aext | ) |
Set the external accelerations.
aext | 3x|# vertices| array of external accelerations |
void pbat::gpu::vbd::Integrator::SetInitializationStrategy | ( | EInitializationStrategy | strategy | ) |
Sets the initialization strategy to kick-start the time step minimization.
strategy | Initialization strategy |
void pbat::gpu::vbd::Integrator::SetNumericalZeroForHessianDeterminant | ( | GpuScalar | zero | ) |
Set threshold for zero determinant check.
zero | Numerical zero used in Hessian determinant check for approximate singularity detection |
void pbat::gpu::vbd::Integrator::SetPositions | ( | Eigen::Ref< GpuMatrixX const > const & | X | ) |
Set the vertex positions.
X | 3x|# vertices| array of vertex positions |
void pbat::gpu::vbd::Integrator::SetRayleighDampingCoefficient | ( | GpuScalar | kD | ) |
Set the damping coefficient for Rayleigh damping.
kD | Damping coefficient |
void pbat::gpu::vbd::Integrator::SetSceneBoundingBox | ( | Eigen::Vector< GpuScalar, 3 > const & | min, |
Eigen::Vector< GpuScalar, 3 > const & | max ) |
Sets the scene bounding box.
min | Minimum corner of the bounding box |
max | Maximum corner of the bounding box |
void pbat::gpu::vbd::Integrator::SetVelocities | ( | Eigen::Ref< GpuMatrixX const > const & | v | ) |
Set the vertex velocities.
v | 3x|# vertices| array of vertex velocities |
void pbat::gpu::vbd::Integrator::Step | ( | GpuScalar | dt, |
GpuIndex | iterations, | ||
GpuIndex | substeps = GpuIndex{1} ) |
Execute one simulation step.
dt | Time step |
iterations | Number of optimization iterations per substep |
substeps | Number of substeps |
void pbat::gpu::vbd::Integrator::TracedStep | ( | GpuScalar | dt, |
GpuIndex | iterations, | ||
GpuIndex | substeps, | ||
GpuIndex | t, | ||
std::string_view | dir = "." ) |
Execute one simulation step and trace the result.
{variable}.t.{timestep}.s.{substep}[.k.{iteration}].mtx
dt | Time step |
iterations | Number of optimization iterations per substep |
substeps | Number of substeps |
t | Current time step |
dir | Directory to save the matrix market files |