Simpatico  v1.10
IntegratorFactory.cpp
1 /*
2 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include "IntegratorFactory.h"
9 
10 // Subclasses of Integrator
11 #include "NveIntegrator.h"
12 #include "NvtIntegrator.h"
13 #include "NvtLangevinIntegrator.h"
14 #include "NptIntegrator.h"
15 #include "NphIntegrator.h"
16 
17 namespace DdMd
18 {
19 
20  using namespace Util;
21 
22  /*
23  * Constructor
24  */
26  : simulationPtr_(&simulation)
27  {}
28 
29  /*
30  * Return a pointer to a instance of Integrator subclass className.
31  */
32  Integrator* IntegratorFactory::factory(const std::string &className) const
33  {
34  Integrator *ptr = 0;
35 
36  // Try subfactories first
37  ptr = trySubfactories(className);
38  if (ptr) return ptr;
39 
40  // Try to match classname
41  if (className == "NveIntegrator") {
42  ptr = new NveIntegrator(*simulationPtr_);
43  } else
44  if (className == "NvtIntegrator") {
45  ptr = new NvtIntegrator(*simulationPtr_);
46  } else
47  if (className == "NvtLangevinIntegrator") {
48  ptr = new NvtLangevinIntegrator(*simulationPtr_);
49  } else
50  if (className == "NptIntegrator") {
51  ptr = new NptIntegrator(*simulationPtr_);
52  } else
53  if (className == "NphIntegrator") {
54  ptr = new NphIntegrator(*simulationPtr_);
55  }
56  // else
57  //if (className == "NvtDpdVvIntegrator") {
58  // ptr = new NvtDpdVvIntegrator(*simulationPtr_);
59  //}
60  //if (className == "NphIntegrator") {
61  // ptr = new NphIntegrator(*simulationPtr_);
62  //}
63  return ptr;
64  }
65 
66 }
A NVT molecular dynamics integrator with a Langevin thermostat.
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
A Nose-Hoover constant temperature, constant volume integrator.
Definition: NvtIntegrator.h:26
An Integrator numerically integrates the equations of motion.
Definition: Integrator.h:29
Integrator * trySubfactories(const std::string &className) const
Search through subfactories for match.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Integrator * factory(const std::string &speciesName) const
Method to create any species supplied with Simpatico.
A velocity-Verlet constant energy integrator.
Definition: NveIntegrator.h:26
IntegratorFactory(Simulation &simulation)
Constructor.
A reversible, symplectic NPH integrator (Anderson barostat).
A reversible symplectic NPT integrator.
Definition: NptIntegrator.h:28