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

#include <Simulation.h>

Collaboration diagram for algorithms::ls2::Simulation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void AssignCells ()
double CalculateCollision (int i, int j, tarch::la::Vector< DIM, double > pboffset)
void ChangeNgrids (int newngrids)
int CheckSphereDiameters ()
void Collision (Event e)
void CollisionChecker (Event c)
void CreateSphere (int Ncurrent)
void CreateSpheres (double temp)
double Energy ()
void findAllNeighbour (int i)
void findNearestNeighbor (int i, double *criteria)
Event FindNextCollision (int i)
Event FindNextEvent (int i)
Event FindNextTransfer (int i)
void ForAllNeighbors (int, tarch::la::Vector< DIM, int >, tarch::la::Vector< DIM, int >, Collisions &)
double getCollisionrate () const
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
void growSphere ()
double oneDimensionDistance (double r1, double r2)
int Optimalngrids ()
int Optimalngrids2 (double maxr)
void OutputCells ()
void OutputEvents ()
double PackingFraction ()
void PredictCollision (int i, int j, tarch::la::Vector< DIM, int > pboffset, double &ctime, int &cpartner, tarch::la::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 ()
 Simulation (double Size_i, int N_i, double r_i, double growthrate_i, double maxpf_i, double various_i, std::vector< double > &array)
void Synchronize (bool rescale)
void TrackPositions ()
void Transfer (Event e)
void UpdateCell (int i, tarch::la::Vector< DIM, int > &celli)
double Velocity (double temp)
void VelocityGiver (double temp)
void WriteConfiguration (const char *wconfigfile)
 ~Simulation ()

Private Attributes

std::vector< double > & _array
double _SIZE
int * binlist
Cells< DIM, int > cells
double collisionrate
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
std::vector< Sphereneighbor
int nEventstot
int ngrids
int ntransfers
double pf
double pressure
double r
double rtime
Spheres
time_t start
double various_radius
tarch::la::Vector< DIM, double > * x
double xmomentum

Detailed Description

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


Constructor & Destructor Documentation

algorithms::ls2::Simulation::Simulation ( double  Size_i,
int  N_i,
double  r_i,
double  growthrate_i,
double  maxpf_i,
double  various_i,
std::vector< double > &  array 
)

Constructor

Destructor


Member Function Documentation

Assign cells to Spheres read in from existing configuration

double algorithms::ls2::Simulation::CalculateCollision ( int  i,
int  j,
tarch::la::Vector< DIM, double >  pboffset 
)

Calculates collision time between i and image of j using quadratic formula

Change ngrids

Processes a collision

Checks Events of predicted collision partner to keep collisions symmetric

Creates a Sphere of radius r at a random unoccupied position

Creates all N Spheres at random positions

Computes the total energy

void algorithms::ls2::Simulation::findNearestNeighbor ( int  i,
double *  criteria 
)

Find next collision

Finds next Event for Sphere i

Find next collision for Sphere i

void algorithms::ls2::Simulation::ForAllNeighbors ( int  i,
tarch::la::Vector< DIM, int >  vl,
tarch::la::Vector< DIM, int >  vr,
Collisions operation 
)

Find next collision for Sphere i

Get information

Functions written by M. Lieb

Functions written by Tan

double algorithms::ls2::Simulation::oneDimensionDistance ( double  r1,
double  r2 
)

Calculates the optimal ngrids

Calculates the optimal ngrids for the initial configuration and assumes that ngrids gets updated (reduced) as the packing proceeds

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

Output Event Heap...purely used for debugging

Calculates the packing fraction

void algorithms::ls2::Simulation::PredictCollision ( int  i,
int  j,
tarch::la::Vector< DIM, int >  pboffset,
double &  ctime,
int &  cpartner,
tarch::la::Vector< DIM, int > &  cpartnerpboffset 
)

Find next collision for Sphere i

Prints statistics for n Events

Processes n Events

Processes n Events

double algorithms::ls2::Simulation::QuadraticFormula ( double  a,
double  b,
double  c 
)

Quadratic Formula ax^2 + bx + c = 0

void algorithms::ls2::Simulation::ReadPositions ( const char *  filename)

ReadFile

void algorithms::ls2::Simulation::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

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::ls2::Simulation::UpdateCell ( int  i,
tarch::la::Vector< DIM, int > &  celli 
)

Updates cell of a Sphere to time

double algorithms::ls2::Simulation::Velocity ( double  temp)

Velocity, gives a single velocity from Max/Boltz dist.

Velocity Giver, assigns initial velocities from Max/Boltz dist.

void algorithms::ls2::Simulation::WriteConfiguration ( const char *  wconfigfile)

Write configuration


Member Data Documentation

std::vector<double>& algorithms::ls2::Simulation::_array [private]

linked-list for cells array

array that keeps track of spheres in each cell

average rate of collision between spheres

kinetic energy

kinetic energy change

growthrate of the spheres

this is global clock

Event heap

const int algorithms::ls2::Simulation::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

packing fraction

pressure

radius, defined at gtime = 0

reset time, total time = rtime + gtime

array of spheres

run time of program

tarch::la::Vector<DIM,double>* algorithms::ls2::Simulation::x [private]

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