BALL 1.5.0
Loading...
Searching...
No Matches
snapShot.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4
5// This file contains the definitions of the classes
6// SnapshotManager and Snapshot.
7// They can be used to obtain snapshots from an MD simulation or an energy
8// minimisation.
9// A snapshot contains atom positions, velocities, forces and potential energy.
10
11
12#ifndef BALL_MOLMEC_COMMON_SNAPSHOT_H
13#define BALL_MOLMEC_COMMON_SNAPSHOT_H
14
15#ifndef BALL_MATHS_VECTOR3_H
16# include <BALL/MATHS/vector3.h>
17#endif
18
19namespace BALL
20{
21 class System;
22
30 {
31
32 public:
33
35
36
38
42
44 SnapShot(const SnapShot& snapshot);
45
47 virtual ~SnapShot();
48
50
52
54 const SnapShot& operator = (const SnapShot& snapshot);
55
57 virtual void clear();
58
60
62
64 bool operator == (const SnapShot& snapshot) const;
65
69 bool isValid() const;
70
72
74
76 void setIndex(Size index);
77
79 Size getIndex() const;
80
82 void setNumberOfAtoms(Size number_of_atoms);
83
86
88 void setPotentialEnergy(DoubleReal potential_energy);
89
92
94 void setKineticEnergy(DoubleReal kinetic_energy);
95
98
100 void setAtomPositions(const ::std::vector<Vector3>& atom_postions);
101
103 const ::std::vector<Vector3>& getAtomPositions() const;
104
106 void setAtomVelocities(const ::std::vector<Vector3>& atom_velocities);
107
109 const ::std::vector<Vector3>& getAtomVelocities() const;
110
112 void setAtomForces(const ::std::vector<Vector3>& atom_forces);
113
115 const ::std::vector<Vector3>& getAtomForces() const;
116
118
120
126 void takeSnapShot(const System& system);
127
135 void applySnapShot(System& system) const;
136
142 void getAtomPositions(const System& system);
143
148 void setAtomPositions(System& system) const;
149
155 void getAtomVelocities(const System& system);
156
161 void setAtomVelocitites(System& system) const;
162
168 void getAtomForces(const System& system);
169
174 void setAtomForces(System& system) const;
175
177
178 protected:
179
180 //_ @name Protected Attributes
182
183 //_ The index of the current snapshot object. Valid indices start at 1.
185
186 /*_ The number of atoms of the underlying system. The system being
187 snapshot must always be the same, especially with respect to
188 the number of atoms.
189 */
191
192 /*_ The potential energy in the system when the snapshot is taken.
193 Only contributions from selected atoms are considered.
194 */
196
197 /*_ The kinetic energy due to electrostatic interactions.
198 Only contributions from selected atoms are considered.
199 */
201
202 //_ An STL vector with the positions of all atoms
204
205 //_ An STL vector with the velocities of all atoms
207
208 //_ An STL vector with the forces of all atoms
210
212
213 }; // Snapshot
214
216 ::std::ostream& operator << (::std::ostream& os, const SnapShot& ss);
217
219 ::std::istream& operator >> (::std::istream& is, SnapShot& ss);
220
221} // end of namespace BALL
222
223#endif // BALL_MOLMEC_COMMON_SNAPSHOT_H
#define BALL_EXPORT
const ::std::vector< Vector3 > & getAtomVelocities() const
Get the vector containing the atom velocitites.
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.
vector< Vector3 > atom_forces_
Definition snapShot.h:209
double kinetic_energy_
Definition snapShot.h:200
void setAtomForces(const ::std::vector< Vector3 > &atom_forces)
Specify all atom forces.
virtual void clear()
Clear method.
Size getIndex() const
Get the index of this instance.
void setIndex(Size index)
Set the index attribute.
void applySnapShot(System &system) const
bool isValid() const
const ::std::vector< Vector3 > & getAtomForces() const
Get all atom forces.
vector< Vector3 > atom_positions_
Definition snapShot.h:203
vector< Vector3 > atom_velocities_
Definition snapShot.h:206
Size getNumberOfAtoms() const
Get the number of atoms that are covered by this snapshot.
Size number_of_atoms_
Definition snapShot.h:190
void setPotentialEnergy(DoubleReal potential_energy)
Set the value for the potential energy of this snapshot's system.
void setAtomVelocitites(System &system) const
void setKineticEnergy(DoubleReal kinetic_energy)
Set the value for the kinetic energy of this snapshot's system.
void setNumberOfAtoms(Size number_of_atoms)
Set the number of atoms that are covered by this snapshot.
void takeSnapShot(const System &system)
DoubleReal getPotentialEnergy() const
Get the value for the potential energy of this snapshot's system.
const ::std::vector< Vector3 > & getAtomPositions() const
Get the vector containing the atom postions.
double potential_energy_
Definition snapShot.h:195
void setAtomVelocities(const ::std::vector< Vector3 > &atom_velocities)
Specify all atom velocities.
#define BALL_CREATE(name)
Definition create.h:62
BALL_SIZE_TYPE Size
double DoubleReal
TVector3< float > Vector3
Definition vector3.h:1084
STL namespace.