Simpatico  v1.10
MdCoulombPotential.h
1 #ifndef MD_COULOMB_POTENTIAL_H
2 #define MD_COULOMB_POTENTIAL_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2012, David Morse (morse012@umn.edu)
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include <util/param/ParamComposite.h> // base class
12 #include <mcMd/potentials/coulomb/EwaldRSpaceAccumulator.h> // member
13 #include <util/misc/Setable.h> // member template
14 #include <util/space/Tensor.h> // template parameter
15 
16 #include <complex>
17 
18 namespace McMd
19 {
20 
21  using namespace Util;
22 
34  {
35 
36  public:
37 
42 
46  virtual ~MdCoulombPotential();
47 
54  virtual void set(std::string name, double value);
55 
56 
62  virtual double get(std::string name) const;
63 
65 
66 
70  bool hasWaves();
71 
75  virtual void makeWaves() = 0;
76 
82  void unsetWaves();
83 
87  virtual int nWave() const = 0;
88 
90 
92 
96  virtual void addForces() = 0;
97 
101  virtual void computeEnergy() = 0;
102 
106  virtual void unsetEnergy();
107 
113  double kSpaceEnergy();
114 
120  double rSpaceEnergy();
121 
128  double energy();
129 
131 
133 
137  virtual void computeStress() = 0;
138 
142  virtual void unsetStress();
143 
149  Tensor kSpaceStress();
150 
156  Tensor rSpaceStress();
157 
164  Tensor stress();
165 
171  void computeStress(Tensor& stress);
172 
176  void computeStress(Vector& pressures);
177 
181  double pressure();
182 
188  void computeStress(double& pressure);
189 
191 
192  protected:
193 
196 
199 
202 
205 
208  bool hasWaves_;
209 
210  };
211 
212  /*
213  * Are wavevectors and k-space potential up to date?
214  */
215  inline
217  { return hasWaves_; }
218 
219 }
220 #endif
Coulomb potential for an Md simulation.
Setable< double > kSpaceEnergy_
K-space part of Coulomb energy.
A Vector is a Cartesian vector.
Definition: Vector.h:75
bool isInitialized_
Have parameters been set?
A Tensor represents a Cartesian tensor.
Definition: Tensor.h:32
Setable< Tensor > kSpaceStress_
K-space part of Coulomb stress.
EwaldRSpaceAccumulator rSpaceAccumulator_
Short-range real space energy and stress contributions.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Utility class to store r-space Coulomb energy and stress.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
bool hasWaves_
Are waves and k-space potential up to date? Unset if boundary or parameters change.
An object that can read multiple parameters from file.
bool hasWaves()
Are wavevectors and k-space influence function up to date?