45#include "applications/dynamicProps/BondCorrFunc.hpp"
48 BondCorrFunc::BondCorrFunc(SimInfo* info,
const std::string& filename,
49 const std::string& sele1,
50 const std::string& sele2) :
51 AutoCorrFunc<RealType>(info, filename, sele1, sele2) {
52 setCorrFuncType(
"Bond Correlation Function");
53 setOutputName(
getPrefix(dumpFilename_) +
".bondcorr");
55 this->autoCorrFunc_ =
true;
56 this->doSystemProperties_ =
false;
57 this->doMolecularProperties_ =
false;
58 this->doObjectProperties_ =
false;
59 this->doBondProperties_ =
true;
61 delta_.resize(nFrames_);
64 int BondCorrFunc::computeProperty1(
int frame, Bond* bond) {
65 RealType re = bond->getBondType()->getEquilibriumBondLength();
66 RealType r = bond->getValue();
68 delta_[frame].push_back(r - re);
69 return delta_[frame].size() - 1;
72 RealType BondCorrFunc::calcCorrVal(
int frame1,
int frame2,
int id1,
int id2) {
73 return delta_[frame1][id1] * delta_[frame2][id2];
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::string getPrefix(const std::string &str)