Gromacs  2024.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::SettleGpu Class Reference

#include <gromacs/mdlib/settle_gpu.h>

Description

Class with interfaces and data for GPU version of SETTLE.

Public Member Functions

 SettleGpu (const gmx_mtop_t &mtop, const DeviceContext &deviceContext, const DeviceStream &deviceStream)
 Create SETTLE object. More...
 
void apply (const DeviceBuffer< Float3 > &d_x, DeviceBuffer< Float3 > d_xp, bool updateVelocities, DeviceBuffer< Float3 > d_v, real invdt, bool computeVirial, tensor virialScaled, const PbcAiuc &pbcAiuc)
 Apply SETTLE. More...
 
void set (const InteractionDefinitions &idef)
 Update data-structures (e.g. after NB search step). More...
 

Constructor & Destructor Documentation

gmx::SettleGpu::SettleGpu ( const gmx_mtop_t &  mtop,
const DeviceContext &  deviceContext,
const DeviceStream deviceStream 
)

Create SETTLE object.

Extracts masses for oxygen and hydrogen as well as the O-H and H-H target distances from the topology data (mtop), check their values for consistency and calls the following constructor.

Parameters
[in]mtopTopology of the system to gen the masses for O and H atoms and target O-H and H-H distances. These values are also checked for consistency.
[in]deviceContextDevice context (dummy in CUDA).
[in]deviceStreamDevice stream to use.

Member Function Documentation

void gmx::SettleGpu::apply ( const DeviceBuffer< Float3 > &  d_x,
DeviceBuffer< Float3 d_xp,
bool  updateVelocities,
DeviceBuffer< Float3 d_v,
real  invdt,
bool  computeVirial,
tensor  virialScaled,
const PbcAiuc pbcAiuc 
)

Apply SETTLE.

Applies SETTLE to coordinates and velocities, stored on GPU. Data at pointers d_xp and d_v change in the GPU memory. The results are not automatically copied back to the CPU memory. Method uses this class data structures which should be updated when needed using update method.

Parameters
[in]d_xCoordinates before timestep (in GPU memory)
[in,out]d_xpCoordinates after timestep (in GPU memory). The resulting constrained coordinates will be saved here.
[in]updateVelocitiesIf the velocities should be updated.
[in,out]d_vVelocities to update (in GPU memory, can be nullptr if not updated)
[in]invdtReciprocal timestep (to scale Lagrange multipliers when velocities are updated)
[in]computeVirialIf virial should be updated.
[in,out]virialScaledScaled virial tensor to be updated.
[in]pbcAiucPBC data.
void gmx::SettleGpu::set ( const InteractionDefinitions &  idef)

Update data-structures (e.g. after NB search step).

Updates the constraints data and copies it to the GPU. Should be called if the particles were sorted, redistributed between domains, etc. Does not recycle the data preparation routines from the CPU version. All three atoms from single water molecule should be handled by the same GPU.

SETTLEs atom ID's is taken from idef.il[F_SETTLE].iatoms.

Parameters
[in]idefSystem topology

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