Simpatico  v1.10
ddMd/potentials/external/ExternalPotential.h
1 #ifndef DDMD_EXTERNAL_POTENTIAL_H
2 #define DDMD_EXTERNAL_POTENTIAL_H
3 
4 #include <ddMd/potentials/Potential.h> // base class
5 #include <simp/boundary/Boundary.h> // member (typedef)
6 #include <util/global.h>
7 
8 #include <iostream>
9 
10 /*
11 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
12 *
13 * Copyright 2010 - 2017, The Regents of the University of Minnesota
14 * Distributed under the terms of the GNU General Public License.
15 */
16 
17 namespace DdMd
18 {
19 
20  class Simulation;
21  class AtomStorage;
22 
23  using namespace Util;
24  using namespace Simp;
25 
32  {
33 
34  public:
35 
39  ExternalPotential(Simulation& simulation);
40 
45 
54  virtual void associate(Boundary& boundary, AtomStorage& storage);
55 
59  virtual ~ExternalPotential();
60 
62 
63 
67  virtual void setNAtomType(int nAtomType) = 0;
68 
76  virtual double externalEnergy(const Vector& position, int i) const = 0;
77 
85  virtual void getExternalForce(const Vector& position, int type,
86  Vector& force) const = 0;
87 
94  virtual void set(std::string name, double value) = 0;
95 
101  virtual double get(std::string name) const = 0;
102 
106  virtual std::string interactionClassName() const = 0;
107 
109 
110  protected:
111 
115  Simulation& simulation();
116 
120  Boundary& boundary();
121 
125  AtomStorage& storage();
126 
127  private:
128 
129  // Pointer to parent Simulation object.
130  Simulation* simulationPtr_;
131 
132  // Pointer to associated Boundary object.
133  Boundary* boundaryPtr_;
134 
135  // Pointer to associated AtomStorage object.
136  AtomStorage* storagePtr_;
137 
138  };
139 
141  { return *simulationPtr_; }
142 
144  { return *boundaryPtr_; }
145 
147  { return *storagePtr_; }
148 
149 }
150 #endif
A Vector is a Cartesian vector.
Definition: Vector.h:75
Boundary & boundary()
Get the Boundary by reference.
An orthorhombic periodic unit cell.
Calculates external forces and energies for a parent Simulation.
File containing preprocessor macros for error handling.
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
A container for all the atoms and ghost atoms on this processor.
AtomStorage & storage()
Get the AtomStorage by reference.
Simulation & simulation()
Get the parent Simulation by reference.