48 #ifdef DEBUG_CONSTRUCTOR
49 std::cout<<
"ChargedBondedInteraction::ChargedBondedInteraction() finished"<<std::endl;
62 #ifdef DEBUG_CONSTRUCTOR
63 std::cout<<
"ChargedBondedInteraction::ChargedBondedInteraction(const ChargedBondedInteraction &p finished"<<std::endl;
72 #ifdef DEBUG_DESTRUCTOR
73 std::cout<<
"ChargedBondedInteraction::ChargedBondedInteractionaction() finished"<<std::endl;
109 const int pCharge = pSpecies->getCharge();
110 const int iCharge = iSpecies->getCharge();
119 const Mdouble rWaals = fMaxWaals / kWaals;
138 if ( (pCharge == 0) or (iCharge == 0) )
144 else if (pCharge == -iCharge)
165 else if (pCharge == iCharge)
190 std::cerr <<
"Error: Particle charge has erroneous value" << std::endl;
207 const int pCharge = pSpecies->getCharge();
208 const int iCharge = iSpecies->getCharge();
216 const Mdouble rWaals = (fMaxWaals==0)?0:(fMaxWaals/kWaals);
228 if ( (pCharge != 0) && (iCharge != 0) )
230 if (pCharge == -iCharge)
234 elasticEnergy -= (0.5 * rWaals +
getOverlap()) * fMaxWaals
248 else if (pCharge == iCharge)
252 elasticEnergy -= (0.5 * rWaals +
getOverlap()) * fMaxWaals
267 logger(
ERROR,
"Particle charge has erroneous value");
270 return elasticEnergy;
284 return "ChargedBonded";
void write(std::ostream &os) const
Interaction print function, which accepts an std::ostream as input.
ChargedBondedInteraction(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
Constructor.
Mdouble getVanDerWaalsForceMax() const
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
std::string getBaseName() const
Returns the name of the interaction, see Interaction.h.
void read(std::istream &is)
Interaction read function, which accepts an std::istream as input.
Mdouble getAdhesionForceMax() const
Allows the spring constant to be accessed.
T square(T val)
squares a number
Stores information about interactions between two interactable objects; often particles but could be ...
ChargedBondedSpecies contains the parameters used to describe a linear reversible short-range force...
Mdouble getBondDissipation() const
Allows the additional dissipation used to damp oscillations between bondd particles to be accessed...
Mdouble getVanDerWaalsStiffness() const
Mdouble getNormalRelativeVelocity() const
Returns a double which is the norm (length) of the relative velocity vector.
Mdouble getInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
Mdouble getElasticEnergy() const
Returns the amount of Elastic energy involved in an interaction. Basically used in case you want to w...
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Mdouble getAdhesionStiffness() const
Allows the spring constant to be accessed.
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
void addForce(Vec3D force)
add an force increment to the total force.
const ChargedBondedSpecies * getSpecies() const
A dynamic_cast of BaseSpecies pointer type to a pointer to an object of type ChargedBondedSpecies.
BaseInteractable * getI()
Mdouble getBondForceMax() const
Allows the maximal force for 'bonding' particles together to be accessed.
virtual Mdouble getElasticEnergyAtEquilibrium(Mdouble adhesiveForce) const
void bond()
A pair of functions which can be used to fix or unfix a pair of overlapping particles.
Defines the basic properties that a interactable object can have.
void computeAdhesionForce()
Computes the adhesive forces.
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
bool bonded_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
virtual ~ChargedBondedInteraction()
Destructor.