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

sph.h

00001 /***************************************************************************
00002                           sph.h  -  description
00003                              -------------------
00004     begin                : Sat Jan 11 2003
00005     copyright            : (C) 2003 by Moritz Franosch
00006     email                : mail@Franosch.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef SPH_H
00019 #define SPH_H
00020 
00021 
00022 #include <ostream>
00023 
00024 #include "askosdata/pointer.h"
00025 
00026 #include "sph_space.h"
00027 #include "particle.h"
00028 #include "kernel.h"
00029 #include "state_equation.h"
00030 
00031 
00036 class SPH {
00037 
00038 private:
00039 
00040   int dimensions; // number of dimensions
00041   SPH_Space space; // particle space
00042   double dt; // timestep
00043   Pointer<Kernel> W; // kernel
00044   State_Equation state_equation; // equation of state
00045   Particle::vector_t g; // gravity acceleration
00046   double nu; // viscosity
00047   double boundary_width; // width of repulsive boundary
00048   double boundary_repulsive_force; // constant for repulsive force near boundary
00049   double t; // simulated time
00050   bool start_called; // true if start() has been called, false otherwise
00051 
00052 public:
00053 
00056   SPH(const int dimensions,
00057       const double xdim, const double ydim, const double zdim, 
00058       const double h, 
00059       const double velocity_of_sound,
00060       const double dt);
00061 
00064   const SPH_Space& get_space() const;
00065 
00068   void set_dt(const double dt);
00069 
00072   void set_density(const double rho);
00073 
00076   void set_viscosity(const double nu);
00077 
00080   void set_gravity(const Particle::vector_t& g);
00081 
00084   void set_velocity_of_sound(const double c);
00085 
00088   void set_boundary_width(const double b);
00089 
00092   void set_boundary_repulsive_force(const double f);
00093 
00098   bool set_kernel(const std::string& name);
00099 
00102   void reset();
00103 
00108   bool next();
00109 
00112   bool at_end() const;
00113 
00116   const Particle& get_particle() const;
00117 
00124   void insert_particle(const Particle::vector_t& p);
00125 
00129   void start();
00130 
00133   double get_time() const;
00134 
00137   double get_dt() const;
00138 
00141   double get_h() const;
00142 
00145   int get_dimensions() const;
00146 
00149   double get_boundary_width() const;
00150 
00153   double get_gravity_energy();
00154 
00157   double get_pressure_energy();
00158 
00161   double get_kinetic_energy();
00162 
00165   double get_max_acceleration();
00166 
00169   double get_density_deviation();
00170 
00174   void update();
00175 
00181   bool is_inner_point(const Particle::vector_t& p);
00182 
00186   double get_implicit_surface(const Particle::vector_t& p);
00187 
00192   double get_density(const Particle::vector_t& p);
00193 
00194 };
00195 
00196 
00197 std::ostream& operator<<(std::ostream& o, SPH& sph);
00198 
00199 
00200 #endif // SPH_H

Generated on Fri Apr 22 11:06:42 2005 for partsim.kdevelop by doxygen 1.3.6