ParM  parm
A molecular dynamics library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Collection Class Referenceabstract

#include <collection.hpp>

Inheritance diagram for Collection:
CollectionCD CollectionCDgrid CollectionDamped CollectionGaussianT CollectionGear3A CollectionGear4A CollectionGear4NPH CollectionGear4NPT CollectionGear5A CollectionGear6A CollectionNLCG CollectionNLCGV CollectionNoseHoover CollectionOverdamped CollectionRK4 CollectionSol CollectionSolHT CollectionVerlet CollectionVerletNPT StaticCollec

Public Member Functions

 Collection (sptr< Box > box, sptr< AtomGroup > atoms, vector< sptr< Interaction > > interactions=vector< sptr< Interaction > >(), vector< sptr< StateTracker > > trackers=vector< sptr< StateTracker > >(), vector< sptr< Constraint > > constraints=vector< sptr< Constraint > >(), bool should_initialize=true)
 
virtual void initialize ()
 
virtual void set_forces (bool constraints_and_a=true)
 Set forces. More...
 
virtual void timestep ()=0
 Take one step forward in time. More...
 
flt degrees_of_freedom ()
 Total degrees of freedom. More...
 
flt potential_energy ()
 
flt energy ()
 Total energy, including both potential and kinetic_energy. More...
 
virtual flt temp (bool minuscomv=true)
 
virtual flt kinetic_energy ()
 
virtual flt virial ()
 
virtual flt pressure ()
 Returns (1/d V) Σ ri dot fi where d is number of dimensions note that Interaction->pressure just returns Σ ri dot fi. More...
 
sptr< Boxget_box ()
 
Vec com ()
 
Vec com_velocity ()
 
Vec angular_momentum (const Vec &loc)
 Shortcut to AtomGroup method of the same name. More...
 
Vec angular_momentum ()
 Shortcut to AtomGroup method of the same name. More...
 
flt gyradius ()
 
virtual ~Collection ()
 
void reset_com_velocity ()
 Shortcut to AtomGroup method of the same name. More...
 
void reset_L ()
 Shortcut to AtomGroup method of the same name. More...
 
void scale_velocities (flt scaleby)
 Scale all velocities by a factor. More...
 
void scale_velocities_to_temp (flt T, bool minuscomv=true)
 Scale all velocities to get to a specific temperature. More...
 
void scale_velocities_to_energy (flt E)
 Scale all velocities to get to a specific total energy. More...
 
void add_interaction (sptr< Interaction > inter)
 
void add_tracker (sptr< StateTracker > track)
 
void add_constraint (sptr< Constraint > c)
 
void add (sptr< Interaction > a)
 
void add (sptr< StateTracker > a)
 
void add (sptr< Constraint > a)
 
vector< sptr< Interaction > > get_interactions ()
 

Protected Member Functions

void update_trackers ()
 To be called immediately after setting particle positions and velocities; lets StateTracker instances stay updated automatically. More...
 
void update_constraint_positions ()
 To be called approximately after forces have been set. More...
 
void update_constraint_velocities ()
 
void update_constraint_forces ()
 
virtual flt set_forces_get_pressure (bool constraints_and_a=true)
 

Protected Attributes

sptr< Boxbox
 
sptr< AtomGroupatoms
 
vector< sptr< Interaction > > interactions
 
vector< sptr< StateTracker > > trackers
 
vector< sptr< Constraint > > constraints
 

Detailed Description

A "Collection" of atoms, the box, and an integrator. Provides general simulation time-stepping as well as statistical tracking.

The most useful method is timestep(), which takes one step forward in time; this is defined by each subclass separately, as each subclass uses a different integration scheme.

Constructor & Destructor Documentation

