Loading...
Searching...
No Matches
BALL::MolecularDynamics Class Reference
Molecular Modeling » Molecular Mechanics » Molecular Dynamics Simulation

`#include <BALL/MOLMEC/MDSIMULATION/molecularDynamics.h>`

Inheritance diagram for BALL::MolecularDynamics:

## Classes

struct | Option
struct | Default

## Public Member Functions

Constructors and Destructors
| MolecularDynamics ()
| MolecularDynamics (ForceField &force_field)
| MolecularDynamics (const MolecularDynamics &rhs)
virtual | ~MolecularDynamics ()
Assignments
const MolecularDynamics & | operator= (const MolecularDynamics &rhs)
void | set (const MolecularDynamics &rhs)
Debugging and Diagnostics
bool | isValid () const
Setup methods
virtual bool | setup (ForceField &force_field, SnapShotManager *snapshot_man)
virtual bool | setup (ForceField &forcefield, SnapShotManager *snapshot_man, const Options &myoptions)
virtual bool | specificSetup ()
Accessors
void | setNumberOfIteration (Size number)
void | setMaximalNumberOfIterations (Size number)
void | setMaximalSimulationTime (double time)
virtual void | setTimeStep (double step)
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
ForceField * | getForceField () const
bool | simulate (bool restart=false)
bool | simulateTime (double simulation_time, bool restart=false)
virtual bool | simulateIterations (Size number, bool restart=false)
void | enableEnergyAbortCondition (bool state)
bool | energyAbortConditionEnabled () const
| Query if the MDSimulation aborts if the Energy is greater than abort_energy_.
void | setEnergyToAbort (float value)
float | getEnergyToAbort () const

## Public Attributes

Options | options
bool | valid_
ForceField * | force_field_ptr_
System * | system_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_
SnapShotManager * | snapshot_manager_ptr_
bool | abort_by_energy_enabled_
float | abort_energy_
void | updateInstantaneousTemperature ()

## Detailed Description

Molecular Dynamics base class. This class is the base class for classical molecular dynamics simulations. Actual MD classes are derived from this class and then implement the actual simulation classes for the different ensembles or methods.

Definition at line 42 of file molecularDynamics.h.

## Constructor & Destructor Documentation

## MolecularDynamics() [1/3]

BALL::MolecularDynamics::MolecularDynamics | ( |  | ) |

Default constructor.

## MolecularDynamics() [2/3]

BALL::MolecularDynamics::MolecularDynamics | ( | ForceField & | force_field | ) |

Constructor. It expects the forcefield

## MolecularDynamics() [3/3]

BALL::MolecularDynamics::MolecularDynamics | ( | const MolecularDynamics & | rhs | ) |

Copy constructor

## ~MolecularDynamics()

virtual BALL::MolecularDynamics::~MolecularDynamics | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## enableEnergyAbortCondition()

void BALL::MolecularDynamics::enableEnergyAbortCondition | ( | bool | state | ) |

Specify if the MDSimulation aborts if the Energy is greater than abort_energy_

## energyAbortConditionEnabled()

bool BALL::MolecularDynamics::energyAbortConditionEnabled | ( |  | ) | const

Query if the MDSimulation aborts if the Energy is greater than abort_energy_.

## getEnergyOutputFrequency()

Size BALL::MolecularDynamics::getEnergyOutputFrequency | ( |  | ) | const

Get the energy output frequency

## getEnergyToAbort()

float BALL::MolecularDynamics::getEnergyToAbort | ( |  | ) | const

Query the energy to abort the simulation. The default value is 10^8.

## getForceField()

ForceField * BALL::MolecularDynamics::getForceField | ( |  | ) | const

Get the force field the MD simulation is bound to

## getKineticEnergy()

double BALL::MolecularDynamics::getKineticEnergy | ( |  | ) | const

Get the current kinetic energy of the system

## getMaximalNumberOfIterations()

Size BALL::MolecularDynamics::getMaximalNumberOfIterations | ( |  | ) | const

Get the maximal number of iterations of the MD simulation

