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
16 {
17  //setting adhesion values initially to zero such that, by default, particles do not experience
18  //long range forces
21  //similarly, setting bond properties to zero such that, by default, particles cannot be 'bondd'...
22  bondForceMax_ = 0;
23  //...and do not impart any excess dissipation!
24  bondDissipation_ = 0;
25  //Setting also parameters corresponding to the van der Waals force to zero by default
28  charge_ = 0;
29 #ifdef DEBUG_CONSTRUCTOR
30  std::cout<<"ChargedBondedSpecies::ChargedBondedSpecies() finished"<<std::endl;
31 #endif
32 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Definition: ChargedBondedSpecies.h:89
Mdouble vanDerWaalsForceMax_
Definition: ChargedBondedSpecies.h:117
Mdouble bondDissipation_
dissipation in bond
Definition: ChargedBondedSpecies.h:105
Mdouble bondForceMax_
The maximal force which acts to bind together particles which are "bondd" into a single body.
Definition: ChargedBondedSpecies.h:101
int charge_
Definition: ChargedBondedSpecies.h:94
Mdouble vanDerWaalsStiffness_
Definition: ChargedBondedSpecies.h:120
Mdouble adhesionStiffness_
stiffness of linear adhesion force
Definition: ChargedBondedSpecies.h:86

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
39 {
40  adhesionForceMax_ = s.adhesionForceMax_;
41  adhesionStiffness_ = s.adhesionStiffness_;
42  bondForceMax_ = s.bondForceMax_;
43  bondDissipation_ = s.bondDissipation_;
44  vanDerWaalsForceMax_ = s.vanDerWaalsForceMax_;
45  vanDerWaalsStiffness_ = s.vanDerWaalsStiffness_;
46  charge_ = s.charge_;
47 #ifdef DEBUG_CONSTRUCTOR
48  std::cout<<"ChargedBondedSpecies::ChargedBondedSpecies(const ChargedBondedSpecies &p) finished"<<std::endl;
49 #endif
50 }
RealScalar s
Definition: level1_cplx_impl.h:130

References adhesionForceMax_, adhesionStiffness_, bondDissipation_, bondForceMax_, charge_, s, 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.

153 {
154  return adhesionForceMax_;
155 }

References adhesionForceMax_.

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

◆ getAdhesionStiffness()

Mdouble ChargedBondedSpecies::getAdhesionStiffness ( ) const

Allows the spring constant to be accessed.

136 {
137  return adhesionStiffness_;
138 }

References adhesionStiffness_.

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

◆ 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")
86 {
87  return "ChargedBonded";
88 }

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

219 {
220  return bondDissipation_;
221 }

References bondDissipation_.

Referenced by ChargedBondedInteraction::computeAdhesionForce().

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

198 {
199  return bondForceMax_;
200 }

References bondForceMax_.

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

◆ getCharge()

int ChargedBondedSpecies::getCharge ( ) const
160 {
161  return charge_;
162 }

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
99 {
100  //'mixing' properties relating to the charged force interactions between particles
101  setAdhesionForceMax(BaseSpecies::average(S->getAdhesionForceMax(), T->getAdhesionForceMax()));
102  setAdhesionStiffness(BaseSpecies::average(S->getAdhesionStiffness(), T->getAdhesionStiffness()));
103 
104  //ensuring that, in addition, bond properties are also 'mixed'
105  bondForceMax_ = BaseSpecies::average(S->getBondForceMax(), T->getBondForceMax());
106  bondDissipation_ = BaseSpecies::average(S->getBondDissipation(), T->getBondDissipation());
107 
108  //and that the van der Waals force also is computed correctly
109  vanDerWaalsForceMax_ = BaseSpecies::average(S->getVanDerWaalsForceMax(), T->getVanDerWaalsForceMax());
110  vanDerWaalsStiffness_ = BaseSpecies::average(S->getVanDerWaalsStiffness(), T->getVanDerWaalsStiffness());
111 
112  charge_ = 0; //note mixedSpecies dont need charge, it's a particle property.
113 }
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:89
void setAdhesionStiffness(Mdouble new_k0)
Allows the spring constant to be changed.
Definition: ChargedBondedSpecies.cc:124
void setAdhesionForceMax(Mdouble new_f0)
Allows the spring constant to be changed.
Definition: ChargedBondedSpecies.cc:141
@ S
Definition: quadtree.h:62

References BaseSpecies::average(), bondDissipation_, bondForceMax_, charge_, oomph::QuadTreeNames::S, 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)
70 {
71  std::string dummy;
72  is >> dummy >> adhesionForceMax_;
73  is >> dummy >> adhesionStiffness_;
74  is >> dummy >> charge_;
75  is >> dummy >> bondForceMax_;
76  is >> dummy >> bondDissipation_;
77  is >> dummy >> vanDerWaalsForceMax_;
78  is >> dummy >> vanDerWaalsStiffness_;
79 }
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References adhesionForceMax_, adhesionStiffness_, bondDissipation_, bondForceMax_, charge_, oomph::Global_string_for_annotation::string(), vanDerWaalsForceMax_, and vanDerWaalsStiffness_.

