14 #ifndef ESYS_LSMPACKER_H
15 #define ESYS_LSMPACKER_H
17 #include "Geometry/CircularNeighbourTable.h"
18 #include "Geometry/ParticleCollection.h"
19 #include <boost/pool/object_pool.hpp>
20 #include <boost/shared_ptr.hpp>
31 template <
typename TmplParticleCollection>
35 typedef TmplParticleCollection ParticleCollection;
37 typedef boost::shared_ptr<ParticleCollection> ParticleCollectionPtr;
38 typedef typename ParticleCollection::Particle Particle;
39 typedef boost::object_pool<Particle> ParticlePool;
40 typedef boost::shared_ptr<ParticlePool> ParticlePoolPtr;
42 typedef boost::shared_ptr<NTable> NTablePtr;
50 Packer(NTablePtr nTablePtr);
52 Packer(ParticlePoolPtr particlePoolPtr, NTablePtr nTablePtr);
56 virtual void generate() = 0;
58 int getNumParticles()
const;
60 int getNextParticleId();
62 void setNTablePtr(NTablePtr nTablePtr);
64 const NTable &getNTable()
const;
66 ParticlePoolPtr getParticlePoolPtr();
67 ParticlePool &getParticlePool();
68 const ParticlePool &getParticlePool()
const;
70 ParticleCollection &getParticleCollection();
71 const ParticleCollection &getParticleCollection()
const;
73 Particle &constructParticle(
const Particle &particle);
79 bool contains(
const Particle &particle)
const;
81 Particle &createAndInsertParticle(
const Particle &particle);
85 typedef std::set<int> IdSet;
88 NTablePtr m_nTablePtr;
89 ParticlePoolPtr m_particlePoolPtr;
90 ParticleCollectionPtr m_particleCollectionPtr;
96 #include "Geometry/Packer.hpp"