OpenMPCD
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate > Class Template Referenceabstract

Base class for MPC solutes. More...

#include <Base.hpp>

Collaboration diagram for OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >:
Collaboration graph
[legend]

Public Member Functions

virtual ~Base ()
 The destructor. More...
 
virtual void performMDTimestep ()=0
 Performs, on the Device, an MD timestep of size getMDTimeStepSize(). More...
 
virtual std::size_t getParticleCount () const =0
 Returns the number of MPC solute particles. More...
 
virtual std::size_t getNumberOfLogicalEntities () const =0
 Returns the number of logical entities in the solute. More...
 
void fetchFromDevice () const
 Copies the MPC solute particles from the CUDA Device to the Host. More...
 
const RemotelyStoredVector< const PositionCoordinate > getPosition (const std::size_t particleID) const
 Returns a MPC solute particle's position vector. More...
 
const RemotelyStoredVector< const VelocityCoordinate > getVelocity (const std::size_t particleID) const
 Returns a MPC solute particle's velocity vector. More...
 
const PositionCoordinate * getDevicePositions () const
 Returns a const pointer to the MPC solute positions on the Device. More...
 
PositionCoordinate * getDevicePositions ()
 Returns a pointer to the MPC solute positions on the Device. More...
 
PositionCoordinate * getHostPositions ()
 Returns a pointer to the MPC solute positions on the Host. More...
 
const VelocityCoordinate * getDeviceVelocities () const
 Returns a const pointer to the MPC solute velocities on the Device. More...
 
VelocityCoordinate * getDeviceVelocities ()
 Returns a pointer to the MPC solute velocities on the Device. More...
 
VelocityCoordinate * getHostVelocities ()
 Returns a pointer to the MPC solute velocities on the Host. More...
 
FP getMDTimeStepSize () const
 Returns the number of time units advanced per MD step. More...
 
bool hasInstrumentation () const
 Returns whether the solute has instrumentation configured. More...
 
Instrumentation::BasegetInstrumentation () const
 Returns the solute instrumentation. More...
 
virtual FP getParticleMass () const =0
 Returns the mass of a particle, which is assumed to be equal for all particles in this instance. More...
 

Protected Member Functions

 Base ()
 The constructor. More...
 
void pushToDevice ()
 Copies the MPC solute particles from the Host to the CUDA Device. More...
 

Protected Attributes

DeviceMemoryManager deviceMemoryManager
 The Device memory manager. More...
 
FP mdTimeStepSize
 The number of time units to advance per MD step. More...
 
Instrumentation::Baseinstrumentation
 The solute instrumentation. More...
 
boost::scoped_array< PositionCoordinate > h_positions
 Host buffer for particle positions. More...
 
boost::scoped_array< VelocityCoordinate > h_velocities
 Host buffer for particle velocities. More...
 
PositionCoordinate * d_positions
 Particle positions on the Device. More...
 
VelocityCoordinate * d_velocities
 Particle velocities on the Device. More...
 

Detailed Description

template<typename PositionCoordinate, typename VelocityCoordinate>
class OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >

Base class for MPC solutes.

Template Parameters
PositionCoordinateThe type to store position coordinates.
VelocityCoordinateThe type to store velocity coordinates.

Definition at line 35 of file CUDA/MPCSolute/Base.hpp.

Constructor & Destructor Documentation

◆ Base()

template<typename PositionCoordinate , typename VelocityCoordinate >
OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::Base ( )
protected

The constructor.

◆ ~Base()

template<typename PositionCoordinate , typename VelocityCoordinate >
virtual OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::~Base ( )
virtual

The destructor.

Member Function Documentation

◆ fetchFromDevice()

template<typename PositionCoordinate , typename VelocityCoordinate >
void OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::fetchFromDevice ( ) const

Copies the MPC solute particles from the CUDA Device to the Host.

◆ getDevicePositions() [1/2]

template<typename PositionCoordinate , typename VelocityCoordinate >
PositionCoordinate* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getDevicePositions ( )
inline

Returns a pointer to the MPC solute positions on the Device.

Definition at line 116 of file CUDA/MPCSolute/Base.hpp.

◆ getDevicePositions() [2/2]

template<typename PositionCoordinate , typename VelocityCoordinate >
const PositionCoordinate* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getDevicePositions ( ) const
inline

Returns a const pointer to the MPC solute positions on the Device.

Definition at line 108 of file CUDA/MPCSolute/Base.hpp.

◆ getDeviceVelocities() [1/2]

template<typename PositionCoordinate , typename VelocityCoordinate >
VelocityCoordinate* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getDeviceVelocities ( )
inline

Returns a pointer to the MPC solute velocities on the Device.

Definition at line 140 of file CUDA/MPCSolute/Base.hpp.

◆ getDeviceVelocities() [2/2]

template<typename PositionCoordinate , typename VelocityCoordinate >
const VelocityCoordinate* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getDeviceVelocities ( ) const
inline

Returns a const pointer to the MPC solute velocities on the Device.

Definition at line 132 of file CUDA/MPCSolute/Base.hpp.

◆ getHostPositions()

template<typename PositionCoordinate , typename VelocityCoordinate >
PositionCoordinate* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getHostPositions ( )
inline

Returns a pointer to the MPC solute positions on the Host.

Definition at line 124 of file CUDA/MPCSolute/Base.hpp.

◆ getHostVelocities()

template<typename PositionCoordinate , typename VelocityCoordinate >
VelocityCoordinate* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getHostVelocities ( )
inline

Returns a pointer to the MPC solute velocities on the Host.

Definition at line 148 of file CUDA/MPCSolute/Base.hpp.

◆ getInstrumentation()

template<typename PositionCoordinate , typename VelocityCoordinate >
Instrumentation::Base& OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getInstrumentation ( ) const
inline

Returns the solute instrumentation.

Exceptions
OpenMPCD::NULLPointerExceptionIf OPENMPCD_DEBUG is defined, throws if !hasInstrumentation().

Definition at line 175 of file CUDA/MPCSolute/Base.hpp.

◆ getMDTimeStepSize()

template<typename PositionCoordinate , typename VelocityCoordinate >
FP OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getMDTimeStepSize ( ) const
inline

Returns the number of time units advanced per MD step.

Definition at line 156 of file CUDA/MPCSolute/Base.hpp.

◆ getNumberOfLogicalEntities()

template<typename PositionCoordinate , typename VelocityCoordinate >
virtual std::size_t OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getNumberOfLogicalEntities ( ) const
pure virtual

Returns the number of logical entities in the solute.

◆ getParticleCount()

template<typename PositionCoordinate , typename VelocityCoordinate >
virtual std::size_t OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getParticleCount ( ) const
pure virtual

Returns the number of MPC solute particles.

◆ getParticleMass()

template<typename PositionCoordinate , typename VelocityCoordinate >
virtual FP OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getParticleMass ( ) const
pure virtual

Returns the mass of a particle, which is assumed to be equal for all particles in this instance.

◆ getPosition()

template<typename PositionCoordinate , typename VelocityCoordinate >
const RemotelyStoredVector<const PositionCoordinate> OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getPosition ( const std::size_t  particleID) const

Returns a MPC solute particle's position vector.

Warning
This function only returns the position that was current the last time fetchFromDevice was called.
Exceptions
OpenMPCD::OutOfBoundsExceptionIf OPENMPCD_DEBUG is defined, throws if particleID >= getParticleCount().
Parameters
[in]particleIDThe particle ID.

◆ getVelocity()

template<typename PositionCoordinate , typename VelocityCoordinate >
const RemotelyStoredVector<const VelocityCoordinate> OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::getVelocity ( const std::size_t  particleID) const

Returns a MPC solute particle's velocity vector.

Warning
This function only returns the velocity that was current the last time fetchFromDevice was called.
Exceptions
OpenMPCD::OutOfBoundsExceptionIf OPENMPCD_DEBUG is defined, throws if particleID >= getParticleCount().
Parameters
[in]particleIDThe particle ID.

◆ hasInstrumentation()

template<typename PositionCoordinate , typename VelocityCoordinate >
bool OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::hasInstrumentation ( ) const
inline

Returns whether the solute has instrumentation configured.

Definition at line 164 of file CUDA/MPCSolute/Base.hpp.

◆ performMDTimestep()

template<typename PositionCoordinate , typename VelocityCoordinate >
virtual void OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::performMDTimestep ( )
pure virtual

◆ pushToDevice()

template<typename PositionCoordinate , typename VelocityCoordinate >
void OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::pushToDevice ( )
protected

Copies the MPC solute particles from the Host to the CUDA Device.

Member Data Documentation

◆ d_positions

template<typename PositionCoordinate , typename VelocityCoordinate >
PositionCoordinate* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::d_positions
protected

Particle positions on the Device.

Definition at line 210 of file CUDA/MPCSolute/Base.hpp.

◆ d_velocities

template<typename PositionCoordinate , typename VelocityCoordinate >
VelocityCoordinate* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::d_velocities
protected

Particle velocities on the Device.

Definition at line 211 of file CUDA/MPCSolute/Base.hpp.

◆ deviceMemoryManager

template<typename PositionCoordinate , typename VelocityCoordinate >
DeviceMemoryManager OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::deviceMemoryManager
protected

The Device memory manager.

Definition at line 199 of file CUDA/MPCSolute/Base.hpp.

◆ h_positions

template<typename PositionCoordinate , typename VelocityCoordinate >
boost::scoped_array<PositionCoordinate> OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::h_positions
mutableprotected

Host buffer for particle positions.

Definition at line 205 of file CUDA/MPCSolute/Base.hpp.

◆ h_velocities

template<typename PositionCoordinate , typename VelocityCoordinate >
boost::scoped_array<VelocityCoordinate> OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::h_velocities
mutableprotected

Host buffer for particle velocities.

Definition at line 207 of file CUDA/MPCSolute/Base.hpp.

◆ instrumentation

template<typename PositionCoordinate , typename VelocityCoordinate >
Instrumentation::Base* OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::instrumentation
protected

The solute instrumentation.

Definition at line 203 of file CUDA/MPCSolute/Base.hpp.

◆ mdTimeStepSize

template<typename PositionCoordinate , typename VelocityCoordinate >
FP OpenMPCD::CUDA::MPCSolute::Base< PositionCoordinate, VelocityCoordinate >::mdTimeStepSize
protected

The number of time units to advance per MD step.

Definition at line 201 of file CUDA/MPCSolute/Base.hpp.


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