5 #ifndef BASEINTERACTION_H
6 #define BASEINTERACTION_H
74 void read(std::istream& is)
override;
79 void write(std::ostream& os)
const override;
255 logger.assert_debug(
P_ !=
nullptr,
"First particle in interaction % is nullptr",
getId());
266 logger.assert_debug(
I_ !=
nullptr,
"Second particle in interaction % is nullptr",
getId());
278 logger.assert_debug(
P_ !=
nullptr,
"First particle in interaction % is nullptr",
getId());
289 logger.assert_debug(
I_ !=
nullptr,
"Second particle in interaction % is nullptr",
getId());
359 virtual std::vector<Mdouble>
getFieldVTK(
unsigned i)
const;
443 virtual void getMPIInteraction(
void* historyDataArray,
unsigned int index)
const;
446 virtual void getInteractionDetails(
void* interactionDataArray,
unsigned int index,
unsigned int& identificationP,
451 virtual void setMPIInteraction(
void* interactionDataArray,
unsigned int index,
bool resetPointers);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
double Mdouble
Definition: GeneralDefine.h:13
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
float * p
Definition: Tutorial_Map_using.cpp:9
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:34
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
unsigned int identificationP_
Definition: BaseInteraction.h:494
void setBasicMPIInteractionValues(int P, int I, unsigned timeStamp, Vec3D force, Vec3D torque, bool isWallInteraction, bool resetPointers)
Definition: BaseInteraction.cc:944
void read(std::istream &is) override
Interaction read function, which accepts an std::istream as input.
Definition: BaseInteraction.cc:165
const Vec3D & getForce() const
Gets the current force (vector) between the two interacting objects.
Definition: BaseInteraction.h:189
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:322
~BaseInteraction() override
The destructor. It removes this interactions from the objects that were interacting,...
Definition: BaseInteraction.cc:103
const Vec3D & getTorque() const
Gets the current torque (vector) between the two interacting objects.
Definition: BaseInteraction.h:197
virtual void createMPIType()
Definition: BaseInteraction.cc:882
unsigned int getMultiContactIdentifier() const
Definition: BaseInteraction.cc:744
const BaseSpecies * species_
Definition: BaseInteraction.h:552
void writeInteraction(std::ostream &os, bool created) const
Writes information about a interaction to the interaction file.
Definition: BaseInteraction.cc:710
void importI(BaseInteractable *I)
Sets the second object involved in the interaction (often particle or wall).
Definition: BaseInteraction.cc:432
void setHandler(InteractionHandler *handler)
Sets the pointer to the interaction hander which is storing this interaction.
Definition: BaseInteraction.cc:241
void setIdentificationP(unsigned int identification)
Definition: BaseInteraction.cc:913
std::string getName() const override
Virtual function which allows interactions to be named.
Definition: BaseInteraction.cc:182
Mdouble getLagrangeMultiplier()
Definition: BaseInteraction.h:169
const Vec3D & getRelativeVelocity() const
Returns a constant reference to a vector of relative velocity.
Definition: BaseInteraction.cc:554
Mdouble getEffectiveMass() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Definition: BaseInteraction.cc:792
void setAbsoluteNormalForce(Mdouble absoluteNormalForce)
the absolute values of the norm (length) of the normal force
Definition: BaseInteraction.cc:651
void setDistance(Mdouble distance)
Sets the interaction distance between the two interacting objects.
Definition: BaseInteraction.cc:201
Mdouble getAbsoluteNormalForce() const
Returns the absolute value of the norm (length) of the Normal force vector.
Definition: BaseInteraction.cc:577
virtual std::vector< Mdouble > getFieldVTK(unsigned i) const
Definition: BaseInteraction.cc:876
Vec3D torque_
Definition: BaseInteraction.h:531
Vec3D getIC() const
Definition: BaseInteraction.cc:447
virtual void getInteractionDetails(void *interactionDataArray, unsigned int index, unsigned int &identificationP, unsigned int &identificationI, bool &isWallInteraction, unsigned &timeStamp)
Definition: BaseInteraction.cc:906
bool isWallInteraction_
Definition: BaseInteraction.h:496
const Vec3D & getContactPoint() const
Gets constant reference to contact point (vector).
Definition: BaseInteraction.h:213
void setTimeStamp(unsigned timeStamp)
Updates the time step of the interacting. Note, time steps used to find completed interactions.
Definition: BaseInteraction.cc:231
virtual void computeForce()
Virtual function that contains the force law between the two objects interacting.
Definition: BaseInteraction.cc:675
Vec3D normal_
Definition: BaseInteraction.h:542
virtual bool isBonded() const
Definition: BaseInteraction.h:472
Vec3D force_
Definition: BaseInteraction.h:526
void setContactPoint(Vec3D contactPoint)
Set the location of the contact point between the two interacting objects.
Definition: BaseInteraction.cc:220
void setMultiContactIdentifier(unsigned int multiContactIdentifier_)
Definition: BaseInteraction.cc:749
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Definition: BaseInteraction.h:205
virtual std::string getTypeVTK(unsigned i) const
Definition: BaseInteraction.cc:866
virtual Mdouble getTangentialOverlap() const
get the length of the current tangential overlap
Definition: BaseInteraction.cc:532
Mdouble absoluteNormalForce_
Definition: BaseInteraction.h:516
Mdouble getTimeStamp() const
Returns an Mdouble which is the time stamp of the interaction.
Definition: BaseInteraction.h:298
virtual Mdouble getElasticEnergy() const
Returns a Mdouble which is the current about of Elastic energy in the interaction.
Definition: BaseInteraction.cc:684
Mdouble lagrangeMultiplier_
Definition: BaseInteraction.h:557
BaseInteractable * P_
Definition: BaseInteraction.h:485
void gatherContactStatistics()
Definition: BaseInteraction.cc:808
void importP(BaseInteractable *P)
Sets the first object involved in the interaction (normally a particle).
Definition: BaseInteraction.cc:400
Mdouble normalRelativeVelocity_
Definition: BaseInteraction.h:511
void setP(BaseInteractable *P)
Sets the first object involved in the interaction (normally a particle).
Definition: BaseInteraction.cc:384
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:861
Vec3D getCP() const
Definition: BaseInteraction.cc:453
void setFStatData(std::fstream &fstat, BaseParticle *P, BaseWall *I)
Definition: BaseInteraction.cc:977
virtual void setMPIInteraction(void *interactionDataArray, unsigned int index, bool resetPointers)
Definition: BaseInteraction.cc:890
void removeFromHandler()
Removes this interaction from its interaction hander.
Definition: BaseInteraction.cc:303
void setWallInteraction(bool flag)
Definition: BaseInteraction.cc:933
bool isWallInteraction()
Definition: BaseInteraction.cc:938
Mdouble overlap_
Definition: BaseInteraction.h:547
virtual void deleteMPIInteractionDataArray(void *dataArray)
Definition: BaseInteraction.cc:900
virtual void * createMPIInteractionDataArray(unsigned int numberOfInteractions) const
Definition: BaseInteraction.cc:894
virtual void actionsAfterTimeStep()
Definition: BaseInteraction.cc:801
int identificationI_
Definition: BaseInteraction.h:495
const BaseInteractable * getI() const
Returns a constant pointer to the second object involved in the interaction.
Definition: BaseInteraction.h:287
const BaseInteractable * getP() const
Returns a constant pointer to the first object involved in the interaction.
Definition: BaseInteraction.h:276
void setI(BaseInteractable *I)
Sets the second object involved in the interaction (often particle or wall).
Definition: BaseInteraction.cc:416
void addForce(Vec3D force)
add an force increment to the total force.
Definition: BaseInteraction.cc:587
int getIdentificationI()
Definition: BaseInteraction.cc:928
Mdouble getDistance() const
Returns an Mdouble which is the norm (length) of distance vector.
Definition: BaseInteraction.cc:520
virtual std::string getNameVTK(unsigned i) const
Definition: BaseInteraction.cc:871
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:63
Vec3D contactPoint_
Definition: BaseInteraction.h:501
Mdouble getNormalRelativeVelocity() const
Returns a double which is the norm (length) of the relative velocity vector.
Definition: BaseInteraction.cc:565
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
Definition: BaseInteraction.cc:663
virtual const Vec3D getTangentialForce() const
Definition: BaseInteraction.cc:544
void setLagrangeMultiplier(Mdouble multiplier)
Definition: BaseInteraction.h:164
virtual Mdouble getElasticEnergyAtEquilibrium(Mdouble adhesiveForce) const
Definition: BaseInteraction.h:413
Mdouble getEffectiveRadius() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Definition: BaseInteraction.cc:774
virtual void integrate(Mdouble timeStep)
integrates variables of the interaction which need to be integrate e.g. the tangential overlap.
Definition: BaseInteraction.cc:359
unsigned timeStamp_
Definition: BaseInteraction.h:537
void setRelativeVelocity(Vec3D relativeVelocity)
set the relative velocity of the current of the interactions.
Definition: BaseInteraction.cc:630
void setNormal(Vec3D normal)
Sets the normal vector between the two interacting objects.
Definition: BaseInteraction.cc:192
void setSpecies(const BaseSpecies *species)
Set the Species of the interaction; note this can either be a Species or MixedSpecies.
Definition: BaseInteraction.cc:371
unsigned int getIdentificationP()
Definition: BaseInteraction.cc:923
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle).
Definition: BaseInteraction.h:264
Mdouble distance_
Definition: BaseInteraction.h:521
BaseInteractable * I_
Definition: BaseInteraction.h:490
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Definition: BaseInteraction.h:253
Mdouble getContactRadius() const
Returns a Mdouble with the current contact between the two interacting objects.
Definition: BaseInteraction.cc:347
void write(std::ostream &os) const override
Interaction print function, which accepts an std::ostream as input.
Definition: BaseInteraction.cc:137
void writeToFStat(std::ostream &os, Mdouble time) const
Writes forces data to the FStat file.
Definition: BaseInteraction.cc:468
InteractionHandler * getHandler() const
Gets a point to the interaction handlers to which this interaction belongs.
Definition: BaseInteraction.cc:247
void setIdentificationI(int identification)
Definition: BaseInteraction.cc:918
void setNormalRelativeVelocity(Mdouble normalRelativeVelocit)
set the normal component of the relative velocity.
Definition: BaseInteraction.cc:641
void addTorque(Vec3D torque)
add a torque increment to the total torque.
Definition: BaseInteraction.cc:597
Vec3D getIP() const
Definition: BaseInteraction.cc:440
virtual void reverseHistory()
When periodic particles some interaction need certain history properties reversing....
Definition: BaseInteraction.cc:699
Mdouble getOverlapVolume() const
Returns the overlap volume between two interacting objects.
Definition: BaseInteraction.cc:257
virtual void getMPIInteraction(void *historyDataArray, unsigned int index) const
copies the history interactions into the data array
Definition: BaseInteraction.cc:886
void setForce(Vec3D force)
set total force (this is used by the normal force, tangential forces are added use addForce)
Definition: BaseInteraction.cc:608
void setTorque(Vec3D torque)
set the total force (this is used by the normal force, tangential torques are added use addTorque)
Definition: BaseInteraction.cc:619
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
Definition: BaseInteraction.h:219
unsigned multiContactIdentifier_
Definition: BaseInteraction.h:562
void setOverlap(Mdouble overlap)
Set the overlap between the two interacting object.
Definition: BaseInteraction.cc:211
virtual void rotateHistory(Matrix3D &rotationMatrix)
When periodic particles are used, some interactions need certain history properties rotated (e....
Definition: BaseInteraction.cc:755
Vec3D relativeVelocity_
Definition: BaseInteraction.h:506
InteractionHandler * handler_
Definition: BaseInteraction.h:480
BaseInteraction()
Definition: BaseInteraction.cc:43
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
Definition: BaseObject.h:30
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:104
Definition: BaseParticle.h:33
BaseSpecies is the class from which all other species are derived.
Definition: BaseSpecies.h:29
Basic class for walls.
Definition: BaseWall.h:28
Container to store Interaction objects.
Definition: InteractionHandler.h:25
Implementation of a 3D matrix.
Definition: Kernel/Math/Matrix.h:17
Definition: Kernel/Math/Vector.h:30
#define I
Definition: main.h:127
double multiplier(const Vector< double > &xi)
Definition: disk_oscillation.cc:63
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286