ESyS-Particle
4.0.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
Geometry
ParticleComparer.hpp
1
2
// //
3
// Copyright (c) 2003-2011 by The University of Queensland //
4
// Earth Systems Science Computational Centre (ESSCC) //
5
// http://www.uq.edu.au/esscc //
6
// //
7
// Primary Business: Brisbane, Queensland, Australia //
8
// Licensed under the Open Software License version 3.0 //
9
// http://www.opensource.org/licenses/osl-3.0.php //
10
// //
12
13
14
namespace
esys
15
{
16
namespace
lsm
17
{
18
template
<
typename
TmplParticle>
19
ParticleComparer<TmplParticle>::ParticleComparer
(
const
Particle &p)
20
: m_pParticle(&p)
21
{
22
}
23
24
template
<
typename
TmplParticle>
25
bool
ParticleComparer<TmplParticle>::operator()
(
26
const
Particle &p1,
27
const
Particle &p2
28
)
const
29
{
30
return
31
(
32
((p1.getPos() - m_pParticle->getPos()).norm() - p1.getRad())
33
<
34
((p2.getPos() - m_pParticle->getPos()).norm() - p2.getRad())
35
);
36
}
37
38
template
<
typename
TmplParticle>
39
bool
ParticleComparer<TmplParticle>::operator()
(
40
const
Particle *p1,
41
const
Particle *p2
42
)
const
43
{
44
return
this->operator()(*p1,*p2);
45
}
46
}
47
}
Generated on Sun Apr 13 2014 05:18:51 for ESyS-Particle by
1.8.1.2