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>
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>
136 typename SphereNeighbours<TmplSphere,TmplIdPair>::IdPairVector
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();
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 =
213 const double radiusSumPlusTolSqrd =
214 radiusSumPlusTol*radiusSumPlusTol;
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)
246 if (p.
getRad() > m_maxRadius)
251 m_nTablePtr->insert(p);
253 for (
int i = 0; i < 3; i++)
255 if (!(m_nTablePtr->getPeriodicDimensions()[i]))
269 template <
typename TmplSphere,
typename TmplIdPair>
double getRad() const
Definition: SimpleParticle.hpp:70
boost::object_pool< IdPair > IdPairPool
Definition: SphereNeighbours.h:136
IdPairVector::value_type IdPair
Definition: SphereNeighbours.h:41
Definition: VectorPy.h:25
result_type operator()(argument_type a) const
Definition: SphereNeighbours.hpp:130
Inherited::ParticleVector ParticleVector
Definition: CircularNeighbourTable.h:38
Iterator getIterator() const
Definition: SphereNeighbours.h:124
boost::shared_ptr< NTable > NTablePtr
Definition: SphereNeighbours.h:135
Definition: SimpleSpherePy.h:24
const Vec3 & getPos() const
Definition: SimpleParticle.hpp:30
Id getId() const
Definition: SimpleParticleData.hpp:94
NTable::ParticleConstIterator SphereConstIterator
Definition: SphereNeighbours.h:72
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:27
Definition: CheckPointable.cpp:16
bool operator()(const TmplSphere *p1, const TmplSphere *p2) const
Definition: SphereNeighbours.hpp:116
Definition: SphereNeighbours.hpp:123
NTable::BoolVector BoolVector
Definition: SphereNeighbours.h:75
Definition: Contact.h:101
std::set< const IdPair *, Cmp > ConstIdPairSet
Definition: SphereNeighbours.h:68
const typedef TmplType & result_type
Definition: SphereNeighbours.hpp:126
const typedef TmplType * argument_type
Definition: SphereNeighbours.hpp:127
Definition: SphereNeighbours.hpp:108
bool operator()(const TmplSphere &p1, const TmplSphere &p2) const
Definition: SphereNeighbours.hpp:111
Vec3 getSizes() const
Definition: BoundingBox.hpp:78
Definition: SphereNeighbours.h:35
Definition: CircularNeighbourTable.h:33