## getMaximalSimulationTime()

double BALL::MolecularDynamics::getMaximalSimulationTime | ( |  | ) | const

Get the maximal simulation time of the MD simulation

## getNumberOfIterations()

Size BALL::MolecularDynamics::getNumberOfIterations | ( |  | ) | const

Get the current iteration of the MD simulation

## getPotentialEnergy()

double BALL::MolecularDynamics::getPotentialEnergy | ( |  | ) | const

Get the current potential energy of the system

## getSnapShotFrequency()

Size BALL::MolecularDynamics::getSnapShotFrequency | ( |  | ) | const

Get the snapshot frequency

## getTemperature()

double BALL::MolecularDynamics::getTemperature | ( |  | ) | const

Get the current temperature of the system

## getTime()

double BALL::MolecularDynamics::getTime | ( |  | ) | const

Get the current time of the MD simulation

## getTimeStep()

double BALL::MolecularDynamics::getTimeStep | ( |  | ) | const

Get the current time step

## getTotalEnergy()

double BALL::MolecularDynamics::getTotalEnergy | ( |  | ) | const

Get the current total energy of the system

## isValid()

bool BALL::MolecularDynamics::isValid | ( |  | ) | const

Has the molecular dynamics class been successfully set up?

## operator=()

const MolecularDynamics & BALL::MolecularDynamics::operator= | ( | const MolecularDynamics & | rhs | ) |

Assignment operator

## set()

void BALL::MolecularDynamics::set | ( | const MolecularDynamics & | rhs | ) |

Assign a molecular dynamics objects.

## setCurrentTime()

void BALL::MolecularDynamics::setCurrentTime | ( | double | time | ) |

Set the current time of the MD run in picoseconds

## setEnergyOutputFrequency()

void BALL::MolecularDynamics::setEnergyOutputFrequency | ( | Size | number | ) |

Set the energy output frequency. The current energies during the simulation will be printed every number steps.

## setEnergyToAbort()

void BALL::MolecularDynamics::setEnergyToAbort | ( | float | value | ) |

Specify the energy to abort the simulation. The default value is 10^8.

## setMaximalNumberOfIterations()

void BALL::MolecularDynamics::setMaximalNumberOfIterations | ( | Size | number | ) |

Set the maximal number of iterations that will be carried out. If the number of the start iteration is 0 (which is the default), this method sets the total number of simulated iterations.

## setMaximalSimulationTime()

void BALL::MolecularDynamics::setMaximalSimulationTime | ( | double | time | ) |

Set the maximal simulation time in ps that will be carried out. If the start time is zero(which is the default), then this method sets the total simulation time.

## setNumberOfIteration()

void BALL::MolecularDynamics::setNumberOfIteration | ( | Size | number | ) |

Set the number of the current iteration

## setReferenceTemperature()

void BALL::MolecularDynamics::setReferenceTemperature | ( | double | temperature | ) |

Set the reference temperature for the system. In isothermal ensembles, this is the simulation temperature set set by the thermostat.

## setSnapShotFrequency()

void BALL::MolecularDynamics::setSnapShotFrequency | ( | Size | number | ) |

Set the snapshot frequency

## setTimeStep()

virtual void BALL::MolecularDynamics::setTimeStep | ( | double | step | ) |

virtual

Set the time step in ps. Note that this will change the maximum simulation time.

Reimplemented in BALL::CanonicalMD, and BALL::MicroCanonicalMD.

## setup() [1/2]

virtual bool BALL::MolecularDynamics::setup | ( | ForceField & | force_field,
|  | SnapShotManager * | snapshot_man )

virtual

Set up the molecular dynamics

Reimplemented in BALL::CanonicalMD, and BALL::MicroCanonicalMD.

## setup() [2/2]

virtual bool BALL::MolecularDynamics::setup | ( | ForceField & | forcefield,
|  | SnapShotManager * | snapshot_man,
|  | const Options & | myoptions )

virtual

Set up the molecular dynamics

Reimplemented in BALL::CanonicalMD, and BALL::MicroCanonicalMD.

