BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | List of all members
BALL::CanonicalMD Class Reference

#include <BALL/MOLMEC/MDSIMULATION/canonicalMD.h>

Inheritance diagram for BALL::CanonicalMD:
BALL::MolecularDynamics

Classes

struct  AuxFactors
 Helper class containing auxiliary factors. More...
 

Public Member Functions

Constructors and Destructor
 CanonicalMD ()
 
 CanonicalMD (ForceField &myforcefield)
 
 CanonicalMD (ForceField &force_field, SnapShotManager *ssm)
 
 CanonicalMD (ForceField &myforcefield, SnapShotManager *ssm, const Options &options)
 
 CanonicalMD (const CanonicalMD &rhs)
 Copy constructor. More...
 
virtual ~CanonicalMD ()
 Destructor. More...
 
Assignment
CanonicalMDoperator= (const CanonicalMD &rhs)
 Assignment operator. More...
 
Setup methods
virtual bool setup (ForceField &force_field, SnapShotManager *ssm=0)
 
virtual bool setup (ForceField &force_field, SnapShotManager *ssm, const Options &options)
 
virtual bool specificSetup ()
 
Accessors
void setBathRelaxationTime (double time)
 
double getBathRelaxationTime () const
 
virtual void setTimeStep (double time)
 
virtual bool simulateIterations (Size number, bool restart=false)
 
- Public Member Functions inherited from BALL::MolecularDynamics
 MolecularDynamics ()
 
 MolecularDynamics (ForceField &force_field)
 
 MolecularDynamics (const MolecularDynamics &rhs)
 
virtual ~MolecularDynamics ()
 
const MolecularDynamicsoperator= (const MolecularDynamics &rhs)
 
void set (const MolecularDynamics &rhs)
 
bool isValid () const
 
void setNumberOfIteration (Size number)
 
void setMaximalNumberOfIterations (Size number)
 
void setMaximalSimulationTime (double time)
 
void setReferenceTemperature (double temperature)
 
void setCurrentTime (double time)
 
void setEnergyOutputFrequency (Size number)
 
void setSnapShotFrequency (Size number)
 
Size getEnergyOutputFrequency () const
 
Size getNumberOfIterations () const
 
Size getMaximalNumberOfIterations () const
 
double getMaximalSimulationTime () const
 
double getTimeStep () const
 
Size getSnapShotFrequency () const
 
double getTemperature () const
 
double getTime () const
 
double getTotalEnergy () const
 
double getPotentialEnergy () const
 
double getKineticEnergy () const
 
ForceFieldgetForceField () const
 
bool simulate (bool restart=false)
 
bool simulateTime (double simulation_time, bool restart=false)
 
void enableEnergyAbortCondition (bool state)
 
bool energyAbortConditionEnabled () const
 Query if the MDSimulation aborts if the Energy is greater than abort_energy_. More...
 
void setEnergyToAbort (float value)
 
float getEnergyToAbort () const
 

Protected Member Functions

Protected methods
void calculateFactors_ ()
 
- Protected Member Functions inherited from BALL::MolecularDynamics
void updateInstantaneousTemperature ()
 

Protected Attributes

Protected Attributes
double bath_relaxation_time_
 The coupling parameter to the heat bath. More...
 
std::vector< AuxFactorsmass_factor_
 This vector contains special precomputed factors. More...
 
- Protected Attributes inherited from BALL::MolecularDynamics
bool valid_
 
ForceFieldforce_field_ptr_
 
Systemsystem_ptr_
 
AtomVector atom_vector_
 
Size number_of_iteration_
 
Size maximal_number_of_iterations_
 
double time_step_
 
double reference_temperature_
 
double current_temperature_
 
double kinetic_energy_
 
double total_energy_
 
double current_time_
 
Size energy_output_frequency_
 
Size snapshot_frequency_
 
SnapShotManagersnapshot_manager_ptr_
 
bool abort_by_energy_enabled_
 
float abort_energy_
 

Additional Inherited Members

- Public Attributes inherited from BALL::MolecularDynamics
Options options
 

Detailed Description

