![]() |
.Simulation
|
MDSimulation is the molecular dynamics simulation for testing Sonoluminescence. More...
Namespaces | |
Constants | |
Constants for the program corresponding to atomic/molecular properties of the various particle types in the simulation. | |
Units | |
Unit conversion code. | |
Classes | |
class | CellList |
This class provides the functionality of a three dimensional cell list. More... | |
class | EventCalendar |
class | SimulationException |
class | InfoStruct |
Defines the structure used to hold the configurable constants of the simulation. More... | |
class | Solver |
The Solver class is templatized by the function it will take. More... | |
struct | Particle |
Definition of a basic particle type. More... | |
class | PressureGauge |
PressureGauge.h - pressure gauge class declaration Written by Alexander Bass, modified by Max I. More... | |
class | RPK |
This module defines the RPK class. More... | |
struct | CollisionRecord |
class | AllParticles |
Function object to regulate the ScheduleParticleCollisions function. More... | |
class | LessThan |
Function object to regulate the ScheduleParticleCollisions function. More... | |
class | Skipping |
Function object to regulate the ScheduleParticleCollisions function. More... | |
class | Simulation |
The Simulation class is the environment in which the simulation occurs. More... | |
class | Statistics |
Typedefs | |
typedef std::pair< double, double > | TimeSeries |
typedef boost::numeric::ublas::vector < double > | state_type |
typedef boost::numeric::ublas::matrix < double > | matrix_type |
typedef odeint::runge_kutta_fehlberg78 < state_type > | error_stepper_type |
typedef odeint::controlled_runge_kutta < error_stepper_type > | controlled_stepper_type |
typedef tvmet::Vector< double, 3UL > | DoubleVector |
Vector type for representing particle positions and velocities as double precision floating point values. | |
typedef tvmet::Vector< int, 3UL > | IntVector |
A vector of integer values to hold a particle's position in the grid of cells. | |
Enumerations | |
enum | EventType { CellCrossingEvent = 0, BubbleWallEvent = 1, ConeWallEvent = 2, CollisionEvent = 3, UpdateSystemEvent = 4 } |
Enumeration of the various event types in the system. More... | |
enum | DriverMode { Sinusoidal, Constant } |
Possible driver modes for use in the RPK equation. More... | |
Functions | |
std::string | getEventName (const EventType type) |
Function for translating an event type to an appropriate string representing the event. More... | |
int | associatedObjects (const EventType type) |
Produces the number of objects associated with the event. More... | |
bool | invalidatesAssociated (const EventType type) |
Check function to determine whether or not the occurrence of a given event will invalidate ones already queued. More... | |
std::ostream & | operator<< (std::ostream &stream, const InfoStruct &is) |
double | max_mag (const double t1, const double t2) |
Produces the value with the largest magnitude of the two given parameters. | |
template<typename T > | |
T | sign (const T n) |
Extract the sign of the (hopefully) numerical value given. | |
template<typename T > | |
double | Sqr (const T x) |
template<typename T > | |
double | Pow3 (const T x) |
template<typename T > | |
T & | identity (T &x) |
double | mean_velocity (const std::vector< Particle > &arr) |
double | median_velocity (const std::vector< Particle > &arr) |
double | intersection_time (const DoubleVector &p1, const DoubleVector &v1, const DoubleVector &p2, const DoubleVector &v2, double diameter) |
Computes the time to intersection given a pair of positions, velocities, and the minimum pass distance. More... | |
void | process_collision (const DoubleVector &p1, DoubleVector &v1, const double m1, const DoubleVector &p2, DoubleVector &v2, const double m2) |
Computes the new velocity vectors for a pair of colliding particles with the given positions, velocities and masses. | |
double | MAX (const double a, const double b) |
double | MIN (const double a, const double b) |
std::ostream & | operator<< (std::ostream &stream, const Particle &particle) |
double | uniform_rand () |
Generates uniformly distributed random numbers in the range [0, 1) | |
void | rand_vector (DoubleVector &v) |
Generates a vector whose components have a standard normal distribution. | |
void | maxwell_boltzman_velocity (const double temp, const double mass, DoubleVector &v) |
Generates a velocity vector according to the Maxwell-Boltzman Distribution. | |
double | rand_maxwell_2d () |
Generates samples from the 2D Maxwell Distribution. | |
double | cosine_distribution () |
Generates a random number according to the cosine distribution f(x) = 0.5 * cos(x) for -pi/2 <= x <= pi/2. | |
std::ostream & | operator<< (std::ostream &stream, const Simulation &sim) |
void | print_trace () |
Variables | |
const size_t | PGAUGE_ORDER = 2 |
const int | DIM = 2 |
MDSimulation is the molecular dynamics simulation for testing Sonoluminescence.
Definition of the simulation class.
Enumeration representing the different types of events that can occur in a simulation. These are used to schedule the events with the calendar as well as to act upon them when their time is due.
This will hold the relevant information for the simulation. This includes the event tree, the cell partitions, and the particles in the system. This provides an interface to execute the simulation along with methods to access the data.
The interface is provided through a series of iterators that allow access to the particles with contain all of the information about the system.
The simulation that this code describes is a complete rewrite of the work of Alexander Bass. His original implementation of an event driven molecular dynamics simulation of bubble cavitation is described in his Ph.D. dissertation "Molecular Dynamics Simulation of Sonoluminescence."
This describes an MD simulation which leverages symmetry to reduce the simulation space to a narrow conic region of the original bubble. This makes the simulation computationally feasible. This is an attempt at a production quality version of the simulation that is more easily verifiable and easier to modify.
Possible driver modes for use in the RPK equation.
These modes define what type of pressure function to use for the driving pressure.
Enumeration of the various event types in the system.
The names correspond to the events exactly as expected.
int MDSimulation::associatedObjects | ( | const EventType | type | ) |
Produces the number of objects associated with the event.
This is always in the range [0,2].
type | The type of the event. |
The | number of particles associated with the given event type. |
std::string MDSimulation::getEventName | ( | const EventType | type | ) |
Function for translating an event type to an appropriate string representing the event.
type | An event. |
A | string representation of the given event. |
|
inline |
Computes the time to intersection given a pair of positions, velocities, and the minimum pass distance.
p1 | Position of the first particle. |
v1 | Velocity of the first particle. |
p2 | Position of the second particle. |
v2 | Velocity of the second particle. |
diameter | The minimum approach diameter of the two particles. |
bool MDSimulation::invalidatesAssociated | ( | const EventType | type | ) |
Check function to determine whether or not the occurrence of a given event will invalidate ones already queued.
Currently, the only such event type is the CellCrossingEvent
. Technically speaking, the UpdateSystemEvent
does not invalidate its associated particles, but it does not have any, so logically, either response works, and this reduces it to one comparison operation.