ESyS-Particle
2.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
NeighbourTable.h
Go to the documentation of this file.
1
2
// //
3
// Copyright (c) 2003-2013 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
#ifndef ESYS_LSMNEIGHBOURTABLE_H
15
#define ESYS_LSMNEIGHBOURTABLE_H
16
17
#include <
Foundation/BoundingBox.h
>
18
#include <
Foundation/StlIterator.h
>
19
#include <
Geometry/Vec3L.h
>
20
#include <vector>
21
#include <algorithm>
22
#include <boost/shared_array.hpp>
23
24
namespace
esys
25
{
26
namespace
lsm
27
{
31
template
<
class
TmplParticle>
32
class
NeighbourTable
33
{
34
public
:
35
typedef
TmplParticle
Particle
;
36
typedef
std::vector<Particle *>
ParticleVector
;
37
38
NeighbourTable
(
const
BoundingBox
&bBox,
double
gridSpacing);
39
40
NeighbourTable
(
const
NeighbourTable
&nTable);
41
42
virtual
~NeighbourTable
();
43
44
void
clear
();
45
46
double
getGridSpacing
()
const
;
47
48
void
resize
(
const
BoundingBox
&bBox,
double
gridSpacing);
49
50
const
Vec3L
&
getDimensions
()
const
;
51
52
const
BoundingBox
&
getBBox
()
const
;
53
54
const
Vec3
&
getMinPt
()
const
;
55
59
size_t
size
()
const
;
60
61
int
getScalarIndex
(
int
xIdx,
int
yIdx,
int
zIdx)
const
;
62
63
int
getScalarIndex
(
const
Vec3L
&index)
const
;
64
65
int
getScalarIndex
(
const
Vec3
&pt)
const
;
66
67
const
Vec3L
&
getMinVecIndex
()
const
;
68
69
const
Vec3L
&
getMaxVecIndex
()
const
;
70
71
Vec3L
getVecIndex
(
const
Vec3
&pt)
const
;
72
73
ParticleVector
getNeighbourVector
(
const
Vec3
&pt,
double
radius)
const
;
74
75
ParticleVector
getUniqueNeighbourVector
(
const
Vec3
&pt,
double
radius)
const
;
76
77
ParticleVector
getNeighbourVector
(
const
Vec3
&pt)
const
;
78
79
void
insert
(
Particle
*pParticle);
80
81
void
insert
(
Particle
&particle);
82
83
typedef
ForwardIterator<ParticleVector>
ParticleIterator
;
84
typedef
ForwardConstIterator<ParticleVector>
ParticleConstIterator
;
85
86
ParticleIterator
getParticleIterator
();
87
88
ParticleConstIterator
getParticleIterator
()
const
;
89
90
protected
:
91
92
void
insertInTable
(
Particle
*pParticle,
const
Vec3L
&minIdx,
const
Vec3L
&maxIdx);
93
94
void
addInserted
(
Particle
*pParticle);
95
96
int
getNumCells
()
const
;
97
98
ParticleVector
getInsertedParticles
()
const
;
99
100
void
clearAndRecomputeGrid
(
const
BoundingBox
&bBox,
double
gridSpacing);
101
102
private
:
103
typedef
boost::shared_array<ParticleVector>
ParticleVectorArrayPtr
;
104
105
Vec3L
m_dimensions
;
106
Vec3L
m_minIndex
;
107
Vec3L
m_maxIndex
;
108
double
m_gridSpacing
;
109
BoundingBox
m_bBox
;
110
ParticleVector
m_insertedParticles
;
111
ParticleVectorArrayPtr
m_tablePtr
;
112
};
113
}
114
}
115
116
#include "
Geometry/NeighbourTable.hpp
"
117
118
#endif
Geometry
NeighbourTable.h
Generated on Mon May 6 2013 23:26:29 for ESyS-Particle by
1.8.3.1