.Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Public Attributes | Friends | List of all members
MDSimulation::Particle Struct Reference

Definition of a basic particle type. More...

#include <Particle.h>

Public Member Functions

 Particle ()
 Create a "null" particle with default values of zero. More...
 
 Particle (const DoubleVector &position, const DoubleVector &velocity, const double updated, const int type)
 Initialize the particle with position and velocity to the given vectors and the type to the given type. More...
 
 Particle (const Particle &other)
 Copy constructor. More...
 
void UpdateParticle (const double currentTime)
 Update the particle to the current system time. More...
 
template<typename Writer >
void Serialize (Writer &pt) const
 

Public Attributes

DoubleVector Position
 Position of the particle in simulation units. More...
 
DoubleVector Velocity
 Velocity of the particle in simulation units. More...
 
double Updated
 Time at which the simulation was last updated. More...
 
int Charge
 Ionization level of the particle. More...
 
int Type
 Index representing the element of the particle. More...
 

Friends

std::ostream & operator<< (std::ostream &stream, const Particle &particle)
 

Detailed Description

Definition of a basic particle type.

This module defines the particle type used in the simulation. We make use of uBLAS vectors to provide multidimensional vectors.

Particles store, along with position and velocity, the time at which these values were last updated (in system units). This lazy update strategy saves the need of having to update the entire system after each event.

Author
Spenser Bauman

Constructor & Destructor Documentation

MDSimulation::Particle::Particle ( )

Create a "null" particle with default values of zero.

Implementation of the particle data structure.

The position and velocity vectors are still initialized to length 3.

Author
Spenser Bauman
MDSimulation::Particle::Particle ( const DoubleVector position,
const DoubleVector velocity,
const double  updated,
const int  type 
)

Initialize the particle with position and velocity to the given vectors and the type to the given type.

Parameters
positionThe position of the particle in simulation units.
velocityThe velocity of the particle in simulation units.
updatedThe time at which the particle was updated in simulation units.
typeThe index of the element of the particle.
MDSimulation::Particle::Particle ( const Particle other)

Copy constructor.

Perform a verbatim copy of the particle's information.

Member Function Documentation

void MDSimulation::Particle::UpdateParticle ( const double  currentTime)

Update the particle to the current system time.

Computes the time differential and then advances the particle that far based on its velocity.

Member Data Documentation

int MDSimulation::Particle::Charge

Ionization level of the particle.

DoubleVector MDSimulation::Particle::Position

Position of the particle in simulation units.

int MDSimulation::Particle::Type

Index representing the element of the particle.

double MDSimulation::Particle::Updated

Time at which the simulation was last updated.

DoubleVector MDSimulation::Particle::Velocity

Velocity of the particle in simulation units.


The documentation for this struct was generated from the following files: