Loading...
Searching...
No Matches
BALL::SnapShot Class Reference
Molecular Modeling » Molecular Mechanics » General Force Field Classes.

`#include <BALL/MOLMEC/COMMON/snapShot.h>`

## Public Member Functions

Constructors and Destructors
| SnapShot ()
| SnapShot (const SnapShot &snapshot)
| Copy constructor.
virtual | ~SnapShot ()
| The destructor.
Assignment
const SnapShot & | operator= (const SnapShot &snapshot)
| Assignment operator.
virtual void | clear ()
| Clear method.
Predicates
bool | operator== (const SnapShot &snapshot) const
| Equality operator.
bool | isValid () const
Accessors
void | setIndex (Size index)
| Set the index attribute.
Size | getIndex () const
| Get the index of this instance.
void | setNumberOfAtoms (Size number_of_atoms)
| Set the number of atoms that are covered by this snapshot.
Size | getNumberOfAtoms () const
| Get the number of atoms that are covered by this snapshot.
void | setPotentialEnergy (DoubleReal potential_energy)
| Set the value for the potential energy of this snapshot's system.
DoubleReal | getPotentialEnergy () const
| Get the value for the potential energy of this snapshot's system.
void | setKineticEnergy (DoubleReal kinetic_energy)
| Set the value for the kinetic energy of this snapshot's system.
DoubleReal | getKineticEnergy () const
| Get the value for the kinetic energy of this snapshot's system.
void | setAtomPositions (const ::std::vector< Vector3 > &atom_postions)
| Specify all atom positions.
const ::std::vector< Vector3 > & | getAtomPositions () const
| Get the vector containing the atom postions.
void | setAtomVelocities (const ::std::vector< Vector3 > &atom_velocities)
| Specify all atom velocities.
const ::std::vector< Vector3 > & | getAtomVelocities () const
| Get the vector containing the atom velocitites.
void | setAtomForces (const ::std::vector< Vector3 > &atom_forces)
| Specify all atom forces.
const ::std::vector< Vector3 > & | getAtomForces () const
| Get all atom forces.

## System interaction

Size | index_
Size | number_of_atoms_
double | potential_energy_
double | kinetic_energy_
vector< Vector3 > | atom_positions_
vector< Vector3 > | atom_velocities_
vector< Vector3 > | atom_forces_
void | takeSnapShot (const System &system)
void | applySnapShot (System &system) const
void | getAtomPositions (const System &system)
void | setAtomPositions (System &system) const
void | getAtomVelocities (const System &system)
void | setAtomVelocitites (System &system) const
void | getAtomForces (const System &system)
void | setAtomForces (System &system) const

## Detailed Description

SnapShot class, containing the actual data of one single snapshot. It consists of the posistions, velocities and forces for each atom along with kinetic and potential energy of selected atoms. It is used by the SnapShotManager .

Definition at line 29 of file snapShot.h.

## Constructor & Destructor Documentation

## SnapShot() [1/2]

BALL::SnapShot::SnapShot | ( |  | ) |

The default constructor. It creates an empty SnapShot object.

## SnapShot() [2/2]

BALL::SnapShot::SnapShot | ( | const SnapShot & | snapshot | ) |

Copy constructor.

## ~SnapShot()

virtual BALL::SnapShot::~SnapShot | ( |  | ) |

virtual

The destructor.

## Member Function Documentation

## applySnapShot()

void BALL::SnapShot::applySnapShot | ( | System & | system | ) | const

Apply the data contained in a SnapShot to a System. Copy all available data to the system. Note that some trajectory file formats do not contain all this information and vectors might be zero or even worse undefined when read SnapShots are read from such a file.

Parameters

  system | the System which will be manipulated

## clear()

virtual void BALL::SnapShot::clear | ( |  | ) |

virtual

Clear method.

## getAtomForces() [1/2]

const ::std::vector< Vector3 > & BALL::SnapShot::getAtomForces | ( |  | ) | const

Get all atom forces.

## getAtomForces() [2/2]

void BALL::SnapShot::getAtomForces | ( | const System & | system | ) |

Read all atom forces from a System and store them in this instance of SnapShot.

Parameters

  system | the System from which data will be read

Exceptions

  BALL::Exception::OutOfMemory |

## getAtomPositions() [1/2]

const ::std::vector< Vector3 > & BALL::SnapShot::getAtomPositions | ( |  | ) | const

Get the vector containing the atom postions.

## getAtomPositions() [2/2]

void BALL::SnapShot::getAtomPositions | ( | const System & | system | ) |

Read all atom positions from a System and store them in this instance of SnapShot.

Parameters

  system | the System from which data will be read

