BondedSpecies Class Reference

BondedSpecies contains the parameters used to describe a linear irreversible short-range force. More...

#include <BondedSpecies.h>

+ Inheritance diagram for BondedSpecies:

Public Types

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

Public Member Functions

 BondedSpecies ()
 The default constructor. More...
 
 BondedSpecies (const BondedSpecies &s)
 The default copy constructor. More...
 
 ~BondedSpecies ()
 The default destructor. 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 (BondedSpecies *S, BondedSpecies *T)
 creates default values for mixed species More...
 
void setBondDissipation (Mdouble disp)
 Allows the spring constant to be changed. More...
 
Mdouble getBondDissipation () const
 Allows the spring constant to be accessed. More...
 
void setBondForceMax (Mdouble new_f0)
 Allows bondForceMax_ to be changed. More...
 
Mdouble getBondForceMax () const
 Allows bondForceMax_ to be accessed. More...
 
- Public Member Functions inherited from BaseForce
BaseSpeciesgetBaseSpecies () const
 
void setBaseSpecies (BaseSpecies *baseSpecies)
 

Private Attributes

Mdouble bondDissipation_
 dissipation in bond More...
 
Mdouble bondForceMax_
 adhesion force at zero overlap More...
 

Detailed Description

BondedSpecies contains the parameters used to describe a linear irreversible short-range force.

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

Member Typedef Documentation

◆ InteractionType

The correct Interaction type for this AdhesiveForceSpecies.

Constructor & Destructor Documentation

◆ BondedSpecies() [1/2]

BondedSpecies::BondedSpecies ( )

The default constructor.

Default constructor for gluable 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
36 {
37  bondForceMax_ = 0;
38  bondDissipation_ = 0;
39 #ifdef DEBUG_CONSTRUCTOR
40  std::cout<<"BondedSpecies::BondedSpecies() finished"<<std::endl;
41 #endif
42 }
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:83
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:80

References bondDissipation_, and bondForceMax_.

◆ BondedSpecies() [2/2]

BondedSpecies::BondedSpecies ( const BondedSpecies s)

The default copy constructor.

Parameters
[in]thespecies that is copied
48 {
51 #ifdef DEBUG_CONSTRUCTOR
52  std::cout<<"BondedSpecies::BondedSpecies(const BondedSpecies &p) finished"<<std::endl;
53 #endif
54 }

References bondDissipation_, and bondForceMax_.

◆ ~BondedSpecies()

BondedSpecies::~BondedSpecies ( )

The default destructor.

57 {
58 #ifdef DEBUG_DESTRUCTOR
59  std::cout<<"BondedSpecies::~BondedSpecies() finished"<<std::endl;
60 #endif
61 }

Member Function Documentation

◆ getBaseName()

std::string BondedSpecies::getBaseName ( ) const

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

Returns
a string containing the name of the species (minus the word "Species")
67 {
68  return "Bonded";
69 }

◆ getBondDissipation()

Mdouble BondedSpecies::getBondDissipation ( ) const

Allows the spring constant to be accessed.

103 {
104  return bondDissipation_;
105 }

References bondDissipation_.

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

◆ getBondForceMax()

Mdouble BondedSpecies::getBondForceMax ( ) const

Allows bondForceMax_ to be accessed.

Allows the spring constant to be accessed.

131 {
132  return bondForceMax_;
133 }

References bondForceMax_.

Referenced by BondedInteraction::bond(), BondedInteraction::getElasticEnergy(), and mix().

◆ mix()

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

creates default values for mixed species

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
96 {
99 }
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
Mdouble getBondDissipation() const
Allows the spring constant to be accessed.
Definition: BondedSpecies.cc:102
Mdouble getBondForceMax() const
Allows bondForceMax_ to be accessed.
Definition: BondedSpecies.cc:130

References BaseSpecies::average(), bondDissipation_, bondForceMax_, getBondDissipation(), and getBondForceMax().

◆ read()

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

Reads the species properties from an input stream.

Parameters
[in]isinput stream (typically the restart file)
84 {
85  std::string dummy;
86  is >> dummy >> bondForceMax_;
87  is >> dummy >> bondDissipation_;
88 }

References bondDissipation_, and bondForceMax_.

◆ setBondDissipation()

void BondedSpecies::setBondDissipation ( Mdouble  disp)

Allows the spring constant to be changed.

120 {
121  if (disp >= 0)
122  bondDissipation_ = disp;
123  else
124  {
125  logger(ERROR, "Error in setBondDissipation");
126  }
127 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ ERROR

References bondDissipation_, ERROR, and logger.

◆ setBondForceMax()

void BondedSpecies::setBondForceMax ( Mdouble  new_f0)

Allows bondForceMax_ to be changed.

Allows the spring constant to be changed.

109 {
110  if (new_f0 >= 0)
111  bondForceMax_ = new_f0;
112  else
113  {
114  logger(ERROR, "Error in setBondForceMax");
115  }
116 }

References bondForceMax_, ERROR, and logger.

◆ write()

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

Writes the species properties to an output stream.

Parameters
[out]osoutput stream (typically the restart file)
75 {
76  os << " bondForceMax " << bondForceMax_;
77  os << " bondDissipation " << bondDissipation_;
78 }

References bondDissipation_, and bondForceMax_.

Member Data Documentation

◆ bondDissipation_

Mdouble BondedSpecies::bondDissipation_
private

dissipation in bond

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

◆ bondForceMax_

Mdouble BondedSpecies::bondForceMax_
private

adhesion force at zero overlap

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


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