ChargedBondedInteraction Class Reference

#include <ChargedBondedInteraction.h>

+ Inheritance diagram for ChargedBondedInteraction:

Public Types

typedef ChargedBondedSpecies SpeciesType
 Setting an alias name for ChargedBondedSpecies. More...
 

Public Member Functions

 ChargedBondedInteraction (BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
 Constructor. More...
 
 ChargedBondedInteraction (const ChargedBondedInteraction &p)
 Copy constructor. More...
 
 ChargedBondedInteraction ()
 
 ~ChargedBondedInteraction () override
 Destructor. More...
 
void computeAdhesionForce ()
 Computes the adhesive forces. More...
 
void read (std::istream &is) override
 Interaction read function, which accepts an std::istream as input. More...
 
void write (std::ostream &os) const override
 Interaction print function, which accepts an std::ostream as input. More...
 
Mdouble getElasticEnergy () const override
 Returns the amount of Elastic energy involved in an interaction. Basically used in case you want to write the elastic energy into an output file. More...
 
const ChargedBondedSpeciesgetSpecies () const
 Returns a pointer to the adhesive force species ChargedBondedSpecies. More...
 
std::string getBaseName () const
 Returns the name of the interaction, see Interaction.h. More...
 
void bond ()
 A pair of functions which can be used to fix or unfix a pair of overlapping particles. More...
 
void unbond ()
 
bool isBonded () const override
 
- Public Member Functions inherited from BaseInteraction
 BaseInteraction (BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
 A constructor takes the BaseInteractable objects which are interacting (come into contact) and time the interaction starts. More...
 
 BaseInteraction ()
 
 BaseInteraction (const BaseInteraction &p)
 Copy constructor. More...
 
 ~BaseInteraction () override
 The destructor. It removes this interactions from the objects that were interacting, and writes the time to a file when needed. More...
 
virtual void actionsOnErase ()
 If an interaction needs to do something before it gets erased, add it here. E.g. Liquid bridges rupture at the end of their lifetime, and the liquid bridge volume has to be redistributed. The reason this action is not done in the destructor is that this action should not be taken when erasing ghost interactions. More...
 
virtual void computeForce ()
 Virtual function that contains the force law between the two objects interacting. More...
 
void read (std::istream &is) override
 Interaction read function, which accepts an std::istream as input. More...
 
void write (std::ostream &os) const override
 Interaction print function, which accepts an std::ostream as input. More...
 
void writeToFStat (std::ostream &os, Mdouble time) const
 Writes forces data to the FStat file. More...
 
std::string getName () const override
 Virtual function which allows interactions to be named. More...
 
void setDistance (Mdouble distance)
 Sets the interaction distance between the two interacting objects. More...
 
void setNormal (Vec3D normal)
 Sets the normal vector between the two interacting objects. More...
 
void setOverlap (Mdouble overlap)
 Set the overlap between the two interacting object. More...
 
void setContactPoint (Vec3D contactPoint)
 Set the location of the contact point between the two interacting objects. More...
 
void setTimeStamp (unsigned timeStamp)
 Updates the time step of the interacting. Note, time steps used to find completed interactions. More...
 
void setSpecies (const BaseSpecies *species)
 Set the Species of the interaction; note this can either be a Species or MixedSpecies. More...
 
void setP (BaseInteractable *P)
 Sets the first object involved in the interaction (normally a particle). More...
 
void setI (BaseInteractable *I)
 Sets the second object involved in the interaction (often particle or wall). More...
 
void importP (BaseInteractable *P)
 Sets the first object involved in the interaction (normally a particle). More...
 
void importI (BaseInteractable *I)
 Sets the second object involved in the interaction (often particle or wall). More...
 
Vec3D getIP () const
 
Vec3D getIC () const
 
Vec3D getCP () const
 
void setLagrangeMultiplier (Mdouble multiplier)
 
Mdouble getLagrangeMultiplier ()
 
void setHandler (InteractionHandler *handler)
 Sets the pointer to the interaction hander which is storing this interaction. More...
 
InteractionHandlergetHandler () const
 Gets a point to the interaction handlers to which this interaction belongs. More...
 
const Vec3DgetForce () const
 Gets the current force (vector) between the two interacting objects. More...
 
const Vec3DgetTorque () const
 Gets the current torque (vector) between the two interacting objects. More...
 
const Vec3DgetNormal () const
 Gets the normal vector between the two interacting objects. More...
 
const Vec3DgetContactPoint () const
 Gets constant reference to contact point (vector). More...
 
Mdouble getOverlap () const
 Returns a Mdouble with the current overlap between the two interacting objects. More...
 
Mdouble getOverlapVolume () const
 Returns the overlap volume between two interacting objects. More...
 
Mdouble getContactRadius () const
 Returns a Mdouble with the current contact between the two interacting objects. More...
 
void removeFromHandler ()
 Removes this interaction from its interaction hander. More...
 
void copySwitchPointer (const BaseInteractable *original, BaseInteractable *ghost) const
 This copies the interactions of the original particle and replaces the original with the ghost copy. More...
 
void gatherContactStatistics ()
 
BaseInteractablegetP ()
 Returns a pointer to first object involved in the interaction (normally a particle). More...
 
BaseInteractablegetI ()
 Returns a pointer to the second object involved in the interaction (often a wall or a particle). More...
 
const BaseInteractablegetP () const
 Returns a constant pointer to the first object involved in the interaction. More...
 
const BaseInteractablegetI () const
 Returns a constant pointer to the second object involved in the interaction. More...
 
Mdouble getTimeStamp () const
 Returns an Mdouble which is the time stamp of the interaction. More...
 
virtual void integrate (Mdouble timeStep)
 integrates variables of the interaction which need to be integrate e.g. the tangential overlap. More...
 
virtual Mdouble getTangentialOverlap () const
 get the length of the current tangential overlap More...
 
Mdouble getDistance () const
 Returns an Mdouble which is the norm (length) of distance vector. More...
 
const Vec3DgetRelativeVelocity () const
 Returns a constant reference to a vector of relative velocity. More...
 
Mdouble getNormalRelativeVelocity () const
 Returns a double which is the norm (length) of the relative velocity vector. More...
 
Mdouble getAbsoluteNormalForce () const
 Returns the absolute value of the norm (length) of the Normal force vector. More...
 
virtual BaseInteractioncopy () const =0
 Makes a copy of the interaction and returns a pointer to the copy. More...
 
void setFStatData (std::fstream &fstat, BaseParticle *P, BaseWall *I)
 
void setFStatData (std::fstream &fstat, BaseParticle *P, BaseParticle *I)
 
unsigned int getMultiContactIdentifier () const
 
void setMultiContactIdentifier (unsigned int multiContactIdentifier_)
 
virtual void rotateHistory (Matrix3D &rotationMatrix)
 When periodic particles are used, some interactions need certain history properties rotated (e.g. tangential springs). This is the function for that. More...
 
virtual void actionsAfterTimeStep ()
 
virtual unsigned getNumberOfFieldsVTK () const
 
virtual std::string getTypeVTK (unsigned i) const
 
virtual std::string getNameVTK (unsigned i) const
 
virtual std::vector< MdoublegetFieldVTK (unsigned i) const
 
void addForce (Vec3D force)
 add an force increment to the total force. More...
 
void addTorque (Vec3D torque)
 add a torque increment to the total torque. More...
 
void setForce (Vec3D force)
 set total force (this is used by the normal force, tangential forces are added use addForce) More...
 
void setTorque (Vec3D torque)
 set the total force (this is used by the normal force, tangential torques are added use addTorque) More...
 
const BaseSpeciesgetBaseSpecies () const
 Return a constant point to BaseSpecies of the interaction. More...
 
virtual void createMPIType ()
 
virtual void * createMPIInteractionDataArray (unsigned int numberOfInteractions) const
 
virtual void deleteMPIInteractionDataArray (void *dataArray)
 
virtual void getMPIInteraction (void *historyDataArray, unsigned int index) const
 copies the history interactions into the data array More...
 
virtual void getInteractionDetails (void *interactionDataArray, unsigned int index, unsigned int &identificationP, unsigned int &identificationI, bool &isWallInteraction, unsigned &timeStamp)
 
virtual void setMPIInteraction (void *interactionDataArray, unsigned int index, bool resetPointers)
 
void setBasicMPIInteractionValues (int P, int I, unsigned timeStamp, Vec3D force, Vec3D torque, bool isWallInteraction, bool resetPointers)
 
void setIdentificationP (unsigned int identification)
 
void setIdentificationI (int identification)
 
void setWallInteraction (bool flag)
 
unsigned int getIdentificationP ()
 
int getIdentificationI ()
 
bool isWallInteraction ()
 
- Public Member Functions inherited from BaseObject
 BaseObject ()=default
 Default constructor. More...
 
 BaseObject (const BaseObject &p)=default
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()=default
 virtual destructor More...
 
virtual void moveInHandler (unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (unsigned long id)
 Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More...
 
unsigned int getIndex () const
 Returns the index of the object in the handler. More...
 
unsigned int getId () const
 Returns the unique identifier of any particular object. More...
 
void setGroupId (unsigned groupId)
 
unsigned getGroupId () const
 

Private Attributes

bool bonded_
 A history parameter to store if the particles were in contact or not. Useful to compute adhesive forces. Setting bonded_ to 'true' for a given pair of (overlapping) particles will cause these particles to become fixed together, resulting in larger, composite particles that can be used to model aspherical geometries. More...
 

Additional Inherited Members

- Protected Member Functions inherited from BaseInteraction
virtual const Vec3D getTangentialForce () const
 
Mdouble getEffectiveRadius () const
 Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap) More...
 
Mdouble getEffectiveMass () const
 Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap) More...
 
void setRelativeVelocity (Vec3D relativeVelocity)
 set the relative velocity of the current of the interactions. More...
 
void setNormalRelativeVelocity (Mdouble normalRelativeVelocit)
 set the normal component of the relative velocity. More...
 
void setAbsoluteNormalForce (Mdouble absoluteNormalForce)
 the absolute values of the norm (length) of the normal force More...
 
virtual Mdouble getElasticEnergyAtEquilibrium (Mdouble adhesiveForce) const
 
virtual void reverseHistory ()
 When periodic particles some interaction need certain history properties reversing. This is the function for that. More...
 
void writeInteraction (std::ostream &os, bool created) const
 Writes information about a interaction to the interaction file. More...
 

Member Typedef Documentation

◆ SpeciesType

Setting an alias name for ChargedBondedSpecies.

Constructor & Destructor Documentation

◆ ChargedBondedInteraction() [1/3]

ChargedBondedInteraction::ChargedBondedInteraction ( BaseInteractable P,
BaseInteractable I,
unsigned  timeStamp 
)

Constructor.

Todo:

Clean up this file by using the logger instead of cout, //cout, cerr and assert, and by motivating why the commented out code needs to be here.

Complete the documentation of these methods

Parameters
[in]P
[in]I
[in]timeStamp
21  : BaseInteraction(P, I, timeStamp)
22 {
23  //ensuring that, by default, particles are not 'bonded'
24  //i.e. they will not unintentionally 'stick' to any overlapping particles!
25  bonded_ = false;
26 #ifdef DEBUG_CONSTRUCTOR
27  std::cout<<"ChargedBondedInteraction::ChargedBondedInteraction() finished"<<std::endl;
28 #endif
29 }
BaseInteraction()
Definition: BaseInteraction.cc:43
bool bonded_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Definition: ChargedBondedInteraction.h:104
#define I
Definition: main.h:127
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77

References bonded_.

◆ ChargedBondedInteraction() [2/3]

ChargedBondedInteraction::ChargedBondedInteraction ( const ChargedBondedInteraction p)

Copy constructor.

Parameters
[in]p
36 {
37  //carrying the history parameter over for copied particles to ensure that any bonded particles
38  //remain bonded!
39  bonded_ = p.bonded_;
40 #ifdef DEBUG_CONSTRUCTOR
41  std::cout<<"ChargedBondedInteraction::ChargedBondedInteraction(const ChargedBondedInteraction &p finished"<<std::endl;
42 #endif
43 }
float * p
Definition: Tutorial_Map_using.cpp:9

References bonded_, and p.

◆ ChargedBondedInteraction() [3/3]

ChargedBondedInteraction::ChargedBondedInteraction ( )
Todo:
MX: add to MPI
46 {
47 #ifdef MERCURYDPM_USE_MPI
48  logger(FATAL,"ChargedBondedInteractions are currently not implemented in parallel MercuryDPM");
49 #endif
50 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ FATAL

References FATAL, and logger.

◆ ~ChargedBondedInteraction()

ChargedBondedInteraction::~ChargedBondedInteraction ( )
override

Destructor.

56 {
57 #ifdef DEBUG_DESTRUCTOR
58  std::cout<<"ChargedBondedInteraction::ChargedBondedInteractionaction() finished"<<std::endl;
59 #endif
60 }

Member Function Documentation

◆ bond()

void ChargedBondedInteraction::bond ( )

A pair of functions which can be used to fix or unfix a pair of overlapping particles.

Used to set the private variable 'bonded' to true, thus allowing the user to choose to fix a given pair of interacting, overlapping particles together

279 {
280  bonded_ = true;
281 }

References bonded_.

Referenced by ChargedBondedInteractionSelfTest::setupInitialConditions(), and ChargedBondedParticleUnitTest::setupInitialConditions().

◆ computeAdhesionForce()

void ChargedBondedInteraction::computeAdhesionForce ( )

Computes the adhesive forces.

TW: I added the vdW force; KW, why was that force not active? Note, this change also shows up in energy

84 {
85 
86  const ChargedBondedSpecies* species = getSpecies();
87  //std::cout << getSpecies()->getCharge() << std::endl;
88 
89  //creating local parameters to store the charges of both particles
90  //involved in the interaction to allow for quick calculation
91  const auto pSpecies = dynamic_cast<const ChargedBondedSpecies*>(getP()->getSpecies());
92  const auto iSpecies = dynamic_cast<const ChargedBondedSpecies*>(getI()->getSpecies());
93  logger.assert_debug(pSpecies,"No ChargedBondedSpecies");
94  logger.assert_debug(iSpecies,"No ChargedBondedSpecies");
95  const int pCharge = pSpecies->getCharge();
96  const int iCharge = iSpecies->getCharge();
97 
98  //similarly, creating local parameters to store the relevant stiffness
99  //and max force values
100  const Mdouble k = species->getAdhesionStiffness();
101  const Mdouble fMax = species->getAdhesionForceMax();
102 
103  const Mdouble kWaals = species->getVanDerWaalsStiffness();
104  const Mdouble fMaxWaals = species->getVanDerWaalsForceMax();
105  const Mdouble rWaals = fMaxWaals / kWaals;
106 
107 
108  //First, adding bonded force if applicable
109  if (bonded_ && getOverlap() >= 0)
110  {
111  addForce(getNormal() * (-species->getBondForceMax()
113  return;
114  }
115 
116 
117  //determining which of the three possible cases for force based on charge -
118  //repulsive (like charges), attractive (unlike charges) or none (1 or more uncharged) -
119  //is relevant for the current combination of particle charges...
120  //(Note that the charge set function contains a safety check that means charge can only be
121  // +/- 1, i.e. the expressions used below should not produce errors!
122 
123  //case 1 - 1 or more particles has no charge, i.e. no EM force between them
124  if ((pCharge == 0) or (iCharge == 0))
125  {
126  //No need to write anything here as nothing needs to be returned!
127  //std::cout << "no charge" << std::endl;
128  }
129  //case 2: unlike charges --> attractive force
130  else if (pCharge == -iCharge)
131  {
132  //std::cout << "dissimilar charge" << std::endl;
133  //in the case of particles with opposing charges, simply implements the
134  //standard attractive force used for adhesive particle interactions
135  if (getOverlap() >= 0)
136  {
137  addForce(getNormal() * -fMax);
138  addForce(getNormal() * -fMaxWaals);
139  }
140  else if (getOverlap() >= -rWaals)
141  {
142  addForce(getNormal() * (-kWaals * getOverlap() - fMaxWaals));
143  addForce(getNormal() * (-k * getOverlap() - fMax));
144  }
145  else
146  {
147  addForce(getNormal() * (-k * getOverlap() - fMax));
148  }
149  }
150  //case 3: like charges --> repulsive force
151  else if (pCharge == iCharge)
152  {
153  //std::cout << "similar charge" << std::endl;
154  //in the case of particles with like charges, reverse the direction of the force applied
155  //such that particles repel one another
156  if (getOverlap() >= 0)
157  {
158  addForce(getNormal() * +fMax);
159  addForce(getNormal() * -fMaxWaals);
161  }
162  else if (getOverlap() >= -rWaals)
163  {
164  addForce(getNormal() * (-kWaals * getOverlap() - fMaxWaals));
165  addForce(getNormal() * (+k * getOverlap() + fMax));
166  //std::cout << "Waals = " << getNormal() * (-kWaals * getOverlap() - fMaxWaals) << std::endl;
167  }
168  else
169  {
170  addForce(getNormal() * (+k * getOverlap() + fMax));
171  }
172  }
173  //if none of the above are satisfied, something must have gone very wrong!
174  else
175  {
176  logger(ERROR, "Particle charge has erroneous value");
177  }
178 }
@ ERROR
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
Definition: BaseInteractable.h:87
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Definition: BaseInteraction.h:205
void addForce(Vec3D force)
add an force increment to the total force.
Definition: BaseInteraction.cc:587
Mdouble getNormalRelativeVelocity() const
Returns a double which is the norm (length) of the relative velocity vector.
Definition: BaseInteraction.cc:565
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle).
Definition: BaseInteraction.h:264
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Definition: BaseInteraction.h:253
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
Definition: BaseInteraction.h:219
const ChargedBondedSpecies * getSpecies() const
Returns a pointer to the adhesive force species ChargedBondedSpecies.
Definition: ChargedBondedInteraction.cc:261
ChargedBondedSpecies contains the parameters used to describe a linear reversible short-range force.
Definition: ChargedBondedSpecies.h:17
Mdouble getAdhesionStiffness() const
Allows the spring constant to be accessed.
Definition: ChargedBondedSpecies.cc:135
Mdouble getBondDissipation() const
Allows the additional dissipation used to damp oscillations between bondd particles to be accessed.
Definition: ChargedBondedSpecies.cc:218
Mdouble getVanDerWaalsForceMax() const
Definition: ChargedBondedSpecies.cc:246
Mdouble getBondForceMax() const
Allows the maximal force for 'bonding' particles together to be accessed.
Definition: ChargedBondedSpecies.cc:197
Mdouble getVanDerWaalsStiffness() const
Definition: ChargedBondedSpecies.cc:259
Mdouble getAdhesionForceMax() const
Allows the spring constant to be accessed.
Definition: ChargedBondedSpecies.cc:152
char char char int int * k
Definition: level2_impl.h:374

References BaseInteraction::addForce(), bonded_, ERROR, ChargedBondedSpecies::getAdhesionForceMax(), ChargedBondedSpecies::getAdhesionStiffness(), ChargedBondedSpecies::getBondDissipation(), ChargedBondedSpecies::getBondForceMax(), BaseInteraction::getI(), BaseInteraction::getNormal(), BaseInteraction::getNormalRelativeVelocity(), BaseInteraction::getOverlap(), BaseInteraction::getP(), BaseInteractable::getSpecies(), getSpecies(), ChargedBondedSpecies::getVanDerWaalsForceMax(), ChargedBondedSpecies::getVanDerWaalsStiffness(), k, and logger.

◆ getBaseName()

std::string ChargedBondedInteraction::getBaseName ( ) const

Returns the name of the interaction, see Interaction.h.

Returns
std::string
270 {
271  return "ChargedBonded";
272 }

◆ getElasticEnergy()

Mdouble ChargedBondedInteraction::getElasticEnergy ( ) const
overridevirtual

Returns the amount of Elastic energy involved in an interaction. Basically used in case you want to write the elastic energy into an output file.

Returns the elastic energy stored in the adhesive spring.

Elastic (=potential) energy is defined as the energy gained by separating two interactables. As it costs energy to separate adhesive interactables, the elastic energy is negative.

Returns
the elastic energy stored in the adhesive spring.

Reimplemented from BaseInteraction.

186 {
187  const ChargedBondedSpecies* species = getSpecies();
188  const auto pSpecies = static_cast<const ChargedBondedSpecies*>(getP()->getSpecies()->getAdhesiveForce());
189  const auto iSpecies = static_cast<const ChargedBondedSpecies*>(getI()->getSpecies()->getAdhesiveForce());
190  logger.assert_debug(pSpecies,"No ChargedBondedSpecies");
191  logger.assert_debug(iSpecies,"No ChargedBondedSpecies");
192  const int pCharge = pSpecies->getCharge();
193  const int iCharge = iSpecies->getCharge();
194 
195  const Mdouble k = species->getAdhesionStiffness();
196  const Mdouble fMax = species->getAdhesionForceMax();
198 
199  const Mdouble kWaals = species->getVanDerWaalsStiffness();
200  const Mdouble fMaxWaals = species->getVanDerWaalsForceMax();
201  const Mdouble rWaals = (fMaxWaals == 0) ? 0 : (fMaxWaals / kWaals);
202 
203 
204  //First, adding bonded force if applicable
205  if (bonded_ && getOverlap() >= 0)
206  {
207  //comment to ignore BondForce
208  Mdouble elasticEnergyAtEquilibrium = getElasticEnergyAtEquilibrium(species->getBondForceMax());
209  return -species->getBondForceMax() * getOverlap() + elasticEnergyAtEquilibrium;
210  }
211 
212  Mdouble elasticEnergy = 0.0;
213  if ((pCharge != 0) && (iCharge != 0))
214  {
215  if (pCharge == -iCharge)
216  {
217  if (getOverlap() >= 0)
218  {
219  elasticEnergy -= (0.5 * rWaals + getOverlap()) * fMaxWaals
220  + (0.5 * r + getOverlap()) * fMax;
221  }
222  else if (getOverlap() >= -rWaals)
223  {
224  elasticEnergy -= (0.5 * kWaals * mathsFunc::square(getOverlap() + rWaals)) +
225  (0.5 * k * mathsFunc::square(getOverlap() + r));
226  }
227  else
228  {
229  elasticEnergy -= (0.5 * k * mathsFunc::square(getOverlap() + r));
230  }
231  }
232  //case 3: like charges --> repulsive force
233  else if (pCharge == iCharge)
234  {
235  if (getOverlap() >= 0)
236  {
237  elasticEnergy -= (0.5 * rWaals + getOverlap()) * fMaxWaals
238  - (0.5 * r + getOverlap()) * fMax;
239  }
240  else if (getOverlap() >= -rWaals)
241  {
242  elasticEnergy -= (0.5 * kWaals * mathsFunc::square(getOverlap() + rWaals)) -
243  (0.5 * k * mathsFunc::square(getOverlap() + r));
244  }
245  else
246  {
247  elasticEnergy += (0.5 * k * mathsFunc::square(getOverlap() + r));
248  }
249  }
250  else
251  {
252  logger(ERROR, "Particle charge has erroneous value");
253  }
254  }
255  return elasticEnergy;
256 }
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
Definition: BaseInteraction.cc:663
virtual Mdouble getElasticEnergyAtEquilibrium(Mdouble adhesiveForce) const
Definition: BaseInteraction.h:413
Mdouble getInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: BaseSpecies.h:125
BaseAdhesiveForce * getAdhesiveForce() const
Definition: BaseSpecies.h:131
r
Definition: UniformPSDSelfTest.py:20
T square(const T val)
squares a number
Definition: ExtendedMath.h:86

References bonded_, ERROR, ChargedBondedSpecies::getAdhesionForceMax(), ChargedBondedSpecies::getAdhesionStiffness(), BaseSpecies::getAdhesiveForce(), BaseInteraction::getBaseSpecies(), ChargedBondedSpecies::getBondForceMax(), BaseInteraction::getElasticEnergyAtEquilibrium(), BaseInteraction::getI(), BaseSpecies::getInteractionDistance(), BaseInteraction::getOverlap(), BaseInteraction::getP(), BaseInteractable::getSpecies(), getSpecies(), ChargedBondedSpecies::getVanDerWaalsForceMax(), ChargedBondedSpecies::getVanDerWaalsStiffness(), k, logger, UniformPSDSelfTest::r, and mathsFunc::square().

◆ getSpecies()

const ChargedBondedSpecies * ChargedBondedInteraction::getSpecies ( ) const

Returns a pointer to the adhesive force species ChargedBondedSpecies.

Returns
a constant pointer to an instance of this class.
262 {
263  return static_cast<const ChargedBondedSpecies*> (getBaseSpecies()->getAdhesiveForce()); //downcast
264 }

References BaseSpecies::getAdhesiveForce(), and BaseInteraction::getBaseSpecies().

Referenced by computeAdhesionForce(), and getElasticEnergy().

◆ isBonded()

bool ChargedBondedInteraction::isBonded ( ) const
inlineoverridevirtual

Reimplemented from BaseInteraction.

93 {return bonded_;}

References bonded_.

◆ read()

void ChargedBondedInteraction::read ( std::istream &  is)
overridevirtual

Interaction read function, which accepts an std::istream as input.

Parameters
[in]is

Implements BaseObject.

74 {
75  std::string dummy;
76  //logger(INFO,"ChargedBondedSpecies %",dummy);
77  is >> dummy >> bonded_;
78 }
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References bonded_, and oomph::Global_string_for_annotation::string().

◆ unbond()

void ChargedBondedInteraction::unbond ( )

Used to set the private variable 'bonded' to false, thus allowing the user to choose to separate (or 'unbond') a given pair of interacting, overlapping particles together which were previously fixed (bonded) together Useful, for example, in implementing breakage mechanisms.

289 {
290  bonded_ = false;
291 }

References bonded_.

◆ write()

void ChargedBondedInteraction::write ( std::ostream &  os) const
overridevirtual

Interaction print function, which accepts an std::ostream as input.

Parameters
[in]os

Implements BaseObject.

66 {
67  os << " bonded " << bonded_;
68 }

References bonded_.

Member Data Documentation

◆ bonded_

bool ChargedBondedInteraction::bonded_
private

A history parameter to store if the particles were in contact or not. Useful to compute adhesive forces. Setting bonded_ to 'true' for a given pair of (overlapping) particles will cause these particles to become fixed together, resulting in larger, composite particles that can be used to model aspherical geometries.

Referenced by bond(), ChargedBondedInteraction(), computeAdhesionForce(), getElasticEnergy(), isBonded(), read(), unbond(), and write().


The documentation for this class was generated from the following files: