ESyS-Particle  2.3.4
BoxPacker.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 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.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 
14 #ifndef ESYS_LSMBOXPACKER_H
15 #define ESYS_LSMBOXPACKER_H
16 
17 #include <Geometry/Packer.h>
18 #include <Foundation/vec3.h>
19 #include <Foundation/BoundingBox.h>
20 
21 #include <vector>
22 
23 namespace esys
24 {
25  namespace lsm
26  {
27  typedef std::vector<bool> BoolVector;
31  template <typename TmplPackerBase>
32  class BoxPacker : public TmplPackerBase
33  {
34  public:
35  typedef TmplPackerBase Inherited;
36  typedef typename Inherited::Particle Particle;
37  typedef typename Inherited::NTable NTable;
38  typedef typename Inherited::NTablePtr NTablePtr;
39  typedef typename Inherited::ParticlePool ParticlePool;
40  typedef typename Inherited::ParticlePoolPtr ParticlePoolPtr;
41 
42  BoxPacker(
43  ParticlePoolPtr particlePoolPtr,
44  NTablePtr nTablePtr,
45  const BoundingBox &bBox,
46  const BoolVector &periodicDimensions,
47  double tolerance
48  );
49 
50  virtual ~BoxPacker();
51 
52  virtual void generate() = 0;
53 
54  bool particleFitsInBBox(const Particle &particle) const;
55 
56  bool is2d() const;
57 
58  bool particleFitsInBBoxWithNeighbours(const Particle &particle) const;
59 
60  bool particleFitsWithNeighbours(const Particle &particle) const;
61 
62  double getTolerance() const;
63 
64  const BoundingBox &getBBox() const;
65 
66 
67  const BoolVector &getPeriodicDimensions() const;
68 
69  private:
72  double m_tolerance;
73  };
74  }
75 }
76 
77 #include "Geometry/BoxPacker.hpp"
78 
79 #endif
esys::lsm::BoxPacker::particleFitsInBBox
bool particleFitsInBBox(const Particle &particle) const
Definition: BoxPacker.hpp:66
esys::lsm::BoxPacker::ParticlePool
Inherited::ParticlePool ParticlePool
Definition: BoxPacker.h:39
esys::lsm::BoxPacker::particleFitsWithNeighbours
bool particleFitsWithNeighbours(const Particle &particle) const
Definition: BoxPacker.hpp:123
esys::lsm::BoxPacker::m_tolerance
double m_tolerance
Definition: BoxPacker.h:72
esys::lsm::BoxPacker::~BoxPacker
virtual ~BoxPacker()
Definition: BoxPacker.hpp:36
BoxPacker.h
esys::lsm::BoxPacker::getTolerance
double getTolerance() const
Definition: BoxPacker.hpp:47
esys::lsm::BoxPacker::m_bBox
BoundingBox m_bBox
Definition: BoxPacker.h:70
BoxPacker.hpp
esys::lsm::BoxPacker::ParticlePoolPtr
Inherited::ParticlePoolPtr ParticlePoolPtr
Definition: BoxPacker.h:40
esys::lsm::BoxPacker::NTablePtr
Inherited::NTablePtr NTablePtr
Definition: BoxPacker.h:38
esys::lsm::BoxPacker::Particle
Inherited::Particle Particle
Definition: BoxPacker.h:36
esys::lsm::BoxPacker::NTable
Inherited::NTable NTable
Definition: BoxPacker.h:37
esys::lsm::BoundingBox
3D bounding box
Definition: BoundingBox.h:28
esys
Definition: CheckPointable.cpp:17
esys::lsm::BoxPacker::getBBox
const BoundingBox & getBBox() const
Definition: BoxPacker.hpp:41
esys::lsm::BoxPacker::is2d
bool is2d() const
Definition: BoxPacker.hpp:53
esys::lsm::BoxPacker::m_periodicDimensions
BoolVector m_periodicDimensions
Definition: BoxPacker.h:71
esys::lsm::BoolVector
std::vector< bool > BoolVector
Definition: BlockGenerator.h:28
esys::lsm::BoxPacker::Inherited
TmplPackerBase Inherited
Definition: BoxPacker.h:35
esys::lsm::BoxPacker::generate
virtual void generate()=0
Packer.h
vec3.h
esys::lsm::BoxPacker
Definition: BoxPacker.h:33
esys::lsm::BoxPacker::particleFitsInBBoxWithNeighbours
bool particleFitsInBBoxWithNeighbours(const Particle &particle) const
Definition: BoxPacker.hpp:146
esys::lsm::BoxPacker::getPeriodicDimensions
const BoolVector & getPeriodicDimensions() const
Definition: BoxPacker.hpp:60
esys::lsm::BoxPacker::BoxPacker
BoxPacker(ParticlePoolPtr particlePoolPtr, NTablePtr nTablePtr, const BoundingBox &bBox, const BoolVector &periodicDimensions, double tolerance)
Definition: BoxPacker.hpp:22
BoundingBox.h