26 #ifndef BASEINTERACTION_H
27 #define BASEINTERACTION_H
95 void read(std::istream& is)
override;
100 void write(std::ostream& os)
const override;
110 std::string
getName()
const override;
276 logger.assert_debug(
P_ !=
nullptr,
"First particle in interaction % is nullptr",
getId());
287 logger.assert_debug(
I_ !=
nullptr,
"Second particle in interaction % is nullptr",
getId());
299 logger.assert_debug(
P_ !=
nullptr,
"First particle in interaction % is nullptr",
getId());
310 logger.assert_debug(
I_ !=
nullptr,
"Second particle in interaction % is nullptr",
getId());
380 virtual std::vector<Mdouble>
getFieldVTK(
unsigned i)
const;
464 virtual void getMPIInteraction(
void* historyDataArray,
unsigned int index)
const;
467 virtual void getInteractionDetails(
void* interactionDataArray,
unsigned int index,
unsigned int& identificationP,
472 virtual void setMPIInteraction(
void* interactionDataArray,
unsigned int index,
bool resetPointers);
double Mdouble
Definition: GeneralDefine.h:34
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:55
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
unsigned int identificationP_
Definition: BaseInteraction.h:515
void setBasicMPIInteractionValues(int P, int I, unsigned timeStamp, Vec3D force, Vec3D torque, bool isWallInteraction, bool resetPointers)
Definition: BaseInteraction.cc:961
void read(std::istream &is) override
Interaction read function, which accepts an std::istream as input.
Definition: BaseInteraction.cc:188
const Vec3D & getForce() const
Gets the current force (vector) between the two interacting objects.
Definition: BaseInteraction.h:210
void copySwitchPointer(const BaseInteractable *original, BaseInteractable *ghost) const
This copies the interactions of the original particle and replaces the original with the ghost copy.
Definition: BaseInteraction.cc:341
~BaseInteraction() override
The destructor. It removes this interactions from the objects that were interacting,...
Definition: BaseInteraction.cc:125
const Vec3D & getTorque() const
Gets the current torque (vector) between the two interacting objects.
Definition: BaseInteraction.h:218
virtual void createMPIType()
Definition: BaseInteraction.cc:899
unsigned int getMultiContactIdentifier() const
Definition: BaseInteraction.cc:763
const BaseSpecies * species_
Definition: BaseInteraction.h:573
void writeInteraction(std::ostream &os, bool created) const
Writes information about a interaction to the interaction file.
Definition: BaseInteraction.cc:729
void importI(BaseInteractable *I)
Sets the second object involved in the interaction (often particle or wall).
Definition: BaseInteraction.cc:451
void setHandler(InteractionHandler *handler)
Sets the pointer to the interaction hander which is storing this interaction.
Definition: BaseInteraction.cc:261
void setIdentificationP(unsigned int identification)
Definition: BaseInteraction.cc:930
std::string getName() const override
Virtual function which allows interactions to be named.
Definition: BaseInteraction.cc:202
Mdouble getLagrangeMultiplier()
Definition: BaseInteraction.h:190
const Vec3D & getRelativeVelocity() const
Returns a constant reference to a vector of relative velocity.
Definition: BaseInteraction.cc:573
Mdouble getEffectiveMass() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Definition: BaseInteraction.cc:810
void setAbsoluteNormalForce(Mdouble absoluteNormalForce)
the absolute values of the norm (length) of the normal force
Definition: BaseInteraction.cc:670
void setDistance(Mdouble distance)
Sets the interaction distance between the two interacting objects.
Definition: BaseInteraction.cc:221
Mdouble getAbsoluteNormalForce() const
Returns the absolute value of the norm (length) of the Normal force vector.
Definition: BaseInteraction.cc:596
virtual std::vector< Mdouble > getFieldVTK(unsigned i) const
Definition: BaseInteraction.cc:893
Vec3D torque_
Definition: BaseInteraction.h:552
Vec3D getIC() const
Definition: BaseInteraction.cc:466
virtual void getInteractionDetails(void *interactionDataArray, unsigned int index, unsigned int &identificationP, unsigned int &identificationI, bool &isWallInteraction, unsigned &timeStamp)
Definition: BaseInteraction.cc:923
bool isWallInteraction_
Definition: BaseInteraction.h:517
const Vec3D & getContactPoint() const
Gets constant reference to contact point (vector).
Definition: BaseInteraction.h:234
void setTimeStamp(unsigned timeStamp)
Updates the time step of the interacting. Note, time steps used to find completed interactions.
Definition: BaseInteraction.cc:251
virtual void computeForce()
Virtual function that contains the force law between the two objects interacting.
Definition: BaseInteraction.cc:694
Vec3D normal_
Definition: BaseInteraction.h:563
virtual bool isBonded() const
Definition: BaseInteraction.h:493
Vec3D force_
Definition: BaseInteraction.h:547
void setContactPoint(Vec3D contactPoint)
Set the location of the contact point between the two interacting objects.
Definition: BaseInteraction.cc:240
void setMultiContactIdentifier(unsigned int multiContactIdentifier_)
Definition: BaseInteraction.cc:768
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Definition: BaseInteraction.h:226
virtual std::string getTypeVTK(unsigned i) const
Definition: BaseInteraction.cc:883
virtual Mdouble getTangentialOverlap() const
get the length of the current tangential overlap
Definition: BaseInteraction.cc:551
Mdouble absoluteNormalForce_
Definition: BaseInteraction.h:537
Mdouble getTimeStamp() const
Returns an Mdouble which is the time stamp of the interaction.
Definition: BaseInteraction.h:319
virtual Mdouble getElasticEnergy() const
Returns a Mdouble which is the current about of Elastic energy in the interaction.
Definition: BaseInteraction.cc:703
Mdouble lagrangeMultiplier_
Definition: BaseInteraction.h:578
BaseInteractable * P_
Definition: BaseInteraction.h:506
void gatherContactStatistics()
Definition: BaseInteraction.cc:825
void importP(BaseInteractable *P)
Sets the first object involved in the interaction (normally a particle).
Definition: BaseInteraction.cc:419
Mdouble normalRelativeVelocity_
Definition: BaseInteraction.h:532
void setP(BaseInteractable *P)
Sets the first object involved in the interaction (normally a particle).
Definition: BaseInteraction.cc:403
virtual BaseInteraction * copy() const =0
Makes a copy of the interaction and returns a pointer to the copy.
virtual unsigned getNumberOfFieldsVTK() const
Definition: BaseInteraction.cc:878
Vec3D getCP() const
Definition: BaseInteraction.cc:472
void setFStatData(std::fstream &fstat, BaseParticle *P, BaseWall *I)
Definition: BaseInteraction.cc:994
virtual void setMPIInteraction(void *interactionDataArray, unsigned int index, bool resetPointers)
Definition: BaseInteraction.cc:907
void removeFromHandler()
Removes this interaction from its interaction hander.
Definition: BaseInteraction.cc:322
void setWallInteraction(bool flag)
Definition: BaseInteraction.cc:950
bool isWallInteraction()
Definition: BaseInteraction.cc:955
Mdouble overlap_
Definition: BaseInteraction.h:568
virtual void deleteMPIInteractionDataArray(void *dataArray)
Definition: BaseInteraction.cc:917
virtual void * createMPIInteractionDataArray(unsigned int numberOfInteractions) const
Definition: BaseInteraction.cc:911
virtual void actionsAfterTimeStep()
Definition: BaseInteraction.cc:818
int identificationI_
Definition: BaseInteraction.h:516
const BaseInteractable * getI() const
Returns a constant pointer to the second object involved in the interaction.
Definition: BaseInteraction.h:308
const BaseInteractable * getP() const
Returns a constant pointer to the first object involved in the interaction.
Definition: BaseInteraction.h:297
void setI(BaseInteractable *I)
Sets the second object involved in the interaction (often particle or wall).
Definition: BaseInteraction.cc:435
void addForce(Vec3D force)
add an force increment to the total force.
Definition: BaseInteraction.cc:606
int getIdentificationI()
Definition: BaseInteraction.cc:945
Mdouble getDistance() const
Returns an Mdouble which is the norm (length) of distance vector.
Definition: BaseInteraction.cc:539
virtual std::string getNameVTK(unsigned i) const
Definition: BaseInteraction.cc:888
virtual void actionsOnErase()
If an interaction needs to do something before it gets erased, add it here. E.g. Liquid bridges ruptu...
Definition: BaseInteraction.h:84
Vec3D contactPoint_
Definition: BaseInteraction.h:522
Mdouble getNormalRelativeVelocity() const
Returns a double which is the norm (length) of the relative velocity vector.
Definition: BaseInteraction.cc:584
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
Definition: BaseInteraction.cc:682
virtual const Vec3D getTangentialForce() const
Definition: BaseInteraction.cc:563
void setLagrangeMultiplier(Mdouble multiplier)
Definition: BaseInteraction.h:185
virtual Mdouble getElasticEnergyAtEquilibrium(Mdouble adhesiveForce) const
Definition: BaseInteraction.h:434
Mdouble getEffectiveRadius() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Definition: BaseInteraction.cc:793
virtual void integrate(Mdouble timeStep)
integrates variables of the interaction which need to be integrate e.g. the tangential overlap.
Definition: BaseInteraction.cc:378
unsigned timeStamp_
Definition: BaseInteraction.h:558
void setRelativeVelocity(Vec3D relativeVelocity)
set the relative velocity of the current of the interactions.
Definition: BaseInteraction.cc:649
void setNormal(Vec3D normal)
Sets the normal vector between the two interacting objects.
Definition: BaseInteraction.cc:212
void setSpecies(const BaseSpecies *species)
Set the Species of the interaction; note this can either be a Species or MixedSpecies.
Definition: BaseInteraction.cc:390
unsigned int getIdentificationP()
Definition: BaseInteraction.cc:940
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle).
Definition: BaseInteraction.h:285
Mdouble distance_
Definition: BaseInteraction.h:542
BaseInteractable * I_
Definition: BaseInteraction.h:511
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Definition: BaseInteraction.h:274
Mdouble getContactRadius() const
Returns a Mdouble with the current contact between the two interacting objects.
Definition: BaseInteraction.cc:366
void write(std::ostream &os) const override
Interaction print function, which accepts an std::ostream as input.
Definition: BaseInteraction.cc:159
void writeToFStat(std::ostream &os, Mdouble time) const
Writes forces data to the FStat file.
Definition: BaseInteraction.cc:487
InteractionHandler * getHandler() const
Gets a point to the interaction handlers to which this interaction belongs.
Definition: BaseInteraction.cc:267
void setIdentificationI(int identification)
Definition: BaseInteraction.cc:935
void setNormalRelativeVelocity(Mdouble normalRelativeVelocit)
set the normal component of the relative velocity.
Definition: BaseInteraction.cc:660
void addTorque(Vec3D torque)
add a torque increment to the total torque.
Definition: BaseInteraction.cc:616
Vec3D getIP() const
Definition: BaseInteraction.cc:459
virtual void reverseHistory()
When periodic particles some interaction need certain history properties reversing....
Definition: BaseInteraction.cc:718
Mdouble getOverlapVolume() const
Returns the overlap volume between two interacting objects.
Definition: BaseInteraction.cc:277
virtual void getMPIInteraction(void *historyDataArray, unsigned int index) const
copies the history interactions into the data array
Definition: BaseInteraction.cc:903
void setForce(Vec3D force)
set total force (this is used by the normal force, tangential forces are added use addForce)
Definition: BaseInteraction.cc:627
void setTorque(Vec3D torque)
set the total force (this is used by the normal force, tangential torques are added use addTorque)
Definition: BaseInteraction.cc:638
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
Definition: BaseInteraction.h:240
unsigned multiContactIdentifier_
Definition: BaseInteraction.h:583
void setOverlap(Mdouble overlap)
Set the overlap between the two interacting object.
Definition: BaseInteraction.cc:231
virtual void rotateHistory(Matrix3D &rotationMatrix)
When periodic particles are used, some interactions need certain history properties rotated (e....
Definition: BaseInteraction.cc:774
Vec3D relativeVelocity_
Definition: BaseInteraction.h:527
InteractionHandler * handler_
Definition: BaseInteraction.h:501
BaseInteraction()
Definition: BaseInteraction.cc:65
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
Definition: BaseObject.h:51
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
Definition: BaseParticle.h:54
BaseSpecies is the class from which all other species are derived.
Definition: BaseSpecies.h:50
Basic class for walls.
Definition: BaseWall.h:49
Container to store Interaction objects.
Definition: InteractionHandler.h:45
Implementation of a 3D matrix.
Definition: Matrix.h:38
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51