OpenMPCD
GaussianRods.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines the OpenMPCD::CUDA::MPCFluid::GaussianRods class.
4  */
5 
6 #ifndef OPENMPCD_CUDA_MPCFLUID_GAUSSIANRODS_HPP
7 #define OPENMPCD_CUDA_MPCFLUID_GAUSSIANRODS_HPP
8 
10 
11 namespace OpenMPCD
12 {
13 namespace CUDA
14 {
15 namespace MPCFluid
16 {
17 
18 /**
19  * Fluid consisting of Gaussian rods with a certain mean length.
20  *
21  * If \f$ \vec{R} \f$ is the bond vector pointing from the first particle to the
22  * second, the potential is
23  * \f$ U = \frac{k}{2} \left( \left| R \right| - L \right)^2 \f$,
24  * where \f$ L \f$ is the mean bond length and \f$ k \f$ is called the spring
25  * constant.
26  */
27 class GaussianRods : public Base
28 {
29  public:
30  /**
31  * The constructor.
32  * @param[in] sim The simulation instance.
33  * @param[in] count The number of fluid particles.
34  * @param[in] streamingTimestep_ The timestep for a streaming step.
35  * @param[in] rng_ A random number generator to seed this instance's RNG with.
36  * @param[in] devMemMgr The Device memory manager.
37  */
38  GaussianRods(const CUDA::Simulation* const sim, const unsigned int count,
39  const FP streamingTimestep_, RNG& rng_,
40  DeviceMemoryManager* const devMemMgr);
41 
42  /**
43  * The destructor.
44  */
45  virtual ~GaussianRods()
46  {
47  }
48 
49  public:
50  virtual unsigned int getNumberOfLogicalEntities() const
51  {
52  return getParticleCount() / 2;
53  }
54 
56  {
57  return true;
58  }
59 
60  virtual unsigned int getNumberOfParticlesPerLogicalEntity() const
61  {
62  return 2;
63  }
64 
65  virtual void stream();
66 
67  private:
68  /**
69  * Reads the configuration.
70  */
71  void readConfiguration();
72 
73  /**
74  * Initializes the particle positions and velocities on the host.
75  */
76  void initializeOnHost();
77 
78  /**
79  * Returns the initial position of the given particle's partner.
80  * @param[in] position1 The position of the first particle of the dumbbell.
81  */
83  getInitialPartnerPosition(
84  const RemotelyStoredVector<MPCParticlePositionType>& position1) const;
85 
86  private:
87  FP meanBondLength; ///< The mean bond length \f$ L \f$.
88  FP springConstant; ///< The spring constant \f$ k \f$.
89 
90  unsigned int mdStepCount; ///< The number of velocity-Verlet steps in each streaming step.
91 }; //class GaussianRods
92 
93 } //namespace MPCFluid
94 } //namespace CUDA
95 } //namespace OpenMPCD
96 
97 #endif
OpenMPCD::CUDA::MPCFluid::Base
Base class for MPC fluids.
Definition: CUDA/MPCFluid/Base.hpp:40
OpenMPCD::RemotelyStoredVector
Represents a vector whose data is stored elsewhere.
Definition: RemotelyStoredVector.hpp:26
OpenMPCD::CUDA::MPCFluid::GaussianRods
Fluid consisting of Gaussian rods with a certain mean length.
Definition: GaussianRods.hpp:27
OpenMPCD::CUDA::DeviceMemoryManager
Class for managing memory on the CUDA Device.
Definition: DeviceMemoryManager.hpp:21
OpenMPCD::Vector3D
3-dimensional vector.
Definition: Vector3D.hpp:38
Base.hpp
OpenMPCD::CUDA::MPCFluid::GaussianRods::getNumberOfParticlesPerLogicalEntity
virtual unsigned int getNumberOfParticlesPerLogicalEntity() const
Returns the number of MPC particles per logical entity.
Definition: GaussianRods.hpp:60
OpenMPCD::CUDA::MPCFluid::GaussianRods::GaussianRods
GaussianRods(const CUDA::Simulation *const sim, const unsigned int count, const FP streamingTimestep_, RNG &rng_, DeviceMemoryManager *const devMemMgr)
The constructor.
OpenMPCD::CUDA::MPCFluid::GaussianRods::~GaussianRods
virtual ~GaussianRods()
The destructor.
Definition: GaussianRods.hpp:45
OpenMPCD::CUDA::MPCFluid::GaussianRods::numberOfParticlesPerLogicalEntityIsConstant
virtual bool numberOfParticlesPerLogicalEntityIsConstant() const
Returns whether all logical entities consist of the same number of MPC particles.
Definition: GaussianRods.hpp:55
OpenMPCD::CUDA::Simulation
MPCD simulation with Molecular Dynamics on CUDA-capable GPUs.
Definition: CUDA/Simulation.hpp:48
OpenMPCD::RNG
boost::mt11213b RNG
The random number generator type.
Definition: Types.hpp:18
OpenMPCD::CUDA::MPCFluid::GaussianRods::getNumberOfLogicalEntities
virtual unsigned int getNumberOfLogicalEntities() const
Returns the number of logical entities in the fluid.
Definition: GaussianRods.hpp:50
OpenMPCD::CUDA::MPCFluid::Base::getParticleCount
unsigned int getParticleCount() const
Returns the number of MPC fluid particles.
Definition: CUDA/MPCFluid/Base.hpp:72
OpenMPCD::FP
double FP
Default floating point type.
Definition: Types.hpp:13
OpenMPCD::CUDA::MPCFluid::GaussianRods::stream
virtual void stream()
Performs a streaming step.