SSAGES
0.1
A MetaDynamics Package
|
Class containing a snapshot of the current simulation in time. More...
#include <Snapshot.h>
Public Member Functions | |
Snapshot (const MPI_Comm &comm, uint wid) | |
Constructor. More... | |
int | GetIteration () const |
Get the current iteration. More... | |
int | GetTargetIterations () const |
Get target iterations. More... | |
double | GetTemperature () const |
Get current temperature. More... | |
double | GetEnergy () const |
Get per-particle energy. More... | |
const Matrix3 & | GetHMatrix () const |
Get system H-matrix. More... | |
const Matrix3 & | GetVirial () const |
Get box virial. More... | |
Matrix3 & | GetVirial () |
Get box virial. More... | |
const Vector3 & | GetOrigin () const |
Get origin of the system. More... | |
const Bool3 & | IsPeriodic () const |
Get periodicity of three dimensions. More... | |
double | GetVolume () const |
Get system volume. More... | |
double | GetKb () const |
Get system Kb. More... | |
double | GetDielectric () const |
Get dielectric constant. More... | |
double | Getqqrd2e () const |
Get qqrd2e value. More... | |
const mxx::comm & | GetCommunicator () const |
Get communicator for walker. More... | |
unsigned | GetWalkerID () const |
Get walker ID. More... | |
unsigned | GetNumAtoms () const |
Get number of atoms in this snapshot. More... | |
void | SetIteration (int iteration) |
Set the iteration. More... | |
void | SetTargetIterations (int target) |
Set target iterations. More... | |
void | SetTemperature (double temperature) |
Change the temperature. More... | |
void | SetEnergy (double energy) |
Change the energy. More... | |
void | SetHMatrix (const Matrix3 &hmat) |
Change the Box H-matrix. More... | |
void | SetVirial (const Matrix3 &virial) |
Change the box virial. More... | |
void | SetOrigin (const Vector3 &origin) |
Change the box origin. More... | |
void | SetPeriodicity (const Bool3 &isperiodic) |
Change the periodicity of the system. More... | |
void | SetKb (double kb) |
Change the kb. More... | |
void | SetDielectric (double dielectric) |
Set the dielectric constant. More... | |
void | Setqqrd2e (double qqrd2e) |
Set the value for qqrd2e. More... | |
void | SetNumAtoms (unsigned int natoms) |
Set number of atoms in this snapshot. More... | |
const std::vector< Vector3 > & | GetPositions () const |
Access the particle positions. More... | |
std::vector< Vector3 > & | GetPositions () |
Access the particle positions. More... | |
const std::vector< Integer3 > & | GetImageFlags () const |
Access the particles image flags. More... | |
std::vector< Integer3 > & | GetImageFlags () |
Access the particles image flags. More... | |
const std::vector< Vector3 > & | GetVelocities () const |
Access the particle velocities. More... | |
std::vector< Vector3 > & | GetVelocities () |
Access the particle velocities. More... | |
const std::vector< Vector3 > & | GetForces () const |
Access the per-particle forces. More... | |
std::vector< Vector3 > & | GetForces () |
Access the per-particle forces. More... | |
const std::vector< double > & | GetMasses () const |
Const access to the particle masses. More... | |
std::vector< double > & | GetMasses () |
Const access to the particle masses. More... | |
Vector3 | ScaleVector (const Vector3 &v) const |
Scale a vector into fractional coordinates. More... | |
Vector3 | UnwrapVector (const Vector3 &v, const Integer3 &image) const |
Unwrap a vector's real coordinates according to its image replica count. More... | |
void | ApplyMinimumImage (Vector3 *v) const |
Apply minimum image to a vector. More... | |
Vector3 | ApplyMinimumImage (const Vector3 &v) const |
Apply minimum image to a vector. More... | |
double | TotalMass (const Label &indices) const |
Compute the total mass of a group of particles based on index. More... | |
Vector3 | CenterOfMass (const Label &indices) const |
Vector3 | CenterOfMass (const Label &indices, double mtot) const |
const Label & | GetAtomIDs () const |
Access the atom IDs. More... | |
Label & | GetAtomIDs () |
Access the atom IDs. More... | |
int | GetLocalIndex (int id) const |
Gets the local atom index corresponding to an atom ID. More... | |
void | GetLocalIndices (const Label &ids, Label *indices) const |
const std::vector< double > & | GetCharges () const |
Access the atom charges. More... | |
std::vector< double > & | GetCharges () |
Access the atom charges. More... | |
const Label & | GetAtomTypes () const |
Access the atom types. More... | |
Label & | GetAtomTypes () |
Access the atom types. More... | |
const std::vector< std::vector < double > > & | GetSigmas () const |
Access the atom sigmas. More... | |
std::vector< std::vector < double > > & | GetSigmas () |
Access the atom sigmas. More... | |
const std::string & | GetSnapshotID () const |
Access the snapshot ID. More... | |
std::string & | GetSnapshotID () |
Access the snapshot ID. More... | |
bool | HasChanged () const |
Query if Snapshot was modified. More... | |
void | Changed (bool state) |
Set the "changed" flag of the Snapshot. More... | |
std::vector< double > | SerializePositions () |
Return the serialized positions across all local cores. | |
std::vector< double > | SerializeVelocities () |
Return the serialized velocities across all local cores. | |
std::vector< int > | SerializeIDs () |
Return the serialized positions across all local cores. | |
~Snapshot () | |
Destructor. | |
Private Attributes | |
mxx::comm | comm_ |
Local snapshot (walker) communicator. | |
uint | wid_ |
Walker ID. | |
uint | nlocal_ |
Number of atoms located on this snapshot. | |
std::string | ID_ |
ID string. | |
Matrix3 | H_ |
Parrinello-Rahman box H-matrix. | |
Matrix3 | Hinv_ |
Parinello-Rahman box inverse. | |
Matrix3 | virial_ |
Vector3 | origin_ |
< Virial tensor. More... | |
Bool3 | isperiodic_ |
Periodicity of box. | |
std::vector< Vector3 > | positions_ |
Positions. | |
std::vector< Integer3 > | images_ |
Unwrapped positions. | |
std::vector< Vector3 > | velocities_ |
Velocities. | |
std::vector< Vector3 > | forces_ |
Forces. | |
std::vector< double > | masses_ |
Masses. | |
std::vector< double > | charges_ |
Charges. | |
Label | atomids_ |
List of Atom IDs. | |
Label | types_ |
List of Atom types. | |
std::vector< std::vector < double > > | sigma_ |
Sigma. | |
int | iteration_ |
Iteration of Simulation. | |
int | targetiter_ |
Iteration target of simulation. | |
double | temperature_ |
Current temperature. | |
double | energy_ |
Average per-particle energy. | |
double | kb_ |
Kb from the MD driver. | |
double | dielectric_ |
Dielectric. | |
double | qqrd2e_ |
qqrd2e | |
bool | changed_ |
TRUE is Simulation state changed | |
Class containing a snapshot of the current simulation in time.
This contains information on the particle positions, velocities, etc... and additional information on the state of the system.
Definition at line 43 of file Snapshot.h.
|
inline |
Constructor.
comm | MPI communicator |
wid | Walker ID |
Initialize a snapshot with MPI communicator and a correpsonding walker ID.
Definition at line 92 of file Snapshot.h.
|
inline |
Apply minimum image to a vector.
v | Vector of interest |
Definition at line 418 of file Snapshot.h.
References H_, Hinv_, isperiodic_, and SSAGES::roundf().
Referenced by CenterOfMass(), SSAGES::AngleCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), and SSAGES::ParticleSeparationCV::Evaluate().
Apply minimum image to a vector.
v | Vector of interest |
Definition at line 433 of file Snapshot.h.
References H_, Hinv_, isperiodic_, and SSAGES::roundf().
Compute center of mass of a group of atoms based on idex with provided Total mass.
indices | IDs of particles of interest. |
Definition at line 466 of file Snapshot.h.
References TotalMass().
Referenced by SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), and SSAGES::ParticleSeparationCV::Evaluate().
Compute center of mass of a group of atoms based on idex with provided Total mass.
indices | IDs of particles of interest. |
mtot | Total mass of particle group. |
Definition at line 483 of file Snapshot.h.
References ApplyMinimumImage(), comm_, masses_, and positions_.
|
inline |
Set the "changed" flag of the Snapshot.
state | State to which the "changed" flag is set |
Definition at line 645 of file Snapshot.h.
References changed_.
Referenced by SSAGES::Hook::PostIntegrationHook(), SSAGES::Hook::PostSimulationHook(), and SSAGES::Hook::PreSimulationHook().
|
inline |
Access the atom IDs.
Definition at line 541 of file Snapshot.h.
References atomids_.
Referenced by SSAGES::ForwardFlux::AppendTrajectoryFile(), SSAGES::PairwiseCV::Evaluate(), SSAGES::FiniteTempString::PostIntegration(), SSAGES::Swarm::PostIntegration(), SSAGES::ForwardFlux::ReadFFSConfiguration(), and SSAGES::ForwardFlux::WriteFFSConfiguration().
|
inline |
Access the atom IDs.
Definition at line 544 of file Snapshot.h.
References atomids_, and changed_.
|
inline |
Access the atom types.
Definition at line 600 of file Snapshot.h.
References types_.
Referenced by SSAGES::COPSSImage::force_pol(), and SSAGES::COPSSImage::PostIntegration().
|
inline |
Access the atom types.
Definition at line 603 of file Snapshot.h.
References changed_, and types_.
|
inline |
Access the atom charges.
Definition at line 587 of file Snapshot.h.
References charges_.
Referenced by SSAGES::COPSSImage::force_pol(), and SSAGES::COPSSImage::PostIntegration().
|
inline |
Access the atom charges.
Definition at line 590 of file Snapshot.h.
References changed_, and charges_.
|
inline |
Get communicator for walker.
Access the communicator containing the set of processors that belong to a single simulation box.
Definition at line 184 of file Snapshot.h.
References comm_.
Referenced by SSAGES::BoxVolumeCV::Evaluate(), SSAGES::AngleCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::AngleCV::Initialize(), SSAGES::PairwiseCV::Initialize(), SSAGES::ParticleCoordinateCV::Initialize(), SSAGES::TorsionalCV::Initialize(), SSAGES::GyrationTensorCV::Initialize(), SSAGES::ParticlePositionCV::Initialize(), SSAGES::RouseModeCV::Initialize(), SSAGES::ParticleSeparationCV::Initialize(), and SSAGES::COPSS::PostIntegration().
|
inline |
Get dielectric constant.
Definition at line 169 of file Snapshot.h.
References dielectric_.
Referenced by SSAGES::COPSSImage::force_pol().
|
inline |
Get per-particle energy.
Definition at line 121 of file Snapshot.h.
References energy_.
|
inline |
Access the per-particle forces.
Definition at line 362 of file Snapshot.h.
References forces_.
Referenced by SSAGES::COPSSImage::force_pol(), SSAGES::COPSS::PostIntegration(), SSAGES::ElasticBand::PostIntegration(), SSAGES::FiniteTempString::PostIntegration(), SSAGES::Swarm::PostIntegration(), SSAGES::Umbrella::PostIntegration(), SSAGES::Meta::PostIntegration(), SSAGES::COPSSImage::PostIntegration(), SSAGES::ABF::PostIntegration(), SSAGES::Basis::PostIntegration(), and SSAGES::ForwardFlux::ReadFFSConfiguration().
|
inline |
Access the per-particle forces.
Definition at line 365 of file Snapshot.h.
References changed_, and forces_.
|
inline |
Get system H-matrix.
Definition at line 127 of file Snapshot.h.
References H_.
Referenced by SSAGES::Umbrella::PostIntegration().
|
inline |
Access the particles image flags.
Definition at line 336 of file Snapshot.h.
References images_.
|
inline |
Access the particles image flags.
Definition at line 339 of file Snapshot.h.
References changed_, and images_.
|
inline |
Get the current iteration.
Definition at line 103 of file Snapshot.h.
References iteration_.
Referenced by SSAGES::Logger::PostIntegration(), SSAGES::Umbrella::PostIntegration(), SSAGES::Meta::PostIntegration(), SSAGES::Basis::PostIntegration(), and SSAGES::Hook::PostIntegrationHook().
|
inline |
Get system Kb.
Definition at line 163 of file Snapshot.h.
References kb_.
Referenced by SSAGES::Basis::PostIntegration().
|
inline |
Gets the local atom index corresponding to an atom ID.
id | Atom ID. |
Definition at line 555 of file Snapshot.h.
References atomids_.
Referenced by SSAGES::AngleCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), GetLocalIndices(), SSAGES::PairwiseCV::Initialize(), SSAGES::ParticleCoordinateCV::Initialize(), SSAGES::GyrationTensorCV::Initialize(), SSAGES::ParticlePositionCV::Initialize(), SSAGES::RouseModeCV::Initialize(), SSAGES::ParticleSeparationCV::Initialize(), SSAGES::FiniteTempString::PostIntegration(), and SSAGES::Swarm::PostIntegration().
Gets the local atom indices corresponding to atom IDs in the vector.
ids | Vector of atom ID's. |
indices | Pointer to container for local atom indices. |
Definition at line 573 of file Snapshot.h.
References GetLocalIndex().
Referenced by SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), SSAGES::AlphaRMSDCV::Evaluate(), SSAGES::AntiBetaRMSDCV::Evaluate(), SSAGES::ParallelBetaRMSDCV::Evaluate(), SSAGES::AngleCV::Initialize(), SSAGES::TorsionalCV::Initialize(), and SSAGES::RouseModeCV::setMasses().
|
inline |
Const access to the particle masses.
Note that the Masses can be either stored as per-atom or per-type depending on the Lammps Atom type used.
Definition at line 378 of file Snapshot.h.
References masses_.
Referenced by SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), and SSAGES::ABF::PostIntegration().
|
inline |
Const access to the particle masses.
Note that the Masses can be either stored as per-atom or per-type depending on the Lammps Atom type used.
Definition at line 381 of file Snapshot.h.
References changed_, and masses_.
|
inline |
Get number of atoms in this snapshot.
Definition at line 200 of file Snapshot.h.
References nlocal_.
Referenced by SSAGES::ABF::CalcBiasForce(), SSAGES::BoxVolumeCV::Evaluate(), SSAGES::AngleCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), SSAGES::AlphaRMSDCV::Evaluate(), SSAGES::AntiBetaRMSDCV::Evaluate(), SSAGES::ParallelBetaRMSDCV::Evaluate(), SSAGES::COPSSImage::PostIntegration(), and SSAGES::ABF::PostIntegration().
|
inline |
Get origin of the system.
Definition at line 145 of file Snapshot.h.
References origin_.
|
inline |
Access the particle positions.
Definition at line 323 of file Snapshot.h.
References positions_.
Referenced by SSAGES::ForwardFlux::AppendTrajectoryFile(), SSAGES::AngleCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::AlphaRMSDCV::Evaluate(), SSAGES::AntiBetaRMSDCV::Evaluate(), SSAGES::ParallelBetaRMSDCV::Evaluate(), SSAGES::COPSSImage::force_pol(), SSAGES::MockCV::Initialize(), SSAGES::FiniteTempString::PostIntegration(), SSAGES::Swarm::PostIntegration(), SSAGES::COPSSImage::PostIntegration(), SSAGES::ABF::PreSimulation(), SSAGES::ForwardFlux::ReadFFSConfiguration(), and SSAGES::ForwardFlux::WriteFFSConfiguration().
|
inline |
Access the particle positions.
Definition at line 326 of file Snapshot.h.
References changed_, and positions_.
|
inline |
Get qqrd2e value.
Definition at line 175 of file Snapshot.h.
References qqrd2e_.
Referenced by SSAGES::COPSSImage::force_pol().
|
inline |
Access the atom sigmas.
Definition at line 613 of file Snapshot.h.
References sigma_.
|
inline |
Access the atom sigmas.
Definition at line 616 of file Snapshot.h.
References changed_, and sigma_.
|
inline |
Access the snapshot ID.
Definition at line 626 of file Snapshot.h.
References ID_.
|
inline |
|
inline |
Get target iterations.
Definition at line 109 of file Snapshot.h.
References targetiter_.
Referenced by SSAGES::Meta::PreSimulation().
|
inline |
Get current temperature.
Definition at line 115 of file Snapshot.h.
References temperature_.
Referenced by SSAGES::Basis::PostIntegration().
|
inline |
Access the particle velocities.
Definition at line 349 of file Snapshot.h.
References velocities_.
Referenced by SSAGES::ForwardFlux::AppendTrajectoryFile(), SSAGES::Swarm::PostIntegration(), SSAGES::ABF::PostIntegration(), SSAGES::ForwardFlux::ReadFFSConfiguration(), and SSAGES::ForwardFlux::WriteFFSConfiguration().
|
inline |
Access the particle velocities.
Definition at line 352 of file Snapshot.h.
References changed_, and velocities_.
|
inline |
Get box virial.
Virial tensor of the simulation box.
Definition at line 133 of file Snapshot.h.
Referenced by SSAGES::Umbrella::PostIntegration(), SSAGES::Meta::PostIntegration(), and SSAGES::Basis::PostIntegration().
|
inline |
|
inline |
Get system volume.
Definition at line 157 of file Snapshot.h.
References H_.
Referenced by SSAGES::BoxVolumeCV::Evaluate().
|
inline |
Get walker ID.
Definition at line 193 of file Snapshot.h.
References wid_.
Referenced by SSAGES::COPSS::PostIntegration(), SSAGES::StringMethod::PreSimulation(), and SSAGES::Basis::PreSimulation().
|
inline |
Query if Snapshot was modified.
True
if Snapshot was modified, else return False
Definition at line 639 of file Snapshot.h.
References changed_.
Referenced by SSAGES::Hook::PostIntegrationHook(), SSAGES::Hook::PostSimulationHook(), and SSAGES::Hook::PreSimulationHook().
|
inline |
Get periodicity of three dimensions.
Definition at line 151 of file Snapshot.h.
References isperiodic_.
Scale a vector into fractional coordinates.
v | Vector of interest |
Definition at line 392 of file Snapshot.h.
References Hinv_, and origin_.
|
inline |
Set the dielectric constant.
dielectric | Value for the dielectric constant. |
Definition at line 297 of file Snapshot.h.
References changed_, and dielectric_.
|
inline |
Change the energy.
energy | New value for the energy |
Definition at line 236 of file Snapshot.h.
References changed_, and energy_.
|
inline |
Change the Box H-matrix.
hmat | New H-matrix for the system |
Definition at line 246 of file Snapshot.h.
References changed_, H_, and Hinv_.
|
inline |
Set the iteration.
iteration | New value for the iteration |
Definition at line 206 of file Snapshot.h.
References changed_, and iteration_.
|
inline |
|
inline |
Set number of atoms in this snapshot.
natoms | Number of atoms in this snapshot |
Definition at line 317 of file Snapshot.h.
References nlocal_.
|
inline |
Change the box origin.
origin | New origin for the system |
Definition at line 267 of file Snapshot.h.
References changed_, and origin_.
|
inline |
Change the periodicity of the system.
isperiodic | Periodicity of three dimensions |
Definition at line 277 of file Snapshot.h.
References changed_, and isperiodic_.
|
inline |
Set the value for qqrd2e.
qqrd2e | Value for qqrd2e. |
Definition at line 307 of file Snapshot.h.
References changed_, and qqrd2e_.
|
inline |
Set target iterations.
target | New value for target iterations |
Definition at line 216 of file Snapshot.h.
References changed_, and targetiter_.
|
inline |
Change the temperature.
temperature | New value for the temperature |
Definition at line 226 of file Snapshot.h.
References changed_, and temperature_.
|
inline |
Change the box virial.
virial | New virial tensor for the system. |
Definition at line 257 of file Snapshot.h.
References changed_.
|
inline |
Compute the total mass of a group of particles based on index.
indices | IDs of particles of interest. |
Definition at line 451 of file Snapshot.h.
References comm_, and masses_.
Referenced by CenterOfMass(), SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), and SSAGES::RouseModeCV::setMasses().
Unwrap a vector's real coordinates according to its image replica count.
v | Vector of interest |
image | Integer vector representing mirror images in the three dimensions. |
Definition at line 409 of file Snapshot.h.
References H_.
|
private |
< Virial tensor.
Box origin.
Definition at line 59 of file Snapshot.h.
Referenced by GetOrigin(), ScaleVector(), and SetOrigin().