63 if (P1->
getId() > P2->
getId()) {PI = P2; PJ = P1;}
64 else {PI = P1; PJ = P2;}
122 #pragma omp parallel num_threads(getNumberOfOMPThreads())
139 #pragma omp for schedule(dynamic)
152 #pragma omp for schedule(dynamic)
158 #pragma omp for schedule(dynamic)
162 if ((p->isPebble()) && (p->getPeriodicFromParticle() ==
nullptr))
164 p->getClump()->addForce(p->getForce());
165 Vec3D lever = p->getPosition()- p->getClump()->getPosition();
172 Vec3D shift = pb->getShift();
173 if (lever.
getLength() > (lever - shift).getLength()) lever -= shift;
174 if (lever.
getLength() > (lever + shift).getLength()) lever += shift;
179 Vec3D torque = p->getTorque();
181 p->getClump()->addTorque(torque);
237 if (dist2 < dist02) {
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Definition: BaseBoundary.h:49
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void addTorque(const Vec3D &addTorque)
Adds an amount to the torque on this BaseInteractable.
Definition: BaseInteractable.cc:132
virtual void resetForceTorque(int numberOfOMPthreads)
Definition: BaseInteractable.cc:141
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
void addForce(const Vec3D &addForce)
Adds an amount to the force on this BaseInteractable.
Definition: BaseInteractable.cc:116
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
Definition: BaseParticle.h:54
bool isFixed() const override
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Definition: BaseParticle.h:93
BaseInteraction * getInteractionWith(BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler) override
Checks if particle is in interaction with given particle P, and if so, returns vector of pointer to t...
Definition: BaseParticle.cc:690
bool isPebble() const
Checks if particle is a pebble (belongs to a clump)
Definition: BaseParticle.h:673
bool isClump() const
Checks if particle is a clump (container)
Definition: BaseParticle.h:664
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e....
Definition: BaseParticle.h:362
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorphism.
BaseParticle * getClump() const
Definition: BaseParticle.h:656
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:341
Basic class for walls.
Definition: BaseWall.h:49
BaseInteraction * getInteractionWith(BaseParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Returns the interaction between this wall and a given particle, nullptr if there is no interaction.
Definition: BaseWall.cc:367
Definition: ClumpParticle.h:41
std::vector< Mdouble > getPebbleRadii()
Definition: ClumpParticle.h:222
int NPebble() const
Definition: ClumpParticle.cc:115
std::vector< Vec3D > getPebblePositions()
Definition: ClumpParticle.h:211
int getNumberOfOMPThreads() const
Definition: DPMBase.cc:1286
unsigned int getNumberOfTimeSteps() const
Returns the current counter of time-steps, i.e. the number of time-steps that the simulation has unde...
Definition: DPMBase.cc:824
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1452
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1467
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
virtual void computeExternalForces(BaseParticle *)
Computes the external forces, such as gravity, acting on particles.
Definition: DPMBase.cc:3159
bool getRotation() const
Indicates whether particle rotation is enabled or disabled.
Definition: DPMBase.h:570
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
void computeInternalForces(BaseParticle *obj) override
Finds contacts with the BaseParticle; avoids multiple checks.
Definition: Mercury3D.cc:224
void computeWallForces(BaseWall *w) override
Compute contacts with a wall.
Definition: Mercury3D.cc:617
Definition: Mercury3DClump.h:39
void computeForcesDueToWalls(BaseParticle *pI, BaseWall *w) override
Definition: Mercury3DClump.h:85
void computeInternalForce(BaseParticle *P1, BaseParticle *P2) override
Definition: Mercury3DClump.h:49
bool checkClumpForInteractionPeriodic(BaseParticle &particle)
Definition: Mercury3DClump.h:210
Mercury3Dclump()
Definition: Mercury3DClump.h:41
bool checkClumpForInteraction(BaseParticle &particle)
Definition: Mercury3DClump.h:189
void computeAllForces() override
Definition: Mercury3DClump.h:119
unsigned int getNumberOfObjects() const override
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid ...
Definition: ParticleHandler.cc:1325
Defines a pair of periodic walls. Inherits from BaseBoundary.
Definition: PeriodicBoundary.h:41
virtual void shiftPosition(BaseParticle *p) const override
shifts the particle
Definition: PeriodicBoundary.cc:219
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:163
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:331
static Mdouble getDistanceSquared(const Vec3D &a, const Vec3D &b)
Calculates the squared distance between two Vec3D: .
Definition: Vector.h:311
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51