![]() |
.Simulation
|
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) |
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.
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.
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.
position | The position of the particle in simulation units. |
velocity | The velocity of the particle in simulation units. |
updated | The time at which the particle was updated in simulation units. |
type | The index of the element of the particle. |
MDSimulation::Particle::Particle | ( | const Particle & | other | ) |
Copy constructor.
Perform a verbatim copy of the particle's information.
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.
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.