Simpatico  v1.10
MdStressAutoCorr.cpp
1 /*
2 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 
9 #include "MdStressAutoCorr.h" // class header
10 
11 namespace McMd
12 {
13 
14  /*
15  * Constructor.
16  */
18  : StressAutoCorr<MdSystem>(system)
19  { setClassName("MdStressAutoCorr"); }
20 
21  /*
22  * Destructor.
23  */
25  {}
26 
27  /*
28  * Compute stress.
29  */
31  {
32  Tensor virial;
33  Tensor kinetic;
34  system().computeVirialStress(virial);
35  system().computeKineticStress(kinetic);
36  stress.add(virial, kinetic);
37  }
38 
39 }
void computeKineticStress(T &stress) const
Compute kinetic stress mvv, arising from velocities.
Compute stress autocorrelation for an isotropic system.
~MdStressAutoCorr()
Destructor.
void computeStress(Tensor &stress)
Compute total stress tensor.
MdSystem & system()
Return reference to parent system.
A Tensor represents a Cartesian tensor.
Definition: Tensor.h:32
Tensor & add(const Tensor &t1, const Tensor &t2)
Add tensors t1 and t2.
Definition: Tensor.h:567
void computeVirialStress(T &stress) const
Compute total virial stress, from all forces.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
void setClassName(const char *className)
Set class name string.
MdStressAutoCorr(MdSystem &system)
Constructor.
A System for Molecular Dynamics simulation.
Definition: MdSystem.h:68