Lagrangian Liquid Simulation
Master Thesis project on simulation of liquids using Lagrangian approach and SPH
|
00001 #ifndef INTEGRATION_H 00002 #define INTEGRATION_H 00003 00004 #include "Particle.h" 00005 00007 enum IntegrationType 00008 { 00009 SEMI_IMPLICIT_EULER, 00010 LEAPFROG 00011 }; 00012 00022 00023 class Integration 00024 { 00025 public: 00029 Integration 00030 ( 00031 const IntegrationType _integrationType, 00032 const ngl::Real _timestep 00033 ); 00034 00037 void integrateNext(Particle& io_currentParticle); 00038 00040 inline IntegrationType getIntegrationType() const { return m_integrationType; } 00041 00044 inline void setIntegrationType(const IntegrationType _v) { m_integrationType = _v; } 00045 00048 inline void setIntegrationType(const int _v) { m_integrationType = (IntegrationType)_v; } 00049 00051 inline ngl::Real getTimestep() const { return m_timestep; } 00052 00055 inline void setTimestep(const ngl::Real _v) { m_timestep = _v; } 00056 00057 00058 private: 00060 IntegrationType m_integrationType; 00061 00063 ngl::Real m_timestep; 00064 00065 private: 00068 void evaluateSemiImplicitEuler(Particle& io_currentParticle); 00069 00072 void evaluateLeapfrog(Particle& io_currentParticle); 00073 00074 }; 00075 00076 #endif // INTEGRATION_H