Simpatico  v1.10
McSystemInterface.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 "McSystemInterface.h"
9 #include <mcMd/mcSimulation/McSystem.h>
10 
11 namespace McMd
12 {
13 
14  using namespace Util;
15 
16  /*
17  * Constructor.
18  *
19  * \param system parent McSystem
20  */
22  : SystemInterface(mcSystem)
23  #ifndef SIMP_NOPAIR
24  , pairPotentialPtr_(0)
25  #endif
26  #ifdef SIMP_BOND
27  , bondPotentialPtr_(0)
28  #endif
29  #ifdef SIMP_ANGLE
30  , anglePotentialPtr_(0)
31  #endif
32  #ifdef SIMP_DIHEDRAL
33  , dihedralPotentialPtr_(0)
34  #endif
35  #ifdef SIMP_EXTERNAL
36  , externalPotentialPtr_(0)
37  #endif
38  {
39  #ifndef SIMP_NOPAIR
40  pairPotentialPtr_ = &mcSystem.pairPotential();
41  #endif
42  #ifdef SIMP_BOND
43  if (hasBonds()) {
44  bondPotentialPtr_ = &mcSystem.bondPotential();
45  }
46  #endif
47  #ifdef SIMP_ANGLE
48  if (hasAngles()) {
49  anglePotentialPtr_ = &mcSystem.anglePotential();
50  }
51  #endif
52  #ifdef SIMP_DIHEDRAL
53  if (hasDihedrals()) {
54  dihedralPotentialPtr_ = &mcSystem.dihedralPotential();
55  }
56  #endif
57  #ifdef SIMP_EXTERNAL
58  if (hasExternal()) {
59  externalPotentialPtr_ = &mcSystem.externalPotential();
60  }
61  #endif
62  }
63 
64  /*
65  * Destructor.
66  */
68  {}
69 
70 }
A System for use in a Markov chain Monte Carlo simulation.
Definition: McSystem.h:52
bool hasExternal() const
Does an external potential exist?
An interface to a System.
bool hasBonds() const
Does a bond potential exist?
BondPotential & bondPotential() const
Return the BondPotential by reference.
Definition: McSystem.h:405
bool hasAngles() const
Does an angle potential exist?
virtual ~McSystemInterface()
Destructor.
bool hasDihedrals() const
Does a dihedral potential exist?
ExternalPotential & externalPotential() const
Return ExternalPotential by reference.
Definition: McSystem.h:473
Utility classes for scientific computation.
Definition: accumulators.mod:1
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
Definition: McSystem.h:388
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
McSystemInterface(McSystem &mcSystem)
Constructor.
AnglePotential & anglePotential() const
Return AnglePotential by reference.
Definition: McSystem.h:422
DihedralPotential & dihedralPotential() const
Return the DihedralPotential by reference.
Definition: McSystem.h:439