ParticleSpecies.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 ParticleSpecies_H
6 #define ParticleSpecies_H
7 
8 #include "BaseSpecies.h"
9 #include "Math/ExtendedMath.h"
11 
12 class BaseInteractable;
13 
14 //Note the getVelocity can for some Species be dependent on which point on the Species is meant.
16 {
17 public:
20 
23 
26 
27  ParticleSpecies(BaseNormalForce* normalForce, BaseFrictionForce* frictionForce, BaseAdhesiveForce* adhesiveForce);
28 
31 
36  ParticleSpecies* copy() const override = 0;
37 
42  virtual BaseSpecies* copyMixed() const = 0;
43 
45  void read(std::istream& is) override;
46 
48  void write(std::ostream& os) const override;
49 
51  std::string getBaseName() const;
52 
56 
60 
61  Mdouble getMassFromRadius(const Mdouble radius,SpeciesHandler& speciesHandler);
62 
64 
66  Mdouble getDensity() const;
67 
71  void computeMass(BaseParticle* p) const;
72 
73  void setTemperatureDependentDensity(const std::function<double(double)>& temperatureDependentDensity);
74 
75  const std::function<double(double)>& getTemperatureDependentDensity() const;
76 
82 
84 
93 
98  void setMaxInteractionDistance(Mdouble interactionDistance=0);
99 
100  const BaseSpecies* getMixedSpecies(const ParticleSpecies* s) const;
101 
102  virtual void actionsAfterTimeStep(BaseParticle* particle) const {};
103 
104 private:
105 
111 
116 
121  std::function<double(double temperature)> temperatureDependentDensity_;
122 
127 
128 
129 };
130 
131 #endif
double Mdouble
Definition: GeneralDefine.h:13
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseAdhesiveForce.h:10
Definition: BaseFrictionForce.h:10
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: BaseNormalForce.h:11
Definition: BaseParticle.h:33
BaseSpecies is the class from which all other species are derived.
Definition: BaseSpecies.h:29
Definition: ParticleSpecies.h:16
Mdouble maxInteractionDistance_
Definition: ParticleSpecies.h:126
BaseInteraction InteractionType
Definition: ParticleSpecies.h:18
std::function< double(double temperature)> temperatureDependentDensity_
Definition: ParticleSpecies.h:121
Mdouble getLargestInverseParticleMassLocal() const
Computes inverse mass of the lightest particle (by mass) belonging to this species....
Definition: ParticleSpecies.cc:168
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:88
~ParticleSpecies()
The default destructor.
Definition: ParticleSpecies.cc:47
virtual BaseSpecies * copyMixed() const =0
Creates a new MixedSpecies with the same force properties as the Species from which it is called....
BaseSpecies MixedSpeciesType
Definition: ParticleSpecies.h:19
Mdouble getSmallestParticleMass() const
Computes mass of the lightest particle (by mass) belonging to this species. This computation calls ge...
Definition: ParticleSpecies.cc:182
virtual void actionsAfterTimeStep(BaseParticle *particle) const
Definition: ParticleSpecies.h:102
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
Definition: ParticleSpecies.cc:80
void setMaxInteractionDistance(Mdouble interactionDistance=0)
Sets maxInteractionDistance_.
Definition: ParticleSpecies.cc:201
Mdouble getMassFromRadius(Mdouble radius) const
Definition: ParticleSpecies.cc:103
const BaseSpecies * getMixedSpecies(const ParticleSpecies *s) const
Definition: ParticleSpecies.cc:218
ParticleSpecies * copy() const override=0
Creates a deep copy of the object from which it is called.
Mdouble density_
The mass density.
Definition: ParticleSpecies.h:115
ParticleSpecies()
The default constructor.
Definition: ParticleSpecies.cc:16
void computeMass(BaseParticle *p) const
Compute Particle mass function, which required a reference to the Species vector. It computes the Par...
Definition: ParticleSpecies.cc:147
void write(std::ostream &os) const override
Writes the species properties to an output stream.
Definition: ParticleSpecies.cc:57
Mdouble getDensity() const
Allows density_ to be accessed.
Definition: ParticleSpecies.cc:98
Mdouble getVolumeFromRadius(Mdouble radius) const
Definition: ParticleSpecies.cc:115
void setTemperatureDependentDensity(const std::function< double(double)> &temperatureDependentDensity)
Definition: ParticleSpecies.cc:157
void read(std::istream &is) override
Reads the species properties from an input stream.
Definition: ParticleSpecies.cc:69
Mdouble getMaxInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
Definition: ParticleSpecies.h:92
const std::function< double(double)> & getTemperatureDependentDensity() const
Definition: ParticleSpecies.cc:152
Container to store all ParticleSpecies.
Definition: SpeciesHandler.h:15
RealScalar s
Definition: level1_cplx_impl.h:130
density
Definition: UniformPSDSelfTest.py:19
radius
Definition: UniformPSDSelfTest.py:15
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286