Simpatico  v1.10
mcMd/potentials/angle/AngleFactory.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 <mcMd/potentials/angle/AngleFactory.h>
9 
10 // AnglePotential base and implementation classes
11 #include <mcMd/potentials/angle/AnglePotential.h>
12 #include <mcMd/potentials/angle/AnglePotentialImpl.h>
13 
14 // Angle Potential interaction classes
15 #include <simp/interaction/angle/CosineAngle.h>
16 #include <simp/interaction/angle/CosineSqAngle.h>
17 #include <simp/interaction/angle/HarmonicAngle.h>
18 
19 namespace McMd
20 {
21 
22  using namespace Simp;
23 
28  : systemPtr_(&system)
29  {}
30 
31  /*
32  * Return a pointer to a new AnglePotential, if possible.
33  */
35  AngleFactory::factory(const std::string& name) const
36  {
37  AnglePotential* ptr = 0;
38 
39  ptr = trySubfactories(name);
40  if (ptr) return ptr;
41 
42  if (name == "CosineAngle") {
43  ptr = new AnglePotentialImpl<CosineAngle>(*systemPtr_);
44  } else
45  if (name == "CosineSqAngle") {
46  ptr = new AnglePotentialImpl<CosineSqAngle>(*systemPtr_);
47  } else
48  if (name == "HarmonicAngle") {
49  ptr = new AnglePotentialImpl<HarmonicAngle>(*systemPtr_);
50  }
51  return ptr;
52  }
53 
54 }
Interface for a Angle Interaction.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
Classes used by all simpatico molecular simulations.
AnglePotential * factory(const std::string &subclass) const
Return a pointer to a new AnglePotential, if possible.
Implementation template for an AnglePotential.
AnglePotential * trySubfactories(const std::string &className) const
Search through subfactories for match.
AngleFactory(System &system)
Default constructor.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).