Gromacs
2025-dev-20240913-b871546
|
#include <gromacs/mdlib/wholemoleculetransform.h>
This class manages a coordinate buffer with molecules not split over periodic boundary conditions for use in force calculations which require whole molecules.
Note: This class should not be used for computation of forces which have virial contributions through shift forces.
Public Member Functions | |
WholeMoleculeTransform (const gmx_mtop_t &mtop, PbcType pbcType, bool useAtomReordering) | |
Constructor. More... | |
void | updateAtomOrder (ArrayRef< const int > globalAtomIndices, const gmx_ga2la_t &ga2la) |
Changes the atom order to the one provided. More... | |
void | updateForAtomPbcJumps (ArrayRef< const RVec > x, const matrix box) |
Updates the graph when atoms have been shifted by periodic vectors. | |
ArrayRef< const RVec > | wholeMoleculeCoordinates (ArrayRef< const RVec > x, const matrix box) |
Create and return coordinates with whole molecules for input coordinates x . More... | |
gmx::WholeMoleculeTransform::WholeMoleculeTransform | ( | const gmx_mtop_t & | mtop, |
PbcType | pbcType, | ||
bool | useAtomReordering | ||
) |
Constructor.
[in] | mtop | The global topology use for getting the connections between atoms |
[in] | pbcType | The type of PBC |
[in] | useAtomReordering | Whether we will use atom reordering |
void gmx::WholeMoleculeTransform::updateAtomOrder | ( | ArrayRef< const int > | globalAtomIndices, |
const gmx_ga2la_t & | ga2la | ||
) |
Changes the atom order to the one provided.
This method is called after domain repartitioning. The object should have been constructed with useAtomReordering
set to true
.
[in] | globalAtomIndices | The global atom indices for the local atoms, size should be the system size |
[in] | ga2la | Global to local atom index lookup (the inverse of globalAtomIndices ) |
ArrayRef< const RVec > gmx::WholeMoleculeTransform::wholeMoleculeCoordinates | ( | ArrayRef< const RVec > | x, |
const matrix | box | ||
) |
Create and return coordinates with whole molecules for input coordinates x
.
[in] | x | Input coordinates, should not have periodic displacement compared with the coordinates passed in the last call to updateForAtomPbcJumps() . |
[in] | box | The current periodic image vectors |
Note: this operation is not free. If you need whole molecules coordinates more than once during the force calculation, store the result and reuse it.