## simulate()

bool BALL::MolecularDynamics::simulate | ( | bool | restart = false | ) |

Start the molecular dynamics simulation. This method calls simulateIterations with the maximum number of iterations.

See also
  setMaximumNumberOfIterations

Returns
  false if an error occurred, e.g. the energy was too high

## simulateIterations()

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

virtual

Start the molecular dynamics simulation and carry out the given number of iterations. This is the proper simulation method, which is implemented in the derived classes only. The implementation provided by MolecularDynamics is simply empty.

Returns
  false if an error occurred, e.g. the energy was too high

Reimplemented in BALL::CanonicalMD, and BALL::MicroCanonicalMD.

## simulateTime()

bool BALL::MolecularDynamics::simulateTime | ( | double | simulation_time,
|  | bool | restart = false )

Simulate a given time interval. This method determines the number of steps necessary to simulate a given time interval and executes a simulation for that interval by calling simulateIterations .

Returns
  false if an error occurred, e.g. the energy was too high

## specificSetup()

virtual bool BALL::MolecularDynamics::specificSetup | ( |  | ) |

virtual

Specific setup; derived class can use this method for additional preparations if necessary

Reimplemented in BALL::CanonicalMD, and BALL::MicroCanonicalMD.

## updateInstantaneousTemperature()

void BALL::MolecularDynamics::updateInstantaneousTemperature | ( |  | ) |

protected

## Member Data Documentation

## abort_by_energy_enabled_

bool BALL::MolecularDynamics::abort_by_energy_enabled_

protected

Definition at line 422 of file molecularDynamics.h.

## abort_energy_

float BALL::MolecularDynamics::abort_energy_

protected

Definition at line 425 of file molecularDynamics.h.

## atom_vector_

AtomVector BALL::MolecularDynamics::atom_vector_

protected

Definition at line 374 of file molecularDynamics.h.

## current_temperature_

double BALL::MolecularDynamics::current_temperature_

protected

Definition at line 395 of file molecularDynamics.h.

## current_time_

double BALL::MolecularDynamics::current_time_

protected

Definition at line 407 of file molecularDynamics.h.

## energy_output_frequency_

Size BALL::MolecularDynamics::energy_output_frequency_

protected

Definition at line 411 of file molecularDynamics.h.

## force_field_ptr_

ForceField* BALL::MolecularDynamics::force_field_ptr_

protected

Definition at line 366 of file molecularDynamics.h.

## kinetic_energy_

double BALL::MolecularDynamics::kinetic_energy_

protected

Definition at line 399 of file molecularDynamics.h.

## maximal_number_of_iterations_

Size BALL::MolecularDynamics::maximal_number_of_iterations_

protected

Definition at line 383 of file molecularDynamics.h.

## number_of_iteration_

Size BALL::MolecularDynamics::number_of_iteration_

protected

Definition at line 378 of file molecularDynamics.h.

## options

Options BALL::MolecularDynamics::options

The options for this class

Definition at line 340 of file molecularDynamics.h.

## reference_temperature_

double BALL::MolecularDynamics::reference_temperature_

protected

Definition at line 391 of file molecularDynamics.h.

## snapshot_frequency_

Size BALL::MolecularDynamics::snapshot_frequency_

protected

Definition at line 415 of file molecularDynamics.h.

## snapshot_manager_ptr_

SnapShotManager* BALL::MolecularDynamics::snapshot_manager_ptr_

protected

Definition at line 419 of file molecularDynamics.h.

## system_ptr_

System* BALL::MolecularDynamics::system_ptr_

protected

Definition at line 370 of file molecularDynamics.h.

## time_step_

double BALL::MolecularDynamics::time_step_

protected

Definition at line 387 of file molecularDynamics.h.

## total_energy_

double BALL::MolecularDynamics::total_energy_

protected

Definition at line 403 of file molecularDynamics.h.

## valid_

bool BALL::MolecularDynamics::valid_

protected

Definition at line 362 of file molecularDynamics.h.