SpherePackingScenarioGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
algorithms::ls::Box Class Reference

#include <Box.h>

Collaboration diagram for algorithms::ls::Box:
Collaboration graph
[legend]

List of all members.

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
Spheres
time_t start
Vector< DIM > * x
double xmomentum

Detailed Description

Class Box Fills Box with hardSpheres to given packing fraction and evolves Spheres using molecular dynamics!


Constructor & Destructor Documentation

algorithms::ls::Box::Box ( int  N_i,
double  r_i,
double  growthrate_i,
double  maxpf_i 
)

Constructor

Destructor


Member Function Documentation

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

Processes a collision

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

Computes the total energy

Find next collision

Finds next Event for Sphere 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

Get information

Functions written by M. Lieb

int algorithms::ls::Box::Optimalngrids ( double  maxpf)

Calculates the optimal ngrids

Output positions of Spheres and their cells...purely used for debugging

Output Event Heap...purely used for debugging

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

Prints statistics for n Events

Processes n Events

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

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

Update positions...purely for graphical display

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


Member Data Documentation

linked-list for cells array

array that keeps track of spheres in each cell

time_t algorithms::ls::Box::end [private]
double algorithms::ls::Box::energy [private]

kinetic energy

kinetic energy change

time_t algorithms::ls::Box::error [private]

growthrate of the spheres

double algorithms::ls::Box::gtime [private]

this is global clock

Event heap

double algorithms::ls::Box::maxpf [private]
const int algorithms::ls::Box::N [private]

number of spheres

number of checks

number of collisions

counts # cycles for output

total number of Events

number of cells in one direction

number of transfers

double algorithms::ls::Box::pf [private]

packing fraction

pressure

double algorithms::ls::Box::r [private]

radius, defined at gtime = 0

double algorithms::ls::Box::rtime [private]

reset time, total time = rtime + gtime

array of spheres

time_t algorithms::ls::Box::start [private]

run time of program

positions of spheres.used for graphics

exchanged momentum


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines