ChargedBondedSpecies Class Reference

ChargedBondedSpecies contains the parameters used to describe a linear reversible short-range force. More...

#include <ChargedBondedSpecies.h>

+ Inheritance diagram for ChargedBondedSpecies:

Public Types

typedef ChargedBondedInteraction InteractionType
 The correct Interaction type for this AdhesiveForceSpecies. More...
 

Public Member Functions

 ChargedBondedSpecies ()
 The default constructor. More...
 
 ChargedBondedSpecies (const ChargedBondedSpecies &s)
 The default constructor. More...
 
 ~ChargedBondedSpecies ()=default
 The default constructor. More...
 
void read (std::istream &is)
 Reads the species properties from an input stream. More...
 
void write (std::ostream &os) const
 Writes the species properties to an output stream. More...
 
std::string getBaseName () const
 Used in Species::getName to obtain a unique name for each Species. More...
 
void mix (ChargedBondedSpecies *S, ChargedBondedSpecies *T)
 creates default values for mixed species More...
 
void setInteractionDistance ()
 returns the largest separation distance at which adhesive short-range forces can occur. More...
 
void setAdhesionStiffness (Mdouble new_k0)
 Allows the spring constant to be changed. More...
 
Mdouble getAdhesionStiffness () const
 Allows the spring constant to be accessed. More...
 
void setAdhesionForceMax (Mdouble new_f0)
 Allows the spring constant to be changed. More...
 
Mdouble getAdhesionForceMax () const
 Allows the spring constant to be accessed. More...
 
int getCharge () const
 
void setCharge (int newCharge)
 
void setBondForceMax (Mdouble new_f0)
 Allows the spring constant for the BOND to be changed (Do not confuse with the charged interaction strength!) More...
 
Mdouble getBondForceMax () const
 Allows the maximal force for 'bonding' particles together to be accessed. More...
 
void setBondDissipation (Mdouble disp)
 Allows the additional dissipation used to damp oscillations between bondd particles to be changed. More...
 
Mdouble getBondDissipation () const
 Allows the additional dissipation used to damp oscillations between bondd particles to be accessed. More...
 
Mdouble getVanDerWaalsStiffness () const
 
Mdouble getVanDerWaalsForceMax () const
 
void setVanDerWaalsStiffness (Mdouble)
 
void setVanDerWaalsForceMax (Mdouble)
 
- Public Member Functions inherited from BaseForce
BaseSpeciesgetBaseSpecies () const
 
void setBaseSpecies (BaseSpecies *baseSpecies)
 

Private Attributes

Mdouble adhesionStiffness_
 stiffness of linear adhesion force More...
 
Mdouble adhesionForceMax_
 adhesion force at zero overlap More...
 
int charge_
 
Mdouble bondForceMax_
 The maximal force which acts to bind together particles which are "bondd" into a single body. More...
 
Mdouble bondDissipation_
 dissipation in bond More...
 
Mdouble vanDerWaalsForceMax_
 
Mdouble vanDerWaalsStiffness_
 

Detailed Description

ChargedBondedSpecies contains the parameters used to describe a linear reversible short-range force.

See ChargedBondedInteraction::computeForce for a description of the force law.

Member Typedef Documentation

◆ InteractionType

The correct Interaction type for this AdhesiveForceSpecies.

Constructor & Destructor Documentation

◆ ChargedBondedSpecies() [1/2]

ChargedBondedSpecies::ChargedBondedSpecies ( )

The default constructor.

Default constructor for charged species. Sets default values for all relevant parameters. Note: if the stiffness of particles is left as zero, no force will be felt during interaction with other particles

Parameters
[in]sthe species that is copied
37 {
38  //setting adhesion values initially to zero such that, by default, particles do not experience
39  //long range forces
42  //similarly, setting bond properties to zero such that, by default, particles cannot be 'bondd'...
43  bondForceMax_ = 0;
44  //...and do not impart any excess dissipation!
45  bondDissipation_ = 0;
46  //Setting also parameters corresponding to the van der Waals force to zero by default
49  charge_ = 0;
50 #ifdef DEBUG_CONSTRUCTOR
51  std::cout<<"ChargedBondedSpecies::ChargedBondedSpecies() finished"<<std::endl;
52 #endif
53 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Definition: ChargedBondedSpecies.h:110
Mdouble vanDerWaalsForceMax_
Definition: ChargedBondedSpecies.h:138
Mdouble bondDissipation_
dissipation in bond
Definition: ChargedBondedSpecies.h:126
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body.
Definition: ChargedBondedSpecies.h:122
int charge_
Definition: ChargedBondedSpecies.h:115
Mdouble vanDerWaalsStiffness_
Definition: ChargedBondedSpecies.h:141
Mdouble adhesionStiffness_
stiffness of linear adhesion force
Definition: ChargedBondedSpecies.h:107

References adhesionForceMax_, adhesionStiffness_, bondDissipation_, bondForceMax_, charge_, vanDerWaalsForceMax_, and vanDerWaalsStiffness_.

◆ ChargedBondedSpecies() [2/2]

ChargedBondedSpecies::ChargedBondedSpecies ( const ChargedBondedSpecies s)

The default constructor.

Copy constructor for charged species

Parameters
[in]sthe species that is copied
60 {
67  charge_ = s.charge_;
68 #ifdef DEBUG_CONSTRUCTOR
69  std::cout<<"ChargedBondedSpecies::ChargedBondedSpecies(const ChargedBondedSpecies &p) finished"<<std::endl;
70 #endif
71 }

References adhesionForceMax_, adhesionStiffness_, bondDissipation_, bondForceMax_, charge_, vanDerWaalsForceMax_, and vanDerWaalsStiffness_.

◆ ~ChargedBondedSpecies()

ChargedBondedSpecies::~ChargedBondedSpecies ( )
default

The default constructor.

Member Function Documentation

◆ getAdhesionForceMax()

Mdouble ChargedBondedSpecies::getAdhesionForceMax ( ) const

Allows the spring constant to be accessed.

174 {
175  return adhesionForceMax_;
176 }

References adhesionForceMax_.

Referenced by ChargedBondedInteraction::computeAdhesionForce(), ChargedBondedInteraction::getElasticEnergy(), and mix().

◆ getAdhesionStiffness()

Mdouble ChargedBondedSpecies::getAdhesionStiffness ( ) const

Allows the spring constant to be accessed.

157 {
158  return adhesionStiffness_;
159 }

References adhesionStiffness_.

Referenced by ChargedBondedInteraction::computeAdhesionForce(), ChargedBondedInteraction::getElasticEnergy(), and mix().

◆ getBaseName()

std::string ChargedBondedSpecies::getBaseName ( ) const

Used in Species::getName to obtain a unique name for each Species.

Returns the name of thebcurrent species

Returns
a string containing the name of the species (minus the word "Species")
107 {
108  return "ChargedBonded";
109 }

◆ getBondDissipation()

Mdouble ChargedBondedSpecies::getBondDissipation ( ) const

Allows the additional dissipation used to damp oscillations between bondd particles to be accessed.

Allows the value of the dissipation between bondd particles to be accessed. This can be used to eliminate oscillations which may arise due to the forces holding the particles together competing with the usual forces which act to push particles in contact apart!

240 {
241  return bondDissipation_;
242 }

References bondDissipation_.

Referenced by ChargedBondedInteraction::computeAdhesionForce(), and mix().

◆ getBondForceMax()

Mdouble ChargedBondedSpecies::getBondForceMax ( ) const

Allows the maximal force for 'bonding' particles together to be accessed.

Allows the the maximal force of the 'bond' used to bond particles together to be accessed.

219 {
220  return bondForceMax_;
221 }

References bondForceMax_.

Referenced by ChargedBondedInteraction::computeAdhesionForce(), ChargedBondedInteraction::getElasticEnergy(), and mix().

◆ getCharge()

int ChargedBondedSpecies::getCharge ( ) const
181 {
182  return charge_;
183 }

References charge_.

◆ getVanDerWaalsForceMax()

Mdouble ChargedBondedSpecies::getVanDerWaalsForceMax ( ) const

◆ getVanDerWaalsStiffness()

Mdouble ChargedBondedSpecies::getVanDerWaalsStiffness ( ) const

◆ mix()

void ChargedBondedSpecies::mix ( ChargedBondedSpecies S,
ChargedBondedSpecies T 
)

creates default values for mixed species

Calling this function acts to assign values of maximum adhesion force and stiffness for mixed species interactions. For all parameters we assume that the harmonic mean of the parameters of the original two species is a sensible default.

Parameters
[in]S,Tthe two species whose properties are mixed to create the new species
120 {
121  //'mixing' properties relating to the charged force interactions between particles
124 
125  //ensuring that, in addition, bond properties are also 'mixed'
128 
129  //and that the van der Waals force also is computed correctly
132 
133  charge_ = 0; //note mixedSpecies dont need charge, it's a particle property.
134 }
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
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
void setAdhesionStiffness(Mdouble new_k0)
Allows the spring constant to be changed.
Definition: ChargedBondedSpecies.cc:145
Mdouble getVanDerWaalsStiffness() const
Definition: ChargedBondedSpecies.cc:280
Mdouble getAdhesionForceMax() const
Allows the spring constant to be accessed.
Definition: ChargedBondedSpecies.cc:173
void setAdhesionForceMax(Mdouble new_f0)
Allows the spring constant to be changed.
Definition: ChargedBondedSpecies.cc:162

References BaseSpecies::average(), bondDissipation_, bondForceMax_, charge_, getAdhesionForceMax(), getAdhesionStiffness(), getBondDissipation(), getBondForceMax(), getVanDerWaalsForceMax(), getVanDerWaalsStiffness(), setAdhesionForceMax(), setAdhesionStiffness(), vanDerWaalsForceMax_, and vanDerWaalsStiffness_.

◆ read()

void ChargedBondedSpecies::read ( std::istream &  is)

Reads the species properties from an input stream.

Parameters
[in]isinput stream (typically the restart file)
91 {
92  std::string dummy;
93  is >> dummy >> adhesionForceMax_;
94  is >> dummy >> adhesionStiffness_;
95  is >> dummy >> charge_;
96  is >> dummy >> bondForceMax_;
97  is >> dummy >> bondDissipation_;
98  is >> dummy >> vanDerWaalsForceMax_;
99  is >> dummy >> vanDerWaalsStiffness_;
100 }

References adhesionForceMax_, adhesionStiffness_, bondDissipation_, bondForceMax_, charge_, vanDerWaalsForceMax_, and vanDerWaalsStiffness_.

◆ setAdhesionForceMax()

void ChargedBondedSpecies::setAdhesionForceMax ( Mdouble  new_f0)

Allows the spring constant to be changed.

163 {
164  if (new_f0 >= 0) {
165  adhesionForceMax_ = new_f0;
167  } else {
168  logger(ERROR, "Error in setAdhesionForceMax");
169  }
170 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ ERROR
void setInteractionDistance()
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: ChargedBondedSpecies.cc:137

References adhesionForceMax_, ERROR, logger, and setInteractionDistance().

Referenced by mix().

◆ setAdhesionStiffness()

void ChargedBondedSpecies::setAdhesionStiffness ( Mdouble  new_k0)

Allows the spring constant to be changed.

146 {
147  if (new_k0 >= 0) {
148  adhesionStiffness_ = new_k0;
150  } else {
151  logger(ERROR, "Error in setAdhesionStiffness");
152  }
153 }

References adhesionStiffness_, ERROR, logger, and setInteractionDistance().

Referenced by mix().

◆ setBondDissipation()

void ChargedBondedSpecies::setBondDissipation ( Mdouble  disp)

Allows the additional dissipation used to damp oscillations between bondd particles to be changed.

Allows the value of the dissipation between bondd particles to be changed. This can be used to eliminate oscillations which may arise due to the forces holding the particles together competing with the usual forces which act to push particles in contact apart!

227 {
228  if (disp >= 0)
229  bondDissipation_ = disp;
230  else
231  {
232  logger(ERROR, "Error in setAdhesionDissipation");
233  }
234 }

References bondDissipation_, ERROR, and logger.

◆ setBondForceMax()

void ChargedBondedSpecies::setBondForceMax ( Mdouble  new_f0)

Allows the spring constant for the BOND to be changed (Do not confuse with the charged interaction strength!)

Allows the spring constant to be changed This means that we can alter the strength with which particles are "bondd" together and, thus, the mean distance by which bondd particles overlap by. As such, we can alter the geometry of multi-particle structures formed.

206 {
207  if (new_f0 >= 0)
208  {
209  bondForceMax_ = new_f0;
210  }
211  else
212  {
213  logger(ERROR, "Error in setBondForceMax");
214  }
215 }

References bondForceMax_, ERROR, and logger.

◆ setCharge()

void ChargedBondedSpecies::setCharge ( int  newCharge)
187 {
188  //making sure that the user can only enter 1 (positive charge) -1 (negative charge)
189  //or zero (no charge)
190  if (newCharge == 0 || newCharge == 1 || newCharge == -1)
191  charge_ = newCharge;
192  else
193  {
194  logger(ERROR, "Error in setCharge - charge must be +1, -1 or zero");
195  }
196 }

References charge_, ERROR, and logger.

◆ setInteractionDistance()

void ChargedBondedSpecies::setInteractionDistance ( )

returns the largest separation distance at which adhesive short-range forces can occur.

Returns
the maximum separation distance below which adhesive forces can occur (needed for contact detection)
138 {
139  logger.assert_debug(adhesionStiffness_ != 0.0,"ChargedBondedSpecies::getInteractionDistance(): adhesionStiffness cannot be zero");
141 }
BaseSpecies * getBaseSpecies() const
Definition: BaseForce.h:35
void setInteractionDistance(Mdouble interactionDistance)
Definition: BaseSpecies.cc:156

References adhesionForceMax_, adhesionStiffness_, BaseForce::getBaseSpecies(), logger, and BaseSpecies::setInteractionDistance().

Referenced by setAdhesionForceMax(), and setAdhesionStiffness().

◆ setVanDerWaalsForceMax()

void ChargedBondedSpecies::setVanDerWaalsForceMax ( Mdouble  fMax)
255 {
256  if (fMax < 0)
257  {
258  logger(ERROR, "Error in setVanDerWaalsForceMax.");
259  }
260  else
261  {
262  vanDerWaalsForceMax_ = fMax;
263  }
264 }

References ERROR, logger, and vanDerWaalsForceMax_.

◆ setVanDerWaalsStiffness()

void ChargedBondedSpecies::setVanDerWaalsStiffness ( Mdouble  stiffness)
275 {
276  vanDerWaalsStiffness_ = stiffness;
277 }

References vanDerWaalsStiffness_.

◆ write()

void ChargedBondedSpecies::write ( std::ostream &  os) const

Writes the species properties to an output stream.

Parameters
[out]osoutput stream (typically the restart file)
77 {
78  os << " adhesionForceMax " << adhesionForceMax_;
79  os << " adhesionStiffness " << adhesionStiffness_;
80  os << " charge " << charge_;
81  os << " bondForceMax " << bondForceMax_;
82  os << " bondDissipation " << bondDissipation_;
83  os << " vanDerWaalsForceMax " << vanDerWaalsForceMax_;
84  os << " vanDerWaalsStiffness " << vanDerWaalsStiffness_;
85 }

References adhesionForceMax_, adhesionStiffness_, bondDissipation_, bondForceMax_, charge_, vanDerWaalsForceMax_, and vanDerWaalsStiffness_.

Member Data Documentation

◆ adhesionForceMax_

Mdouble ChargedBondedSpecies::adhesionForceMax_
private

◆ adhesionStiffness_

Mdouble ChargedBondedSpecies::adhesionStiffness_
private

◆ bondDissipation_

Mdouble ChargedBondedSpecies::bondDissipation_
private

dissipation in bond

the additional dissipation used to 'damp' oscillations between bondd particles

Referenced by ChargedBondedSpecies(), getBondDissipation(), mix(), read(), setBondDissipation(), and write().

◆ bondForceMax_

Mdouble ChargedBondedSpecies::bondForceMax_
private

The maximal force which acts to bind together particles which are "bondd" into a single body.

Referenced by ChargedBondedSpecies(), getBondForceMax(), mix(), read(), setBondForceMax(), and write().

◆ charge_

int ChargedBondedSpecies::charge_
private

◆ vanDerWaalsForceMax_

Mdouble ChargedBondedSpecies::vanDerWaalsForceMax_
private

◆ vanDerWaalsStiffness_

Mdouble ChargedBondedSpecies::vanDerWaalsStiffness_
private

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