Computes the 3D Cartesian coordinates of a particle based on the hexagonal close packing.
More...
#include <hexagonal_packing.h>
|
| HexagonalPacking3D (double xmin_, double xmax_, double ymin_, double ymax_, double zmin_, double zmax_, double h_r_) |
| Constructor. More...
|
|
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. More...
|
|
double | computeX (int tag, size_t k) |
| Computes the particle location in the x-coordinate. More...
|
|
double | computeY (int tag, size_t j) |
| Computes the particle location in the y-coordinate. More...
|
|
double | computeZ (size_t i) |
| Computes the particle location in the z-coordinate. More...
|
|
Computes the 3D Cartesian coordinates of a particle based on the hexagonal close packing.
- Author
- Chen, Hsin-Chiang (morri.nosp@m.sche.nosp@m.n2008.nosp@m.@gma.nosp@m.il.co.nosp@m.m)
- Version
- 1.0
- Date
- 2014/05/09
Created on: 2014/05/01
HexagonalPacking3D::HexagonalPacking3D |
( |
double |
xmin_, |
|
|
double |
xmax_, |
|
|
double |
ymin_, |
|
|
double |
ymax_, |
|
|
double |
zmin_, |
|
|
double |
zmax_, |
|
|
double |
h_r_ |
|
) |
| |
Constructor.
The constructor initializes parameters needed to compute the 3D Cartesian coordinate of particles based on the hexagonal close packing using the input spatial domain and the input radius of the constructing equal sphere. All particles will be located inside the input spatial domain.
- Parameters
-
[in] | xmin_ | The minimum value of the input spatial domain in x-coordinate |
[in] | xmax_ | The maximum value of the input spatial domain in x-coordinate |
[in] | ymin_ | The minimum value of the input spatial domain in y-coordinate |
[in] | ymax_ | The maximum value of the input spatial domain in y-coordinate |
[in] | zmin_ | The minimum value of the input spatial domain in z-coordinate |
[in] | zmax_ | The maximum value of the input spatial domain in z-coordinate |
[in] | h_r_ | The radius of the constructing sphere |
- Note
- The parameter h_r_ should be set to be one half of the initial inter-particle distance
double HexagonalPacking3D::computeX |
( |
int |
tag, |
|
|
size_t |
k |
|
) |
| |
|
inline |
Computes the particle location in the x-coordinate.
- Parameters
-
[in] | tag | Value 0 indicates: 1. odd layers and odd rows, or 2. even layers and even rows ; otherwise indicates: 1. odd layers and even rows, or 2. even layers and odd rows |
[in] | k | The k-th column |
- Returns
- Particle location in the x-coordinate
double HexagonalPacking3D::computeY |
( |
int |
tag, |
|
|
size_t |
j |
|
) |
| |
|
inline |
Computes the particle location in the y-coordinate.
- Parameters
-
[in] | tag | Value 0 indicates: odd-numbered layers; otherwise indicates even-numbered layers |
[in] | j | The j-th row |
- Returns
- Particle location in the y-coordinate
double HexagonalPacking3D::computeZ |
( |
size_t |
i | ) |
|
|
inline |
Computes the particle location in the z-coordinate.
- Parameters
-
- Returns
- Particle location in the z-coordinate
void HexagonalPacking3D::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_ |
|
) |
| |
|
inline |
Getter function to retrieve parameters of the boundaries of this hexagonal close packing.
- Parameters
-
[out] | l0_ | The minimum index of layers |
[out] | l1_ | The maximum index of layers |
[out] | m0_odd_ | The minimum index of rows in odd-numbered layers |
[out] | m1_odd_ | The maximum index of rows in odd-numbered layers |
[out] | m0_even_ | The minimum index of rows in even-numbered layers |
[out] | m1_even_ | The maximum index of rows in even-numbered layers |
[out] | n0_odd_ | The minimum index of columns in odd rows & odd layers |
[out] | n1_odd_ | The maximum index of columns in odd rows & odd layers |
[out] | n0_even_ | The minimum index of columns in even rows & odd layers |
[out] | n1_even_ | The maximum index of columns in even rows & odd layers |
[out] | nn0_odd_ | The minimum index of columns in odd rows & even layers |
[out] | nn1_odd_ | The maximum index of columns in odd rows & even layers |
[out] | nn0_even_ | The minimum index of columns in even rows & even layers |
[out] | nn1_even_ | The maximum index of columns in even rows & even layers |
- Note
- The information is retrieved to compute the Cartesian coordinate of particles one-by-one outside this class. This enables the caller to use different criterions to screen each particle to decide if this particle should be included into the computational context or not. This will save a lot of computational time compared to if all particles within the input spatial domain is included in the computational context first, and then screen and delete unnecessary particles.
The documentation for this class was generated from the following files: