MercuryDPM  Alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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...
 
virtual ~ChargedBondedSpecies ()
 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 *const S, ChargedBondedSpecies *const T)
 creates default values for mixed species More...
 
Mdouble getInteractionDistance () const
 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 BaseSpecies
 BaseSpecies ()
 The default constructor. More...
 
 BaseSpecies (const BaseSpecies &p)
 The copy constructor. More...
 
virtual ~BaseSpecies ()
 The default destructor. More...
 
virtual BaseSpeciescopy () const =0
 Creates a deep copy of the object from which it is called. More...
 
void setHandler (SpeciesHandler *handler)
 Sets the pointer to the handler to which this species belongs. More...
 
SpeciesHandlergetHandler () const
 Returns the pointer to the handler to which this species belongs. More...
 
Mdouble average (Mdouble a, Mdouble b)
 defines the average of two variables by the harmonic mean. More...
 
virtual void mixAll (BaseSpecies *const S, BaseSpecies *const T)=0
 creates default values for mixed species More...
 
virtual bool getUseAngularDOFs () const =0
 Returns true if torques (i.e. angular degrees of freedom) have to be calculated. More...
 
virtual BaseInteractiongetNewInteraction (BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp) const =0
 returns new Interaction object. More...
 
- Public Member Functions inherited from BaseObject
 BaseObject ()
 Default constructor. More...
 
 BaseObject (const BaseObject &p)
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()
 virtual destructor More...
 
virtual std::string getName () const =0
 A purely virtual function. More...
 
