PeriDyno 1.0.0
Loading...
Searching...
No Matches
dyno::IterativeDensitySolver< TDataType > Class Template Reference

This is an implementation of the iterative density solver integrated into the Position Based Dynamics framework. More...

#include <IterativeDensitySolver.h>

Inheritance diagram for dyno::IterativeDensitySolver< TDataType >:
Collaboration diagram for dyno::IterativeDensitySolver< TDataType >:

Public Types

typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
- Public Types inherited from dyno::ParticleApproximation< TDataType >
typedef TDataType::Real Real
 
- Public Types inherited from dyno::OBase
typedef std::vector< FBase * > FieldVector
 
typedef std::map< FieldID, FBase * > FieldMap
 

Public Member Functions

 IterativeDensitySolver ()
 
 ~IterativeDensitySolver () override
 
 DEF_VAR_IN (Real, TimeStep, "Time Step")
 
 DEF_ARRAY_IN (Coord, Position, DeviceType::GPU, "Input particle position")
 Particle positions.
 
 DEF_ARRAY_IN (Coord, Velocity, DeviceType::GPU, "Input particle velocity")
 Particle velocities.
 
 DEF_ARRAY_IN (Attribute, Attribute, DeviceType::GPU, "Particle attribute")
 Attribute Particle attribute.
 
 DEF_ARRAYLIST_IN (int, NeighborIds, DeviceType::GPU, "Neighboring particles' ids")
 Neighboring particles' ids.
 
 DEF_ARRAY_OUT (Real, Density, DeviceType::GPU, "Final particle density")
 Final particle densities.
 
 DEF_VAR (int, IterationNumber, 5, "Iteration number of the PBD solver")
 
 DEF_VAR (Real, RestDensity, 1000, "Reference density")
 
 DEF_VAR (Real, Kappa, Real(1), "")
 
void takeOneIteration ()
 
void updateVelocity ()
 
- Public Member Functions inherited from dyno::ParticleApproximation< TDataType >
 ParticleApproximation ()
 
virtual ~ParticleApproximation ()
 
 DECLARE_ENUM (EKernelType, KT_Smooth=0, KT_Spiky=1)
 
void compute () override
 
 DEF_VAR_IN (Real, SmoothingLength, "Smoothing Length")
 
 DEF_VAR_IN (Real, SamplingDistance, "Particle sampling distance")
 
 DEF_ENUM (EKernelType, KernelType, EKernelType::KT_Spiky, "Rendering mode")
 
- Public Member Functions inherited from dyno::ComputeModule
 ComputeModule ()
 
 ~ComputeModule () override
 
std::string getModuleType () override
 
- Public Member Functions inherited from dyno::Module
 Module (std::string name="default")
 
 ~Module (void) override
 
bool initialize ()
 
void update ()
 
void setName (std::string name)
 
std::string getName () override
 
virtual void setParentNode (Node *node)
 Set the parent node.
 
NodegetParentNode ()
 
SceneGraphgetSceneGraph ()
 
bool isInitialized ()
 
bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true) override
 Attach a field to Base.
 
bool isInputComplete ()
 Check the completeness of input fields.
 
bool isOutputCompete ()
 
 DEF_VAR (bool, ForceUpdate, false, "")
 
void setUpdateAlways (bool b)
 Set the update strategy for the module.
 
- Public Member Functions inherited from dyno::OBase
 OBase ()
 
 ~OBase () override
 
virtual std::string caption ()
 Return the caption.
 
virtual bool captionVisible ()
 Whether to hide the caption in the GUI.
 
virtual std::string description ()
 Return a description for the node or module, override this function to support user-defined description.
 
bool addField (FBase *data)
 Add a field to Base FieldID will be set to the name of Field by default.
 
bool addField (FieldID name, FBase *data)
 Add a field to Base.
 
bool addFieldAlias (FieldID name, FBase *data)
 
bool addFieldAlias (FieldID name, FBase *data, FieldMap &fieldAlias)
 
bool findField (FBase *data)
 Find a field by its pointer.
 
bool findFieldAlias (const FieldID name)
 Find a field by its name.
 
bool findFieldAlias (const FieldID name, FieldMap &fieldAlias)
 Find a field in fieldAlias by its name This function is typically called by other functions.
 
bool removeField (FBase *data)
 Remove a field by its pointer.
 
bool removeFieldAlias (const FieldID name)
 Remove a field by its name.
 
bool removeFieldAlias (const FieldID name, FieldMap &fieldAlias)
 
FBasegetField (const FieldID name)
 Return a field by its name.
 
std::vector< FBase * > & getAllFields ()
 
template<typename T>
TgetField (FieldID name)
 
bool isAllFieldsReady ()
 Check the completeness of all required fields.
 
std::vector< FieldIDgetFieldAlias (FBase *data)
 
int getFieldAliasCount (FBase *data)
 
void setBlockCoord (float x, float y)
 
float bx ()
 
float by ()
 
bool findInputField (FBase *field)
 
bool addInputField (FBase *field)
 
bool removeInputField (FBase *field)
 
std::vector< FBase * > & getInputFields ()
 
bool findOutputField (FBase *field)
 
bool addOutputField (FBase *field)
 
bool addToOutput (FBase *field)
 
bool removeOutputField (FBase *field)
 
bool removeFromOutput (FBase *field)
 
std::vector< FBase * > & getOutputFields ()
 
bool findParameter (FBase *field)
 
bool addParameter (FBase *field)
 
bool removeParameter (FBase *field)
 
std::vector< FBase * > & getParameters ()
 
