MeltableInteraction.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 MERCURY_MELTABLEINTERACTION_H
6 #define MERCURY_MELTABLEINTERACTION_H
7 
9 #include "ParticleHandler.h"
10 #include "InteractionHandler.h"
11 
12 class BaseParticle;
13 class MeltableParticle;
14 class BaseInteractable;
16 
17 class MeltableInteraction : public virtual BaseInteraction {
18 public:
20  : BaseInteraction(P, I, timeStamp) {}
21 
23 
24  MeltableInteraction() = default;
25 
26  void read(std::istream &is) override;
27 
28  void write(std::ostream &os) const override;
29 
30  void computeNormalForce();
31 
32  void actionsAfterTimeStep() override;
33 
34  Mdouble getElasticEnergy() const override;
35 
37  return "Meltable";
38  }
39 
44 
46  {
47  return bondingOverlap_;
48  }
49 
50  void setBondingOverlap(Mdouble bondingOverlap)
51  {
52  bondingOverlap_ = bondingOverlap;
53  }
54 
55  void addBondingOverlap(Mdouble bondingOverlap)
56  {
57  bondingOverlap_ += bondingOverlap;
58  }
59 
61  return std::sqrt(neckRadius2_);
62  };
63 
64  void addNeckRadius2(Mdouble diffNeckRadius2) {
65  neckRadius2_ = std::max(neckRadius2_+diffNeckRadius2,0.0);
66  }
67 
69  return Vec3D::dot(getI()->getVelocity()-getP()->getVelocity(),getNormal());
70  }
71 
72 private:
74 
76 };
77 
78 #endif
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
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
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Definition: BaseInteraction.h:205
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle).
Definition: BaseInteraction.h:264
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Definition: BaseInteraction.h:253
Definition: BaseParticle.h:33
Definition: MeltableInteraction.h:17
MeltableInteraction(BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
Definition: MeltableInteraction.h:19
void addBondingOverlap(Mdouble bondingOverlap)
Definition: MeltableInteraction.h:55
void computeNormalForce()
Definition: MeltableInteraction.cc:24
void setBondingOverlap(Mdouble bondingOverlap)
Definition: MeltableInteraction.h:50
Mdouble bondingOverlap_
Definition: MeltableInteraction.h:73
const MeltableNormalSpecies * getMeltableNormalSpecies() const
Definition: MeltableInteraction.cc:183
void actionsAfterTimeStep() override
Definition: MeltableInteraction.cc:118
std::string getBaseName() const
Definition: MeltableInteraction.h:36
Mdouble getOverlapGrowthRate() const
Definition: MeltableInteraction.h:68
MeltableInteraction()=default
Mdouble getBondingOverlap() const
Definition: MeltableInteraction.h:45
void addNeckRadius2(Mdouble diffNeckRadius2)
Definition: MeltableInteraction.h:64
void read(std::istream &is) override
Interaction read function, which accepts an std::istream as input.
Definition: MeltableInteraction.cc:16
void write(std::ostream &os) const override
Interaction print function, which accepts an std::ostream as input.
Definition: MeltableInteraction.cc:9
Mdouble neckRadius2_
Definition: MeltableInteraction.h:75
Mdouble getElasticEnergy() const override
Returns a Mdouble which is the current about of Elastic energy in the interaction.
Definition: MeltableInteraction.cc:154
MeltableInteraction(const MeltableInteraction &p)=default
Mdouble getNeckRadius() const
Definition: MeltableInteraction.h:60
Definition: MeltableNormalSpecies.h:13
Definition: MeltableParticle.h:15
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:56
#define max(a, b)
Definition: datatypes.h:23
#define I
Definition: main.h:127
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
const Mdouble NaN
Definition: GeneralDefine.h:22
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286