SpherePackingScenarioGenerator
|
#include <Box.h>
Public Member Functions | |
void | AssignCells () |
Box (int N_i, double r_i, double growthrate_i, double maxpf_i) | |
double | CalculateCollision (int i, int j, Vector< DIM > pboffset) |
void | Collision (Event e) |
void | CollisionChecker (Event c) |
void | CreateSphere (int Ncurrent) |
void | CreateSpheres (double temp) |
double | Energy () |
Event | FindNextCollision (int i) |
Event | FindNextEvent (int i) |
Event | FindNextTransfer (int i) |
void | ForAllNeighbors (int, Vector< DIM, int >, Vector< DIM, int >, Neighbor &) |
double | getEnergyChance () const |
double | getFraction () const |
void | GetInfo () |
int | getNumberGrids () const |
double | getPressure () const |
double | getRadius () const |
void | getSpheres (std::vector< algorithms::geometries::SphereGeometry > &spheres) const |
double | getTotalEvents () const |
int | Optimalngrids (double maxpf) |
void | OutputCells () |
void | OutputEvents () |
double | PackingFraction () |
void | PredictCollision (int i, int j, Vector< DIM, int > pboffset, double &ctime, int &cpartner, Vector< DIM, int > &cpartnerpboffset) |
void | PrintStatistics () |
void | Process (int n) |
void | ProcessEvent () |
double | QuadraticFormula (double a, double b, double c) |
void | ReadPositions (const char *filename) |
void | RecreateSpheres (const char *filename, double temp) |
void | RunTime () |
void | SetInitialEvents () |
void | Synchronize (bool rescale) |
void | TrackPositions () |
void | Transfer (Event e) |
void | UpdateCell (int i, Vector< DIM, int > &celli) |
double | Velocity (double temp) |
void | VelocityGiver (double temp) |
void | WriteConfiguration (const char *wconfigfile) |
~Box () | |
Private Attributes | |
int * | binlist |
GridField< DIM, int > | cells |
time_t | end |
double | energy |
double | energychange |
time_t | error |
double | growthrate |
double | gtime |
Heap | h |
double | maxpf |
const int | N |
int | nchecks |
int | ncollisions |
int | ncycles |
int | nEventstot |
int | ngrids |
int | ntransfers |
double | pf |
double | pressure |
double | r |
double | rtime |
Sphere * | s |
time_t | start |
Vector< DIM > * | x |
double | xmomentum |
Class Box Fills Box with hardSpheres to given packing fraction and evolves Spheres using molecular dynamics!
algorithms::ls::Box::Box | ( | int | N_i, |
double | r_i, | ||
double | growthrate_i, | ||
double | maxpf_i | ||
) |
Constructor
Destructor
void algorithms::ls::Box::AssignCells | ( | ) |
Assign cells to Spheres read in from existing configuration
double algorithms::ls::Box::CalculateCollision | ( | int | i, |
int | j, | ||
Vector< DIM > | pboffset | ||
) |
Calculates collision time between i and image of j using quadratic formula
void algorithms::ls::Box::Collision | ( | Event | e | ) |
Processes a collision
void algorithms::ls::Box::CollisionChecker | ( | Event | c | ) |
Checks Events of predicted collision partner to keep collisions symmetric
void algorithms::ls::Box::CreateSphere | ( | int | Ncurrent | ) |
Creates a Sphere of radius r at a random unoccupied position
void algorithms::ls::Box::CreateSpheres | ( | double | temp | ) |
Creates all N Spheres at random positions
double algorithms::ls::Box::Energy | ( | ) |
Computes the total energy
Find next collision
Event algorithms::ls::Box::FindNextEvent | ( | int | i | ) |
Find next collision for Sphere i
void algorithms::ls::Box::ForAllNeighbors | ( | int | i, |
Vector< DIM, int > | vl, | ||
Vector< DIM, int > | vr, | ||
Neighbor & | operation | ||
) |
Find next collision for Sphere i
double algorithms::ls::Box::getEnergyChance | ( | ) | const |
double algorithms::ls::Box::getFraction | ( | ) | const |
void algorithms::ls::Box::GetInfo | ( | ) |
Get information
int algorithms::ls::Box::getNumberGrids | ( | ) | const |
double algorithms::ls::Box::getPressure | ( | ) | const |
double algorithms::ls::Box::getRadius | ( | ) | const |
void algorithms::ls::Box::getSpheres | ( | std::vector< algorithms::geometries::SphereGeometry > & | spheres | ) | const |
Functions written by M. Lieb
double algorithms::ls::Box::getTotalEvents | ( | ) | const |
int algorithms::ls::Box::Optimalngrids | ( | double | maxpf | ) |
Calculates the optimal ngrids
void algorithms::ls::Box::OutputCells | ( | ) |
Output positions of Spheres and their cells...purely used for debugging
void algorithms::ls::Box::OutputEvents | ( | ) |
double algorithms::ls::Box::PackingFraction | ( | ) |
Calculates the packing fraction
void algorithms::ls::Box::PredictCollision | ( | int | i, |
int | j, | ||
Vector< DIM, int > | pboffset, | ||
double & | ctime, | ||
int & | cpartner, | ||
Vector< DIM, int > & | cpartnerpboffset | ||
) |
Find next collision for Sphere i
void algorithms::ls::Box::PrintStatistics | ( | ) |
Prints statistics for n Events
void algorithms::ls::Box::Process | ( | int | n | ) |
Processes n Events
void algorithms::ls::Box::ProcessEvent | ( | ) |
Processes n Events
double algorithms::ls::Box::QuadraticFormula | ( | double | a, |
double | b, | ||
double | c | ||
) |
Quadratic Formula ax^2 + bx + c = 0
void algorithms::ls::Box::ReadPositions | ( | const char * | filename | ) |
ReadFile
void algorithms::ls::Box::RecreateSpheres | ( | const char * | filename, |
double | temp | ||
) |
Recreates all N Spheres at random positions
void algorithms::ls::Box::RunTime | ( | ) |
Run time
Finds next Events for all Spheres..do this once at beginning
void algorithms::ls::Box::Synchronize | ( | bool | rescale | ) |
Updates Spheres to gtime, synchronizes, and can change growth rate
void algorithms::ls::Box::TrackPositions | ( | ) |
Update positions...purely for graphical display
void algorithms::ls::Box::Transfer | ( | Event | e | ) |
Transfer, takes care of boundary Events too
void algorithms::ls::Box::UpdateCell | ( | int | i, |
Vector< DIM, int > & | celli | ||
) |
Updates cell of a Sphere to time
double algorithms::ls::Box::Velocity | ( | double | temp | ) |
Velocity, gives a single velocity from Max/Boltz dist.
void algorithms::ls::Box::VelocityGiver | ( | double | temp | ) |
Velocity Giver, assigns initial velocities from Max/Boltz dist.
void algorithms::ls::Box::WriteConfiguration | ( | const char * | wconfigfile | ) |
Write configuration
int* algorithms::ls::Box::binlist [private] |
linked-list for cells array
GridField<DIM, int> algorithms::ls::Box::cells [private] |
array that keeps track of spheres in each cell
time_t algorithms::ls::Box::end [private] |
double algorithms::ls::Box::energy [private] |
kinetic energy
double algorithms::ls::Box::energychange [private] |
kinetic energy change
time_t algorithms::ls::Box::error [private] |
double algorithms::ls::Box::growthrate [private] |
growthrate of the spheres
double algorithms::ls::Box::gtime [private] |
this is global clock
Heap algorithms::ls::Box::h [private] |
Event heap
double algorithms::ls::Box::maxpf [private] |
const int algorithms::ls::Box::N [private] |
number of spheres
int algorithms::ls::Box::nchecks [private] |
number of checks
int algorithms::ls::Box::ncollisions [private] |
number of collisions
int algorithms::ls::Box::ncycles [private] |
counts # cycles for output
int algorithms::ls::Box::nEventstot [private] |
total number of Events
int algorithms::ls::Box::ngrids [private] |
number of cells in one direction
int algorithms::ls::Box::ntransfers [private] |
number of transfers
double algorithms::ls::Box::pf [private] |
packing fraction
double algorithms::ls::Box::pressure [private] |
pressure
double algorithms::ls::Box::r [private] |
radius, defined at gtime = 0
double algorithms::ls::Box::rtime [private] |
reset time, total time = rtime + gtime
Sphere* algorithms::ls::Box::s [private] |
array of spheres
time_t algorithms::ls::Box::start [private] |
run time of program
Vector<DIM>* algorithms::ls::Box::x [private] |
positions of spheres.used for graphics
double algorithms::ls::Box::xmomentum [private] |
exchanged momentum