Gromacs
2025.0-dev-20241011-013a99c
|
#include <gromacs/mdtypes/threaded_force_buffer.h>
Object that holds force and energies buffers plus a mask for a thread.
ForceBufferElementType | The type for components of the normal force buffer: rvec or rvec4 |
Public Member Functions | |
ThreadForceBuffer (int threadIndex, bool useEnergyTerms, int numEnergyGroups) | |
Constructor. More... | |
void | resizeBufferAndClearMask (int numAtoms) |
Resizes the buffer to numAtoms and clears the mask. | |
void | addAtomToMask (const int atomIndex) |
Adds atom with index atomIndex for reduction. | |
void | processMask () |
Index | size () const |
Returns the size of the force buffer in number of atoms. | |
void | clearForcesAndEnergies () |
Clears all force and energy buffers. | |
ArrayRef< ForceBufferElementType > | forceBuffer () |
Returns an array reference to the force buffer which is aligned for SIMD access. | |
ArrayRefWithPadding < ForceBufferElementType > | forceBufferWithPadding () |
Returns an array reference with padding to the force buffer which is aligned for SIMD access. More... | |
ArrayRef< RVec > | shiftForces () |
Returns a view of the shift force buffer. | |
ArrayRef< real > | energyTerms () |
Returns a view of the energy terms, size F_NRE. | |
gmx_grppairener_t & | groupPairEnergies () |
Returns a reference to the energy group pair energies. | |
EnumerationArray < FreeEnergyPerturbationCouplingType, real > & | dvdl () |
Returns a reference to the dvdl terms. | |
ArrayRef< const gmx_bitmask_t > | reductionMask () const |
Returns a const view to the reduction masks. | |
Static Public Attributes | |
static constexpr int | s_numReductionBlockBits = 5 |
The log2 of the reduction block size. | |
static constexpr int | s_reductionBlockSize = (1 << s_numReductionBlockBits) |
Force buffer block size in atoms. | |
gmx::ThreadForceBuffer< ForceBufferElementType >::ThreadForceBuffer | ( | int | threadIndex, |
bool | useEnergyTerms, | ||
int | numEnergyGroups | ||
) |
Constructor.
[in] | threadIndex | The index of the thread that will fill the buffers in this object |
[in] | useEnergyTerms | Whether the list of energy terms will be used |
[in] | numEnergyGroups | The number of non-bonded energy groups |
|
inline |
Returns an array reference with padding to the force buffer which is aligned for SIMD access.
For RVec there is padding of one real for 4-wide SIMD access. For both RVec and rvec4 there is padding up to the block size for use in ThreadedForceBuffer.