MercuryDPM  Trunk
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...

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

Allows the spring constant to be changed. More...

Allows the spring constant to be accessed. More...

Allows the spring constant to be changed. More...

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

stiffness of linear adhesion force More...

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.

Definition at line 37 of file ChargedBondedSpecies.h.

Member Typedef Documentation

The correct Interaction type for this AdhesiveForceSpecies.

Definition at line 41 of file ChargedBondedSpecies.h.

Constructor & Destructor Documentation

 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] s the species that is copied

Definition at line 36 of file ChargedBondedSpecies.cc.

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 bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
Mdouble bondDissipation_
dissipation in bond
 ChargedBondedSpecies::ChargedBondedSpecies ( const ChargedBondedSpecies & s )

The default constructor.

Copy constructor for charged species

Parameters
 [in] s the species that is copied

Definition at line 59 of file ChargedBondedSpecies.cc.

60 {
67  charge_ = s.charge_;
68 #ifdef DEBUG_CONSTRUCTOR
69  std::cout<<"ChargedBondedSpecies::ChargedBondedSpecies(const ChargedBondedSpecies &p) finished"<<std::endl;
70 #endif
71 }
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
Mdouble bondDissipation_
dissipation in bond
 ChargedBondedSpecies::~ChargedBondedSpecies ( )
default

The default constructor.

Member Function Documentation

Allows the spring constant to be accessed.

Definition at line 173 of file ChargedBondedSpecies.cc.

174 {
176 }

Allows the spring constant to be accessed.

Definition at line 156 of file ChargedBondedSpecies.cc.

157 {
159 }
 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")

Definition at line 106 of file ChargedBondedSpecies.cc.

107 {
108  return "ChargedBonded";
109 }
 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!

Definition at line 242 of file ChargedBondedSpecies.cc.

References bondDissipation_.

243 {
244  return bondDissipation_;
245 }
Mdouble bondDissipation_
dissipation in bond
 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.

Definition at line 220 of file ChargedBondedSpecies.cc.

References bondForceMax_.

221 {
222  return bondForceMax_;
223 }
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
 int ChargedBondedSpecies::getCharge ( ) const

Definition at line 180 of file ChargedBondedSpecies.cc.

References charge_.

181 {
182  return charge_;
183 }
 Mdouble ChargedBondedSpecies::getVanDerWaalsForceMax ( ) const

Definition at line 271 of file ChargedBondedSpecies.cc.

References vanDerWaalsForceMax_.

272 {
273  return vanDerWaalsForceMax_;
274 }
 Mdouble ChargedBondedSpecies::getVanDerWaalsStiffness ( ) const

Definition at line 284 of file ChargedBondedSpecies.cc.

References vanDerWaalsStiffness_.

285 {
286  return vanDerWaalsStiffness_;
287 }
 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,T the two species whose properties are mixed to create the new species

Definition at line 119 of file ChargedBondedSpecies.cc.

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 }
Mdouble getVanDerWaalsForceMax() const
Allows the spring constant to be changed.
Allows the spring constant to be accessed.
Mdouble getBondDissipation() const
Allows the additional dissipation used to damp oscillations between bondd particles to be accessed...
Mdouble getVanDerWaalsStiffness() const
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
Allows the spring constant to be accessed.
Mdouble bondDissipation_
dissipation in bond
Allows the spring constant to be changed.
Mdouble getBondForceMax() const
Allows the maximal force for 'bonding' particles together to be accessed.
 void ChargedBondedSpecies::read ( std::istream & is )

Reads the species properties from an input stream.

Parameters
 [in] is input stream (typically the restart file)

Definition at line 90 of file ChargedBondedSpecies.cc.

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 }
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
Mdouble bondDissipation_
dissipation in bond
 void ChargedBondedSpecies::setAdhesionForceMax ( Mdouble new_f0 )

Allows the spring constant to be changed.

Definition at line 162 of file ChargedBondedSpecies.cc.

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

Referenced by mix().

163 {
164  if (new_f0 >= 0) {
167  } else {
169  }
170 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setInteractionDistance()
returns the largest separation distance at which adhesive short-range forces can occur.
 void ChargedBondedSpecies::setAdhesionStiffness ( Mdouble new_k0 )

Allows the spring constant to be changed.

Definition at line 145 of file ChargedBondedSpecies.cc.

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

Referenced by mix().

146 {
147  if (new_k0 >= 0) {
150  } else {
152  }
153 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setInteractionDistance()
returns the largest separation distance at which adhesive short-range forces can occur.
 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!

Definition at line 228 of file ChargedBondedSpecies.cc.

References bondDissipation_.

229 {
230  if (disp >= 0)
231  bondDissipation_ = disp;
232  else
233  {
234  std::cerr << "Error in setAdhesionDissipation" << std::endl;
235  exit(-1);
236  }
237 }
Mdouble bondDissipation_
dissipation in bond
 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.

Definition at line 206 of file ChargedBondedSpecies.cc.

References bondForceMax_.

207 {
208  if (new_f0 >= 0)
209  {
210  bondForceMax_ = new_f0;
211  }
212  else
213  {
214  std::cerr << "Error in setBondForceMax" << std::endl;
215  exit(-1);
216  }
217 }
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
 void ChargedBondedSpecies::setCharge ( int newCharge )

Definition at line 186 of file ChargedBondedSpecies.cc.

References charge_.

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  std::cerr << "Error in setCharge - charge must be +1, -1 or zero" << std::endl;
195  exit(-1);
196  }
197 }
 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)

Definition at line 137 of file ChargedBondedSpecies.cc.

138 {
141 }
BaseSpecies * getBaseSpecies() const
Definition: BaseForce.h:35
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void setInteractionDistance(Mdouble interactionDistance)
Sets BaseSpecies::interactionDistance_.
Definition: BaseSpecies.cc:156
 void ChargedBondedSpecies::setVanDerWaalsForceMax ( Mdouble fMax )

Definition at line 257 of file ChargedBondedSpecies.cc.

References vanDerWaalsForceMax_.

258 {
259  if (fMax < 0)
260  {
261  std::cerr << "Error in setVanDerWaalsForceMax." << std::endl;
262  exit(-1);
263  }
264  else
265  {
266  vanDerWaalsForceMax_ = fMax;
267  }
268 }
 void ChargedBondedSpecies::setVanDerWaalsStiffness ( Mdouble stiffness )

Definition at line 278 of file ChargedBondedSpecies.cc.

References vanDerWaalsStiffness_.

279 {
280  vanDerWaalsStiffness_ = stiffness;
281 }
 void ChargedBondedSpecies::write ( std::ostream & os ) const

Writes the species properties to an output stream.

Parameters
 [out] os output stream (typically the restart file)

Definition at line 76 of file ChargedBondedSpecies.cc.

77 {
80  os << " charge " << charge_;
81  os << " bondForceMax " << bondForceMax_;
82  os << " bondDissipation " << bondDissipation_;
83  os << " vanDerWaalsForceMax " << vanDerWaalsForceMax_;
84  os << " vanDerWaalsStiffness " << vanDerWaalsStiffness_;
85 }
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
Mdouble bondDissipation_
dissipation in bond

Member Data Documentation

private

Definition at line 110 of file ChargedBondedSpecies.h.

private

Definition at line 107 of file ChargedBondedSpecies.h.

 Mdouble ChargedBondedSpecies::bondDissipation_
private

dissipation in bond

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

Definition at line 126 of file ChargedBondedSpecies.h.

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

 Mdouble ChargedBondedSpecies::bondForceMax_
private

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

Definition at line 122 of file ChargedBondedSpecies.h.

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

 int ChargedBondedSpecies::charge_
private

Definition at line 115 of file ChargedBondedSpecies.h.

Referenced by ChargedBondedSpecies(), getCharge(), mix(), read(), setCharge(), and write().

 Mdouble ChargedBondedSpecies::vanDerWaalsForceMax_
private
 Mdouble ChargedBondedSpecies::vanDerWaalsStiffness_
private

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