Simpatico  v1.10
LinkFactory.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/link/LinkFactory.h>
9 #include <mcMd/simulation/System.h>
10 #include <mcMd/potentials/bond/BondPotential.h>
11 #include <mcMd/potentials/link/LinkPotentialImpl.h>
12 
13 // Bond interaction classes
14 #include <simp/interaction/bond/HarmonicBond.h>
15 #include <simp/interaction/bond/HarmonicL0Bond.h>
16 #include <simp/interaction/bond/FeneBond.h>
17 
18 namespace McMd
19 {
20 
21  using namespace Simp;
22 
23  /*
24  * Default constructor.
25  */
27  : systemPtr_(&system)
28  {}
29 
30  /*
31  * Return a pointer to a new BondPotential, if possible.
32  */
33  BondPotential* LinkFactory::factory(const std::string& name) const
34  {
35  BondPotential* ptr = 0;
36  if (name == "HarmonicBond") {
37  ptr = new LinkPotentialImpl<HarmonicBond>(*systemPtr_);
38  } else
39  if (name == "HarmonicL0Bond") {
40  ptr = new LinkPotentialImpl<HarmonicL0Bond>(*systemPtr_);
41  } else
42  if (name == "FeneBond") {
43  ptr = new LinkPotentialImpl<FeneBond>(*systemPtr_);
44  }
45 
46  return ptr;
47  }
48 
49 }
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
Classes used by all simpatico molecular simulations.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
BondPotential * factory(const std::string &subclass) const
Return a pointer to a new McBondInteration, if possible.
Definition: LinkFactory.cpp:33
LinkFactory(System &system)
Default constructor.
Definition: LinkFactory.cpp:26
Abstract Bond Potential class.
Template implementation of an BondPotential for links.