8 #include "StressCalculator.h" 9 #include <util/space/Vector.h> 20 : createsStress_(createsStress)
27 {
return createsStress_; }
43 if (!stress_.isSet()) {
48 stress = stress_.value();
59 if (!stress_.isSet()) {
65 pressures[i] = stress_.value()(i, i);
77 if (!stress_.isSet()) {
84 pressure += stress_.value()(i, i);
86 pressure = pressure/double(Dimension);
const int Dimension
Dimensionality of space.
A Vector is a Cartesian vector.
A Tensor represents a Cartesian tensor.
Utility classes for scientific computation.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
bool createsStress() const
Return false if subclass does not generate stress.
virtual void unsetStress()
Mark the stress as unknown.
virtual void computeStress()
Compute and store the stress tensor.
StressCalculator(bool createsStress=true)
Constructor (protected to prevent direct instantiation).