ESyS-Particle  2.3.2
ParticleComparer.hpp
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 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.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 
14 namespace esys
15 {
16  namespace lsm
17  {
18  template <typename TmplParticle>
20  : m_pParticle(&p)
21  {
22  }
23 
24  template <typename TmplParticle>
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>
40  const Particle *p1,
41  const Particle *p2
42  ) const
43  {
44  return this->operator()(*p1,*p2);
45  }
46  }
47 }