Mercury3D.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef MERCURY3D_H
6 #define MERCURY3D_H
7 
8 #include "MercuryBase.h"
9 
10 class ClusterGenerator;
11 
15 class Mercury3D : public MercuryBase
16 {
17 public:
18 
22  Mercury3D();
23 
27  explicit Mercury3D(const DPMBase& other);
28 
32  Mercury3D(const Mercury3D& other);
33 
37  void constructor();
38 
42  std::vector<BaseParticle*> hGridFindParticleContacts(const BaseParticle* obj) override;
43 
44 protected:
48  void hGridFindContactsWithinTargetCell(int x, int y, int z, unsigned int l);
49 
53  void hGridFindContactsWithTargetCell(int x, int y, int z, unsigned int l, BaseParticle* obj);
54 
58  void computeWallForces(BaseWall* w) override;
59 
60 
64  void hGridFindParticlesWithTargetCell(int x, int y, int z, unsigned int l, BaseParticle* obj,
65  std::vector<BaseParticle*>& list);
66 
70  void hGridGetInteractingParticleList(BaseParticle* obj, std::vector<BaseParticle*>& list) override;
71 
75  void computeInternalForces(BaseParticle* obj) override;
76 
80  bool hGridHasContactsInTargetCell(int x, int y, int z, unsigned int l, const BaseParticle* obj) const;
81 
85  bool hGridHasParticleContacts(const BaseParticle* obj) override;
86 
90  void hGridRemoveParticle(BaseParticle* obj) override;
91 
95  void hGridUpdateParticle(BaseParticle* obj) override;
96 
97 #ifdef CONTACT_LIST_HGRID
101  void InsertCell(int x, int y, int z, unsigned int l, BaseParticle* obj);
102 
106  void InsertObjAgainstGrid(BaseParticle* obj);
107 #endif
108 };
109 
110 #endif
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Definition: BaseParticle.h:33
Basic class for walls.
Definition: BaseWall.h:28
This class allows the user to create clusters of particles. All particles will be of LinearPlasticVis...
Definition: ClusterGenerator.h:18
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:56
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:16
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:125
void hGridUpdateParticle(BaseParticle *obj) override
Updates the cell (not the level) of a BaseParticle.
Definition: Mercury3D.cc:340
void hGridGetInteractingParticleList(BaseParticle *obj, std::vector< BaseParticle * > &list) override
Obtains all neighbour particles of a given object, obtained from the hgrid.
Definition: Mercury3D.cc:145
Mercury3D()
This is the default constructor. All it does is set sensible defaults.
Definition: Mercury3D.cc:8
std::vector< BaseParticle * > hGridFindParticleContacts(const BaseParticle *obj) override
Returns all particles that have a contact with a given particle.
Definition: Mercury3D.cc:523
bool hGridHasParticleContacts(const BaseParticle *obj) override
Tests if a BaseParticle has any contacts in the HGrid.
Definition: Mercury3D.cc:464
void computeInternalForces(BaseParticle *obj) override
Finds contacts with the BaseParticle; avoids multiple checks.
Definition: Mercury3D.cc:203
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:97
void computeWallForces(BaseWall *w) override
Compute contacts with a wall.
Definition: Mercury3D.cc:596
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:435
void constructor()
Function that sets the SystemDimension and ParticleDimension to 3.
Definition: Mercury3D.cc:38
void hGridRemoveParticle(BaseParticle *obj) override
Removes a BaseParticle from the HGrid.
Definition: Mercury3D.cc:401
void hGridFindContactsWithinTargetCell(int x, int y, int z, unsigned int l)
Finds contacts between particles in the target cell.
Definition: Mercury3D.cc:52
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:105
Scalar * y
Definition: level1_cplx_impl.h:128
list x
Definition: plotDoE.py:28