Loading...
Searching...
No Matches
molecularDynamics.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: molecularDynamics.h,v 1.33 2005/12/23 17:01:53 amoll Exp $
//
// MolecularDynamics: A base class for molecular dynamics simulations
// Useful MD classes must be derived from this class.
#ifndef BALL_MOLMEC_MDSIMULATION_MOLECULARDYNAMICS_H
#define BALL_MOLMEC_MDSIMULATION_MOLECULARDYNAMICS_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
# include <BALL/DATATYPE/options.h>
#endif
#ifndef BALL_MOLMEC_COMMON_ATOMVECTOR_H
# include <BALL/MOLMEC/COMMON/atomVector.h>
#endif
#include <vector>
namespace BALL
{
// Some forward decls
class SnapShotManager;
class ForceField;
class System;
class BALL_EXPORT MolecularDynamics
{
public:
struct BALL_EXPORT Option
{
static const char* MAXIMAL_NUMBER_OF_ITERATIONS;
static const char* MAXIMAL_SIMULATION_TIME;
static const char* NUMBER_OF_ITERATION;
static const char* ENERGY_OUTPUT_FREQUENCY;
static const char* SNAPSHOT_FREQUENCY;
static const char* TIME_STEP;
static const char* REFERENCE_TEMPERATURE;
static const char* BATH_RELAXATION_TIME;
static const char* CURRENT_TIME;
};
struct BALL_EXPORT Default
{
static const Size MAXIMAL_NUMBER_OF_ITERATIONS;
static const double MAXIMAL_SIMULATION_TIME;
static const Size NUMBER_OF_ITERATION;
static const Size ENERGY_OUTPUT_FREQUENCY;
static const Size SNAPSHOT_FREQUENCY;
static const double TIME_STEP;
static const double REFERENCE_TEMPERATURE;
static const double BATH_RELAXATION_TIME;
static const double CURRENT_TIME;
};
BALL_CREATE(MolecularDynamics)
MolecularDynamics();
MolecularDynamics(ForceField& force_field);
MolecularDynamics(const MolecularDynamics& rhs);
virtual ~MolecularDynamics();
const MolecularDynamics& operator =(const MolecularDynamics& rhs);
void set(const MolecularDynamics& rhs);
bool isValid() const;
virtual bool setup(ForceField& force_field, SnapShotManager* snapshot_man);
virtual bool setup(ForceField& forcefield, SnapShotManager* snapshot_man, const Options& myoptions);
virtual bool specificSetup();
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;
void setEnergyToAbort(float value);
float getEnergyToAbort() const;
Options options;
protected:
/*_ @name Protected Methods
*/
//_@{
/*_ A method for calculating the
current temperature in the system
*/
void updateInstantaneousTemperature();
//_@}
/*_ @name Protected Attributes
*/
//_@{
/*_ The boolean variable indicates if the setup of the
molecular dynamics has been successful
*/
bool valid_;
/*_ The force field the MD class is bound to
*/
ForceField* force_field_ptr_;
/*_ The system the MD class is bound to
*/
System* system_ptr_;
/*_ The list of atoms. The simulation will be carried out for these atoms
*/
AtomVector atom_vector_;
/*_ The current iteration number
*/
Size number_of_iteration_;
/*_ The maximal number of iterations to be simulated when
calling the simulate() method.
*/
Size maximal_number_of_iterations_;
/*_ The time step in picoseconds
*/
double time_step_;
/*_ The reference temperature in Kelvin
*/
double reference_temperature_;
/*_ The current(kinetic) temperatue in Kelvin
*/
double current_temperature_;
/*_ The current kinetic energy in kJ/mol
*/
double kinetic_energy_;
/*_ The current total energy in kJ/mol
*/
double total_energy_;
/*_ The current time of the MD run
*/
double current_time_;
/*_ Frequency of energy output(i.e. after how many iterations)
*/
Size energy_output_frequency_;
/*_ Frequency of taking snapshots(i.e. after how many iterations)
*/
Size snapshot_frequency_;
/*_ The Snapshot Manager that is used for taking snapshots
*/
SnapShotManager* snapshot_manager_ptr_;
//_
bool abort_by_energy_enabled_;
//_
float abort_energy_;
//_@}
}; // end of class MolecularDynamics
} // end of namespace Ball
#endif // BALL_MOLMEC_MDSIMULATION_MOLECULARDYNAMICS_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
atomVector.h
BALL::AtomVector
Definition atomVector.h:31
BALL::ForceField
Definition forceField.h:86
BALL::MolecularDynamics::isValid
bool isValid() const
BALL::MolecularDynamics::set
void set(const MolecularDynamics &rhs)
BALL::MolecularDynamics::setSnapShotFrequency
void setSnapShotFrequency(Size number)
BALL::MolecularDynamics::abort_by_energy_enabled_
bool abort_by_energy_enabled_
Definition molecularDynamics.h:422
BALL::MolecularDynamics::setNumberOfIteration
void setNumberOfIteration(Size number)
BALL::MolecularDynamics::getTotalEnergy
double getTotalEnergy() const
BALL::MolecularDynamics::snapshot_manager_ptr_
SnapShotManager * snapshot_manager_ptr_
Definition molecularDynamics.h:419
BALL::MolecularDynamics::getTimeStep
double getTimeStep() const
BALL::MolecularDynamics::abort_energy_
float abort_energy_
Definition molecularDynamics.h:425
BALL::MolecularDynamics::getEnergyToAbort
float getEnergyToAbort() const
BALL::MolecularDynamics::simulateTime
bool simulateTime(double simulation_time, bool restart=false)
BALL::MolecularDynamics::getKineticEnergy
double getKineticEnergy() const
BALL::MolecularDynamics::setMaximalNumberOfIterations
void setMaximalNumberOfIterations(Size number)
BALL::MolecularDynamics::force_field_ptr_
ForceField * force_field_ptr_
Definition molecularDynamics.h:366
BALL::MolecularDynamics::setReferenceTemperature
void setReferenceTemperature(double temperature)
BALL::MolecularDynamics::system_ptr_
System * system_ptr_
Definition molecularDynamics.h:370
BALL::MolecularDynamics::options
Options options
Definition molecularDynamics.h:340
BALL::MolecularDynamics::number_of_iteration_
Size number_of_iteration_
Definition molecularDynamics.h:378
BALL::MolecularDynamics::total_energy_
double total_energy_
Definition molecularDynamics.h:403
BALL::MolecularDynamics::MolecularDynamics
MolecularDynamics()
BALL::MolecularDynamics::atom_vector_
AtomVector atom_vector_
Definition molecularDynamics.h:374
BALL::MolecularDynamics::energyAbortConditionEnabled
bool energyAbortConditionEnabled() const
Query if the MDSimulation aborts if the Energy is greater than abort_energy_.
BALL::MolecularDynamics::reference_temperature_
double reference_temperature_
Definition molecularDynamics.h:391
BALL::MolecularDynamics::valid_
bool valid_
Definition molecularDynamics.h:362
BALL::MolecularDynamics::getSnapShotFrequency
Size getSnapShotFrequency() const
BALL::MolecularDynamics::energy_output_frequency_
Size energy_output_frequency_
Definition molecularDynamics.h:411
BALL::MolecularDynamics::getNumberOfIterations
Size getNumberOfIterations() const
BALL::MolecularDynamics::time_step_
double time_step_
Definition molecularDynamics.h:387
BALL::MolecularDynamics::snapshot_frequency_
Size snapshot_frequency_
Definition molecularDynamics.h:415
BALL::MolecularDynamics::specificSetup
virtual bool specificSetup()
BALL::MolecularDynamics::getTime
double getTime() const
BALL::MolecularDynamics::kinetic_energy_
double kinetic_energy_
Definition molecularDynamics.h:399
BALL::MolecularDynamics::updateInstantaneousTemperature
void updateInstantaneousTemperature()
BALL::MolecularDynamics::setup
virtual bool setup(ForceField &force_field, SnapShotManager *snapshot_man)
BALL::MolecularDynamics::setCurrentTime
void setCurrentTime(double time)
BALL::MolecularDynamics::simulateIterations
virtual bool simulateIterations(Size number, bool restart=false)
BALL::MolecularDynamics::getMaximalSimulationTime
double getMaximalSimulationTime() const
BALL::MolecularDynamics::current_time_
double current_time_
Definition molecularDynamics.h:407
BALL::MolecularDynamics::getEnergyOutputFrequency
Size getEnergyOutputFrequency() const
BALL::MolecularDynamics::setEnergyOutputFrequency
void setEnergyOutputFrequency(Size number)
BALL::MolecularDynamics::enableEnergyAbortCondition
void enableEnergyAbortCondition(bool state)
BALL::MolecularDynamics::maximal_number_of_iterations_
Size maximal_number_of_iterations_
Definition molecularDynamics.h:383
BALL::MolecularDynamics::getPotentialEnergy
double getPotentialEnergy() const
BALL::MolecularDynamics::setTimeStep
virtual void setTimeStep(double step)
BALL::MolecularDynamics::setMaximalSimulationTime
void setMaximalSimulationTime(double time)
BALL::MolecularDynamics::getForceField
ForceField * getForceField() const
BALL::MolecularDynamics::getMaximalNumberOfIterations
Size getMaximalNumberOfIterations() const
BALL::MolecularDynamics::setEnergyToAbort
void setEnergyToAbort(float value)
BALL::MolecularDynamics::current_temperature_
double current_temperature_
Definition molecularDynamics.h:395
BALL::MolecularDynamics::simulate
bool simulate(bool restart=false)
BALL::MolecularDynamics::getTemperature
double getTemperature() const
BALL::Options
Definition options.h:48
BALL::SnapShotManager
Definition snapShotManager.h:34
BALL::System
Definition KERNEL/system.h:40
common.h
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
options.h
BALL::MolecularDynamics::Default
Definition molecularDynamics.h:92
BALL::MolecularDynamics::Default::NUMBER_OF_ITERATION
static const Size NUMBER_OF_ITERATION
Definition molecularDynamics.h:105
BALL::MolecularDynamics::Default::MAXIMAL_NUMBER_OF_ITERATIONS
static const Size MAXIMAL_NUMBER_OF_ITERATIONS
Definition molecularDynamics.h:96
BALL::MolecularDynamics::Default::REFERENCE_TEMPERATURE
static const double REFERENCE_TEMPERATURE
Definition molecularDynamics.h:122
BALL::MolecularDynamics::Default::CURRENT_TIME
static const double CURRENT_TIME
Definition molecularDynamics.h:131
BALL::MolecularDynamics::Default::TIME_STEP
static const double TIME_STEP
Definition molecularDynamics.h:118
BALL::MolecularDynamics::Default::ENERGY_OUTPUT_FREQUENCY
static const Size ENERGY_OUTPUT_FREQUENCY
Definition molecularDynamics.h:110
BALL::MolecularDynamics::Default::SNAPSHOT_FREQUENCY
static const Size SNAPSHOT_FREQUENCY
Definition molecularDynamics.h:114
BALL::MolecularDynamics::Default::BATH_RELAXATION_TIME
static const double BATH_RELAXATION_TIME
Definition molecularDynamics.h:126
BALL::MolecularDynamics::Default::MAXIMAL_SIMULATION_TIME
static const double MAXIMAL_SIMULATION_TIME
Definition molecularDynamics.h:101
BALL::MolecularDynamics::Option
Definition molecularDynamics.h:50
BALL::MolecularDynamics::Option::REFERENCE_TEMPERATURE
static const char * REFERENCE_TEMPERATURE
Definition molecularDynamics.h:79
BALL::MolecularDynamics::Option::MAXIMAL_NUMBER_OF_ITERATIONS
static const char * MAXIMAL_NUMBER_OF_ITERATIONS
Definition molecularDynamics.h:54
BALL::MolecularDynamics::Option::BATH_RELAXATION_TIME
static const char * BATH_RELAXATION_TIME
Definition molecularDynamics.h:84
BALL::MolecularDynamics::Option::TIME_STEP
static const char * TIME_STEP
Definition molecularDynamics.h:75
BALL::MolecularDynamics::Option::MAXIMAL_SIMULATION_TIME
static const char * MAXIMAL_SIMULATION_TIME
Definition molecularDynamics.h:59
BALL::MolecularDynamics::Option::NUMBER_OF_ITERATION
static const char * NUMBER_OF_ITERATION
Definition molecularDynamics.h:63
BALL::MolecularDynamics::Option::ENERGY_OUTPUT_FREQUENCY
static const char * ENERGY_OUTPUT_FREQUENCY
Definition molecularDynamics.h:67
BALL::MolecularDynamics::Option::SNAPSHOT_FREQUENCY
static const char * SNAPSHOT_FREQUENCY
Definition molecularDynamics.h:71
BALL::MolecularDynamics::Option::CURRENT_TIME
static const char * CURRENT_TIME
Definition molecularDynamics.h:88