MercuryDPM  Alpha
 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...
 
virtual ~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 *const S, BondedSpecies *const 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 the spring constant to be changed. More...
 
Mdouble getBondForceMax () const
 Allows the spring constant to be accessed. More...
 
Mdouble getInteractionDistance () const
 returns the largest separation distance at which adhesive short-range forces can occur (0.0 for the default EmptyAdhesiveSpecies). More...
 
- 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 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 37 of file BondedSpecies.h.

Member Typedef Documentation

The correct Interaction type for this AdhesiveForceSpecies.

Definition at line 41 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 34 of file BondedSpecies.cc.

References bondDissipation_, and bondForceMax_.

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

The default copy constructor.

Parameters
[in]thespecies that is copied

Definition at line 46 of file BondedSpecies.cc.

References bondDissipation_, and bondForceMax_.

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

The default destructor.

Definition at line 55 of file BondedSpecies.cc.

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

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 65 of file BondedSpecies.cc.

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

Allows the spring constant to be accessed.

Definition at line 101 of file BondedSpecies.cc.

References bondDissipation_.

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

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

Allows the spring constant to be accessed.

Definition at line 131 of file BondedSpecies.cc.

References bondForceMax_.

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

132 {
133  return bondForceMax_;
134 }
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:85
Mdouble BondedSpecies::getInteractionDistance ( ) const
virtual

returns the largest separation distance at which adhesive short-range forces can occur (0.0 for the default EmptyAdhesiveSpecies).

Returns
the maximum separation distance below which adhesive forces can occur (needed for contact detection)

Implements BaseSpecies.

Definition at line 137 of file BondedSpecies.cc.

138 {
139  return 0.0;
140 }
void BondedSpecies::mix ( BondedSpecies *const  S,
BondedSpecies *const  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 94 of file BondedSpecies.cc.

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

95 {
98 }
Mdouble getBondDissipation() const
Allows the spring constant to be accessed.
Mdouble bondDissipation_
dissipation in bond
Definition: BondedSpecies.h:82
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:85
Mdouble average(Mdouble a, Mdouble b)
defines the average of two variables by the harmonic mean.
Definition: BaseSpecies.cc:85
Mdouble getBondForceMax() const
Allows the spring constant to be accessed.
void BondedSpecies::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 82 of file BondedSpecies.cc.

References bondDissipation_, and bondForceMax_.

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

Allows the spring constant to be changed.

Definition at line 119 of file BondedSpecies.cc.

References bondDissipation_.

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

Allows the spring constant to be changed.

Definition at line 107 of file BondedSpecies.cc.

References bondForceMax_.

108 {
109  if (new_f0 >= 0)
110  bondForceMax_ = new_f0;
111  else
112  {
113  std::cerr << "Error in setBondForceMax" << std::endl;
114  exit(-1);
115  }
116 }
Mdouble bondForceMax_
adhesion force at zero overlap
Definition: BondedSpecies.h:85
void BondedSpecies::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 73 of file BondedSpecies.cc.

References bondDissipation_, and bondForceMax_.

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

Member Data Documentation

Mdouble BondedSpecies::bondDissipation_
private

dissipation in bond

Definition at line 82 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 85 of file BondedSpecies.h.

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


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