Simpatico  v1.10
EwaldRSpaceAccumulator.h
1 #ifndef MD_EWALD_RSPACE_ACCUMULATOR_h
2 #define MD_EWALD_RSPACE_ACCUMULATOR_h
3 
4 
5 #include <util/space/Tensor.h>
6 #include <util/misc/Setable.h>
7 
8 namespace McMd
9 {
10 
11  class PairPotential;
12 
13  using namespace Util;
14 
21  {
22  public:
23 
24  /*
25  * Constructor.
26  */
28  :rSpaceEnergy_(),
29  rSpaceStress_(),
30  pairPotentialPtr_(0)
31  {
32  rSpaceEnergy_.unset();
33  rSpaceStress_.unset();
34  }
35 
36  void setPairPotential(PairPotential& potential)
37  { pairPotentialPtr_ = &potential; }
38 
42  bool isSetEnergy() const
43  { return rSpaceEnergy_.isSet(); }
44 
48  bool isSetStress() const
49  { return rSpaceStress_.isSet(); }
50 
54  double rSpaceEnergy();
55 
59  Tensor rSpaceStress();
60 
61  private:
62 
63  Setable<double> rSpaceEnergy_;
64 
65  Setable<Tensor> rSpaceStress_;
66 
67  PairPotential* pairPotentialPtr_;
68 
69  // friend:
70 
71  template <typename T>
72  friend class MdEwaldPairPotentialImpl;
73 
74  };
75 }
76 #endif
Implementation of a pair potential for a charged system.
A Tensor represents a Cartesian tensor.
Definition: Tensor.h:32
bool isSetEnergy() const
Is the r-space energy set?
Utility classes for scientific computation.
Definition: accumulators.mod:1
Utility class to store r-space Coulomb energy and stress.
bool isSetStress() const
Is the r-space stress set?
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
Interface for a Pair Potential.