Simpatico  v1.10
StressCalculator.h
1 #ifndef MCMD_STRESS_CALCULATOR_H
2 #define MCMD_STRESS_CALCULATOR_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 <util/space/Tensor.h>
12 #include <util/misc/Setable.h>
13 
14 namespace Util {
15  class Vector;
16 }
17 
18 namespace McMd
19 {
20 
21  using namespace Util;
22 
29  {
30 
31  public:
32 
40  virtual void computeStress()
41  { UTIL_THROW("Unimplemented computeStress function"); }
42 
46  virtual void unsetStress();
47 
56  void computeStress(Tensor& stress);
57 
66  void computeStress(Vector& pressures);
67 
76  void computeStress(double& pressure);
77 
81  bool createsStress() const;
82 
83  protected:
84 
85  // Setable value of stress tensor.
86  Setable<Tensor> stress_;
87 
93  StressCalculator(bool createsStress = true);
94 
95  private:
96 
98  bool createsStress_;
99 
100  };
101 
102 }
103 #endif
A Vector is a Cartesian vector.
Definition: Vector.h:75
Template for a value that can be set or declared null (i.e., unknown).
Definition: Setable.h:38
A Tensor represents a Cartesian tensor.
Definition: Tensor.h:32
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Definition: global.h:51
Utility classes for scientific computation.
Definition: accumulators.mod:1
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
Interface for a stress calculator.
virtual void computeStress()
Compute and store the stress tensor.