MercuryDPM  Beta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseSpecies.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2014, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef BASESPECIES_H
27 #define BASESPECIES_H
28 #include "BaseObject.h"
29 #include "Math/ExtendedMath.h"
30 #include "Math/Helpers.h"
31 
32 class SpeciesHandler;// derived from BaseHandler<ParticleSpecies>
33 //class BaseParticle; //
34 class BaseInteractable;
35 class BaseInteraction;
36 
43 //Note the getVelocity can for some Species be dependent on which point on the Species is meant.
44 class BaseSpecies : public BaseObject
45 {
46 public:
47 
49  BaseSpecies();
50 
52  BaseSpecies(const BaseSpecies &p);
53 
55  virtual ~BaseSpecies();
56 
71  virtual BaseSpecies* copy() const = 0;
72 
74  void setHandler(SpeciesHandler* handler);
75 
77  SpeciesHandler* getHandler() const;
78 
81 
83 
91  virtual void mixAll(BaseSpecies * const S, BaseSpecies * const T) = 0;
92 
94 
102  virtual Mdouble getInteractionDistance() const = 0;
103 
104 //setters and getters
105 
107 
116  virtual bool getUseAngularDOFs() const = 0;
117 
119 
127 
128 private:
135 };
136 #endif
Container to store all ParticleSpecies.
virtual Mdouble getInteractionDistance() const =0
returns the largest separation distance at which adhesive short-range forces can occur.
BaseSpecies is the class from which all other species are derived.
Definition: BaseSpecies.h:44
virtual ~BaseSpecies()
The default destructor.
Definition: BaseSpecies.cc:56
virtual BaseInteraction * getNewInteraction(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)=0
returns new Interaction object.
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
Definition: BaseObject.h:49
double Mdouble
virtual void mixAll(BaseSpecies *const S, BaseSpecies *const T)=0
creates default values for mixed species
Stores information about interactions between two interactable objects; often particles but could be ...
SpeciesHandler * getHandler() const
Returns the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:74
SpeciesHandler * handler_
A pointer to the handler to which this species belongs. It is initialized to nullptr and gets set whe...
Definition: BaseSpecies.h:134
Mdouble average(Mdouble a, Mdouble b)
defines the average of two variables by the harmonic mean.
Definition: BaseSpecies.cc:85
void setHandler(SpeciesHandler *handler)
Sets the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:66
virtual BaseSpecies * copy() const =0
Creates a deep copy of the object from which it is called.
virtual bool getUseAngularDOFs() const =0
Returns true if torques (i.e. angular degrees of freedom) have to be calculated.
BaseSpecies()
The default constructor.
Definition: BaseSpecies.cc:35
Defines the basic properties that a interactable object can have.