Exceptions

  BALL::Exception::OutOfMemory |

## getAtomVelocities() [1/2]

const ::std::vector< Vector3 > & BALL::SnapShot::getAtomVelocities | ( |  | ) | const

Get the vector containing the atom velocitites.

## getAtomVelocities() [2/2]

void BALL::SnapShot::getAtomVelocities | ( | const System & | system | ) |

Read all atom velocities from a System and store them in this instance of SnapShot.

Parameters

  system | the System from which data will be read

Exceptions

  BALL::Exception::OutOfMemory |

## getIndex()

Size BALL::SnapShot::getIndex | ( |  | ) | const

Get the index of this instance.

## getKineticEnergy()

DoubleReal BALL::SnapShot::getKineticEnergy | ( |  | ) | const

Get the value for the kinetic energy of this snapshot's system.

## getNumberOfAtoms()

Size BALL::SnapShot::getNumberOfAtoms | ( |  | ) | const

Get the number of atoms that are covered by this snapshot.

## getPotentialEnergy()

DoubleReal BALL::SnapShot::getPotentialEnergy | ( |  | ) | const

Get the value for the potential energy of this snapshot's system.

## isValid()

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

Indicates validity of the SnapShot

Returns
  true if this instance is valid

## operator=()

const SnapShot & BALL::SnapShot::operator= | ( | const SnapShot & | snapshot | ) |

Assignment operator.

## operator==()

bool BALL::SnapShot::operator== | ( | const SnapShot & | snapshot | ) | const

Equality operator.

## setAtomForces() [1/2]

void BALL::SnapShot::setAtomForces | ( | const ::std::vector< Vector3 > & | atom_forces | ) |

Specify all atom forces.

## setAtomForces() [2/2]

void BALL::SnapShot::setAtomForces | ( | System & | system | ) | const

Set all Atom forces of a System to the values stored in this instance of SnapShot.

Parameters

  system | the system which will be manipulated

## setAtomPositions() [1/2]

void BALL::SnapShot::setAtomPositions | ( | const ::std::vector< Vector3 > & | atom_postions | ) |

Specify all atom positions.

## setAtomPositions() [2/2]

void BALL::SnapShot::setAtomPositions | ( | System & | system | ) | const

Set all Atom positions of a System to the values stored in this instance of SnapShot.

Parameters

  system | the system which will be manipulated

## setAtomVelocities()

void BALL::SnapShot::setAtomVelocities | ( | const ::std::vector< Vector3 > & | atom_velocities | ) |

Specify all atom velocities.

## setAtomVelocitites()

void BALL::SnapShot::setAtomVelocitites | ( | System & | system | ) | const

Set all Atom velocities of a System to the values stored in this instance of SnapShot.

Parameters

  system | the system which will be manipulated

## setIndex()

void BALL::SnapShot::setIndex | ( | Size | index | ) |

Set the index attribute.

## setKineticEnergy()

void BALL::SnapShot::setKineticEnergy | ( | DoubleReal | kinetic_energy | ) |

Set the value for the kinetic energy of this snapshot's system.

## setNumberOfAtoms()

void BALL::SnapShot::setNumberOfAtoms | ( | Size | number_of_atoms | ) |

Set the number of atoms that are covered by this snapshot.

## setPotentialEnergy()

void BALL::SnapShot::setPotentialEnergy | ( | DoubleReal | potential_energy | ) |

Set the value for the potential energy of this snapshot's system.

## takeSnapShot()

void BALL::SnapShot::takeSnapShot | ( | const System & | system | ) |

Take a SnapShot from a system. Copy all positions, velocities and forces from the System system to this instance of SnapShot.

Parameters

  system | the System from which to take the data

Exceptions

  BALL::Exception::OutOfMemory |

## Member Data Documentation

## atom_forces_

vector<Vector3> BALL::SnapShot::atom_forces_

protected

Definition at line 209 of file snapShot.h.

## atom_positions_

vector<Vector3> BALL::SnapShot::atom_positions_

protected

Definition at line 203 of file snapShot.h.

## atom_velocities_

vector<Vector3> BALL::SnapShot::atom_velocities_

protected

Definition at line 206 of file snapShot.h.

## index_

Size BALL::SnapShot::index_

protected

Definition at line 184 of file snapShot.h.

## kinetic_energy_

double BALL::SnapShot::kinetic_energy_

protected

Definition at line 200 of file snapShot.h.

## number_of_atoms_

Size BALL::SnapShot::number_of_atoms_

protected

Definition at line 190 of file snapShot.h.

## potential_energy_

double BALL::SnapShot::potential_energy_

protected

Definition at line 195 of file snapShot.h.