~ubuntu-branches/debian/jessie/yade/jessie

« back to all changes in this revision

Viewing changes to pkg/common/SPHEngine.hpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-10-20 21:31:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20141020213137-wt0doalgtw493ohd
Tags: 1.12.0-1
* [3bba065] Imported Upstream version 1.12.0. (Closes: #763259)
* [1ac4c00] Remove patch applied by upstream.
* [0b5f802] Set Standards-Version: 3.9.6. No changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifdef YADE_SPH
2
2
#pragma once
3
3
 
4
 
#include<yade/core/PartialEngine.hpp>
5
 
#include<yade/pkg/dem/ScGeom.hpp>
 
4
#include<core/PartialEngine.hpp>
 
5
#include<pkg/dem/ScGeom.hpp>
6
6
 
7
7
typedef Real (* KernelFunction)(const double & r, const double & h);
8
8
 
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.");
11
11
 
12
12
enum typeKernFunctions {Norm, Grad, Lapl};
13
13
class SPHEngine: public PartialEngine{
14
14
  public:
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."))
23
23
  );
24
24
};
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);
41
29
 
42
30
KernelFunction returnKernelFunction(const int a, const int b, const typeKernFunctions typeF);
 
31
KernelFunction returnKernelFunction(const int a, const typeKernFunctions typeF);
43
32
 
44
33
bool computeForceSPH(shared_ptr<IGeom>& _geom, shared_ptr<IPhys>& _phys, Interaction* I, Vector3r & force);
45
34
#endif