MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.

Definition at line 38 of file BondedSpecies.h.

Member Typedef Documentation

The correct Interaction type for this AdhesiveForceSpecies.

Definition at line 42 of file BondedSpecies.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file BondedSpecies.cc.

References bondDissipation_, and bondForceMax_.

36 {
37  bondForceMax_ = 0;
38  bondDissipation_ = 0;
39 #ifdef DEBUG_CONSTRUCTOR
40  std::cout<<"BondedSpecies::BondedSpecies() finished"<<std::endl;
41 #endif
42 }
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:80
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:83
BondedSpecies::BondedSpecies ( const BondedSpecies s)

The default copy constructor.

Parameters
[in]thespecies that is copied

Definition at line 47 of file BondedSpecies.cc.

References bondDissipation_, and bondForceMax_.

48 {
51 #ifdef DEBUG_CONSTRUCTOR
52  std::cout<<"BondedSpecies::BondedSpecies(const BondedSpecies &p) finished"<<std::endl;
53 #endif
54 }
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:80
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:83
BondedSpecies::~BondedSpecies ( )

The default destructor.

Definition at line 56 of file BondedSpecies.cc.

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

Member Function Documentation

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")

Definition at line 66 of file BondedSpecies.cc.

67 {
68  return "Bonded";
69 }
Mdouble BondedSpecies::getBondDissipation ( ) const

Allows the spring constant to be accessed.

Definition at line 102 of file BondedSpecies.cc.

References bondDissipation_.

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

103 {
104  return bondDissipation_;
105 }
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:80
Mdouble BondedSpecies::getBondForceMax ( ) const

Allows bondForceMax_ to be accessed.

Allows the spring constant to be accessed.

Definition at line 132 of file BondedSpecies.cc.

References bondForceMax_.

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

133 {
134  return bondForceMax_;
135 }
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:83
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

Definition at line 95 of file BondedSpecies.cc.

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

96 {
99 }
Mdouble getBondDissipation() const
Allows the spring constant to be accessed.
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:80
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:83
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
Mdouble getBondForceMax() const
Allows bondForceMax_ to be accessed.
void BondedSpecies::read ( std::istream &  is)

Reads the species properties from an input stream.

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

Definition at line 83 of file BondedSpecies.cc.

References bondDissipation_, and bondForceMax_.

84 {
85  std::string dummy;
86  is >> dummy >> bondForceMax_;
87  is >> dummy >> bondDissipation_;
88 }
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:80
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:83
void BondedSpecies::setBondDissipation ( Mdouble  disp)

Allows the spring constant to be changed.

Definition at line 120 of file BondedSpecies.cc.

References bondDissipation_.

121 {
122  if (disp >= 0)
123  bondDissipation_ = disp;
124  else
125  {
126  std::cerr << "Error in setBondDissipation" << std::endl;
127  exit(-1);
128  }
129 }
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:80
void BondedSpecies::setBondForceMax ( Mdouble  new_f0)

Allows bondForceMax_ to be changed.

Allows the spring constant to be changed.

Definition at line 108 of file BondedSpecies.cc.

References bondForceMax_.

109 {
110  if (new_f0 >= 0)
111  bondForceMax_ = new_f0;
112  else
113  {
114  std::cerr << "Error in setBondForceMax" << std::endl;
115  exit(-1);
116  }
117 }
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:83
void BondedSpecies::write ( std::ostream &  os) const

Writes the species properties to an output stream.

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

Definition at line 74 of file BondedSpecies.cc.

References bondDissipation_, and bondForceMax_.

75 {
76  os << " bondForceMax " << bondForceMax_;
77  os << " bondDissipation " << bondDissipation_;
78 }
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:80
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:83

Member Data Documentation

Mdouble BondedSpecies::bondDissipation_
private

dissipation in bond

Definition at line 80 of file BondedSpecies.h.

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

Mdouble BondedSpecies::bondForceMax_
private

adhesion force at zero overlap

Definition at line 83 of file BondedSpecies.h.

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


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