- Public Member Functions inherited from dyno::Object
 Object ()
 
virtual ~Object ()
 
ObjectId objectId ()
 

Protected Member Functions

void compute () override
 
- Protected Member Functions inherited from dyno::Module
virtual bool initializeImpl ()
 
virtual void preprocess ()
 
virtual void postprocess ()
 
virtual bool validateInputs ()
 
virtual bool validateOutputs ()
 
virtual bool requireUpdate ()
 
virtual void updateStarted ()
 Two functions called at the beginning and end of update() used for debug.
 
virtual void updateEnded ()
 

Private Attributes

DArray< RealmLamda
 
DArray< CoordmDeltaPos
 
DArray< CoordmPositionOld
 
Arithmetic< Real > * m_arithmetic
 
std::shared_ptr< SummationDensity< TDataType > > mSummation
 

Additional Inherited Members

- Static Public Member Functions inherited from dyno::Object
static bool registerClass (ClassInfo *ci)
 
static ObjectcreateObject (std::string name)
 
static std::map< std::string, ClassInfo * > * getClassMap ()
 
static ObjectId baseId ()
 Base Id.
 
- Protected Attributes inherited from dyno::ParticleApproximation< TDataType >
Real mScalingFactor = Real(1)
 
- Protected Attributes inherited from dyno::OBase
std::vector< FBase * > fields_input
 
std::vector< FBase * > fields_output
 
std::vector< FBase * > fields_param
 

Detailed Description

template<typename TDataType>
class dyno::IterativeDensitySolver< TDataType >

This is an implementation of the iterative density solver integrated into the Position Based Dynamics framework.

For details, refer to "Position Based Fluids" by Macklin and MĄ§uller, ACM TOG, 2013

Definition at line 33 of file IterativeDensitySolver.h.

Member Typedef Documentation

◆ Coord

template<typename TDataType>
typedef TDataType::Coord dyno::IterativeDensitySolver< TDataType >::Coord

Definition at line 38 of file IterativeDensitySolver.h.

◆ Real

template<typename TDataType>
typedef TDataType::Real dyno::IterativeDensitySolver< TDataType >::Real

Definition at line 37 of file IterativeDensitySolver.h.

Constructor & Destructor Documentation

◆ IterativeDensitySolver()

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::IterativeDensitySolver ( )

◆ ~IterativeDensitySolver()

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::~IterativeDensitySolver ( )
override

Member Function Documentation

◆ compute()

template<typename TDataType>
void dyno::IterativeDensitySolver< TDataType >::compute ( )
overrideprotectedvirtual

Implements dyno::ComputeModule.

◆ DEF_ARRAY_IN() [1/3]

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_ARRAY_IN ( Attribute ,
Attribute ,
DeviceType::GPU ,
"Particle attribute"  )

Attribute Particle attribute.

◆ DEF_ARRAY_IN() [2/3]

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_ARRAY_IN ( Coord ,
Position ,
DeviceType::GPU ,
"Input particle position"  )

Particle positions.

◆ DEF_ARRAY_IN() [3/3]

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_ARRAY_IN ( Coord ,
Velocity ,
DeviceType::GPU ,
"Input particle velocity"  )

Particle velocities.

◆ DEF_ARRAY_OUT()

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_ARRAY_OUT ( Real ,
Density ,
DeviceType::GPU ,
"Final particle density"  )

Final particle densities.

◆ DEF_ARRAYLIST_IN()

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_ARRAYLIST_IN ( int ,
NeighborIds ,
DeviceType::GPU ,
"Neighboring particles' ids"  )

Neighboring particles' ids.

◆ DEF_VAR() [1/3]

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_VAR ( int ,
IterationNumber ,
5 ,
"Iteration number of the PBD solver"  )

◆ DEF_VAR() [2/3]

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_VAR ( Real ,
Kappa ,
Real(1) ,
""  )

◆ DEF_VAR() [3/3]

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_VAR ( Real ,
RestDensity ,
1000 ,
"Reference density"  )

◆ DEF_VAR_IN()

template<typename TDataType>
dyno::IterativeDensitySolver< TDataType >::DEF_VAR_IN ( Real ,
TimeStep ,
"Time Step"  )

◆ takeOneIteration()

template<typename TDataType>
void dyno::IterativeDensitySolver< TDataType >::takeOneIteration ( )

◆ updateVelocity()

template<typename TDataType>
void dyno::IterativeDensitySolver< TDataType >::updateVelocity ( )

Member Data Documentation

◆ m_arithmetic

template<typename TDataType>
Arithmetic<Real>* dyno::IterativeDensitySolver< TDataType >::m_arithmetic
private

Definition at line 94 of file IterativeDensitySolver.h.

◆ mDeltaPos

template<typename TDataType>
DArray<Coord> dyno::IterativeDensitySolver< TDataType >::mDeltaPos
private

Definition at line 90 of file IterativeDensitySolver.h.

◆ mLamda

template<typename TDataType>
DArray<Real> dyno::IterativeDensitySolver< TDataType >::mLamda
private

Definition at line 89 of file IterativeDensitySolver.h.

◆ mPositionOld

template<typename TDataType>
DArray<Coord> dyno::IterativeDensitySolver< TDataType >::mPositionOld
private

Definition at line 91 of file IterativeDensitySolver.h.

◆ mSummation

template<typename TDataType>
std::shared_ptr<SummationDensity<TDataType> > dyno::IterativeDensitySolver< TDataType >::mSummation
private

Definition at line 98 of file IterativeDensitySolver.h.


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