Simpatico  v1.10
mcMd/potentials/pair/PairFactory.h
1 #ifndef MCMD_PAIR_FACTORY_H
2 #define MCMD_PAIR_FACTORY_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2014, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include <util/global.h>
12 #include <iostream>
13 #include <vector>
14 
15 namespace McMd
16 {
17 
18  class System;
19  class MdSystem;
20  class MdPairPotential;
21  class McPairPotential;
22 
34  class PairFactory
35  {
36 
37  public:
38 
42  PairFactory();
43 
47  virtual ~PairFactory()
48  {}
49 
58  void addSubfactory(PairFactory& subfactory);
59 
66  virtual McPairPotential* mcFactory(const std::string& subclass, System& system) const;
67 
74  virtual MdPairPotential* mdFactory(const std::string& subclass, System& system) const;
75 
81  virtual MdPairPotential* mdFactory(McPairPotential& potential) const;
82 
83  protected:
84 
92  McPairPotential* tryMcSubfactories(const std::string& className, System& system) const;
93 
101  MdPairPotential* tryMdSubfactories(const std::string& className, System& system) const;
102 
110 
111  private:
112 
114  std::vector< PairFactory* > subfactories_;
115 
116  };
117 
118 }
119 #endif
120 
A PairPotential for MC simulations (abstract).
Factory for subclasses MdPairPotential or McPairPotential.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
File containing preprocessor macros for error handling.
virtual ~PairFactory()
Destructor.
void addSubfactory(PairFactory &subfactory)
Add a new subfactory to the list.
virtual McPairPotential * mcFactory(const std::string &subclass, System &system) const
Return a pointer to a new McPairPotential, if possible.
virtual MdPairPotential * mdFactory(const std::string &subclass, System &system) const
Return a pointer to a new McPairPotential, if possible.
An PairPotential for MD simulation.
MdPairPotential * tryMdSubfactories(const std::string &className, System &system) const
Search subfactories for match to MdPairPotential subclass name.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
McPairPotential * tryMcSubfactories(const std::string &className, System &system) const
Search subfactories for match to McPairPotential subclass name.