ESyS-Particle  2.3.2
ClosePackIterator.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
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 
14 #ifndef ESYS_LSMCLOSEPACKITERATOR_H
15 #define ESYS_LSMCLOSEPACKITERATOR_H
16 
17 #include "Foundation/BoundingBox.h"
18 #include "Foundation/vec3.h"
19 #include "Geometry/Vec3L.h"
21 
22 namespace esys
23 {
24  namespace lsm
25  {
26  template <int NI, int NJ, int NK>
27  class TmplMatrix
28  {
29  public:
30  TmplMatrix();
31 
32  TmplMatrix(const TmplMatrix &m);
33 
34  TmplMatrix &operator=(const TmplMatrix &m);
35 
36  const double &operator()(int i, int j, int k) const;
37 
38  double &operator()(int i, int j, int k);
39 
40  int getNumI() const;
41 
42  int getNumJ() const;
43 
44  int getNumK() const;
45 
46  private:
47  double m_matrix[NI][NJ][NK];
48  };
49 
55  {
56  public:
57  static const double SQRT_1_OVER_3;
58  static const double SQRT_8_OVER_3;
59  static const double SQRT_3;
60 
64  inline ClosePackIterator();
65 
75  inline ClosePackIterator(
76  int numI,
77  int numJ,
78  int numK,
79  double sphereRadius,
81  );
82 
87  inline bool hasNext() const;
88 
92  inline Vec3 next();
93 
97  inline double getRadius() const;
98 
99  protected:
101 
102  inline void incrementDimIndex();
103 
104  inline double getOffset(int i) const;
105 
106  inline const Vec3 &getMinPt() const;
107 
108  inline void setMinPt(const Vec3 &pt) const;
109 
110  inline void setDimRepeat(const Vec3L &dimRepeat);
111 
112  inline void setOffsetMatrix(const OffsetMatrix &offsetMatrix);
113 
114  private:
116  double m_radius;
123  };
124  }
125 }
126 
128 
129 #endif