Loading...
Searching...
No Matches
snapShot.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// This file contains the definitions of the classes
// SnapshotManager and Snapshot.
// They can be used to obtain snapshots from an MD simulation or an energy
// minimisation.
// A snapshot contains atom positions, velocities, forces and potential energy.
#ifndef BALL_MOLMEC_COMMON_SNAPSHOT_H
#define BALL_MOLMEC_COMMON_SNAPSHOT_H
#ifndef BALL_MATHS_VECTOR3_H
# include <BALL/MATHS/vector3.h>
#endif
namespace BALL
{
class System;
class BALL_EXPORT SnapShot
{
public:
BALL_CREATE(SnapShot)
SnapShot();
SnapShot(const SnapShot& snapshot);
virtual ~SnapShot();
const SnapShot& operator = (const SnapShot& snapshot);
virtual void clear();
bool operator == (const SnapShot& snapshot) const;
bool isValid() const;
void setIndex(Size index);
Size getIndex() const;
void setNumberOfAtoms(Size number_of_atoms);
Size getNumberOfAtoms() const;
void setPotentialEnergy(DoubleReal potential_energy);
DoubleReal getPotentialEnergy() const;
void setKineticEnergy(DoubleReal kinetic_energy);
DoubleReal getKineticEnergy() const;
void setAtomPositions(const ::std::vector<Vector3>& atom_postions);
const ::std::vector<Vector3>& getAtomPositions() const;
void setAtomVelocities(const ::std::vector<Vector3>& atom_velocities);
const ::std::vector<Vector3>& getAtomVelocities() const;
void setAtomForces(const ::std::vector<Vector3>& atom_forces);
const ::std::vector<Vector3>& getAtomForces() const;
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;
protected:
//_ @name Protected Attributes
//_ The index of the current snapshot object. Valid indices start at 1.
Size index_;
/*_ The number of atoms of the underlying system. The system being
snapshot must always be the same, especially with respect to
the number of atoms.
*/
Size number_of_atoms_;
/*_ The potential energy in the system when the snapshot is taken.
Only contributions from selected atoms are considered.
*/
double potential_energy_;
/*_ The kinetic energy due to electrostatic interactions.
Only contributions from selected atoms are considered.
*/
double kinetic_energy_;
//_ An STL vector with the positions of all atoms
vector<Vector3> atom_positions_;
//_ An STL vector with the velocities of all atoms
vector<Vector3> atom_velocities_;
//_ An STL vector with the forces of all atoms
vector<Vector3> atom_forces_;
}; // Snapshot
::std::ostream& operator << (::std::ostream& os, const SnapShot& ss);
::std::istream& operator >> (::std::istream& is, SnapShot& ss);
} // end of namespace BALL
#endif // BALL_MOLMEC_COMMON_SNAPSHOT_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::SnapShot
Definition snapShot.h:30
BALL::SnapShot::getAtomVelocities
const ::std::vector< Vector3 > & getAtomVelocities() const
Get the vector containing the atom velocitites.
BALL::SnapShot::getKineticEnergy
DoubleReal getKineticEnergy() const
Get the value for the kinetic energy of this snapshot's system.
BALL::SnapShot::setAtomPositions
void setAtomPositions(const ::std::vector< Vector3 > &atom_postions)
Specify all atom positions.
BALL::SnapShot::atom_forces_
vector< Vector3 > atom_forces_
Definition snapShot.h:209
BALL::SnapShot::index_
Size index_
Definition snapShot.h:184
BALL::SnapShot::kinetic_energy_
double kinetic_energy_
Definition snapShot.h:200
BALL::SnapShot::setAtomForces
void setAtomForces(const ::std::vector< Vector3 > &atom_forces)
Specify all atom forces.
BALL::SnapShot::SnapShot
SnapShot()
BALL::SnapShot::clear
virtual void clear()
Clear method.
BALL::SnapShot::getIndex
Size getIndex() const
Get the index of this instance.
BALL::SnapShot::setIndex
void setIndex(Size index)
Set the index attribute.
BALL::SnapShot::applySnapShot
void applySnapShot(System &system) const
BALL::SnapShot::isValid
bool isValid() const
BALL::SnapShot::getAtomForces
const ::std::vector< Vector3 > & getAtomForces() const
Get all atom forces.
BALL::SnapShot::atom_positions_
vector< Vector3 > atom_positions_
Definition snapShot.h:203
BALL::SnapShot::atom_velocities_
vector< Vector3 > atom_velocities_
Definition snapShot.h:206
BALL::SnapShot::getNumberOfAtoms
Size getNumberOfAtoms() const
Get the number of atoms that are covered by this snapshot.
BALL::SnapShot::number_of_atoms_
Size number_of_atoms_
Definition snapShot.h:190
BALL::SnapShot::setPotentialEnergy
void setPotentialEnergy(DoubleReal potential_energy)
Set the value for the potential energy of this snapshot's system.
BALL::SnapShot::setAtomVelocitites
void setAtomVelocitites(System &system) const
BALL::SnapShot::setKineticEnergy
void setKineticEnergy(DoubleReal kinetic_energy)
Set the value for the kinetic energy of this snapshot's system.
BALL::SnapShot::setNumberOfAtoms
void setNumberOfAtoms(Size number_of_atoms)
Set the number of atoms that are covered by this snapshot.
BALL::SnapShot::takeSnapShot
void takeSnapShot(const System &system)
BALL::SnapShot::getPotentialEnergy
DoubleReal getPotentialEnergy() const
Get the value for the potential energy of this snapshot's system.
BALL::SnapShot::getAtomPositions
const ::std::vector< Vector3 > & getAtomPositions() const
Get the vector containing the atom postions.
BALL::SnapShot::potential_energy_
double potential_energy_
Definition snapShot.h:195
BALL::SnapShot::setAtomVelocities
void setAtomVelocities(const ::std::vector< Vector3 > &atom_velocities)
Specify all atom velocities.
BALL::System
Definition KERNEL/system.h:40
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
BALL::DoubleReal
double DoubleReal
Definition COMMON/global.h:156
BALL::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
std
STL namespace.
vector3.h