SpherePackingScenarioGenerator
|
#include <HardspherePosition.h>
Public Member Functions | |
void | AddGhostSphere (double x, double y, double z) |
double | GetLength () |
double | GetNumber () |
void | GetPosition () |
double * | GetPositionsAsArray () |
double | GetPositionX (int k) |
double | GetPositionY (int k) |
double | GetPositionZ (int k) |
double | GetRadius () |
void | GhostSphere (std::string filename) |
HardspherePosition () | |
void | Print () |
void | Randomsphere (std::string filename) |
void | Regularsphere (regularpacking::RegularPacking Packing) |
virtual | ~HardspherePosition () |
Private Attributes | |
std::vector< double > | _positionx |
std::vector< double > | _positiony |
std::vector< double > | _positionz |
std::vector< double > | _sphereCoordinateVector |
double | length |
std::string | line |
double | radius |
Class HardspherePosition Get the position of sphere through Regualar algorithms and irregualar algorithms
Constructor
algorithms::HardspherePosition::~HardspherePosition | ( | ) | [virtual] |
Destructor
void algorithms::HardspherePosition::AddGhostSphere | ( | double | x, |
double | y, | ||
double | z | ||
) |
Add the Ghost Sphere
x | the position of the new sphere in x axle |
y | the position of the new sphere in y axle |
z | the position of the new sphere in z axle |
double algorithms::HardspherePosition::GetLength | ( | ) |
Gets the length of domain
double algorithms::HardspherePosition::GetNumber | ( | ) |
Gets the number of spheres
Gets the position of spheres in the format of x1,y1,z1,r1,x2,y2,z2,r2......
Pass the Array of position of spheres
double algorithms::HardspherePosition::GetPositionX | ( | int | k | ) |
Gets the position x axle for certain sphere
k | the number of certain sphere |
double algorithms::HardspherePosition::GetPositionY | ( | int | k | ) |
Gets the position y axle for certain sphere
k | the number of certain sphere |
double algorithms::HardspherePosition::GetPositionZ | ( | int | k | ) |
Gets the position z axle for certain sphere
k | the number of certain sphere |
double algorithms::HardspherePosition::GetRadius | ( | ) |
Gets the radius of sphere
void algorithms::HardspherePosition::GhostSphere | ( | std::string | filename | ) |
Get the position of GhostSphere and append to the file
The algorithm to generate GhostSphere:
All three of x,y,z has has five intervals,0~sqrt(2)/2*r,sqrt(2)/2*r~r,r~l-r,
l-r~l-sqrt(2)/2*r,l-sqrt(2)/2*r~l
There are several typical situation:
1. sphere was located in (r~l-r,r~l-r,r~l-r) no ghost sphere 0.15-0.85 0-0.1 0.1-0.15 in the case of r=0.15, l=1 2. sphere was located in (0~r,r~l-r,r~l-r) one ghost sphere
3. sphere was located in (0~r,sqrt(2)/2*r~r,r~l-r) two ghost sphere
4. sphere was located in (0~sqrt(2)/2*r,0~sqrt(2)/2*r,r~l-r) three ghost sphere
5. sphere was located in (0~r,sqrt(2)/2*r~r,sqrt(2)/2*r~r) three ghost sphere
6. sphere was located in (0~sqrt(2)/2*r,0~sqrt(2)/2*r,sqrt(2)/2*r~r) four ghost sphere
7. sphere was located in (1/2*r~sqrt(2)/2*r,1/2*r~sqrt(2)/2*r,1/2*r~sqrt(2)/2*r) six ghost sphere
8. sphere was located in (0~1/2*r,1/2*r~sqrt(2)/2*r,1/2*r~sqrt(2)/2*r) seven ghost sphere
filename | the file contain the positions of spheres |
Print the position of sphere in the special format
void algorithms::HardspherePosition::Randomsphere | ( | std::string | filename | ) |
Get the position of Randomsphere which are generated with LS algorithms
filename | the file contain the positions of spheres |
Get the position of Regualrsphere which are generated with RegualrPacking algorithms
Packing | the new list of spheres |
std::vector<double> algorithms::HardspherePosition::_positionx [private] |
std::vector<double> algorithms::HardspherePosition::_positiony [private] |
std::vector<double> algorithms::HardspherePosition::_positionz [private] |
std::vector<double> algorithms::HardspherePosition::_sphereCoordinateVector [private] |
double algorithms::HardspherePosition::length [private] |
std::string algorithms::HardspherePosition::line [private] |
double algorithms::HardspherePosition::radius [private] |