~ubuntu-branches/ubuntu/trusty/yade/trusty

« back to all changes in this revision

Viewing changes to pkg/dem/BubbleMat.hpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky, cf3f8d9
  • Date: 2013-10-30 20:56:33 UTC
  • mfrom: (20.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20131030205633-1f01r7hjce17d723
Tags: 1.05.0-2
[cf3f8d9] Pass -ftrack-macro-expansion=0 only if gcc>=4.8. (Closes: #726009)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
 
 
3
#include<yade/core/Material.hpp>
 
4
#include<yade/core/IPhys.hpp>
 
5
#include<yade/pkg/dem/ScGeom.hpp>
 
6
#include<yade/pkg/common/Dispatching.hpp>
 
7
 
 
8
namespace py=boost::python;
 
9
 
 
10
 
 
11
/********************** BubbleMat ****************************/
 
12
class BubbleMat : public Material {
 
13
        public:
 
14
        YADE_CLASS_BASE_DOC_ATTRS_CTOR(BubbleMat,Material,"material for bubble interactions, for use with other Bubble classes",
 
15
                ((Real,surfaceTension,0.07197,,"The surface tension in the fluid surrounding the bubbles. The default value is that of water at 25 degrees Celcius."))
 
16
                ,
 
17
                createIndex();
 
18
                density=1; // TODO density default value
 
19
        );
 
20
        REGISTER_CLASS_INDEX(BubbleMat,Material);
 
21
};
 
22
REGISTER_SERIALIZABLE(BubbleMat);
 
23
 
 
24
 
 
25
/********************** BubblePhys ****************************/
 
26
class BubblePhys : public IPhys {
 
27
        public:
 
28
 
 
29
        static Real computeForce(Real penetrationDepth, Real surfaceTension, Real rAvg, int newtonIter, Real newtonTol);
 
30
 
 
31
        virtual ~BubblePhys(){};
 
32
        YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(BubblePhys,IPhys,"Physics of bubble-bubble interactions, for use with BubbleMat",
 
33
                ((Vector3r,normalForce,Vector3r::Zero(),,"Normal force"))
 
34
                ((Real,surfaceTension,NaN,,"Surface tension of the surrounding liquid"))
 
35
                ((Real,fN,NaN,,"Contact normal force"))
 
36
                ((Real,rAvg,NaN,,"Average radius of the two interacting bubbles"))
 
37
                ((Real,newtonIter,50,,"Maximum number of force iterations allowed"))
 
38
                ((Real,newtonTol,1e-6,,"Convergence criteria for force iterations"))
 
39
                ,
 
40
                createIndex();
 
41
                ,
 
42
                .def("computeForce",&BubblePhys::computeForce,"Computes the normal force acting between the two interacting bubbles using the Newton-Rhapson method")
 
43
                .staticmethod("computeForce")
 
44
        );
 
45
        DECLARE_LOGGER;
 
46
        REGISTER_CLASS_INDEX(BubblePhys,IPhys);
 
47
};
 
48
REGISTER_SERIALIZABLE(BubblePhys);
 
49
 
 
50
 
 
51
 
 
52
/********************** Ip2_BubbleMat_BubbleMat_BubblePhys ****************************/
 
53
class Ip2_BubbleMat_BubbleMat_BubblePhys : public IPhysFunctor{
 
54
        public:
 
55
        virtual void go(const shared_ptr<Material>& m1, const shared_ptr<Material>& m2, const shared_ptr<Interaction>& interaction);
 
56
        FUNCTOR2D(BubbleMat,BubbleMat);
 
57
        DECLARE_LOGGER;
 
58
        YADE_CLASS_BASE_DOC_ATTRS(Ip2_BubbleMat_BubbleMat_BubblePhys,IPhysFunctor,"Generates bubble interactions.Used in the contact law Law2_ScGeom_BubblePhys_Bubble.",
 
59
        );
 
60
};
 
61
REGISTER_SERIALIZABLE(Ip2_BubbleMat_BubbleMat_BubblePhys);
 
62
 
 
63
 
 
64
/********************** Law2_ScGeom_BubblePhys_Bubble ****************************/
 
65
class Law2_ScGeom_BubblePhys_Bubble : public LawFunctor{
 
66
        public:
 
67
        void go(shared_ptr<IGeom>& _geom, shared_ptr<IPhys>& _phys, Interaction* interaction);
 
68
        FUNCTOR2D(GenericSpheresContact,BubblePhys);
 
69
        YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(Law2_ScGeom_BubblePhys_Bubble,LawFunctor,"Constitutive law for Bubble model.",
 
70
                ,
 
71
                /*ctor*/,
 
72
        );
 
73
        DECLARE_LOGGER;
 
74
};
 
75
REGISTER_SERIALIZABLE(Law2_ScGeom_BubblePhys_Bubble);