14 #include "Geometry/SimpleBlock.h"
20 #include <boost/limits.hpp>
26 template <
typename TmplParticle>
27 SimpleBlockGenerator<TmplParticle>::SimpleBlockGenerator(
34 m_dimCounts(numX, numY, numZ)
38 template <
typename TmplParticle>
39 Vec3 SimpleBlockGenerator<TmplParticle>::getPos(
const Vec3L &idx)
43 idx[0]*2.0*getRadius() + getRadius(),
44 idx[1]*2.0*getRadius() + getRadius(),
45 idx[2]*2.0*getRadius() + ((m_dimCounts[2] > 1) ? getRadius() : 0.0)
49 template <
typename TmplParticle>
50 int SimpleBlockGenerator<TmplParticle>::getId(
const Vec3L &idx)
57 idx[2]*m_dimCounts[0]*m_dimCounts[1];
60 template <
typename TmplParticle>
61 template <
typename TmplParticleCollection>
63 SimpleBlockGenerator<TmplParticle>::createParticles(
64 TmplParticleCollection &particleCollection
68 for (idx[2]=0; idx[2] < m_dimCounts[2]; (idx[2])++)
70 for (idx[1]=0; idx[1] < m_dimCounts[1]; (idx[1])++)
72 for (idx[0]=0; idx[0] < m_dimCounts[0]; (idx[0])++)
74 particleCollection.createParticle(
87 template <
typename TmplParticle>
88 SimpleBlockGenerator<TmplParticle>::~SimpleBlockGenerator()
92 template <
typename TmplParticle>
93 double SimpleBlockGenerator<TmplParticle>::getRadius()
const
104 template <
typename TmplParticle>
105 SimpleBlock<TmplParticle>::SimpleBlock(
111 : ParticleCollection<TmplParticle>(),
112 m_generator(numX, numY, numZ, radius)
117 template <
typename TmplParticle>
118 SimpleBlock<TmplParticle>::~SimpleBlock()
122 template <
typename TmplParticle>
123 void SimpleBlock<TmplParticle>::createParticles()
125 m_generator.createParticles(*
this);
128 template <
typename TmplParticle>
129 double SimpleBlock<TmplParticle>::getRadius()
const
131 return m_generator.getRadius();