Simpatico  v1.10
GroupRebridgeBase.h
1 #ifndef MCMD_GROUP_REBRIDGE_BASE_H
2 #define MCMD_GROUP_REBRIDGE_BASE_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 <mcMd/mcMoves/SystemMove.h> // base class
12 #include <mcMd/mcSimulation/McSystem.h>
13 #ifdef SIMP_ANGLE
14 #include <mcMd/potentials/angle/AnglePotential.h>
15 #endif
16 #include <simp/boundary/Boundary.h>
17 #include <util/space/Vector.h>
18 
19 namespace McMd
20 {
21 
22  class Atom;
23  class McSystem;
24 
25  using namespace Util;
26  using namespace Simp;
27 
33  class GroupRebridgeBase : public SystemMove
34  {
35 
36  public:
37 
41  GroupRebridgeBase(McSystem& system);
42 
46  virtual ~GroupRebridgeBase();
47 
58  void tetraEnergy(Atom* aPtr, Atom* bPtr, Atom* cPtr, Atom* dPtr,
59  int bondType, double &energy);
60 
61  #ifdef SIMP_ANGLE
62 
72  double angleEnergy(const Atom &a, const Atom &b, const Atom &c, int type);
73  #endif
74 
87  void octaEnergy(Atom* aPtr, Atom* bPtr, Atom* cPtr, Atom* dPtr,
88  Atom* mPtr, Atom* nPtr, int bondType, double &energy);
89 
90  };
91 
92  #ifdef SIMP_ANGLE
93  /*
94  */
95  inline
96  double GroupRebridgeBase::angleEnergy(const Atom &a, const Atom &b,
97  const Atom &c, int type)
98  {
99  Vector r1, r2;
100  double cosTheta;
101  system().boundary().distanceSq(b.position(), a.position(), r1);
102  system().boundary().distanceSq(c.position(), b.position(), r2);
103  r1 /= r1.abs();
104  r2 /= r2.abs();
105  cosTheta = r1.dot(r2);
106  return system().anglePotential().energy(cosTheta, type);
107  }
108  #endif
109 
110 }
111 #endif
A System for use in a Markov chain Monte Carlo simulation.
Definition: McSystem.h:52
A Vector is a Cartesian vector.
Definition: Vector.h:75
double dot(const Vector &v) const
Return dot product of this vector and vector v.
Definition: Vector.h:632
Classes used by all simpatico molecular simulations.
A point particle within a Molecule.
Utility classes for scientific computation.
Definition: accumulators.mod:1
An McMove that acts on one McSystem.
Definition: SystemMove.h:28
double angleEnergy(const Atom &a, const Atom &b, const Atom &c, int type)
Calculate the angle energy for a bead triple.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
double abs() const
Return absolute magnitude of this vector.
Definition: Vector.h:625
const Vector & position() const
Get the position Vector by const reference.
Base class for rebridging a group of atoms forming a tetrahedron.