Go to the documentation of this file.
22 template <
typename TmplSphere,
typename TmplIdPair>
31 m_minRadius(
std::numeric_limits<double>::max()),
32 m_maxRadius(-
std::numeric_limits<double>::max()),
34 m_minPt(bBox.getMinPt()),
35 m_maxPt(bBox.getMaxPt())
37 const double gridSize =
58 template <
typename TmplSphere,
typename TmplIdPair>
63 template <
typename TmplSphere,
typename TmplIdPair>
66 return m_nTablePtr->size();
69 template <
typename TmplSphere,
typename TmplIdPair>
72 return m_connectionSet.size();
75 template <
typename TmplSphere,
typename TmplIdPair>
81 template <
typename TmplSphere,
typename TmplIdPair>
87 template <
typename TmplSphere,
typename TmplIdPair>
91 return m_nTablePtr->getIterator();
94 template <
typename TmplSphere,
typename TmplIdPair>
102 **(m_connectionSet.insert(
103 m_connectionPoolPtr->construct(p1.getId(), p2.
getId())
107 template <
typename TmplSphere>
111 bool operator()(
const TmplSphere &p1,
const TmplSphere &p2)
const
113 return (p1.getId() < p2.getId());
116 bool operator()(
const TmplSphere *p1,
const TmplSphere *p2)
const
118 return (p1->getId() < p2->getId());
122 template <
typename TmplType>
134 template <
typename TmplSphere,
typename TmplIdPair>
135 template <
typename TmplSphereIterator>
138 TmplSphereIterator it
142 typedef std::set<Sphere *, CmpSphereId<Sphere> > SphereSet;
161 typename SphereSet::const_iterator pIt = pSet.begin();
168 m_nTablePtr->getNeighbourVector(
170 (*pIt)->getRad() + m_maxDist
175 typename NTable::ParticleVector::const_iterator nIt = nVector.begin();
176 nIt != nVector.end();
185 (p1->getId() < p2->getId())
187 (pSet.find(p1) != pSet.end())
189 (pSet.find(p2) != pSet.end())
193 ((pSet.find(p1)==pSet.end()) && (pSet.find(p2)!= pSet.end()))
195 ((pSet.find(p1)!=pSet.end()) && (pSet.find(p2)== pSet.end()))
200 ((*pIt)->getId() < (*nIt)->getId())
206 ((*pIt)->getId() < (*nIt)->getId())
211 const double radiusSumPlusTol =
212 m_maxDist + p1->getRad() + p2->getRad();
213 const double radiusSumPlusTolSqrd =
214 radiusSumPlusTol*radiusSumPlusTol;
217 (p1->getPos() - p2->getPos()).norm2()
219 (radiusSumPlusTolSqrd)
222 idPairSet.insert(&createIdPair(*p1, *p2));
228 idPairVector.reserve(idPairSet.size());
232 std::back_insert_iterator<IdPairVector>(idPairVector),
238 template <
typename TmplSphere,
typename TmplIdPair>
242 if (p.getRad() < m_minRadius)
244 m_minRadius = p.getRad();
246 if (p.getRad() > m_maxRadius)
248 m_maxRadius = p.getRad();
251 m_nTablePtr->insert(p);
253 for (
int i = 0; i < 3; i++)
255 if (!(m_nTablePtr->getPeriodicDimensions()[i]))
257 if (p.getPos()[i]-p.getRad() < m_minPt[i])
259 m_minPt[i] = p.getPos()[i]-p.getRad();
261 if (p.getPos()[i]+p.getRad() > m_maxPt[i])
263 m_maxPt[i] = p.getPos()[i]+p.getRad();
269 template <
typename TmplSphere,
typename TmplIdPair>
boost::object_pool< IdPair > IdPairPool
Definition: SphereNeighbours.h:136
IdPairVector::value_type IdPair
Definition: SphereNeighbours.h:41
result_type operator()(argument_type a) const
Definition: SphereNeighbours.hpp:130
Inherited::ParticleVector ParticleVector
Definition: CircularNeighbourTable.h:38
~SphereNeighbours()
Definition: SphereNeighbours.hpp:59
BoundingBox getSphereBBox() const
Definition: SphereNeighbours.hpp:271
boost::shared_ptr< NTable > NTablePtr
Definition: SphereNeighbours.h:135
void insert(Sphere &p)
Definition: SphereNeighbours.hpp:240
CircularNeighbourTable< Sphere > NTable
Definition: SphereNeighbours.h:70
Definition: SimpleSpherePy.h:25
const IdPair & createIdPair(const Sphere &p1, const Sphere &p2)
Definition: SphereNeighbours.hpp:96
Id getId() const
Definition: SimpleParticleData.hpp:94
const TmplType & result_type
Definition: SphereNeighbours.hpp:126
SphereNeighbours(double maxDist, const BoundingBox &bBox=BoundingBox(Vec3(-10,-10,-10), Vec3(10, 10, 10)), const BoolVector &circDimensions=BoolVector(3, false))
Definition: SphereNeighbours.hpp:23
3D bounding box
Definition: BoundingBox.h:28
Definition: CheckPointable.cpp:17
bool operator()(const TmplSphere *p1, const TmplSphere *p2) const
Definition: SphereNeighbours.hpp:116
double getMinRadius() const
Definition: SphereNeighbours.hpp:76
const TmplType * argument_type
Definition: SphereNeighbours.hpp:127
TmplIdPairVector IdPairVector
Definition: SphereNeighbours.h:40
Definition: SphereNeighbours.hpp:124
SphereConstIterator getSphereIterator() const
Definition: SphereNeighbours.hpp:89
NTable::BoolVector BoolVector
Definition: SphereNeighbours.h:75
Definition: StlIterator.h:76
Definition: Contact.h:101
int getNumIdPairs() const
Definition: SphereNeighbours.hpp:70
std::set< const IdPair *, Cmp > ConstIdPairSet
Definition: SphereNeighbours.h:68
Definition: SphereNeighbours.hpp:109
NTablePtr m_nTablePtr
Definition: SphereNeighbours.h:141
bool operator()(const TmplSphere &p1, const TmplSphere &p2) const
Definition: SphereNeighbours.hpp:111
int getNumSpheres() const
Definition: SphereNeighbours.hpp:64
Vec3 getSizes() const
Definition: BoundingBox.hpp:78
IdPairVector getNeighbours(TmplSphereIterator it)
Definition: SphereNeighbours.hpp:137
double getMaxRadius() const
Definition: SphereNeighbours.hpp:82