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

kernel.h

00001 /***************************************************************************
00002                           kernel.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 KERNEL_H
00019 #define KERNEL_H
00020 
00021 
00022 #include "particle.h"
00023 
00024 
00031 class Kernel {
00032 
00033 protected:
00034   
00035   int d; // spacial dimension of this kernel
00036   double h; // smoothing length
00037   double c_d; // alpha_d/h^d, ensures that int W(r,r') dV = 1.
00038 
00039 public: 
00040 
00046   Kernel(const int d, const double h, const double alpha_d);
00047 
00050   virtual ~Kernel();
00051 
00054   double get_h() const;
00055 
00058   int get_d() const;
00059 
00062   double operator()(const double r) const {
00063     return c_d * w(r/h);
00064   }
00065 
00068   double dW(const double r) const;
00069 
00072   const Particle::vector_t grad_r(const Particle::vector_t& r1, 
00073                                   const Particle::vector_t& r2) const;
00074 
00079   const Particle::vector_t grad_r(const Particle::vector_t& r1, 
00080                                   const Particle::vector_t& r2,
00081                                   const double& r12) const;
00082 
00088   const Particle::vector_t& grad_r(const Particle::vector_t& r1, 
00089                                    const Particle::vector_t& r2,
00090                                    const double& r12,
00091                                    Particle::vector_t& g) const;
00092 
00097   virtual double w(const double x) const=0;
00098 
00101   virtual double dw(const double x) const=0;
00102 
00103 };
00104 
00105 
00108 double select(const int i, double x1, double x2, double x3);
00109 
00110 
00111 #endif // KERNEL_H

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