OpenMPCD
MPCFluid/Factory.cpp
2 
9 
10 using namespace OpenMPCD;
11 using namespace OpenMPCD::CUDA;
12 
14  const Configuration& config,
15  const unsigned int count,
16  RNG& rng)
17 {
18  const FP mpcTimestep = config.read<FP>("mpc.timestep");
19 
20  if(!config.has("mpc.fluid"))
21  return NULL;
22 
23  if(config.has("mpc.fluid.simple"))
24  return new MPCFluid::Simple(sim, count, mpcTimestep, rng, sim->getDeviceMemoryManager());
25 
26  if(config.has("mpc.fluid.dumbbell"))
27  {
28  const FP bulkThermostatTargetkT = config.read<FP>("bulkThermostat.targetkT");
29  const FP shearRate = config.read<FP>("boundaryConditions.LeesEdwards.shearRate");
30 
31  return new MPCFluid::GaussianDumbbells(
32  sim, count, mpcTimestep, rng, sim->getDeviceMemoryManager(),
33  bulkThermostatTargetkT, shearRate);
34  }
35 
36  if(config.has("mpc.fluid.gaussianChains"))
37  {
38  return new MPCFluid::GaussianChains(
39  sim, count, mpcTimestep, rng, sim->getDeviceMemoryManager());
40  }
41 
42  if(config.has("mpc.fluid.gaussianRods"))
43  {
44  return new MPCFluid::GaussianRods(
45  sim, count, mpcTimestep, rng, sim->getDeviceMemoryManager());
46  }
47 
48  if(config.has("mpc.fluid.harmonicTrimers"))
49  return new MPCFluid::HarmonicTrimers(sim, count, mpcTimestep, rng, sim->getDeviceMemoryManager());
50 
51  OPENMPCD_THROW(InvalidConfigurationException, "Invalid MPC fluid type.");
52 }
HarmonicTrimers.hpp
OpenMPCD::CUDA::MPCFluid::Base
Base class for MPC fluids.
Definition: CUDA/MPCFluid/Base.hpp:40
OpenMPCD::Configuration::has
bool has(const std::string &setting) const
Returns whether a setting with the given name exists.
Definition: Configuration.hpp:509
OpenMPCD::Configuration
Represents the configuration of the simulation.
Definition: Configuration.hpp:28
Exceptions.hpp
OPENMPCD_THROW
#define OPENMPCD_THROW(ExceptionType, message)
Throws the given ExceptionType, passing the given message along with file and line number information...
Definition: Exceptions.hpp:22
GaussianRods.hpp
OpenMPCD::CUDA::MPCFluid::GaussianRods
Fluid consisting of Gaussian rods with a certain mean length.
Definition: GaussianRods.hpp:27
OpenMPCD::Configuration::read
void read(const std::pair< const char *, ValueType * >(&settingsAndValues)[settingsCount]) const
Reads the specified settings from the given configuration file and stores them in the given location.
Definition: Configuration.hpp:523
OpenMPCD::CUDA
Namespace for simulations using CUDA.
Definition: Bitset.hpp:15
OpenMPCD::CUDA::MPCFluid::HarmonicTrimers
Fluid consisting of three particles, with two harmonic springs coupling them.
Definition: HarmonicTrimers.hpp:41
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
GaussianChains.hpp
Factory.hpp
OpenMPCD::CUDA::MPCFluid::GaussianDumbbells
Fluid consisting of Gaussian dumbbells.
Definition: GaussianDumbbells.hpp:48
OpenMPCD::FP
double FP
Default floating point type.
Definition: Types.hpp:13
OpenMPCD::CUDA::Simulation::getDeviceMemoryManager
DeviceMemoryManager * getDeviceMemoryManager()
Returns the Device memory manager.
Definition: CUDA/Simulation.hpp:224
OpenMPCD::CUDA::MPCFluid::Simple
Fluid consisting of independent particles.
Definition: Simple.hpp:20
OpenMPCD::InvalidConfigurationException
Represents an invalid configuration.
Definition: Exceptions.hpp:80
GaussianDumbbells.hpp
OpenMPCD::CUDA::MPCFluid::GaussianChains
Generalization of GaussianDumbbells to chains with an arbitrary number of constituent particles.
Definition: GaussianChains.hpp:38
OpenMPCD::CUDA::MPCFluid::Factory::getInstance
static MPCFluid::Base * getInstance(CUDA::Simulation *const sim, const Configuration &config, const unsigned int count, RNG &rng)
Returns a newly constructed MPC fluid.
Definition: MPCFluid/Factory.cpp:13
Simple.hpp