00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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;
00041 SPH_Space space;
00042 double dt;
00043 Pointer<Kernel> W;
00044 State_Equation state_equation;
00045 Particle::vector_t g;
00046 double nu;
00047 double boundary_width;
00048 double boundary_repulsive_force;
00049 double t;
00050 bool start_called;
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