Simpatico  v1.10
ddMd/potentials/dihedral/DihedralPotential.h
1 #ifndef DDMD_DIHEDRAL_POTENTIAL_H
2 #define DDMD_DIHEDRAL_POTENTIAL_H
3 
4 #include <ddMd/potentials/Potential.h> // base class
5 #include <simp/boundary/Boundary.h> // typedef
6 
7 #include <iostream>
8 
9 /*
10 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
11 *
12 * Copyright 2010 - 2017, The Regents of the University of Minnesota
13 * Distributed under the terms of the GNU General Public License.
14 */
15 
16 namespace DdMd
17 {
18 
19  class Simulation;
20  template <int N> class GroupStorage;
21 
22  using namespace Util;
23  using namespace Simp;
24 
31  {
32 
33  public:
34 
43  DihedralPotential(Simulation& simulation);
44 
49 
54 
63  void associate(Boundary& boundary, GroupStorage<4>& storage);
64 
66 
67 
71  virtual void setNDihedralType(int nDihedralType) = 0;
72 
87  virtual double
88  dihedralEnergy(const Vector& R1, const Vector& R2, const Vector& R3,
89  int type) const = 0;
90 
103  virtual void
104  dihedralForce(const Vector& R1, const Vector& R2, const Vector& R3,
105  Vector& F1, Vector& F2, Vector& F3, int type) const = 0;
106 
114  virtual void set(std::string name, int type, double value) = 0;
115 
122  virtual double get(std::string name, int type) const = 0;
123 
127  virtual std::string interactionClassName() const = 0;
128 
130 
131  protected:
132 
136  Boundary& boundary() const;
137 
141  GroupStorage<4>& storage() const;
142 
143  private:
144 
145  // Pointer to associated Boundary object.
146  Boundary* boundaryPtr_;
147 
148  // Pointer to associated GroupStorage<4> object.
149  GroupStorage<4>* storagePtr_;
150 
151  };
152 
153  // Get boundary by reference.
155  { return *boundaryPtr_; }
156 
157  // Get bond storage by reference.
159  { return *storagePtr_; }
160 
161 }
162 #endif
Boundary & boundary() const
Return boundary by reference.
A Vector is a Cartesian vector.
Definition: Vector.h:75
GroupStorage< 4 > & storage() const
Return bond storage by reference.
An orthorhombic periodic unit cell.
Parallel domain decomposition (DD) MD simulation.
Classes used by all simpatico molecular simulations.
Main object for a domain-decomposition MD simulation.
A Potential represents a potential energy contribution.
Definition: Potential.h:28
Utility classes for scientific computation.
Definition: accumulators.mod:1
Abstract base class for computing dihedral forces and energies.