20 #ifndef __HEXAGONALPACKING_H__
21 #define __HEXAGONALPACKING_H__
59 HexagonalPacking2D(
double xmin_,
double xmax_,
double ymin_,
double ymax_,
double h_r_);
79 size_t& n0_odd_,
size_t& n1_odd_,
80 size_t& n0_even_,
size_t& n1_even_) {
97 if(tag==0)
return xmin+2.0*h_r+k*2.0*h_r;
98 else return xmin+h_r+k*2.0*h_r;
108 return ymin+h_r+j*sqrt(3.0)*h_r;
112 double xmin, xmax, ymin, ymax, h_r;
113 size_t m0, m1, n0_odd, n1_odd, n0_even, n1_even;
162 HexagonalPacking3D(
double xmin_,
double xmax_,
double ymin_,
double ymax_,
double zmin_,
double zmax_,
double h_r_);
190 size_t& m0_odd_,
size_t& m1_odd_,
191 size_t& m0_even_,
size_t& m1_even_,
192 size_t& n0_odd_,
size_t& n1_odd_,
193 size_t& n0_even_,
size_t& n1_even_,
194 size_t& nn0_odd_,
size_t& nn1_odd_,
195 size_t& nn0_even_,
size_t& nn1_even_) {
208 nn0_even_ = nn0_even;
209 nn1_even_ = nn1_even;
222 if(tag==0)
return xmin+2.0*h_r+k*2.0*h_r;
223 else return xmin+h_r+k*2.0*h_r;
234 if(tag==0)
return ymin+h_r+j*sqrt(3.0)*h_r;
235 else return ymin+sqrt(3.0)/3.0*h_r+j*sqrt(3.0)*h_r;
246 return zmin+h_r+i*2.0*sqrt(6.0)/3.0*h_r;
251 double xmin, xmax, ymin, ymax, zmin, zmax, h_r;
253 size_t m0_odd, m1_odd, m0_even, m1_even, n0_odd, n1_odd, n0_even, n1_even;
254 size_t nn0_odd, nn1_odd, nn0_even, nn1_even;
261 #endif // __HEXAGONALPACKING_H__
void getParameters(size_t &l0_, size_t &l1_, size_t &m0_odd_, size_t &m1_odd_, size_t &m0_even_, size_t &m1_even_, size_t &n0_odd_, size_t &n1_odd_, size_t &n0_even_, size_t &n1_even_, size_t &nn0_odd_, size_t &nn1_odd_, size_t &nn0_even_, size_t &nn1_even_)
Getter function to retrieve parameters of the boundaries of this hexagonal close packing.
Definition: hexagonal_packing.h:189
Computes the 2D Cartesian coordinates of a particle based on the hexagonal close packing.
Definition: hexagonal_packing.h:41
double computeY(size_t j)
Computes the particle location in the y-coordinate.
Definition: hexagonal_packing.h:107
double computeX(int tag, size_t k)
Computes the particle location in the x-coordinate.
Definition: hexagonal_packing.h:221
double computeX(int tag, size_t k)
Computes the particle location in the x-coordinate.
Definition: hexagonal_packing.h:96
HexagonalPacking3D(double xmin_, double xmax_, double ymin_, double ymax_, double zmin_, double zmax_, double h_r_)
Constructor.
Definition: hexagonal_packing.cpp:46
Computes the 3D Cartesian coordinates of a particle based on the hexagonal close packing.
Definition: hexagonal_packing.h:142
double computeZ(size_t i)
Computes the particle location in the z-coordinate.
Definition: hexagonal_packing.h:245
void getParameters(size_t &m0_, size_t &m1_, size_t &n0_odd_, size_t &n1_odd_, size_t &n0_even_, size_t &n1_even_)
Getter function to retrieve parameters of the boundaries of this hexagonal close packing.
Definition: hexagonal_packing.h:78
double computeY(int tag, size_t j)
Computes the particle location in the y-coordinate.
Definition: hexagonal_packing.h:233
HexagonalPacking2D(double xmin_, double xmax_, double ymin_, double ymax_, double h_r_)
Constructor.
Definition: hexagonal_packing.cpp:11