ReversibleAdhesiveSpecies Class Reference

ReversibleAdhesiveSpecies contains the parameters used to describe a linear reversible short-range force. More...

#include <ReversibleAdhesiveSpecies.h>

+ Inheritance diagram for ReversibleAdhesiveSpecies:

Public Types

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

Public Member Functions

 ReversibleAdhesiveSpecies ()
 The default constructor. More...
 
 ReversibleAdhesiveSpecies (const ReversibleAdhesiveSpecies &s)
 The default constructor. More...
 
 ~ReversibleAdhesiveSpecies ()
 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 (ReversibleAdhesiveSpecies *S, ReversibleAdhesiveSpecies *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...
 
- 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...
 

Detailed Description

ReversibleAdhesiveSpecies contains the parameters used to describe a linear reversible short-range force.

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

Member Typedef Documentation

◆ InteractionType

The correct Interaction type for this AdhesiveForceSpecies.

Constructor & Destructor Documentation

◆ ReversibleAdhesiveSpecies() [1/2]

ReversibleAdhesiveSpecies::ReversibleAdhesiveSpecies ( )

The default constructor.

10 {
13  //interaction distance not yet determined
14 #ifdef DEBUG_CONSTRUCTOR
15  std::cout<<"ReversibleAdhesiveSpecies::ReversibleAdhesiveSpecies() finished"<<std::endl;
16 #endif
17 }
Mdouble adhesionForceMax_
adhesion force at zero overlap
Definition: ReversibleAdhesiveSpecies.h:66
Mdouble adhesionStiffness_
stiffness of linear adhesion force
Definition: ReversibleAdhesiveSpecies.h:63

References adhesionForceMax_, and adhesionStiffness_.

◆ ReversibleAdhesiveSpecies() [2/2]

ReversibleAdhesiveSpecies::ReversibleAdhesiveSpecies ( const ReversibleAdhesiveSpecies s)

The default constructor.

Parameters
[in]sthe species that is copied
23 {
24  adhesionForceMax_ = s.adhesionForceMax_;
25  adhesionStiffness_ = s.adhesionStiffness_;
26 #ifdef DEBUG_CONSTRUCTOR
27  std::cout<<"ReversibleAdhesiveSpecies::ReversibleAdhesiveSpecies(const ReversibleAdhesiveSpecies &p) finished"<<std::endl;
28 #endif
29 }
RealScalar s
Definition: level1_cplx_impl.h:130

References adhesionForceMax_, adhesionStiffness_, and s.

◆ ~ReversibleAdhesiveSpecies()

ReversibleAdhesiveSpecies::~ReversibleAdhesiveSpecies ( )

The default constructor.

32 {
33 #ifdef DEBUG_DESTRUCTOR
34  std::cout<<"ReversibleAdhesiveSpecies::~ReversibleAdhesiveSpecies() finished"<<std::endl;
35 #endif
36 }

Member Function Documentation

◆ getAdhesionForceMax()

Mdouble ReversibleAdhesiveSpecies::getAdhesionForceMax ( ) const

◆ getAdhesionStiffness()

◆ getBaseName()

std::string ReversibleAdhesiveSpecies::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")
61 {
62  return "ReversibleAdhesive";
63 }

◆ mix()

void ReversibleAdhesiveSpecies::mix ( ReversibleAdhesiveSpecies S,
ReversibleAdhesiveSpecies 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
71 {
72  adhesionForceMax_ = BaseSpecies::average(S->getAdhesionForceMax(), T->getAdhesionForceMax());
73  adhesionStiffness_ = BaseSpecies::average(S->getAdhesionStiffness(), T->getAdhesionStiffness());
74 }
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:89
@ S
Definition: quadtree.h:62

References adhesionForceMax_, adhesionStiffness_, BaseSpecies::average(), and oomph::QuadTreeNames::S.

◆ read()

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

Reads the species properties from an input stream.

Parameters
[in]isinput stream (typically the restart file)
51 {
52  std::string dummy;
53  is >> dummy >> adhesionForceMax_;
54  is >> dummy >> adhesionStiffness_;
55 }
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References adhesionForceMax_, adhesionStiffness_, and oomph::Global_string_for_annotation::string().

◆ setAdhesionForceMax()

void ReversibleAdhesiveSpecies::setAdhesionForceMax ( Mdouble  new_f0)

Allows the spring constant to be changed.

99 {
100  logger.assert_debug(adhesionForceMax >= 0,"Error in setAdhesionForceMax");
101  adhesionForceMax_ = adhesionForceMax;
103 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
void setInteractionDistance()
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: ReversibleAdhesiveSpecies.cc:77

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

Referenced by ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), and ParticleWallInteraction::setupInitialConditions().

◆ setAdhesionStiffness()

void ReversibleAdhesiveSpecies::setAdhesionStiffness ( Mdouble  new_k0)

Allows the spring constant to be changed.

85 {
86  logger.assert_debug(adhesionStiffness >= 0,"Error in setAdhesionStiffness");
87  adhesionStiffness_ = adhesionStiffness;
89 }

References adhesionStiffness_, logger, and setInteractionDistance().

Referenced by ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), and ParticleWallInteraction::setupInitialConditions().

◆ setInteractionDistance()

void ReversibleAdhesiveSpecies::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.

78 {
79  logger.assert_debug(adhesionStiffness_ != 0.0,"ReversibleAdhesiveSpecies::getInteractionDistance(): adhesionStiffness cannot be zero");
81 }
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().

◆ write()

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

Writes the species properties to an output stream.

Parameters
[out]osoutput stream (typically the restart file)
42 {
43  os << " adhesionForceMax " << adhesionForceMax_;
44  os << " adhesionStiffness " << adhesionStiffness_;
45 }

References adhesionForceMax_, and adhesionStiffness_.

Member Data Documentation

◆ adhesionForceMax_

Mdouble ReversibleAdhesiveSpecies::adhesionForceMax_
private

◆ adhesionStiffness_

Mdouble ReversibleAdhesiveSpecies::adhesionStiffness_
private

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