45#include "applications/dynamicProps/WCorrFunc.hpp"
47#include "types/FixedChargeAdapter.hpp"
48#include "types/FluctuatingChargeAdapter.hpp"
51 WCorrFunc::WCorrFunc(
SimInfo* info,
const std::string& filename,
52 const std::string& sele1,
const std::string& sele2) :
53 ObjectACF<RealType>(info, filename, sele1, sele2) {
54 setCorrFuncType(
" Charge Velocity Correlation Function");
55 setOutputName(
getPrefix(dumpFilename_) +
".wcorr");
56 setLabelString(
"<w(0)w(t)>");
57 charge_velocities_.resize(nFrames_);
60 int WCorrFunc::computeProperty1(
int frame,
StuntDouble* sd) {
61 charge_velocities_[frame].push_back(sd->
getFlucQVel());
62 return charge_velocities_[frame].size() - 1;
65 RealType WCorrFunc::calcCorrVal(
int frame1,
int frame2,
int id1,
int id2) {
67 charge_velocities_[frame1][id1] * charge_velocities_[frame2][id2];
81 if (!fqa.isFluctuatingCharge()) {
82 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
83 "WCorrFunc::validateSelection Error: selection "
85 "\t is not a fluq object\n",
AtomType * getAtomType()
Returns the AtomType of this Atom.
AtomType is what OpenMD looks to for unchanging data about an atom.
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...
"Don't move, or you're dead! Stand up! Captain, we've got them!"
virtual std::string getType()=0
Returns the name of this stuntDouble.
int getGlobalIndex()
Returns the global index of this stuntDouble.
RealType getFlucQVel()
Returns the current charge velocity 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)