Class TimeStepPF

Inheritance Relationships

Base Type

Class Documentation

class TimeStepPF : public SPH::TimeStep

This class implements the Projective Fluids approach introduced by Weiler, Koschier and Bender [WKB16].

References:

  • [WKB16] Marcel Weiler, Dan Koschier, and Jan Bender. Projective fluids. In Proceedings of the 9th International Conference on Motion in Games, MIG ‘16, 79-84. New York, NY, USA, 2016. ACM. URL: http://doi.acm.org/10.1145/2994258.2994282

Public Functions

TimeStepPF()
virtual ~TimeStepPF(void)
virtual void step() override
virtual void reset() override
virtual void resize() override
inline virtual std::string getMethodName()

returns the name of the method

inline virtual int getNumIterations()

Public Static Functions

static void matrixVecProd(const Real *vec, Real *result, void *userData)

Public Static Attributes

static std::string METHOD_NAME = "Projective Fluids"
static int SOLVER_ITERATIONS = -1
static int MIN_ITERATIONS = -1
static int MAX_ITERATIONS = -1
static int MAX_ERROR = -1
static int STIFFNESS = -1

Protected Types

using VectorXr = Eigen::Matrix<Real, -1, 1>
using VectorXrMap = Eigen::Map<VectorXr>
using Solver = Eigen::ConjugateGradient<MatrixReplacement, Eigen::Lower | Eigen::Upper, JacobiPreconditioner3D>

Protected Functions

void preparePreconditioner()
void initialGuessForPositions(const unsigned int fluidModelIndex)
void solvePDConstraints()
void updatePositionsAndVelocity(const VectorXr &x)
void addAccellerationToVelocity()
void matrixFreeRHS(const VectorXr &x, VectorXr &result)

compute the right hand side of the system in a matrix-free fashion and store the result in result

virtual void performNeighborhoodSearchSort()

Important: First call m_model->performNeighborhoodSearchSort() to call the z_sort of the neighborhood search.

virtual void emittedParticles(FluidModel *model, const unsigned int startIndex) override
virtual void initParameters() override

Protected Attributes

SimulationDataPF m_simulationData
Solver m_solver
unsigned int m_iterations
Real m_maxError
unsigned int m_minIterations
unsigned int m_maxIterations
Real m_stiffness
unsigned int m_numActiveParticlesTotal

Protected Static Functions

static FORCE_INLINE void diagonalMatrixElement (const unsigned int row, Vector3r &result, void *userData)