BondedInteraction.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef BondInteraction_h
6 #define BondInteraction_h
7 
8 #include "../BaseInteraction.h"
9 #include "Math/Vector.h"
10 
11 class BaseParticle;
12 
13 class BondedSpecies;
14 
15 class BaseInteractable;
16 
20 class BondedInteraction : public virtual BaseInteraction
21 {
22 public:
27 
31  BondedInteraction(BaseInteractable* P, BaseInteractable* I, unsigned timeStamp);
32 
37 
40 
44  ~BondedInteraction() override;
45 
49  void computeAdhesionForce();
50 
54  void read(std::istream& is) override;
55 
59  void write(std::ostream& os) const override;
60 
64  const BondedSpecies* getSpecies() const;
65 
69  std::string getBaseName() const;
70 
74  Mdouble getElasticEnergy() const override;
75 
80  bool getBonded() const;
81 
82  bool isBonded() const override {
83  return bonded_;
84  };
85 
89  void setBonded(bool bonded);
90 
94  void bond();
95 
101  void bondInPlace();
102 
103  void unbond();
104 
109  return bondForce_;
110  }
111 
112 private:
117  bool bonded_;
118 
123 
124 };
125 
126 #endif
float * p
Definition: Tutorial_Map_using.cpp:9
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:34
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
Definition: BaseParticle.h:33
Definition: BondedInteraction.h:21
void read(std::istream &is) override
Interaction read function, which accepts an std::istream as input.
Definition: BondedInteraction.cc:70
bool isBonded() const override
Definition: BondedInteraction.h:82
Mdouble getBondForce() const
Simple access function to return the force of the bond.
Definition: BondedInteraction.h:108
Mdouble bondForce_
This stores the extra force created by the bond.
Definition: BondedInteraction.h:122
BondedSpecies SpeciesType
An alias name for BondedSpecies data type.
Definition: BondedInteraction.h:26
void unbond()
Definition: BondedInteraction.cc:143
std::string getBaseName() const
Returns the name of the interaction, see Interaction.h.
Definition: BondedInteraction.cc:102
void setBonded(bool bonded)
Set function.
Definition: BondedInteraction.cc:125
bool getBonded() const
Get function.
Definition: BondedInteraction.cc:120
void bond()
Definition: BondedInteraction.cc:131
void computeAdhesionForce()
Computes the Adhesive force.
Definition: BondedInteraction.cc:80
void write(std::ostream &os) const override
Interaction print function, which accepts an std::ostream as input.
Definition: BondedInteraction.cc:61
BondedInteraction()
Definition: BondedInteraction.cc:41
const BondedSpecies * getSpecies() const
Returns a pointer to the adhesive force species BondedSpecies.
Definition: BondedInteraction.cc:93
bool bonded_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Definition: BondedInteraction.h:117
Mdouble getElasticEnergy() const override
Returns the elastic energy stored in the adhesive spring.
Definition: BondedInteraction.cc:112
~BondedInteraction() override
Destructor.
Definition: BondedInteraction.cc:51
void bondInPlace()
Definition: BondedInteraction.cc:137
BondedSpecies contains the parameters used to describe a linear irreversible short-range force.
Definition: BondedSpecies.h:18
#define I
Definition: main.h:127
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286