ESyS-Particle  4.0.1
ClosePackBlock.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 
14 #ifndef ESYS_LSMCLOSEPACKBLOCK_H
15 #define ESYS_LSMCLOSEPACKBLOCK_H
16 
17 #include "Geometry/ClosePackIterator.h"
18 #include "Geometry/ParticleCollection.h"
19 
20 namespace esys
21 {
22  namespace lsm
23  {
27  template <typename TmplClosePackIterator,typename TmplParticle>
29  {
30  public:
31  typedef TmplClosePackIterator CentrePointIterator;
32 
34  unsigned int numX,
35  unsigned int numY,
36  unsigned int numZ,
37  double radius = 0.5,
38  ClosePackOrientation orientation = DEFAULT_ORIENT
39  );
40 
41  virtual ~ClosePackBlockGenerator();
42 
43  double getRadius() const;
44 
45  template <typename TmplParticleCollection>
46  void createParticles(TmplParticleCollection &particleCollection);
47 
48  protected:
49 
50  private:
51  double m_radius;
52  Vec3L m_dimCounts;
53  ClosePackOrientation m_orientation;
54  };
55 
59  template <typename TmplClosePackIterator, typename TmplParticle>
60  class ClosePackBlock : public ParticleCollection<TmplParticle>
61  {
62  public:
63  typedef typename ParticleCollection<TmplParticle>::Particle Particle;
64  typedef TmplClosePackIterator ClosePackIterator;
67  unsigned int numX,
68  unsigned int numY,
69  unsigned int numZ,
70  double radius = 0.5,
71  ClosePackOrientation orientation = DEFAULT_ORIENT
72  );
73 
74  virtual ~ClosePackBlock();
75 
76  double getRadius() const;
77 
78  protected:
79  void createParticles();
80 
81  private:
82  BlockGenerator m_generator;
83  };
84  };
85 };
86 
87 #include "Geometry/ClosePackBlock.hpp"
88 
89 #endif