ESyS-Particle
2.3.4
ClosePackBlock.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
#ifndef ESYS_LSMCLOSEPACKBLOCK_HPP
15
#define ESYS_LSMCLOSEPACKBLOCK_HPP
16
17
#include "
Geometry/ClosePackBlock.h
"
18
#include "
Geometry/ClosePackIterator.h
"
19
20
namespace
esys
21
{
22
namespace
lsm
23
{
24
template
<
typename
TmplClosePackIterator,
typename
TmplParticle>
25
ClosePackBlockGenerator<TmplClosePackIterator,TmplParticle>::ClosePackBlockGenerator
(
26
unsigned
int
numX,
27
unsigned
int
numY,
28
unsigned
int
numZ,
29
double
radius,
30
ClosePackOrientation
orientation
31
)
32
: m_radius(radius),
33
m_dimCounts(numX, numY, numZ),
34
m_orientation(orientation)
35
{
36
}
37
38
template
<
typename
TmplClosePackIterator,
typename
TmplParticle>
39
template
<
typename
TmplParticleCollection>
40
void
41
ClosePackBlockGenerator<TmplClosePackIterator,TmplParticle>::createParticles
(
42
TmplParticleCollection &particleCollection
43
)
44
{
45
int
id
= 0;
46
CentrePointIterator
it =
47
CentrePointIterator
(
48
m_dimCounts[0],
49
m_dimCounts[1],
50
m_dimCounts[2],
51
getRadius(),
52
((m_orientation ==
DEFAULT_ORIENT
) && (m_dimCounts[2] <= 1)) ?
XYZ
: m_orientation
53
);
54
55
while
(it.
hasNext
())
56
{
57
particleCollection.createParticle(
58
TmplParticle(
59
it.
next
(),
60
getRadius(),
61
id,
62
0
63
)
64
);
65
id
++;
66
}
67
}
68
69
template
<
typename
TmplClosePackIterator,
typename
TmplParticle>
70
ClosePackBlockGenerator<TmplClosePackIterator,TmplParticle>::~ClosePackBlockGenerator
()
71
{
72
}
73
74
template
<
typename
TmplClosePackIterator,
typename
TmplParticle>
75
double
ClosePackBlockGenerator<TmplClosePackIterator,TmplParticle>::getRadius
()
const
76
{
77
return
m_radius;
78
}
79
80
81
82
83
84
85
86
template
<
typename
TmplClosePackIterator,
typename
TmplParticle>
87
ClosePackBlock<TmplClosePackIterator,TmplParticle>::ClosePackBlock
(
88
unsigned
int
numX,
89
unsigned
int
numY,
90
unsigned
int
numZ,
91
double
radius,
92
ClosePackOrientation
orientation
93
)
94
:
ParticleCollection
<TmplParticle>(),
95
m_generator(numX, numY, numZ, radius)
96
{
97
createParticles();
98
}
99
100
template
<
typename
TmplClosePackIterator,
typename
TmplParticle>
101
ClosePackBlock<TmplClosePackIterator,TmplParticle>::~ClosePackBlock
()
102
{
103
}
104
105
template
<
typename
TmplClosePackIterator,
typename
TmplParticle>
106
void
ClosePackBlock<TmplClosePackIterator,TmplParticle>::createParticles
()
107
{
108
m_generator.
createParticles
(*
this
);
109
}
110
111
template
<
typename
TmplClosePackIterator,
typename
TmplParticle>
112
double
ClosePackBlock<TmplClosePackIterator,TmplParticle>::getRadius
()
const
113
{
114
return
m_generator.
getRadius
();
115
}
116
}
117
}
118
119
#endif
ClosePackIterator.h
esys::lsm::ClosePackBlock::createParticles
void createParticles()
Definition:
ClosePackBlock.hpp:106
esys::lsm::CubicBlockIterator
Definition:
CubicBlockIterator.h:31
esys::lsm::ClosePackBlock
Definition:
ClosePackBlock.h:60
esys::lsm::ClosePackBlock::getRadius
double getRadius() const
Definition:
ClosePackBlock.hpp:112
esys::lsm::ClosePackIterator::hasNext
bool hasNext() const
Definition:
ClosePackIterator.hpp:148
esys
Definition:
CheckPointable.cpp:16
esys::lsm::ClosePackBlockGenerator::ClosePackBlockGenerator
ClosePackBlockGenerator(unsigned int numX, unsigned int numY, unsigned int numZ, double radius=0.5, ClosePackOrientation orientation=DEFAULT_ORIENT)
Definition:
ClosePackBlock.hpp:25
esys::lsm::ClosePackIterator::next
Vec3 next()
Definition:
ClosePackIterator.hpp:183
ClosePackBlock.h
esys::lsm::XYZ
Definition:
ClosePackOrientation.h:28
esys::lsm::ClosePackOrientation
ClosePackOrientation
Definition:
ClosePackOrientation.h:25
esys::lsm::DEFAULT_ORIENT
Definition:
ClosePackOrientation.h:27
esys::lsm::ParticleCollection
Definition:
ParticleCollection.h:34
esys::lsm::ClosePackBlockGenerator
Definition:
ClosePackBlock.h:28
Geometry
ClosePackBlock.hpp
Generated by
1.8.16