Simpatico  v1.10
mcMd/potentials/dihedral/DihedralPotential.h
1 #ifndef MCMD_DIHEDRAL_POTENTIAL_H
2 #define MCMD_DIHEDRAL_POTENTIAL_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include <util/param/ParamComposite.h>
12 #include <mcMd/potentials/misc/EnergyCalculator.h> // base class
13 #include <mcMd/potentials/misc/StressCalculator.h> // base class
14 
15 #include <string>
16 
17 namespace Util
18 {
19  class Vector;
20  class Tensor;
21 }
22 
23 namespace McMd
24 {
25 
26  using namespace Util;
27 
28  class Atom;
29 
36  public EnergyCalculator, public StressCalculator
37 
38  {
39 
40  public:
41 
46 
50  virtual ~DihedralPotential();
51 
53 
54 
69  virtual
70  double energy(const Vector& R1, const Vector& R2, const Vector& R3,
71  int type) const = 0;
72 
84  virtual
85  void force(const Vector& R1, const Vector& R2, const Vector& R3,
86  Vector& F1, Vector& F2, Vector& F3, int type) const = 0;
87 
95  virtual void set(std::string name, int type, double value) = 0;
96 
104  virtual double get(std::string name, int type) const = 0;
105 
109  virtual std::string interactionClassName() const = 0;
110 
112 
114 
118  virtual void addForces() = 0;
119 
130  virtual double atomEnergy(const Atom& atom) const
131  {
132  UTIL_THROW("Unimplemented method");
133  return 0.0; // Never reached, but avoids compiler warning.
134  }
135 
136  // Prevent hiding of inherited function energy();
137  using EnergyCalculator::energy;
138 
140  };
141 
142 }
143 #endif
A Vector is a Cartesian vector.
Definition: Vector.h:75
Interface for a Dihedral Potential.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Definition: global.h:51
Interface for a class that calculates a total energy.
A point particle within a Molecule.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
An object that can read multiple parameters from file.
Interface for a stress calculator.
virtual double atomEnergy(const Atom &atom) const
Compute and return the dihedral potential energy for one Atom.