36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
40 |
< |
* |
39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
> |
* [4] , Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). * |
41 |
|
*/ |
42 |
|
|
43 |
|
/* Calculates Rho(theta) */ |
44 |
|
|
45 |
|
#include <algorithm> |
46 |
< |
#include <fstream> |
46 |
> |
#include <fstream> |
47 |
|
#include "applications/staticProps/pAngle.hpp" |
48 |
|
#include "utils/simError.h" |
49 |
|
#include "io/DumpReader.hpp" |
50 |
|
#include "primitives/Molecule.hpp" |
51 |
+ |
#include "brains/Thermo.hpp" |
52 |
+ |
|
53 |
|
namespace OpenMD { |
54 |
|
|
55 |
|
pAngle::pAngle(SimInfo* info, const std::string& filename, |
76 |
|
Molecule::RigidBodyIterator rbIter; |
77 |
|
int i; |
78 |
|
|
79 |
+ |
Thermo thermo(info_); |
80 |
|
DumpReader reader(info_, dumpFilename_); |
81 |
|
int nFrames = reader.getNFrames(); |
82 |
|
nProcessed_ = nFrames/step_; |
97 |
|
} |
98 |
|
} |
99 |
|
|
100 |
< |
Vector3d CenterOfMass = info_->getCom(); |
100 |
> |
Vector3d CenterOfMass = thermo.getCom(); |
101 |
|
|
102 |
|
if (evaluator_.isDynamic()) { |
103 |
|
seleMan_.setSelectionSet(evaluator_.evaluate()); |
104 |
|
} |
105 |
|
|
103 |
– |
|
104 |
– |
int runningTot = 0; |
106 |
|
for (sd = seleMan_.beginSelected(i); sd != NULL; |
107 |
|
sd = seleMan_.nextSelected(i)) { |
108 |
< |
|
108 |
> |
|
109 |
|
Vector3d pos = sd->getPos(); |
110 |
|
|
111 |
|
Vector3d r1 = CenterOfMass - pos; |
133 |
|
void pAngle::processHistogram() { |
134 |
|
|
135 |
|
int atot = 0; |
136 |
< |
for(int i = 0; i < count_.size(); ++i) |
136 |
> |
for(unsigned int i = 0; i < count_.size(); ++i) |
137 |
|
atot += count_[i]; |
138 |
|
|
139 |
< |
for(int i = 0; i < count_.size(); ++i) { |
140 |
< |
histogram_[i] = double(count_[i]) / double(atot); |
139 |
> |
for(unsigned int i = 0; i < count_.size(); ++i) { |
140 |
> |
histogram_[i] = double(count_[i] / double(atot)); |
141 |
|
} |
142 |
|
} |
143 |
|
|
151 |
|
rdfStream << "#selection: (" << selectionScript_ << ")\n"; |
152 |
|
rdfStream << "#cos(theta)\tp(cos(theta))\n"; |
153 |
|
RealType dct = 2.0 / histogram_.size(); |
154 |
< |
for (int i = 0; i < histogram_.size(); ++i) { |
154 |
> |
for (unsigned int i = 0; i < histogram_.size(); ++i) { |
155 |
|
RealType ct = -1.0 + (2.0 * i + 1) / (histogram_.size()); |
156 |
|
rdfStream << ct << "\t" << histogram_[i]/dct << "\n"; |
157 |
|
} |