OpenMPCD
MPCSolute/Factory.cpp
2 
5 #include <cmath>
6 
7 using namespace OpenMPCD;
8 using namespace OpenMPCD::CUDA;
9 
12  CUDA::Simulation* const sim,
13  const Configuration& config,
14  RNG& rng)
15 {
16  if(!config.has("solute"))
17  return NULL;
18 
19  Configuration::Setting soluteGroup = config.getSetting("solute");
20 
21  if(soluteGroup.getChildCount() == 0)
22  return NULL;
23 
24  if(soluteGroup.getChildCount() != 1)
25  {
28  "Currently, only a single type of solutes is supported");
29  }
30 
31  if(soluteGroup.has("StarPolymers"))
32  {
33  return
36  soluteGroup.getSetting("StarPolymers"),
37  sim->getBoundaryConditions());
38  }
39 
40  OPENMPCD_THROW(UnimplementedException, "Unknown solute type");
41 }
42 
OpenMPCD::Configuration::getSetting
const Setting getSetting(const std::string &name) const
Returns the setting object with the given name.
Definition: Configuration.hpp:579
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::Setting::getChildCount
std::size_t getChildCount() const
Returns the number of direct child settings in this setting.
Definition: Configuration.hpp:235
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
OpenMPCD::CUDA::Simulation::getBoundaryConditions
const BoundaryCondition::Base * getBoundaryConditions() const
Returns the boundary conditions.
Definition: CUDA/Simulation.hpp:182
OpenMPCD::UnimplementedException
Exception for unimplemented functionality.
Definition: Exceptions.hpp:192
OpenMPCD::MPCParticlePositionType
FP MPCParticlePositionType
The data type for the positions of MPC particles.
Definition: Types.hpp:15
OpenMPCD::CUDA::MPCSolute::Base< MPCParticlePositionType, MPCParticleVelocityType >
OpenMPCD::CUDA::MPCSolute::Factory::getInstance
static MPCSolute::Base< MPCParticlePositionType, MPCParticleVelocityType > * getInstance(CUDA::Simulation *const sim, const Configuration &config, RNG &rng)
Returns a newly constructed MPC solute.
Definition: MPCSolute/Factory.cpp:11
OpenMPCD::CUDA
Namespace for simulations using CUDA.
Definition: Bitset.hpp:15
OpenMPCD::Configuration::Setting::has
bool has(const std::string &settingName) const
Returns whether a setting with the given name exists.
Definition: Configuration.hpp:82
OpenMPCD::Configuration::Setting::getSetting
const Setting getSetting(const std::string &name) const
Returns the setting object with the given name.
Definition: Configuration.hpp:275
OpenMPCD::CUDA::Simulation
MPCD simulation with Molecular Dynamics on CUDA-capable GPUs.
Definition: CUDA/Simulation.hpp:48
Factory.hpp
OpenMPCD::RNG
boost::mt11213b RNG
The random number generator type.
Definition: Types.hpp:18
OpenMPCD::MPCParticleVelocityType
FP MPCParticleVelocityType
The data type for the velocities of MPC particles.
Definition: Types.hpp:16
StarPolymers.hpp
OpenMPCD::Configuration::Setting
Represents a setting in the configuration.
Definition: Configuration.hpp:36
OpenMPCD::CUDA::MPCSolute::StarPolymers
Class representing star polymers.
Definition: StarPolymers.hpp:123