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

« back to all changes in this revision

Viewing changes to pkg/common/Grid.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:
28
28
#include <yade/core/Body.hpp>
29
29
#include <yade/pkg/common/Dispatching.hpp>
30
30
#include <yade/pkg/dem/Ig2_Sphere_Sphere_ScGeom.hpp>
 
31
#include <yade/pkg/dem/ElasticContactLaw.hpp>
31
32
#ifdef YADE_OPENGL
32
33
        #include<yade/pkg/common/GLDrawFunctors.hpp>
33
34
#endif
41
42
                virtual ~GridConnection();
42
43
                Real getLength();
43
44
                Vector3r getSegment();
44
 
        YADE_CLASS_BASE_DOC_ATTRS_CTOR(GridConnection,Sphere,"GridConnection shape. Component of a grid designed to link two :yref:`GridNodes<GridNode>`. It's highly recommanded to use utils.gridConnection(...) to generate correct :yref:`GridConnections<GridConnection>`.",
 
45
        YADE_CLASS_BASE_DOC_ATTRS_CTOR(GridConnection,Sphere,"GridConnection shape. Component of a grid designed to link two :yref:`GridNodes<GridNode>`. It's highly recommended to use utils.gridConnection(...) to generate correct :yref:`GridConnections<GridConnection>`.",
45
46
                ((shared_ptr<Body> , node1 , ,,"First :yref:`Body` the GridConnection is connected to."))
46
47
                ((shared_ptr<Body> , node2 , ,,"Second :yref:`Body` the GridConnection is connected to."))
47
48
                ((bool, periodic, false,,"true if two nodes from different periods are connected."))
57
58
        public:
58
59
                virtual ~GridNode();
59
60
                void addConnection(shared_ptr<Body> GC);
60
 
        YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(GridNode,Sphere,"GridNode shape, component of a grid.\nTo create a Grid, place the nodes first, they will define the spacial discretisation of it. It's highly recommanded to use utils.gridNode(...) to generate correct :yref:`GridNodes<GridNode>`. Note that the GridNodes should only be in an Interaction with other GridNodes. The Sphere-Grid contact is only handled by the :yref:`GridConnections<GridConnection>`.",
 
61
        YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(GridNode,Sphere,"GridNode shape, component of a grid.\nTo create a Grid, place the nodes first, they will define the spacial discretisation of it. It's highly recommended to use utils.gridNode(...) to generate correct :yref:`GridNodes<GridNode>`. Note that the GridNodes should only be in an Interaction with other GridNodes. The Sphere-Grid contact is only handled by the :yref:`GridConnections<GridConnection>`.",
61
62
                ((vector<shared_ptr<Body> >,ConnList,,,"List of :yref:`GridConnections<GridConnection>` the GridNode is connected to.")),
62
63
                /*ctor*/
63
64
                createIndex();,
103
104
};
104
105
REGISTER_SERIALIZABLE(ScGridCoGeom);
105
106
 
 
107
//!                     -|-
 
108
class GridCoGridCoGeom: public ScGeom {
 
109
        public:
 
110
                /// Emulate a sphere whose position is the projection of sphere's center on cylinder sphere, and with motion linearly interpolated between nodes
 
111
                State fictiousState1,fictiousState2;
 
112
                virtual ~GridCoGridCoGeom ();
 
113
        YADE_CLASS_BASE_DOC_ATTRS_CTOR(GridCoGridCoGeom,ScGeom,"Geometry of a :yref:`GridConnection`-:yref:`GridConnection` contact.",
 
114
                ((Real,relPos1,0,,"position of the contact on the first connection (0: node-, 1:node+) |yupdate|"))
 
115
                ((Real,relPos2,0,,"position of the contact on the first connection (0: node-, 1:node+) |yupdate|")),
 
116
                createIndex(); /*ctor*/
 
117
        );
 
118
        REGISTER_CLASS_INDEX(ScGridCoGeom,ScGeom);
 
119
};
 
120
REGISTER_SERIALIZABLE(GridCoGridCoGeom);
 
121
 
106
122
//!##################   IGeom Functors   #####################
107
123
 
108
124
//!                     O-O
120
136
};
121
137
REGISTER_SERIALIZABLE(Ig2_GridNode_GridNode_GridNodeGeom6D);
122
138
 
 
139
//!                     -/-
 
140
class Ig2_GridConnection_GridConnection_GridCoGridCoGeom: public IGeomFunctor{
 
141
        public:
 
142
                virtual bool go(const shared_ptr<Shape>& cm1, const shared_ptr<Shape>& cm2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& c);
 
143
                virtual bool goReverse( const shared_ptr<Shape>& cm1, const shared_ptr<Shape>& cm2, const State& state1, const State& state2, const Vector3r& shift2, const bool& force, const shared_ptr<Interaction>& c);
 
144
        YADE_CLASS_BASE_DOC_ATTRS(Ig2_GridConnection_GridConnection_GridCoGridCoGeom,IGeomFunctor,"Create/update a :yref:`GridCoGridCoGeom` instance representing the geometry of a contact point between two :yref:`GridConnection` , including relative rotations.",
 
145
        );
 
146
        FUNCTOR2D(GridConnection,GridConnection);
 
147
        DEFINE_FUNCTOR_ORDER_2D(GridConnection,GridConnection);
 
148
};
 
149
REGISTER_SERIALIZABLE(Ig2_GridConnection_GridConnection_GridCoGridCoGeom);
 
150
 
 
151
 
123
152
//!                     O/
124
153
class Ig2_Sphere_GridConnection_ScGridCoGeom: public IGeomFunctor{
125
154
        public:
162
191
};
163
192
REGISTER_SERIALIZABLE(Law2_ScGridCoGeom_CohFrictPhys_CundallStrack);
164
193
 
 
194
//!                     -/-
 
195
class Law2_GridCoGridCoGeom_FrictPhys_CundallStrack: public Law2_ScGeom_FrictPhys_CundallStrack{
 
196
        public:
 
197
                virtual void go(shared_ptr<IGeom>& _geom, shared_ptr<IPhys>& _phys, Interaction* I);
 
198
                YADE_CLASS_BASE_DOC_ATTRS(Law2_GridCoGridCoGeom_FrictPhys_CundallStrack,Law2_ScGeom_FrictPhys_CundallStrack,"Frictional elastic contact law between two :yref:`gridConnection` . See :yref:`Law2_ScGeom_FrictPhys_CundallStrack` for more details.",
 
199
                /*ATTRS*/
 
200
        );
 
201
        FUNCTOR2D(GridCoGridCoGeom,FrictPhys);
 
202
        DECLARE_LOGGER;
 
203
};
 
204
REGISTER_SERIALIZABLE(Law2_GridCoGridCoGeom_FrictPhys_CundallStrack);
 
205
 
165
206
 
166
207
//!##################   Bounds   #####################
167
208