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
43  : BaseInteraction(P, I, timeStamp)
44 {
45  //ensuring that, by default, particles are not 'bonded'
46  //i.e. they will not unintentionally 'stick' to any overlapping particles!
47  bonded_ = false;
48 #ifdef DEBUG_CONSTRUCTOR
49  std::cout<<"ChargedBondedInteraction::ChargedBondedInteraction() finished"<<std::endl;
50 #endif
51 }
BaseInteraction()
Definition: BaseInteraction.cc:65
bool bonded_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Definition: ChargedBondedInteraction.h:125
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73

References bonded_.

◆ ChargedBondedInteraction() [2/3]

ChargedBondedInteraction::ChargedBondedInteraction ( const ChargedBondedInteraction p)

Copy constructor.

Parameters
[in]p
57  : BaseInteraction(p)
58 {
59  //carrying the history parameter over for copied particles to ensure that any bonded particles
60  //remain bonded!
61  bonded_ = p.bonded_;
62 #ifdef DEBUG_CONSTRUCTOR
63  std::cout<<"ChargedBondedInteraction::ChargedBondedInteraction(const ChargedBondedInteraction &p finished"<<std::endl;
64 #endif
65 }

References bonded_.

◆ ChargedBondedInteraction() [3/3]

ChargedBondedInteraction::ChargedBondedInteraction ( )
Todo:
MX: add to MPI
68 {
69 #ifdef MERCURYDPM_USE_MPI
70  logger(FATAL,"ChargedBondedInteractions are currently not implemented in parallel MercuryDPM");
71 #endif
72 }
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.

78 {
79 #ifdef DEBUG_DESTRUCTOR
80  std::cout<<"ChargedBondedInteraction::ChargedBondedInteractionaction() finished"<<std::endl;
81 #endif
82 }

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

301 {
302  bonded_ = true;
303 }

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

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

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(), and logger.

◆ getBaseName()

std::string ChargedBondedInteraction::getBaseName ( ) const

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

Returns
std::string
292 {
293  return "ChargedBonded";
294 }

◆ 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.

208 {
209  const ChargedBondedSpecies* species = getSpecies();
210  const auto pSpecies = static_cast<const ChargedBondedSpecies*>(getP()->getSpecies()->getAdhesiveForce());
211  const auto iSpecies = static_cast<const ChargedBondedSpecies*>(getI()->getSpecies()->getAdhesiveForce());
212  logger.assert_debug(pSpecies,"No ChargedBondedSpecies");
213  logger.assert_debug(iSpecies,"No ChargedBondedSpecies");
214  const int pCharge = pSpecies->getCharge();
215  const int iCharge = iSpecies->getCharge();
216 
217  const Mdouble k = species->getAdhesionStiffness();
218  const Mdouble fMax = species->getAdhesionForceMax();
220 
221  const Mdouble kWaals = species->getVanDerWaalsStiffness();
222  const Mdouble fMaxWaals = species->getVanDerWaalsForceMax();
223  const Mdouble rWaals = (fMaxWaals == 0) ? 0 : (fMaxWaals / kWaals);
224 
225 
226  //First, adding bonded force if applicable
227  if (bonded_ && getOverlap() >= 0)
228  {
229  //comment to ignore BondForce
230  Mdouble elasticEnergyAtEquilibrium = getElasticEnergyAtEquilibrium(species->getBondForceMax());
231  return -species->getBondForceMax() * getOverlap() + elasticEnergyAtEquilibrium;
232  }
233 
234  Mdouble elasticEnergy = 0.0;
235  if ((pCharge != 0) && (iCharge != 0))
236  {
237  if (pCharge == -iCharge)
238  {
239  if (getOverlap() >= 0)
240  {
241  elasticEnergy -= (0.5 * rWaals + getOverlap()) * fMaxWaals
242  + (0.5 * r + getOverlap()) * fMax;
243  }
244  else if (getOverlap() >= -rWaals)
245  {
246  elasticEnergy -= (0.5 * kWaals * mathsFunc::square(getOverlap() + rWaals)) +
247  (0.5 * k * mathsFunc::square(getOverlap() + r));
248  }
249  else
250  {
251  elasticEnergy -= (0.5 * k * mathsFunc::square(getOverlap() + r));
252  }
253  }
254  //case 3: like charges --> repulsive force
255  else if (pCharge == iCharge)
256  {
257  if (getOverlap() >= 0)
258  {
259  elasticEnergy -= (0.5 * rWaals + getOverlap()) * fMaxWaals
260  - (0.5 * r + getOverlap()) * fMax;
261  }
262  else if (getOverlap() >= -rWaals)
263  {
264  elasticEnergy -= (0.5 * kWaals * mathsFunc::square(getOverlap() + rWaals)) -
265  (0.5 * k * mathsFunc::square(getOverlap() + r));
266  }
267  else
268  {
269  elasticEnergy += (0.5 * k * mathsFunc::square(getOverlap() + r));
270  }
271  }
272  else
273  {
274  logger(ERROR, "Particle charge has erroneous value");
275  }
276  }
277  return elasticEnergy;
278 }
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
Definition: BaseInteraction.cc:682
virtual Mdouble getElasticEnergyAtEquilibrium(Mdouble adhesiveForce) const
Definition: BaseInteraction.h:434
Mdouble getInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: BaseSpecies.h:146
BaseAdhesiveForce * getAdhesiveForce() const
Definition: BaseSpecies.h:152
T square(const T val)
squares a number
Definition: ExtendedMath.h:106

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(), logger, 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.
284 {
285  return static_cast<const ChargedBondedSpecies*> (getBaseSpecies()->getAdhesiveForce()); //downcast
286 }

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

Referenced by computeAdhesionForce(), and getElasticEnergy().

◆ isBonded()

bool ChargedBondedInteraction::isBonded ( ) const
inlineoverridevirtual

Reimplemented from BaseInteraction.

114 {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.

96 {
97  std::string dummy;
98  //logger(INFO,"ChargedBondedSpecies %",dummy);
99  is >> dummy >> bonded_;
100 }

References bonded_.

◆ 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.

311 {
312  bonded_ = false;
313 }

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.

88 {
89  os << " bonded " << bonded_;
90 }

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: