SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Class containing a snapshot of the current simulation in time. More...
#include <Snapshot.h>
Public Member Functions | |
Snapshot (const MPI_Comm &comm, unsigned int wid) | |
Constructor. More... | |
size_t | GetIteration () const |
Get the current iteration. More... | |
size_t | 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 (size_t 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< 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... | |
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, bool mass_weight=true) const |
Compute center of mass of a group of atoms based on index. More... | |
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::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. More... | |
std::vector< double > | SerializeVelocities () |
Return the serialized velocities across all local cores. More... | |
std::vector< int > | SerializeIDs () |
Return the serialized IDs across all local cores. More... | |
~Snapshot () | |
Destructor. | |
Private Attributes | |
mxx::comm | comm_ |
Local snapshot (walker) communicator. | |
unsigned int | wid_ |
Walker ID. | |
unsigned int | 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_ |
Virial tensor. | |
Vector3 | origin_ |
Box origin. | |
Bool3 | isperiodic_ |
Periodicity of box. | |
std::vector< Vector3 > | positions_ |
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. | |
size_t | iteration_ |
Iteration of Simulation. | |
size_t | 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 47 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 94 of file Snapshot.h.
Apply minimum image to a vector.
v | Vector of interest |
Definition at line 405 of file Snapshot.h.
References H_, Hinv_, isperiodic_, and SSAGES::roundf().
|
inline |
Apply minimum image to a vector.
v | Vector of interest |
Definition at line 390 of file Snapshot.h.
References H_, Hinv_, isperiodic_, and SSAGES::roundf().
Referenced by CenterOfMass(), SSAGES::AngleCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), SSAGES::RMSDCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), and SSAGES::TorsionalCV::Evaluate().
|
inline |
Compute center of mass of a group of atoms based on index.
indices | IDs of particles of interest. |
mass_weight | Mass-weighting for COM calculation. |
Definition at line 442 of file Snapshot.h.
References ApplyMinimumImage(), comm_, masses_, positions_, and TotalMass().
Referenced by SSAGES::ANNCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), SSAGES::RMSDCV::Evaluate(), and SSAGES::RouseModeCV::Evaluate().
|
inline |
Set the "changed" flag of the Snapshot.
state | State to which the "changed" flag is set |
Definition at line 596 of file Snapshot.h.
References changed_.
Referenced by SSAGES::Hook::PostIntegrationHook(), SSAGES::Hook::PostSimulationHook(), and SSAGES::Hook::PreSimulationHook().
|
inline |
|
inline |
Access the atom IDs.
Definition at line 505 of file Snapshot.h.
References atomids_.
Referenced by SSAGES::ForwardFlux::AppendTrajectoryFile(), SSAGES::PairwiseCV::Evaluate(), SSAGES::ForwardFlux::ReadFFSConfiguration(), and SSAGES::ForwardFlux::WriteFFSConfiguration().
|
inline |
|
inline |
Access the atom types.
Definition at line 564 of file Snapshot.h.
References types_.
|
inline |
|
inline |
Access the atom charges.
Definition at line 551 of file Snapshot.h.
References charges_.
|
inline |
Get communicator for walker.
Access the communicator containing the set of processors that belong to a single simulation box.
Definition at line 186 of file Snapshot.h.
References comm_.
Referenced by SSAGES::AlphaRMSDCV::Evaluate(), SSAGES::AngleCV::Evaluate(), SSAGES::ANNCV::Evaluate(), SSAGES::AntiBetaRMSDCV::Evaluate(), SSAGES::BoxVolumeCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::ParallelBetaRMSDCV::Evaluate(), SSAGES::RMSDCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), SSAGES::AlphaRMSDCV::Initialize(), SSAGES::AngleCV::Initialize(), SSAGES::ANNCV::Initialize(), SSAGES::AntiBetaRMSDCV::Initialize(), SSAGES::GyrationTensorCV::Initialize(), SSAGES::PairwiseCV::Initialize(), SSAGES::ParallelBetaRMSDCV::Initialize(), SSAGES::ParticleCoordinateCV::Initialize(), SSAGES::ParticlePositionCV::Initialize(), SSAGES::ParticleSeparationCV::Initialize(), SSAGES::RMSDCV::Initialize(), SSAGES::RouseModeCV::Initialize(), and SSAGES::TorsionalCV::Initialize().
|
inline |
Get dielectric constant.
Definition at line 171 of file Snapshot.h.
References dielectric_.
|
inline |
Get per-particle energy.
Definition at line 123 of file Snapshot.h.
References energy_.
|
inline |
|
inline |
Access the per-particle forces.
Definition at line 351 of file Snapshot.h.
References forces_.
Referenced by SSAGES::ABF::PostIntegration(), SSAGES::ANN::PostIntegration(), SSAGES::BFS::PostIntegration(), SSAGES::CFF::PostIntegration(), SSAGES::ElasticBand::PostIntegration(), SSAGES::FiniteTempString::PostIntegration(), SSAGES::Meta::PostIntegration(), SSAGES::Swarm::PostIntegration(), SSAGES::Umbrella::PostIntegration(), and SSAGES::ForwardFlux::ReadFFSConfiguration().
|
inline |
Get system H-matrix.
Definition at line 129 of file Snapshot.h.
References H_.
|
inline |
Get the current iteration.
Definition at line 105 of file Snapshot.h.
References iteration_.
Referenced by SSAGES::Logger::PostIntegration(), SSAGES::ANN::PostIntegration(), SSAGES::BFS::PostIntegration(), SSAGES::CFF::PostIntegration(), SSAGES::Meta::PostIntegration(), SSAGES::Umbrella::PostIntegration(), and SSAGES::Hook::PostIntegrationHook().
|
inline |
Get system Kb.
Definition at line 165 of file Snapshot.h.
References kb_.
Referenced by SSAGES::BFS::PostIntegration(), SSAGES::ANN::PreSimulation(), and SSAGES::CFF::PreSimulation().
|
inline |
Gets the local atom index corresponding to an atom ID.
id | Atom ID. |
Definition at line 519 of file Snapshot.h.
References atomids_.
Referenced by SSAGES::AlphaRMSDCV::Evaluate(), SSAGES::AngleCV::Evaluate(), SSAGES::AntiBetaRMSDCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::ParallelBetaRMSDCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), GetLocalIndices(), SSAGES::GyrationTensorCV::Initialize(), SSAGES::PairwiseCV::Initialize(), SSAGES::ParticleCoordinateCV::Initialize(), SSAGES::ParticlePositionCV::Initialize(), SSAGES::ParticleSeparationCV::Initialize(), SSAGES::RMSDCV::Initialize(), SSAGES::RouseModeCV::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 537 of file Snapshot.h.
References GetLocalIndex().
Referenced by SSAGES::ANNCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), SSAGES::RMSDCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), SSAGES::AlphaRMSDCV::Initialize(), SSAGES::AngleCV::Initialize(), SSAGES::ANNCV::Initialize(), SSAGES::AntiBetaRMSDCV::Initialize(), SSAGES::ParallelBetaRMSDCV::Initialize(), SSAGES::RMSDCV::Initialize(), SSAGES::TorsionalCV::Initialize(), and SSAGES::RouseModeCV::setMasses().
|
inline |
|
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 367 of file Snapshot.h.
References masses_.
Referenced by SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), SSAGES::RMSDCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), SSAGES::RMSDCV::Initialize(), SSAGES::ABF::PostIntegration(), and SSAGES::CFF::PostIntegration().
|
inline |
Get number of atoms in this snapshot.
Definition at line 202 of file Snapshot.h.
References nlocal_.
Referenced by SSAGES::ABF::CalcBiasForce(), SSAGES::AlphaRMSDCV::Evaluate(), SSAGES::AngleCV::Evaluate(), SSAGES::ANNCV::Evaluate(), SSAGES::AntiBetaRMSDCV::Evaluate(), SSAGES::BoxVolumeCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::ParallelBetaRMSDCV::Evaluate(), SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), SSAGES::RMSDCV::Evaluate(), SSAGES::RouseModeCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), SSAGES::RMSDCV::Initialize(), SSAGES::ABF::PostIntegration(), and SSAGES::CFF::PostIntegration().
|
inline |
Get origin of the system.
Definition at line 147 of file Snapshot.h.
References origin_.
|
inline |
Access the particle positions.
Definition at line 328 of file Snapshot.h.
References changed_, and positions_.
|
inline |
Access the particle positions.
Definition at line 325 of file Snapshot.h.
References positions_.
Referenced by SSAGES::ForwardFlux::AppendTrajectoryFile(), SSAGES::AlphaRMSDCV::Evaluate(), SSAGES::AngleCV::Evaluate(), SSAGES::ANNCV::Evaluate(), SSAGES::AntiBetaRMSDCV::Evaluate(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::PairwiseCV::Evaluate(), SSAGES::ParallelBetaRMSDCV::Evaluate(), SSAGES::RMSDCV::Evaluate(), SSAGES::TorsionalCV::Evaluate(), SSAGES::MockCV::Initialize(), SSAGES::FiniteTempString::PostIntegration(), SSAGES::Swarm::PostIntegration(), SSAGES::ABF::PreSimulation(), SSAGES::ForwardFlux::ReadFFSConfiguration(), and SSAGES::ForwardFlux::WriteFFSConfiguration().
|
inline |
Get qqrd2e value.
Definition at line 177 of file Snapshot.h.
References qqrd2e_.
|
inline |
|
inline |
Access the snapshot ID.
Definition at line 577 of file Snapshot.h.
References ID_.
|
inline |
Get target iterations.
Definition at line 111 of file Snapshot.h.
References targetiter_.
Referenced by SSAGES::Meta::PreSimulation().
|
inline |
Get current temperature.
Definition at line 117 of file Snapshot.h.
References temperature_.
|
inline |
Access the particle velocities.
Definition at line 341 of file Snapshot.h.
References changed_, and velocities_.
|
inline |
Access the particle velocities.
Definition at line 338 of file Snapshot.h.
References velocities_.
Referenced by SSAGES::ForwardFlux::AppendTrajectoryFile(), SSAGES::ABF::PostIntegration(), SSAGES::CFF::PostIntegration(), SSAGES::Swarm::PostIntegration(), SSAGES::ForwardFlux::ReadFFSConfiguration(), and SSAGES::ForwardFlux::WriteFFSConfiguration().
|
inline |
Get box virial.
Definition at line 141 of file Snapshot.h.
References virial_.
|
inline |
Get box virial.
Definition at line 135 of file Snapshot.h.
References virial_.
Referenced by SSAGES::ANN::PostIntegration(), SSAGES::BFS::PostIntegration(), SSAGES::CFF::PostIntegration(), SSAGES::Meta::PostIntegration(), and SSAGES::Umbrella::PostIntegration().
|
inline |
Get system volume.
Definition at line 159 of file Snapshot.h.
References H_.
Referenced by SSAGES::BoxVolumeCV::Evaluate().
|
inline |
Get walker ID.
Definition at line 195 of file Snapshot.h.
References wid_.
Referenced by SSAGES::BFS::PreSimulation(), and SSAGES::StringMethod::PreSimulation().
|
inline |
Query if Snapshot was modified.
True
if Snapshot was modified, else return False
Definition at line 590 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 153 of file Snapshot.h.
References isperiodic_.
|
inline |
Return the serialized IDs across all local cores.
Definition at line 673 of file Snapshot.h.
References atomids_, comm_, and nlocal_.
Referenced by SSAGES::FiniteTempString::PostIntegration(), and SSAGES::Swarm::PostIntegration().
|
inline |
Return the serialized positions across all local cores.
Definition at line 602 of file Snapshot.h.
References comm_, nlocal_, and positions_.
Referenced by SSAGES::FiniteTempString::PostIntegration(), and SSAGES::Swarm::PostIntegration().
|
inline |
Return the serialized velocities across all local cores.
Definition at line 638 of file Snapshot.h.
References comm_, nlocal_, and velocities_.
Referenced by SSAGES::Swarm::PostIntegration().
|
inline |
Set the dielectric constant.
dielectric | Value for the dielectric constant. |
Definition at line 299 of file Snapshot.h.
References changed_, and dielectric_.
|
inline |
|
inline |
|
inline |
Set the iteration.
iteration | New value for the iteration |
Definition at line 208 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 319 of file Snapshot.h.
References nlocal_.
|
inline |
|
inline |
Change the periodicity of the system.
isperiodic | Periodicity of three dimensions |
Definition at line 279 of file Snapshot.h.
References changed_, and isperiodic_.
|
inline |
|
inline |
Set target iterations.
target | New value for target iterations |
Definition at line 218 of file Snapshot.h.
References changed_, and targetiter_.
|
inline |
Change the temperature.
temperature | New value for the temperature |
Definition at line 228 of file Snapshot.h.
References changed_, and temperature_.
|
inline |
|
inline |
Compute the total mass of a group of particles based on index.
indices | IDs of particles of interest. |
Definition at line 423 of file Snapshot.h.
References comm_, and masses_.
Referenced by CenterOfMass(), SSAGES::GyrationTensorCV::Evaluate(), SSAGES::ParticleCoordinateCV::Evaluate(), SSAGES::ParticlePositionCV::Evaluate(), SSAGES::ParticleSeparationCV::Evaluate(), SSAGES::RMSDCV::Evaluate(), and SSAGES::RouseModeCV::setMasses().