Lagrangian Particle Code for The Simulation of 2D/3D Fluid Dynamics
 All Classes Files Functions Variables Typedefs Friends Pages
Public Member Functions | List of all members
HexagonalPacking3D Class Reference

Computes the 3D Cartesian coordinates of a particle based on the hexagonal close packing. More...

#include <hexagonal_packing.h>

Public Member Functions

 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...
 

Detailed Description

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

Constructor & Destructor Documentation

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

Member Function Documentation

double HexagonalPacking3D::computeX ( int  tag,
size_t  k 
)
inline

Computes the particle location in the x-coordinate.

Parameters
[in]tagValue 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]kThe 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]tagValue 0 indicates: odd-numbered layers; otherwise indicates even-numbered layers
[in]jThe 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
[in]jThe i-th layer
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: