ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/staticProps/NitrileFrequencyMap.cpp
(Generate patch)

Comparing trunk/src/applications/staticProps/NitrileFrequencyMap.cpp (file contents):
Revision 1994 by gezelter, Wed Apr 30 18:50:45 2014 UTC vs.
Revision 2071 by gezelter, Sat Mar 7 21:41:51 2015 UTC

# Line 54 | Line 54 | namespace OpenMD {
54                                             const std::string& filename,
55                                             const std::string& sele1,
56                                             int nbins)
57 <    : StaticAnalyser(info, filename), selectionScript1_(sele1),
58 <      evaluator1_(info), seleMan1_(info), nBins_(nbins), info_(info) {
57 >    : StaticAnalyser(info, filename), info_(info),
58 >      selectionScript1_(sele1), seleMan1_(info_), evaluator1_(info_),
59 >      nBins_(nbins) {
60      
61      setOutputName(getPrefix(filename) + ".freqs");
62      
# Line 100 | Line 101 | namespace OpenMD {
101  
102      EF_ = V3Zero;
103  
104 <    if (info_->getSimParams()->haveElectricField())
105 <      EF_ = info_->getSimParams()->getElectricField();
104 >    std::vector<RealType> ef;
105 >    bool efSpec = false;
106  
107 +    if (info_->getSimParams()->haveElectricField()) {
108 +      efSpec = true;
109 +      ef = info_->getSimParams()->getElectricField();            
110 +    }  
111 +    if (info_->getSimParams()->haveUniformField()) {
112 +      efSpec = true;
113 +      ef = info_->getSimParams()->getUniformField();
114 +    }  
115 +    if (efSpec) {
116 +      if (ef.size() != 3) {
117 +        sprintf(painCave.errMsg,
118 +                "NitrileFrequencyMap: Incorrect number of parameters specified for uniformField.\n"
119 +                "\tthere should be 3 parameters, but %lu were specified.\n", ef.size());
120 +        painCave.isFatal = 1;
121 +        simError();      
122 +      }
123 +      EF_.x() = ef[0];
124 +      EF_.y() = ef[1];
125 +      EF_.z() = ef[2];
126 +    }
127 +
128      excludesForAtom.clear();
129      excludesForAtom.resize(nAtoms);
130  
# Line 141 | Line 163 | namespace OpenMD {
163      Atom* atom2;
164      StuntDouble* sd1;
165      int ii, sdID, molID, sdID2;
166 <    RealType li;
166 >    RealType li(0.0);
167      RealType sPot, s1, s2;
168      RealType freqShift;
169      std::string name;
# Line 205 | Line 227 | namespace OpenMD {
227  
228          sPot = sd1->getSitePotential();
229          
230 <        // Subtract out the contribution from every other site on this molecule:
230 >        // Subtract out the contribution from every other site on this
231 >        // molecule:
232          for(atom2 = mol->beginAtom(ai2); atom2 != NULL;
233              atom2 = mol->nextAtom(ai2)) {  
234  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines