45#include "applications/dynamicProps/ThetaCorrFunc.hpp"
48 ThetaCorrFunc::ThetaCorrFunc(SimInfo* info,
const std::string& filename,
49 const std::string& sele1,
50 const std::string& sele2) :
51 ObjectACF<RealType>(info, filename, sele1, sele2) {
52 setCorrFuncType(
"ThetaCorrFunc");
53 setOutputName(
getPrefix(dumpFilename_) +
".tcorr");
54 setLabelString(
"Cos(theta)");
55 coords_.resize(nFrames_);
59 reader_->setNeedCOMprops(ncp);
62 int ThetaCorrFunc::computeProperty1(
int frame, StuntDouble* sd) {
63 coords_[frame].push_back(sd->getPos() - sd->getCOM());
64 return coords_[frame].size() - 1;
67 RealType ThetaCorrFunc::calcCorrVal(
int frame1,
int frame2,
int id1,
69 Vector3d a = coords_[frame1][id1];
70 Vector3d b = coords_[frame2][id2];
71 return dot(a, b) / (a.length() * b.length());
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
Real dot(const DynamicVector< Real > &v1, const DynamicVector< Real > &v2)
Returns the dot product of two DynamicVectors.
std::string getPrefix(const std::string &str)