4
#include<yade/core/PartialEngine.hpp>
5
#include<yade/pkg/dem/ScGeom.hpp>
4
#include<core/PartialEngine.hpp>
5
#include<pkg/dem/ScGeom.hpp>
7
7
typedef Real (* KernelFunction)(const double & r, const double & h);
9
enum KernFunctions {Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5};
9
enum KernFunctions {Lucy=1};
10
10
#define KERNELFUNCDESCR throw runtime_error("Type of kernel function undefined! The following kernel functions are available: Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5.");
12
12
enum typeKernFunctions {Norm, Grad, Lapl};
13
13
class SPHEngine: public PartialEngine{
15
15
void calculateSPHRho(const shared_ptr<Body>& b);
16
void calculateSPHCs (const shared_ptr<Body>& b);
17
16
virtual void action();
18
17
YADE_CLASS_BASE_DOC_ATTRS(SPHEngine,PartialEngine,"Apply given torque (momentum) value at every subscribed particle, at every step. ",
19
18
((int, mask,-1,, "Bitmask for SPH-particles."))
20
19
((Real,k,-1,, "Gas constant for SPH-interactions (only for SPH-model). See Mueller [Mueller2003]_ .")) // [Mueller2003], (11)
21
20
((Real,rho0,-1,, "Rest density. See Mueller [Mueller2003]_ .")) // [Mueller2003], (1)
22
((int,KernFunctionDensity, Poly6,, "Kernel function for density calculation (by default - Poly6). The following kernel functions are available: Poly6=1, Spiky=2, Visco=3, Lucy=4, Monaghan=5."))
21
((Real,h,-1,, "Core radius. See Mueller [Mueller2003]_ .")) // [Mueller2003], (1)
22
((int,KernFunctionDensity, Lucy,, "Kernel function for density calculation (by default - Lucy). The following kernel functions are available: Lucy=1."))
25
25
REGISTER_SERIALIZABLE(SPHEngine);
26
Real smoothkernelPoly6(const double & r, const double & h); // [Mueller2003] (20)
27
Real smoothkernelPoly6Grad(const double & r, const double & h);
28
Real smoothkernelPoly6Lapl(const double & r, const double & h);
29
Real smoothkernelSpiky(const double & r, const double & h); // [Mueller2003] (21)
30
Real smoothkernelSpikyGrad(const double & r, const double & h);
31
Real smoothkernelSpikyLapl(const double & r, const double & h);
32
Real smoothkernelVisco(const double & r, const double & h); // [Mueller2003] (22)
33
Real smoothkernelViscoGrad(const double & r, const double & h); // [Mueller2003] (22)
34
Real smoothkernelViscoLapl(const double & r, const double & h);
35
26
Real smoothkernelLucy(const double & r, const double & h);
36
27
Real smoothkernelLucyGrad(const double & r, const double & h);
37
28
Real smoothkernelLucyLapl(const double & r, const double & h);
38
Real smoothkernelMonaghan(const double & r, const double & h);
39
Real smoothkernelMonaghanGrad(const double & r, const double & h);
40
Real smoothkernelMonaghanLapl(const double & r, const double & h);
42
30
KernelFunction returnKernelFunction(const int a, const int b, const typeKernFunctions typeF);
31
KernelFunction returnKernelFunction(const int a, const typeKernFunctions typeF);
44
33
bool computeForceSPH(shared_ptr<IGeom>& _geom, shared_ptr<IPhys>& _phys, Interaction* I, Vector3r & force);