Main Page | Class Hierarchy | Class List | File List | Class Members

SPH Class Reference

#include <sph.h>

List of all members.

Public Member Functions

 SPH (const int dimensions, const double xdim, const double ydim, const double zdim, const double h, const double velocity_of_sound, const double dt)
const SPH_Spaceget_space () const
void set_dt (const double dt)
void set_density (const double rho)
void set_viscosity (const double nu)
void set_gravity (const Particle::vector_t &g)
void set_velocity_of_sound (const double c)
void set_boundary_width (const double b)
void set_boundary_repulsive_force (const double f)
bool set_kernel (const std::string &name)
void reset ()
bool next ()
bool at_end () const
const Particleget_particle () const
void insert_particle (const Particle::vector_t &p)
void start ()
double get_time () const
double get_dt () const
double get_h () const
int get_dimensions () const
double get_boundary_width () const
double get_gravity_energy ()
double get_pressure_energy ()
double get_kinetic_energy ()
double get_max_acceleration ()
double get_density_deviation ()
void update ()
bool is_inner_point (const Particle::vector_t &p)
double get_implicit_surface (const Particle::vector_t &p)
double get_density (const Particle::vector_t &p)


Detailed Description

Smoothed Particle Hydrodynamics.

Author:
Moritz Franosch


Constructor & Destructor Documentation

SPH::SPH const int  dimensions,
const double  xdim,
const double  ydim,
const double  zdim,
const double  h,
const double  velocity_of_sound,
const double  dt
 

Constructs a SPH space.


Member Function Documentation

bool SPH::at_end  )  const
 

Last next() has returned false.

double SPH::get_boundary_width  )  const
 

Returns width of the boundary.

double SPH::get_density const Particle::vector_t &  p  ) 
 

Returns the density at position p.

Invalidates iterator through particles.

double SPH::get_density_deviation  ) 
 

Returns the deviation sqrt( <(rho_i-rho_0)^2> )/rho_0 of the densities.

int SPH::get_dimensions  )  const
 

Returns the number of dimensions.

double SPH::get_dt  )  const
 

Returns current timestep in s.

double SPH::get_gravity_energy  ) 
 

Returns current gravity energy in Joule.

double SPH::get_h  )  const
 

Returns the radius of the kernel (smoothing length) in m.

double SPH::get_implicit_surface const Particle::vector_t &  p  ) 
 

A differentiable function that returns a value >0 iff position p is inside the fluid and <0 otherwise.

double SPH::get_kinetic_energy  ) 
 

Returns current kinetic energy in Joule.

double SPH::get_max_acceleration  ) 
 

Returns the maximum acceleration of the particles in m/s^2.

const Particle & SPH::get_particle  )  const
 

Returns a reference to current particle.

double SPH::get_pressure_energy  ) 
 

Returns current pressure energy in Joule.

const SPH_Space & SPH::get_space  )  const
 

Returns a reference to the SPH_Space used.

double SPH::get_time  )  const
 

Returns current simulated time in s.

void SPH::insert_particle const Particle::vector_t &  p  ) 
 

Insert particle at postion p.

Calls reset().

Invalidates all references to particles.

bool SPH::is_inner_point const Particle::vector_t &  p  ) 
 

True iff position p is inside the fluid, i.e. iff get_implicit_surface()>0.

Invalidates iterator through particles.

bool SPH::next  ) 
 

Iterator set to next particle.

Returns false if no next particle exists.

void SPH::reset  ) 
 

Resets iterator through particles.

void SPH::set_boundary_repulsive_force const double  f  ) 
 

Sets repulsive force of the boundary.

void SPH::set_boundary_width const double  b  ) 
 

Sets width of the boundary.

void SPH::set_density const double  rho  ) 
 

Sets the initial density of the fluid.

void SPH::set_dt const double  dt  ) 
 

Sets timestep.

void SPH::set_gravity const Particle::vector_t &  g  ) 
 

Sets the gravity acceleration.

bool SPH::set_kernel const std::string &  name  ) 
 

Sets the kernel.

Returns true if successful.

void SPH::set_velocity_of_sound const double  c  ) 
 

Sets the velocity of sound.

void SPH::set_viscosity const double  nu  ) 
 

Sets the viscosity of the fluid.

void SPH::start  ) 
 

Must be called after all particles are inserted and before the first update().

void SPH::update  ) 
 

Updates positions and velocities of all particles according to SPH.


The documentation for this class was generated from the following files:
Generated on Fri Apr 22 11:06:48 2005 for partsim.kdevelop by doxygen 1.3.6