virtual void moveInHandler (const unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (const unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (const unsigned int 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...
 

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.

Definition at line 36 of file ChargedBondedSpecies.h.

Member Typedef Documentation

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

Definition at line 35 of file ChargedBondedSpecies.cc.

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

36 {
37  //setting adhesion values initially to zero such that, by default, particles do not experience
38  //long range forces
41  //similarly, setting bond properties to zero such that, by default, particles cannot be 'bondd'...
42  bondForceMax_ = 0;
43  //...and do not impart any excess dissipation!
44  bondDissipation_ = 0;
45  //Setting also parameters corresponding to the van der Waals force to zero by default
48  charge_ = 0;
49 #ifdef DEBUG_CONSTRUCTOR
50  std::cout<<"ChargedBondedSpecies::ChargedBondedSpecies() finished"<<std::endl;
51 #endif
52 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
Mdouble bondDissipation_
dissipation in bond
Mdouble adhesionStiffness_
stiffness of linear adhesion force
ChargedBondedSpecies::ChargedBondedSpecies ( const ChargedBondedSpecies s)

The default constructor.

Copy constructor for charged species

Parameters
[in]sthe species that is copied

Definition at line 58 of file ChargedBondedSpecies.cc.

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

59 {
66  charge_ = s.charge_;
67 #ifdef DEBUG_CONSTRUCTOR
68  std::cout<<"ChargedBondedSpecies::ChargedBondedSpecies(const ChargedBondedSpecies &p) finished"<<std::endl;
69 #endif
70 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
Mdouble bondDissipation_
dissipation in bond
Mdouble adhesionStiffness_
stiffness of linear adhesion force
ChargedBondedSpecies::~ChargedBondedSpecies ( )
virtual

The default constructor.

Definition at line 72 of file ChargedBondedSpecies.cc.

73 {
74 #ifdef DEBUG_DESTRUCTOR
75  std::cout<<"ChargedBondedSpecies::~ChargedBondedSpecies() finished"<<std::endl;
76 #endif
77 }

Member Function Documentation

Mdouble ChargedBondedSpecies::getAdhesionForceMax ( ) const

Allows the spring constant to be accessed.

Definition at line 185 of file ChargedBondedSpecies.cc.

References adhesionForceMax_.

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

186 {
187  return adhesionForceMax_;
188 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Mdouble ChargedBondedSpecies::getAdhesionStiffness ( ) const

Allows the spring constant to be accessed.

Definition at line 168 of file ChargedBondedSpecies.cc.

References adhesionStiffness_.

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

169 {
170  return adhesionStiffness_;
171 }
Mdouble adhesionStiffness_
stiffness of linear adhesion force
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 114 of file ChargedBondedSpecies.cc.

115 {
116  return "ChargedBonded";
117 }
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 249 of file ChargedBondedSpecies.cc.

References bondDissipation_.

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

250 {
251  return bondDissipation_;
252 }
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 228 of file ChargedBondedSpecies.cc.

References bondForceMax_.

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

229 {
230  return bondForceMax_;
231 }
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 192 of file ChargedBondedSpecies.cc.

References charge_.

192  {
193  return charge_;
194 }
Mdouble ChargedBondedSpecies::getInteractionDistance ( ) const
virtual

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)

Implements BaseSpecies.

Definition at line 145 of file ChargedBondedSpecies.cc.

References adhesionForceMax_, and adhesionStiffness_.

Referenced by ChargedBondedInteraction::getElasticEnergy().

146 {
147  if (adhesionStiffness_ != 0.0)
149  else
150  {
151  std::cerr << "ChargedBondedSpecies::getInteractionDistance(): adhesionStiffness cannot be zero" << std::endl;
152  exit(-1);
153  }
154 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Mdouble adhesionStiffness_
stiffness of linear adhesion force
Mdouble ChargedBondedSpecies::getVanDerWaalsForceMax ( ) const
Mdouble ChargedBondedSpecies::getVanDerWaalsStiffness ( ) const
void ChargedBondedSpecies::mix ( ChargedBondedSpecies *const  S,
ChargedBondedSpecies *const  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

Definition at line 127 of file ChargedBondedSpecies.cc.

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

128 {
129  //'mixing' properties relating to the charged force interactions between particles
132 
133  //ensuring that, in addition, bond properties are also 'mixed'
136 
137  //and that the van der Waals force also is computed correctly
140 
141  charge_ = 0; //note mixedSpecies dont need charge, it's a particle property.
142 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Mdouble getVanDerWaalsForceMax() const
Mdouble getAdhesionForceMax() const
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...
Mdouble average(Mdouble a, Mdouble b)
defines the average of two variables by the harmonic mean.
Definition: BaseSpecies.cc:85
Mdouble getAdhesionStiffness() const
Allows the spring constant to be accessed.
Mdouble bondDissipation_
dissipation in bond
Mdouble getBondForceMax() const
Allows the maximal force for 'bonding' particles together to be accessed.
Mdouble adhesionStiffness_
stiffness of linear adhesion force
void ChargedBondedSpecies::read ( std::istream &  is)
virtual

Reads the species properties from an input stream.

Parameters
[in]isinput stream (typically the restart file)

Implements BaseObject.

Definition at line 96 of file ChargedBondedSpecies.cc.

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

97 {
98  std::string dummy;
99  is >> dummy >> adhesionForceMax_;
100  is >> dummy >> adhesionStiffness_;
101  logger(INFO,"adhesionForceMax_ %", adhesionForceMax_);
102  is >> dummy >> charge_;
103  logger(INFO,"charge % %", dummy, charge_);
104  is >> dummy >> bondForceMax_;
105  is >> dummy >> bondDissipation_;
106  is >> dummy >> vanDerWaalsForceMax_;
107  is >> dummy >> vanDerWaalsStiffness_;
108 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
Mdouble bondDissipation_
dissipation in bond
Mdouble adhesionStiffness_
stiffness of linear adhesion force
void ChargedBondedSpecies::setAdhesionForceMax ( Mdouble  new_f0)

Allows the spring constant to be changed.

Definition at line 174 of file ChargedBondedSpecies.cc.

References adhesionForceMax_.

175 {
176  if (new_f0 >= 0)
177  adhesionForceMax_ = new_f0;
178  else
179  {
180  std::cerr << "Error in setBondForceMax" << std::endl;
181  exit(-1);
182  }
183 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
void ChargedBondedSpecies::setAdhesionStiffness ( Mdouble  new_k0)

Allows the spring constant to be changed.

Definition at line 157 of file ChargedBondedSpecies.cc.

References adhesionStiffness_.

158 {
159  if (new_k0 >= 0)
160  adhesionStiffness_ = new_k0;
161  else
162  {
163  std::cerr << "Error in setAdhesionStiffness" << std::endl;
164  exit(-1);
165  }
166 }
Mdouble adhesionStiffness_
stiffness of linear adhesion force
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 236 of file ChargedBondedSpecies.cc.

References bondDissipation_.

237 {
238  if (disp >= 0)
239  bondDissipation_ = disp;
240  else
241  {
242  std::cerr << "Error in setAdhesionDissipation" << std::endl;
243  exit(-1);
244  }
245 }
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 217 of file ChargedBondedSpecies.cc.

References bondForceMax_.

217  {
218  if (new_f0 >= 0) {
219  bondForceMax_ = new_f0;
220  }
221  else {
222  std::cerr << "Error in setBondForceMax" << std::endl;
223  exit(-1);
224  }
225 }
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 197 of file ChargedBondedSpecies.cc.

References charge_.

198 {
199  //making sure that the user can only enter 1 (positive charge) -1 (negative charge)
200  //or zero (no charge)
201  if (newCharge == 0 || newCharge == 1 || newCharge == -1)
202  charge_ = newCharge;
203  else
204  {
205  std::cerr << "Error in setCharge - charge must be +1, -1 or zero" << std::endl;
206  exit(-1);
207  }
208 }
void ChargedBondedSpecies::setVanDerWaalsForceMax ( Mdouble  fMax)

Definition at line 264 of file ChargedBondedSpecies.cc.

References vanDerWaalsForceMax_.

265 {
266  if ( fMax < 0 ) {
267  std::cerr << "Error in setVanDerWaalsForceMax." << std::endl;
268  exit(-1);
269  }
270  else {
271  vanDerWaalsForceMax_ = fMax;
272  }
273 }
void ChargedBondedSpecies::setVanDerWaalsStiffness ( Mdouble  stiffness)

Definition at line 283 of file ChargedBondedSpecies.cc.

References vanDerWaalsStiffness_.

284 {
285  vanDerWaalsStiffness_ = stiffness;
286 }
void ChargedBondedSpecies::write ( std::ostream &  os) const
virtual

Writes the species properties to an output stream.

Parameters
[out]osoutput stream (typically the restart file)

Implements BaseObject.

Definition at line 82 of file ChargedBondedSpecies.cc.

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

83 {
84  os << " adhesionForceMax " << adhesionForceMax_;
85  os << " adhesionStiffness " << adhesionStiffness_;
86  os << " charge " << charge_;
87  os << " bondForceMax " << bondForceMax_;
88  os << " bondDissipation " << bondDissipation_;
89  os << " vanDerWaalsForceMax " << vanDerWaalsForceMax_;
90  os << " vanDerWaalsStiffness " << vanDerWaalsStiffness_;
91 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body...
Mdouble bondDissipation_
dissipation in bond
Mdouble adhesionStiffness_
stiffness of linear adhesion force

Member Data Documentation

Mdouble ChargedBondedSpecies::adhesionForceMax_
private

adhesion force at zero overlap

Definition at line 109 of file ChargedBondedSpecies.h.

Referenced by ChargedBondedSpecies(), getAdhesionForceMax(), getInteractionDistance(), mix(), read(), setAdhesionForceMax(), and write().

Mdouble ChargedBondedSpecies::adhesionStiffness_
private

stiffness of linear adhesion force

Definition at line 106 of file ChargedBondedSpecies.h.

Referenced by ChargedBondedSpecies(), getAdhesionStiffness(), getInteractionDistance(), mix(), read(), setAdhesionStiffness(), and write().

Mdouble ChargedBondedSpecies::bondDissipation_
private

dissipation in bond

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

Definition at line 125 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 121 of file ChargedBondedSpecies.h.

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

int ChargedBondedSpecies::charge_
private

Definition at line 114 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: