Simpatico  v1.10
ddMd/potentials/bond/BondPotential.h
1 #ifndef DDMD_BOND_POTENTIAL_H
2 #define DDMD_BOND_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 BondPotential : public Potential
31  {
32 
33  public:
34 
42  BondPotential(Simulation& simulation);
43 
49  BondPotential();
50 
54  ~BondPotential();
55 
65  void associate(Boundary& boundary, GroupStorage<2>& storage);
66 
78  virtual void setNBondType(int nBondType) = 0;
79 
81 
82 
89  virtual double bondEnergy(double rsq, int bondTypeId) const = 0;
90 
97  virtual double bondForceOverR(double rsq, int bondTypeId) const = 0;
98 
111  virtual double
112  randomBondLength(Random* random, double beta, int bondTypeId) const = 0;
113 
121  virtual void set(std::string name, int bondTypeId, double value) = 0;
122 
129  virtual double get(std::string name, int bondTypeId) const = 0;
130 
134  virtual std::string interactionClassName() const = 0;
135 
137 
138  protected:
139 
143  Boundary& boundary() const;
144 
148  GroupStorage<2>& storage() const;
149 
150  private:
151 
152  // Pointer to associated Boundary object.
153  Boundary* boundaryPtr_;
154 
155  // Pointer to associated GroupStorage<2> object.
156  GroupStorage<2>* storagePtr_;
157 
158  };
159 
161  { return *boundaryPtr_; }
162 
164  { return *storagePtr_; }
165 
166 }
167 #endif
An orthorhombic periodic unit cell.
Abstract base class for computing bond forces and energies.
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
GroupStorage< 2 > & storage() const
Return bond storage by reference.
Boundary & boundary() const
Return boundary by reference.
Random number generator.
Definition: Random.h:46