--- trunk/src/applications/staticProps/NitrileFrequencyMap.cpp 2014/04/30 18:50:45 1994 +++ trunk/src/applications/staticProps/NitrileFrequencyMap.cpp 2015/03/07 21:41:51 2071 @@ -54,8 +54,9 @@ namespace OpenMD { const std::string& filename, const std::string& sele1, int nbins) - : StaticAnalyser(info, filename), selectionScript1_(sele1), - evaluator1_(info), seleMan1_(info), nBins_(nbins), info_(info) { + : StaticAnalyser(info, filename), info_(info), + selectionScript1_(sele1), seleMan1_(info_), evaluator1_(info_), + nBins_(nbins) { setOutputName(getPrefix(filename) + ".freqs"); @@ -100,9 +101,30 @@ namespace OpenMD { EF_ = V3Zero; - if (info_->getSimParams()->haveElectricField()) - EF_ = info_->getSimParams()->getElectricField(); + std::vector ef; + bool efSpec = false; + if (info_->getSimParams()->haveElectricField()) { + efSpec = true; + ef = info_->getSimParams()->getElectricField(); + } + if (info_->getSimParams()->haveUniformField()) { + efSpec = true; + ef = info_->getSimParams()->getUniformField(); + } + if (efSpec) { + if (ef.size() != 3) { + sprintf(painCave.errMsg, + "NitrileFrequencyMap: Incorrect number of parameters specified for uniformField.\n" + "\tthere should be 3 parameters, but %lu were specified.\n", ef.size()); + painCave.isFatal = 1; + simError(); + } + EF_.x() = ef[0]; + EF_.y() = ef[1]; + EF_.z() = ef[2]; + } + excludesForAtom.clear(); excludesForAtom.resize(nAtoms); @@ -141,7 +163,7 @@ namespace OpenMD { Atom* atom2; StuntDouble* sd1; int ii, sdID, molID, sdID2; - RealType li; + RealType li(0.0); RealType sPot, s1, s2; RealType freqShift; std::string name; @@ -205,7 +227,8 @@ namespace OpenMD { sPot = sd1->getSitePotential(); - // Subtract out the contribution from every other site on this molecule: + // Subtract out the contribution from every other site on this + // molecule: for(atom2 = mol->beginAtom(ai2); atom2 != NULL; atom2 = mol->nextAtom(ai2)) {