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

Kernel Class Reference

#include <kernel.h>

Inheritance diagram for Kernel:

Cusp_Kernel Lucy_Kernel Poly5_Kernel List of all members.

Public Member Functions

 Kernel (const int d, const double h, const double alpha_d)
virtual ~Kernel ()
double get_h () const
int get_d () const
double operator() (const double r) const
double dW (const double r) const
const Particle::vector_t grad_r (const Particle::vector_t &r1, const Particle::vector_t &r2) const
const Particle::vector_t grad_r (const Particle::vector_t &r1, const Particle::vector_t &r2, const double &r12) const
const Particle::vector_t & grad_r (const Particle::vector_t &r1, const Particle::vector_t &r2, const double &r12, Particle::vector_t &g) const
virtual double w (const double x) const=0
virtual double dw (const double x) const=0

Protected Attributes

int d
double h
double c_d

Detailed Description

Smoothing kernel for SPH.

Base class for all kernels.

Author:
Moritz Franosch


Constructor & Destructor Documentation

Kernel::Kernel const int  d,
const double  h,
const double  alpha_d
 

Constructs a kernel for a dimension d and smoothing length h.

The parameter alpha_d is a scaling factor dependent on the dimension.

Kernel::~Kernel  )  [virtual]
 

Virtual destructor.


Member Function Documentation

virtual double Kernel::dw const double  x  )  const [pure virtual]
 

Returns the derivative dw(x)/dx of the form function w.

Implemented in Cusp_Kernel, Lucy_Kernel, and Poly5_Kernel.

double Kernel::dW const double  r  )  const
 

Returns dW(r)/dr.

int Kernel::get_d  )  const
 

Returns the dimension of the kernel.

double Kernel::get_h  )  const
 

Returns the smoothing length (radius) of the kernel.

const Particle::vector_t & Kernel::grad_r const Particle::vector_t &  r1,
const Particle::vector_t &  r2,
const double &  r12,
Particle::vector_t &  g
const
 

Writes grad r1 W(|r1-r2|) into vector g and returns a reference to it.

Precondition: r12=|r1-r2|.

const Particle::vector_t Kernel::grad_r const Particle::vector_t &  r1,
const Particle::vector_t &  r2,
const double &  r12
const
 

Returns grad r1 W(|r1-r2|).

Precondition: r12=|r1-r2|.

const Particle::vector_t Kernel::grad_r const Particle::vector_t &  r1,
const Particle::vector_t &  r2
const
 

Returns grad r1 W(|r1-r2|).

double Kernel::operator() const double  r  )  const [inline]
 

Returns W(r) = alpha_d/h^d * w(r/h).

virtual double Kernel::w const double  x  )  const [pure virtual]
 

Returns the form function w(x).

The precondition int alpha_d w(|r|) dV = 1 must hold.

Implemented in Cusp_Kernel, Lucy_Kernel, and Poly5_Kernel.


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