ESyS-Particle  4.0.1
BasicParticle.h
1 
2 // //
3 // Copyright (c) 2003-2011 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __BASICPARTICLE_H
14 #define __BASICPARTICLE_H
15 
16 // -- project includes --
17 #include "Foundation/vec3.h"
18 
19 // --- STL includes ---
20 #include <map>
21 #include <utility>
22 
23 using std::map;
24 using std::pair;
25 using std::make_pair;
26 
27 namespace esys
28 {
29  namespace lsm
30  {
31  class SimpleParticleData;
32  }
33 }
34 
45 {
46 protected:
48  double m_rad;
49  int m_global_id;
50  int m_tag;
51 
52 public:
53  static const CBasicParticle INVALID;
54 
56  CBasicParticle(const Vec3 &pos, double radius, int id=-1, int tag=-1);
58 
59  inline virtual ~CBasicParticle(){}
60 
61  inline Vec3 & getPPos() {return m_pos;}
62  inline Vec3 getPos() const {return m_pos;}
63  inline void setPos(const Vec3 &pos) {m_pos = pos;}
64  inline double getRad() const {return m_rad;}
65  inline int getID() const {return m_global_id;}
66  inline void setID(int id) {m_global_id = id;}
67 
68  inline void moveBy(Vec3 v){m_pos+=v;}
69  inline void moveTo(Vec3 v){m_pos=v;}
70  inline void setRad(double r){m_rad=r;}
71 
73  inline void setTag(int t){m_tag=t;}
74  inline int getTag() const {return m_tag;}
75  inline bool isValid() const {return (getID() >= 0);}
76 };
77 ostream& operator<<(ostream&,const CBasicParticle&);
78 
79 #endif //__BASICPARTICLE_H