Collection::Collection ( sptr< Box box,
sptr< AtomGroup atoms,
vector< sptr< Interaction > >  interactions = vector<sptr<Interaction> >(),
vector< sptr< StateTracker > >  trackers = vector<sptr<StateTracker> >(),
vector< sptr< Constraint > >  constraints = vector<sptr<Constraint> >(),
bool  should_initialize = true 
)
virtual Collection::~Collection ( )
inlinevirtual

Member Function Documentation

void Collection::add ( sptr< Interaction a)
inline
Examples:
hardspheres.cpp.
void Collection::add ( sptr< StateTracker a)
inline
void Collection::add ( sptr< Constraint a)
inline
void Collection::add_constraint ( sptr< Constraint c)
inline
void Collection::add_interaction ( sptr< Interaction inter)
inline
void Collection::add_tracker ( sptr< StateTracker track)
inline
Vec Collection::angular_momentum ( const Vec loc)
inline

Shortcut to AtomGroup method of the same name.

Vec Collection::angular_momentum ( )
inline

Shortcut to AtomGroup method of the same name.

Vec Collection::com ( )
inline
Vec Collection::com_velocity ( )
inline
flt Collection::degrees_of_freedom ( )

Total degrees of freedom.

This takes into account constraints, and whether the center-of-mass is free.

flt Collection::energy ( )

Total energy, including both potential and kinetic_energy.

Examples:
LJatoms.cpp.
sptr<Box> Collection::get_box ( )
inline
vector<sptr<Interaction> > Collection::get_interactions ( )
inline
flt Collection::gyradius ( )
void Collection::initialize ( )
virtual
virtual flt Collection::kinetic_energy ( )
inlinevirtual

Reimplemented in CollectionGear4NPH, and CollectionNLCG.

Examples:
LJatoms.cpp.
flt Collection::potential_energy ( )
Examples:
hardspheres.cpp.
flt Collection::pressure ( )
virtual

Returns (1/d V) Σ ri dot fi where d is number of dimensions note that Interaction->pressure just returns Σ ri dot fi.

Reimplemented in CollectionNLCGV, and CollectionNLCG.

void Collection::reset_com_velocity ( )
inline

Shortcut to AtomGroup method of the same name.

Examples:
hardspheres.cpp, and LJatoms.cpp.
void Collection::reset_L ( )
inline

Shortcut to AtomGroup method of the same name.

void Collection::scale_velocities ( flt  scaleby)

Scale all velocities by a factor.

void Collection::scale_velocities_to_energy ( flt  E)

Scale all velocities to get to a specific total energy.

Examples:
LJatoms.cpp.
void Collection::scale_velocities_to_temp ( flt  T,
bool  minuscomv = true 
)

Scale all velocities to get to a specific temperature.

void Collection::set_forces ( bool  constraints_and_a = true)
virtual

Set forces.

This should be called at the beginning of the simulation, and will also be called by timestep()

Reimplemented in CollectionGear4NPT, CollectionGaussianT, and CollectionNLCG.

flt Collection::set_forces_get_pressure ( bool  constraints_and_a = true)
protectedvirtual
flt Collection::temp ( bool  minuscomv = true)
virtual

Reimplemented in CollectionGear4NPH.

virtual void Collection::timestep ( )
pure virtual
void Collection::update_constraint_forces ( )
protected
void Collection::update_constraint_positions ( )
protected

To be called approximately after forces have been set.

Constraints will typically set forces / velocities in some direction to zero, so update_constraints should be called after all forces have been set, and any external velocity changes have been made.

void Collection::update_constraint_velocities ( )
protected
void Collection::update_trackers ( )
protected

To be called immediately after setting particle positions and velocities; lets StateTracker instances stay updated automatically.

flt Collection::virial ( )
virtual

Member Data Documentation

sptr<AtomGroup> Collection::atoms
protected
sptr<Box> Collection::box
protected
vector<sptr<Constraint> > Collection::constraints
protected
vector<sptr<Interaction> > Collection::interactions
protected
vector<sptr<StateTracker> > Collection::trackers
protected

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