45#include "applications/dynamicProps/StressCorrFunc.hpp"
49#include "applications/dynamicProps/TimeCorrFunc.hpp"
52#include "utils/Constants.hpp"
53#include "utils/Revision.hpp"
60 StressCorrFunc::StressCorrFunc(
SimInfo* info,
const std::string& filename,
61 const std::string& sele1,
62 const std::string& sele2) :
64 setCorrFuncType(
"StressCorrFunc");
65 setOutputName(
getPrefix(dumpFilename_) +
".action");
66 setLabelString(
"Txx\tTxy\tTxz\tTyx\tTyy\tTyz\tTzx\tTzy\tTzz");
72 thermo_ =
new Thermo(info_);
74 action_.resize(nTimeBins_);
75 time_.resize(nTimeBins_);
78 void StressCorrFunc::computeProperty1(
int frame) {
79 forceMan_->calcForces();
80 RealType vol = thermo_->getVolume();
81 RealType pressure = thermo_->getPressure() / Constants::pressureConvert;
92 action_[frame] += m * outProduct(r, v);
95 action_[frame] /= vol;
98 pressure_.
add(pressure);
101 Mat3x3d StressCorrFunc::calcCorrVal(
int frame1,
int frame2) {
107 for (
unsigned int i = 0; i < 3; i++) {
108 for (
unsigned int j = 0; j < 3; j++) {
110 thisTerm = (action_[frame2](i, j) - action_[frame1](i, j) -
111 pAve * (time_[frame2] - time_[frame1]));
113 thisTerm = (action_[frame2](i, j) - action_[frame1](i, j));
115 corrTensor(i, j) += thisTerm * thisTerm;
void getAverage(ResultType &ret)
compute the Mean
virtual void add(ElementType const &val)
Accumulate another value.
ForceManager is responsible for calculating both the short range (bonded) interactions and long range...
StuntDouble * nextSelected(int &i)
Finds the next selected StuntDouble in the selection.
StuntDouble * beginSelected(int &i)
Finds the first selected StuntDouble in the selection.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
SnapshotManager * getSnapshotManager()
Returns the snapshot manager.
Snapshot * getCurrentSnapshot()
Returns the pointer of current snapshot.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
Vector3d getVel()
Returns the current velocity of this stuntDouble.
RealType getMass()
Returns the mass of this stuntDouble.
Vector3d getPos()
Returns the current position of this stuntDouble.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::string getPrefix(const std::string &str)