A MD simulation in the canoncial ensemble. A class for doing molecular dynamics simulations according to the principle of a canonical ensemble (NVT), i.e., the temperature is kept constant. This is achieved via the velocity rescaling proposed by Berendsen et al., J. Chem. Physics, 81:3684, 1984. Note that this approach does not give all properties of a true canonical system. In particular, the heat capacity cannot be calculated!

The temperature is set through the MDSimulation::setReferenceTemperature method.

Definition at line 30 of file canonicalMD.h.

Constructor & Destructor Documentation

BALL::CanonicalMD::CanonicalMD ( )
BALL::CanonicalMD::CanonicalMD ( ForceField myforcefield)

This constructor expects a force field . The force field's options are used and no saving of snapshots is done.

Parameters
myforcefieldthe forcefield we need for the simulation
BALL::CanonicalMD::CanonicalMD ( ForceField force_field,
SnapShotManager ssm 
)

This constructor expects a force field and a snapshot manager. The force field's options are used.

Parameters
myforcefieldthe forcefield to use in the simulation
ssma pointer to the SnapShotManager which will be used to create trajectory files
BALL::CanonicalMD::CanonicalMD ( ForceField myforcefield,
SnapShotManager ssm,
const Options options 
)

This constructor wants a force field, a snapshot manager and new options.

Parameters
myforcefieldthe forcefield which is to be used in the simulation
ssma pointer to the SnapShotManager used for creating trajectory files
myoptionsarbitrary options that are to be used by this instance instead of those defined therein
BALL::CanonicalMD::CanonicalMD ( const CanonicalMD rhs)

Copy constructor.

virtual BALL::CanonicalMD::~CanonicalMD ( )
virtual

Destructor.

Member Function Documentation

void BALL::CanonicalMD::calculateFactors_ ( )
protected

A protected method for calculating some factors that are needed all the time.

double BALL::CanonicalMD::getBathRelaxationTime ( ) const

This method gets the current value for heat bath coupling.

Returns
the bath relaxation time in ps
CanonicalMD& BALL::CanonicalMD::operator= ( const CanonicalMD rhs)

Assignment operator.

void BALL::CanonicalMD::setBathRelaxationTime ( double  time)

This method sets a new relaxation time for the coupling to an external heat bath. The readjustment to the external bath is not done after every step in order to save compute time. Instead, it is coupled periodically after the time specified here has elapsed.

Parameters
timethe time in ps
virtual void BALL::CanonicalMD::setTimeStep ( double  time)
virtual

Set a new time step for the numerical integration.

Reimplemented from BALL::MolecularDynamics.

virtual bool BALL::CanonicalMD::setup ( ForceField force_field,
SnapShotManager ssm = 0 
)
virtual

This method does general setup things

Parameters
ssmif no snapshots during the simulations are required, leave this at the default (NULL pointer)
force_fieldthe forcefield, which has to be bound to a system

Reimplemented from BALL::MolecularDynamics.

virtual bool BALL::CanonicalMD::setup ( ForceField force_field,
SnapShotManager ssm,
const Options options 
)
virtual

This method does general setup things. This method also allows the assignment of options for the setup.

Reimplemented from BALL::MolecularDynamics.

virtual bool BALL::CanonicalMD::simulateIterations ( Size  number,
bool  restart = false 
)
virtual

This method does the actual simulation stuff. It runs for the indicated number of iterations. If restart is true, the counting of iterations starts with the number of the last iteration in the previous run.

Parameters
numberthe number of iterations that have to be simulated
restartflag for restarting the simulation

Reimplemented from BALL::MolecularDynamics.

virtual bool BALL::CanonicalMD::specificSetup ( )
virtual

This method is meant for additional preparations apart from those done in setup.

Returns
bool, true if specificSetup() was successful

Reimplemented from BALL::MolecularDynamics.

Member Data Documentation

double BALL::CanonicalMD::bath_relaxation_time_
protected

The coupling parameter to the heat bath.

Definition at line 160 of file canonicalMD.h.

std::vector<AuxFactors> BALL::CanonicalMD::mass_factor_
protected

This vector contains special precomputed factors.

Definition at line 163 of file canonicalMD.h.