48#include "applications/dynamicProps/StressCorrFunc.hpp"
52#include "applications/dynamicProps/TimeCorrFunc.hpp"
55#include "utils/Constants.hpp"
56#include "utils/Revision.hpp"
63 StressCorrFunc::StressCorrFunc(
SimInfo* info,
const std::string& filename,
64 const std::string& sele1,
65 const std::string& sele2) :
66 SystemACF<Mat3x3d>(info, filename, sele1, sele2) {
67 setCorrFuncType(
"StressCorrFunc");
68 setOutputName(
getPrefix(dumpFilename_) +
".action");
69 setLabelString(
"Txx\tTxy\tTxz\tTyx\tTyy\tTyz\tTzx\tTzy\tTzz");
72 forceMan_ =
new ForceManager(info_);
75 thermo_ =
new Thermo(info_);
77 action_.resize(nTimeBins_);
78 time_.resize(nTimeBins_);
81 void StressCorrFunc::computeProperty1(
int frame) {
82 forceMan_->calcForces();
83 RealType vol = thermo_->getVolume();
84 RealType pressure = thermo_->getPressure() / Constants::pressureConvert;
89 for (sd = seleMan1_.beginSelected(i); sd != NULL;
90 sd = seleMan1_.nextSelected(i)) {
91 Vector3d r = sd->getPos();
92 Vector3d v = sd->getVel();
93 RealType m = sd->getMass();
95 action_[frame] += m * outProduct(r, v);
98 action_[frame] /= vol;
99 time_[frame] = info_->getSnapshotManager()->getCurrentSnapshot()->getTime();
101 pressure_.add(pressure);
104 Mat3x3d StressCorrFunc::calcCorrVal(
int frame1,
int frame2) {
105 Mat3x3d corrTensor(0.0);
108 RealType pAve = pressure_.getAverage();
110 for (
unsigned int i = 0; i < 3; i++) {
111 for (
unsigned int j = 0; j < 3; j++) {
113 thisTerm = (action_[frame2](i, j) - action_[frame1](i, j) -
114 pAve * (time_[frame2] - time_[frame1]));
116 thisTerm = (action_[frame2](i, j) - action_[frame1](i, j));
118 corrTensor(i, j) += thisTerm * thisTerm;
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::string getPrefix(const std::string &str)