Gromacs  2027.0-dev-20261118-bc88ada
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
gmx::MDAtoms Class Reference

#include <gromacs/mdtypes/mdatoms.h>

+ Collaboration diagram for gmx::MDAtoms:

Description

Contains a C-style t_mdatoms while managing some of its memory with C++ vectors with allocators.

Todo:
The group-scheme kernels needed a plain C-style t_mdatoms, so this type combines that with the memory management needed for efficient PME on GPU transfers. The mdAtoms_ member should be removed.

Public Member Functions

 MDAtoms (const gmx_mtop_t &mtop, const t_inputrec &inputrec, bool rankHasPmeGpuTask, bool useGpuForUpdate, const DeviceStreamManager *deviceStreamManager)
 
void updateAfterPartition (int numTotalAtoms, ArrayRef< const int > index, int numHomeAtoms, real massLambda)
 Write out per-atom arrays for this domain. More...
 
void updateForMassLambda (real massLambda)
 This routine updates the mass-related values in mdAtoms to respect massLambda. More...
 

Public Attributes

real tmassA
 Total mass in state A.
 
real tmassB
 Total mass in state B.
 
real tmass
 Total mass.
 
bool bVCMgrps = false
 
int nPerturbed = 0
 Number of perturbed atoms.
 
int nMassPerturbed = 0
 Number of atoms for which the mass is perturbed.
 
int nChargePerturbed = 0
 Number of atoms for which the charge is perturbed.
 
int nTypePerturbed = 0
 Number of atoms for which the type is perturbed.
 
int numHomeAtoms
 Number of home atoms in this domain.
 
std::vector< real > massA
 Atomic mass in A state.
 
std::vector< real > massB
 Atomic mass in B state.
 
std::vector< real > massT
 Atomic mass in present state.
 
PaddedHostVector< real > invmass
 Inverse atomic mass per atom, 0 for vsites and shells.
 
std::vector< RVec > invMassPerDim
 Inverse atomic mass per atom and dimension, 0 for vsites, shells and frozen dimensions.
 
PaddedHostVector< real > chargeA
 Atomic charges in the A state.
 
PaddedHostVector< real > chargeB
 Atomic charges in the B state.
 
std::vector< real > sqrt_c6A
 Dispersion constant C6 in A state.
 
std::vector< real > sqrt_c6B
 Dispersion constant C6 in A state.
 
std::vector< real > sigmaA
 Van der Waals radius sigma in the A state.
 
std::vector< real > sigmaB
 Van der Waals radius sigma in the B state.
 
std::vector< real > sigma3A
 Van der Waals radius sigma^3 in the A state.
 
std::vector< real > sigma3B
 Van der Waals radius sigma^3 in the B state.
 
std::vector< BoolType > bPerturbed
 Is this atom perturbed?
 
std::vector< int > typeA
 Type of atom in the A state.
 
std::vector< int > typeB
 Type of atom in the B state.
 
std::vector< ParticleType > ptype
 Particle type.
 
HostVector< unsigned short > cTC
 Group index for temperature coupling.
 
std::vector< unsigned short > cENER
 Group index for energy matrix.
 
std::vector< unsigned short > cACC
 Group index for acceleration.
 
std::vector< unsigned short > cFREEZE
 Group index for freezing.
 
std::vector< unsigned short > cVCM
 Group index for center of mass motion removal.
 
std::vector< unsigned short > cU1
 Group index for user 1.
 
std::vector< unsigned short > cU2
 Group index for user 2.
 

Member Function Documentation

void gmx::MDAtoms::updateAfterPartition ( int  numTotalAtoms,
ArrayRef< const int >  index,
int  numHomeAtoms,
real  massLambda 
)

Write out per-atom arrays for this domain.

Force, update, and constraint modules need various per-atom fields that are efficient to look up when fully written out for the whole domain. As particles may have moved between domain repartitionings, these vectors must be re-filled at the start of every domain lifetime.

Parameters
[in]numTotalAtomsThe number of atoms used on this domain
[in]indexLookup table for global atom index.
[in]numHomeAtomsNumber of home atoms for this domain
[in]massLambdaThe FEP lambda value relevant to mass perturbation

When using DD, numTotalAtoms indicates the size of the map from local to global atom indices.

If index is non-empty only the indexed atoms are copied.

void gmx::MDAtoms::updateForMassLambda ( real  massLambda)

This routine updates the mass-related values in mdAtoms to respect massLambda.

Intended to cater for possible per-step changes to the lambda value for masses with slow-growth FEP, but also called by atoms2md() during reinit after DD repartitioning.

Parameters
[in]massLambdaThe FEP lambda value relevant to mass perturbation

The documentation for this class was generated from the following files: