Go to the documentation of this file.
6 #ifndef OPENMPCD_CUDA_SIMULATION_HPP
7 #define OPENMPCD_CUDA_SIMULATION_HPP
21 namespace OpenMPCDTest
50 friend class OpenMPCDTest::CUDA::SimulationTest;
59 Simulation(
const std::string& configurationFilename,
const unsigned int rngSeed,
const std::string& dir);
143 return mpcFluid != NULL;
171 #ifdef OPENMPCD_DEBUG
184 return boundaryCondition;
193 if (mpcSolute)
return true;
226 return &deviceMemoryManager;
234 void readConfiguration();
245 void run(
const unsigned int stepCount);
293 FP bulkThermostatTargetkT;
298 unsigned int mpcSweepSize;
299 unsigned int numberOfCompletedSweeps;
311 const std::string rundir;
323 unsigned int* d_fluidCollisionCellIndices;
324 unsigned int* d_collisionCellParticleCounts;
328 FP* collisionCellRelativeVelocityScalings;
329 FP* d_collisionCellRelativeVelocityScalings;
330 FP* d_collisionCellFrameInternalKineticEnergies;
334 FP* d_collisionCellMasses;
339 unsigned int* d_collisionCellIndices_solute;
unsigned int getNumberOfCompletedSweeps() const
Returns the number of times sweep has completed, not counting warmup sweeps as performed by warmup.
Base class for MPC fluids.
unsigned int getSimulationBoxSizeZ() const
Returns the size of the primary simulation box along the z direction.
bool hasSolute() const
Returns true if Simulation has an instance of MPCSolute::Base.
Exception for a forbidden function call.
const MPCFluid::Base & getMPCFluid() const
Returns the MPC fluid.
unsigned int getSimulationBoxSizeY() const
Returns the size of the primary simulation box along the y direction.
Represents the configuration of the simulation.
Simulation(const std::string &configurationFilename, const unsigned int rngSeed, const std::string &dir)
The constructor.
#define OPENMPCD_THROW(ExceptionType, message)
Throws the given ExceptionType, passing the given message along with file and line number information...
__constant__ unsigned int mpcSimulationBoxSizeY
The size of the primary simulation box along the y direction.
__global__ void generateGridShiftVector(MPCParticlePositionType *const gridShift, const FP gridShiftScale, GPURNG *const rngs)
Generates a new random grid shift vector.
__global__ void generateCollisionCellRotationAxes(const unsigned int workUnitOffset, const unsigned int collisionCellCount, FP *const collisionCellRotationAxes, GPURNG *const rngs)
Generates new rotation axes for the collision cells.
~Simulation()
The destructor.
const BoundaryCondition::Base * getBoundaryConditions() const
Returns the boundary conditions.
Class for managing memory on the CUDA Device.
std::string getRundir() const
Returns the directory containing the Simulation run data.
__constant__ FP srdCollisionAngle
The collision angle for SRD collisions.
bool hasMPCFluid() const
Returns whether an MPC fluid has been configured.
unsigned int getSimulationBoxSizeX() const
Returns the size of the primary simulation box along the x direction.
__constant__ unsigned int mpcSimulationBoxSizeX
The size of the primary simulation box along the x direction.
const MPCSolute::Base< MPCParticlePositionType, MPCParticleVelocityType > & getMPCSolute() const
Returns the MPC solute.
FP MPCParticlePositionType
The data type for the positions of MPC particles.
unsigned int getCollisionCellCount() const
Returns the number of collision cells.
Base class for MPC solutes.
const Configuration & getConfiguration() const
Returns the configuration.
FP getMPCTime() const
Returns the MPC time that has passed since the start of the simulation.
MPCD simulation with Molecular Dynamics on CUDA-capable GPUs.
boost::mt11213b RNG
The random number generator type.
__constant__ unsigned int mpcSimulationBoxSizeZ
The size of the primary simulation box along the z direction.
#define OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE(assertion, ExceptionType)
double FP
Default floating point type.
DeviceMemoryManager * getDeviceMemoryManager()
Returns the Device memory manager.
FP MPCParticleVelocityType
The data type for the velocities of MPC particles.
__global__ void generateCollisionCellMBSFactors(const unsigned int workUnitOffset, const unsigned int collisionCellCount, const FP *const collisionCellFrameInternalKineticEnergies, unsigned int *const collisionCellParticleCounts, FP *const collisionCellRelativeVelocityScalings, const FP bulkThermostatTargetkT, GPURNG *const rngs)
Generates Maxwell-Boltzmann-Scaling factors for the collision cells.
FP getMPCTimestep() const
Returns the MPC timestep.
void warmup()
Performs the warmup step.
void sweep()
Performs a sweep.
Base class for boundary condition.
Philox4x32-10 counter-bases PRNG.