OpenMPCD
Simple.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines the OpenMPCD::CUDA::MPCFluid::Simple class.
4  */
5 
6 #ifndef OPENMPCD_CUDA_MPCFLUID_SIMPLE_HPP
7 #define OPENMPCD_CUDA_MPCFLUID_SIMPLE_HPP
8 
10 
11 namespace OpenMPCD
12 {
13 namespace CUDA
14 {
15 namespace MPCFluid
16 {
17  /**
18  * Fluid consisting of independent particles
19  */
20  class Simple : public Base
21  {
22  public:
23  /**
24  * The constructor.
25  * @param[in] sim The simulation instance.
26  * @param[in] count The number of fluid particles.
27  * @param[in] streamingTimestep_ The timestep for a streaming step.
28  * @param[in] rng_ A random number generator to seed this instance's RNG with.
29  * @param[in] devMemMgr The Device memory manager.
30  */
31  Simple(const CUDA::Simulation* const sim, const unsigned int count,
32  const FP streamingTimestep_, RNG& rng_, DeviceMemoryManager* const devMemMgr);
33 
34  /**
35  * The destructor.
36  */
37  virtual ~Simple()
38  {
39  }
40 
41  public:
42  virtual unsigned int getNumberOfLogicalEntities() const
43  {
44  return getParticleCount();
45  }
46 
48  {
49  return true;
50  }
51 
52  virtual unsigned int getNumberOfParticlesPerLogicalEntity() const
53  {
54  return 1;
55  }
56 
57  virtual void stream();
58 
59  private:
60  /**
61  * Reads the configuration.
62  */
63  void readConfiguration();
64 
65  /**
66  * Initializes the particle positions and velocities on the host.
67  */
68  void initializeOnHost();
69  };
70 } //namespace MPCFluid
71 } //namespace CUDA
72 } //namespace OpenMPCD
73 
74 #endif
OpenMPCD::CUDA::MPCFluid::Base
Base class for MPC fluids.
Definition: CUDA/MPCFluid/Base.hpp:40
OpenMPCD::CUDA::MPCFluid::Simple::Simple
Simple(const CUDA::Simulation *const sim, const unsigned int count, const FP streamingTimestep_, RNG &rng_, DeviceMemoryManager *const devMemMgr)
The constructor.
OpenMPCD::CUDA::DeviceMemoryManager
Class for managing memory on the CUDA Device.
Definition: DeviceMemoryManager.hpp:21
OpenMPCD::CUDA::MPCFluid::Simple::stream
virtual void stream()
Performs a streaming step.
Base.hpp
OpenMPCD::CUDA::MPCFluid::Simple::getNumberOfParticlesPerLogicalEntity
virtual unsigned int getNumberOfParticlesPerLogicalEntity() const
Returns the number of MPC particles per logical entity.
Definition: Simple.hpp:52
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::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::Simple::~Simple
virtual ~Simple()
The destructor.
Definition: Simple.hpp:37
OpenMPCD::CUDA::MPCFluid::Simple::getNumberOfLogicalEntities
virtual unsigned int getNumberOfLogicalEntities() const
Returns the number of logical entities in the fluid.
Definition: Simple.hpp:42
OpenMPCD::CUDA::MPCFluid::Simple
Fluid consisting of independent particles.
Definition: Simple.hpp:20
OpenMPCD::CUDA::MPCFluid::Simple::numberOfParticlesPerLogicalEntityIsConstant
virtual bool numberOfParticlesPerLogicalEntityIsConstant() const
Returns whether all logical entities consist of the same number of MPC particles.
Definition: Simple.hpp:47