MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Mercury3D.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef MERCURY3D_H
27 #define MERCURY3D_H
28 
29 #include "MercuryBase.h"
30 
31 class ClusterGenerator;
32 
36 class Mercury3D : public MercuryBase
37 {
38 public:
39 
43  Mercury3D();
44 
48  explicit Mercury3D(const DPMBase& other);
49 
53  Mercury3D(const Mercury3D& other);
54 
58  void constructor();
59 
63  std::vector<BaseParticle*> hGridFindParticleContacts(const BaseParticle* obj) override;
64 
65 protected:
69  void hGridFindContactsWithinTargetCell(int x, int y, int z, unsigned int l);
70 
74  void hGridFindContactsWithTargetCell(int x, int y, int z, unsigned int l, BaseParticle* obj);
75 
79  void computeWallForces(BaseWall* w) override;
80 
84  void hGridFindParticlesWithTargetCell(int x, int y, int z, unsigned int l, BaseParticle* obj,
85  std::vector<BaseParticle*>& list);
86 
90  void hGridGetInteractingParticleList(BaseParticle* obj, std::vector<BaseParticle*>& list) override;
91 
95  void computeInternalForces(BaseParticle* obj) override;
96 
100  bool hGridHasContactsInTargetCell(int x, int y, int z, unsigned int l, const BaseParticle* obj) const;
101 
105  bool hGridHasParticleContacts(const BaseParticle* obj) override;
106 
110  void hGridRemoveParticle(BaseParticle* obj) override;
111 
115  void hGridUpdateParticle(BaseParticle* obj) override;
116 
117 #ifdef CONTACT_LIST_HGRID
118 
121  void InsertCell(int x, int y, int z, unsigned int l, BaseParticle* obj);
122 
126  void InsertObjAgainstGrid(BaseParticle* obj);
127 #endif
128 };
129 
130 #endif
void computeWallForces(BaseWall *w) override
Compute contacts with a wall.
Definition: Mercury3D.cc:615
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:72
void hGridRemoveParticle(BaseParticle *obj) override
Removes a BaseParticle from the HGrid.
Definition: Mercury3D.cc:422
void hGridFindContactsWithinTargetCell(int x, int y, int z, unsigned int l)
Finds contacts between particles in the target cell.
Definition: Mercury3D.cc:73
void constructor()
Function that sets the SystemDimension and ParticleDimension to 3.
Definition: Mercury3D.cc:59
bool hGridHasContactsInTargetCell(int x, int y, int z, unsigned int l, const BaseParticle *obj) const
Tests if the BaseParticle has contacts with other Particles in the target cell.
Definition: Mercury3D.cc:456
void computeInternalForces(BaseParticle *obj) override
Finds contacts with the BaseParticle; avoids multiple checks.
Definition: Mercury3D.cc:224
void hGridUpdateParticle(BaseParticle *obj) override
Updates the cell (not the level) of a BaseParticle.
Definition: Mercury3D.cc:361
std::vector< BaseParticle * > hGridFindParticleContacts(const BaseParticle *obj) override
Returns all particles that have a contact with a given particle.
Definition: Mercury3D.cc:544
void hGridGetInteractingParticleList(BaseParticle *obj, std::vector< BaseParticle * > &list) override
Obtains all neighbour particles of a given object, obtained from the hgrid.
Definition: Mercury3D.cc:166
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:125
Mercury3D()
This is the default constructor. All it does is set sensible defaults.
Definition: Mercury3D.cc:29
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:36
bool hGridHasParticleContacts(const BaseParticle *obj) override
Tests if a BaseParticle has any contacts in the HGrid.
Definition: Mercury3D.cc:485
Basic class for walls.
Definition: BaseWall.h:47
void hGridFindContactsWithTargetCell(int x, int y, int z, unsigned int l, BaseParticle *obj)
Finds contacts between the BaseParticle and the target cell.
Definition: Mercury3D.cc:118
void hGridFindParticlesWithTargetCell(int x, int y, int z, unsigned int l, BaseParticle *obj, std::vector< BaseParticle * > &list)
Finds particles within target cell and stores them in a list.
Definition: Mercury3D.cc:146
This class allows the user to create clusters of particles. All particles will be of LinearPlasticVis...