ESyS-Particle
2.3.4
ParticleComparer.hpp
Go to the documentation of this file.
1
// //
3
// Copyright (c) 2003-2017 by The University of Queensland //
4
// Centre for Geoscience Computing //
5
// http://earth.uq.edu.au/centre-geoscience-computing //
6
// //
7
// Primary Business: Brisbane, Queensland, Australia //
8
// Licensed under the Open Software License version 3.0 //
9
// http://www.apache.org/licenses/LICENSE-2.0 //
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
}
esys::lsm::ParticleComparer::Particle
TmplParticle Particle
Definition:
ParticleComparer.h:25
esys::lsm::ParticleComparer::operator()
bool operator()(const Particle &p1, const Particle &p2) const
Definition:
ParticleComparer.hpp:25
esys::lsm::ParticleComparer::ParticleComparer
ParticleComparer(const Particle &p)
Definition:
ParticleComparer.hpp:19
esys
Definition:
CheckPointable.cpp:17
Geometry
ParticleComparer.hpp
Generated by
1.8.20