Program Listing for File TimeIntegration.h

Return to documentation for file (SPlisHSPlasH/PBF/TimeIntegration.h)

#ifndef TIMEINTEGRATION_H
#define TIMEINTEGRATION_H

#include "SPlisHSPlasH/Common.h"

// ------------------------------------------------------------------------------------
namespace SPH
{
    class TimeIntegration
    {
    public:
        static void semiImplicitEuler(
            const Real h,
            const Real mass,
            Vector3r &position,
            Vector3r &velocity,
            const Vector3r &acceleration);


        // -------------- velocity update (first order) -----------------------------------------------------
        static void velocityUpdateFirstOrder(
            const Real h,
            const Real mass,
            const Vector3r &position,               // position after constraint projection at time t+h
            const Vector3r &oldPosition,                // position before constraint projection at time t
            Vector3r &velocity);

        // -------------- velocity update (second order) -----------------------------------------------------
        static void velocityUpdateSecondOrder(
            const Real h,
            const Real mass,
            const Vector3r &position,               // position after constraint projection at time t+h
            const Vector3r &oldPosition,                // position before constraint projection at time t
            const Vector3r &positionOfLastStep,     // position of last simulation step at time t-h
            Vector3r &velocity);

    };
}

#endif