◆ setAdhesionForceMax()

void ChargedBondedSpecies::setAdhesionForceMax ( Mdouble  new_f0)

Allows the spring constant to be changed.

142 {
143  if (new_f0 >= 0) {
144  adhesionForceMax_ = new_f0;
146  } else {
147  logger(ERROR, "Error in setAdhesionForceMax");
148  }
149 }
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:116

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

Referenced by mix().

◆ setAdhesionStiffness()

void ChargedBondedSpecies::setAdhesionStiffness ( Mdouble  new_k0)

Allows the spring constant to be changed.

125 {
126  if (new_k0 >= 0) {
127  adhesionStiffness_ = new_k0;
129  } else {
130  logger(ERROR, "Error in setAdhesionStiffness");
131  }
132 }

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!

206 {
207  if (disp >= 0)
208  bondDissipation_ = disp;
209  else
210  {
211  logger(ERROR, "Error in setAdhesionDissipation");
212  }
213 }

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.

185 {
186  if (new_f0 >= 0)
187  {
188  bondForceMax_ = new_f0;
189  }
190  else
191  {
192  logger(ERROR, "Error in setBondForceMax");
193  }
194 }

References bondForceMax_, ERROR, and logger.

◆ setCharge()

void ChargedBondedSpecies::setCharge ( int  newCharge)
166 {
167  //making sure that the user can only enter 1 (positive charge) -1 (negative charge)
168  //or zero (no charge)
169  if (newCharge == 0 || newCharge == 1 || newCharge == -1)
170  charge_ = newCharge;
171  else
172  {
173  logger(ERROR, "Error in setCharge - charge must be +1, -1 or zero");
174  }
175 }

References charge_, ERROR, and logger.

◆ setInteractionDistance()

void ChargedBondedSpecies::setInteractionDistance ( )
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)

Reimplemented from BaseAdhesiveForce.

117 {
118  logger.assert_debug(adhesionStiffness_ != 0.0,"ChargedBondedSpecies::getInteractionDistance(): adhesionStiffness cannot be zero");
120 }
BaseSpecies * getBaseSpecies() const
Definition: BaseForce.h:15
void setInteractionDistance(Mdouble interactionDistance)
Definition: BaseSpecies.cc:135

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

Referenced by setAdhesionForceMax(), and setAdhesionStiffness().

◆ setVanDerWaalsForceMax()

void ChargedBondedSpecies::setVanDerWaalsForceMax ( Mdouble  fMax)
234 {
235  if (fMax < 0)
236  {
237  logger(ERROR, "Error in setVanDerWaalsForceMax.");
238  }
239  else
240  {
241  vanDerWaalsForceMax_ = fMax;
242  }
243 }

References ERROR, logger, and vanDerWaalsForceMax_.

◆ setVanDerWaalsStiffness()

void ChargedBondedSpecies::setVanDerWaalsStiffness ( Mdouble  stiffness)
254 {
255  vanDerWaalsStiffness_ = stiffness;
256 }

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)
56 {
57  os << " adhesionForceMax " << adhesionForceMax_;
58  os << " adhesionStiffness " << adhesionStiffness_;
59  os << " charge " << charge_;
60  os << " bondForceMax " << bondForceMax_;
61  os << " bondDissipation " << bondDissipation_;
62  os << " vanDerWaalsForceMax " << vanDerWaalsForceMax_;
63  os << " vanDerWaalsStiffness " << vanDerWaalsStiffness_;
64 }

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: