Simpatico  v1.10
ddMd/potentials/angle/AnglePotential.h
1 #ifndef DDMD_ANGLE_POTENTIAL_H
2 #define DDMD_ANGLE_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 
30  class AnglePotential : public Potential
31  {
32 
33  public:
34 
43  AnglePotential(Simulation& simulation);
44 
49 
53  ~AnglePotential();
54 
63  void associate(Boundary& boundary, GroupStorage<3>& storage);
64 
66 
67 
71  virtual void setNAngleType(int nAngleType) = 0;
72 
79  double angleEnergy(double cosTheta, int type) const;
80 
90  void angleForce(const Vector& R1, const Vector& R2,
91  Vector& F1, Vector& F2, int type) const;
92 
100  virtual void set(std::string name, int type, double value) = 0;
101 
108  virtual double get(std::string name, int type) const = 0;
109 
113  virtual std::string interactionClassName() const = 0;
114 
116 
117  protected:
118 
122  Boundary& boundary() const;
123 
127  GroupStorage<3>& storage() const;
128 
129  private:
130 
131  // Pointer to associated Boundary object.
132  Boundary* boundaryPtr_;
133 
134  // Pointer to associated GroupStorage<3> object.
135  GroupStorage<3>* storagePtr_;
136 
137  };
138 
139  // Get boundary by reference.
141  { return *boundaryPtr_; }
142 
143  // Get bond storage by reference.
145  { return *storagePtr_; }
146 
147 }
148 #endif
A Vector is a Cartesian vector.
Definition: Vector.h:75
Abstract base class for computation of angle force and energies.
An orthorhombic periodic unit cell.
GroupStorage< 3 > & storage() const
Return bond storage by reference.
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
Boundary & boundary() const
Return boundary by reference.