Computes the 2D Cartesian coordinates of a particle based on the hexagonal close packing.
More...
#include <hexagonal_packing.h>
|
| HexagonalPacking2D (double xmin_, double xmax_, double ymin_, double ymax_, double h_r_) |
| Constructor. More...
|
|
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. More...
|
|
double | computeX (int tag, size_t k) |
| Computes the particle location in the x-coordinate. More...
|
|
double | computeY (size_t j) |
| Computes the particle location in the y-coordinate. More...
|
|
Computes the 2D 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
HexagonalPacking2D::HexagonalPacking2D |
( |
double |
xmin_, |
|
|
double |
xmax_, |
|
|
double |
ymin_, |
|
|
double |
ymax_, |
|
|
double |
h_r_ |
|
) |
| |
Constructor.
The constructor initializes parameters needed to compute the 2D 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] | 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 HexagonalPacking2D::computeX |
( |
int |
tag, |
|
|
size_t |
k |
|
) |
| |
|
inline |
Computes the particle location in the x-coordinate.
- Parameters
-
[in] | tag | Value 0 indicates odd-numbered rows; otherwise indicates even-numbered rows |
[in] | k | The k-th column |
- Returns
- Particle location in the x-coordinate
double HexagonalPacking2D::computeY |
( |
size_t |
j | ) |
|
|
inline |
Computes the particle location in the y-coordinate.
- Parameters
-
- Returns
- Particle location in the y-coordinate
void HexagonalPacking2D::getParameters |
( |
size_t & |
m0_, |
|
|
size_t & |
m1_, |
|
|
size_t & |
n0_odd_, |
|
|
size_t & |
n1_odd_, |
|
|
size_t & |
n0_even_, |
|
|
size_t & |
n1_even_ |
|
) |
| |
|
inline |
Getter function to retrieve parameters of the boundaries of this hexagonal close packing.
- Parameters
-
[out] | m0_ | The minimum index of rows |
[out] | m1_ | The maximum index of rows |
[out] | n0_odd_ | The minimum index of columns in odd-numbered rows |
[out] | n1_odd_ | The maximum index of columns in odd-numbered rows |
[out] | n0_even_ | The minimum index of columns in even-numbered rows |
[out] | n1_even_ | The maximum index of columns in even-numbered rows |
- 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: