44 |
|
* |
45 |
|
* Created by Charles F. Vardeman II on 11/26/05. |
46 |
|
* @author Charles F. Vardeman II |
47 |
< |
* @version $Id: RhoZ.cpp,v 1.4 2006-03-07 16:43:52 gezelter Exp $ |
47 |
> |
* @version $Id: RhoZ.cpp,v 1.6 2006-10-18 21:58:47 gezelter Exp $ |
48 |
|
* |
49 |
|
*/ |
50 |
|
|
58 |
|
#include "primitives/Molecule.hpp" |
59 |
|
namespace oopse { |
60 |
|
|
61 |
< |
RhoZ::RhoZ(SimInfo* info, const std::string& filename, const std::string& sele, double len, int nrbins) |
61 |
> |
RhoZ::RhoZ(SimInfo* info, const std::string& filename, const std::string& sele, RealType len, int nrbins) |
62 |
|
: StaticAnalyser(info, filename), selectionScript_(sele), evaluator_(info), seleMan_(info), len_(len), nRBins_(nrbins){ |
63 |
|
|
64 |
|
evaluator_.loadScriptString(sele); |
91 |
|
reader.readFrame(istep); |
92 |
|
currentSnapshot_ = info_->getSnapshotManager()->getCurrentSnapshot(); |
93 |
|
|
94 |
< |
double sliceVolume = currentSnapshot_->getVolume() /nRBins_; |
94 |
> |
RealType sliceVolume = currentSnapshot_->getVolume() /nRBins_; |
95 |
|
//assume simulation box will never change |
96 |
|
//Mat3x3d hmat = currentSnapshot_->getHmat(); |
97 |
< |
double halfBoxZ_ = len_ / 2.0; |
97 |
> |
RealType halfBoxZ_ = len_ / 2.0; |
98 |
|
|
99 |
|
if (evaluator_.isDynamic()) { |
100 |
|
seleMan_.setSelectionSet(evaluator_.evaluate()); |
103 |
|
//wrap the stuntdoubles into a cell |
104 |
|
for (sd = seleMan_.beginSelected(i); sd != NULL; sd = seleMan_.nextSelected(i)) { |
105 |
|
Vector3d pos = sd->getPos(); |
106 |
< |
currentSnapshot_->wrapVector(pos); |
106 |
> |
if (usePeriodicBoundaryConditions_) |
107 |
> |
currentSnapshot_->wrapVector(pos); |
108 |
|
sd->setPos(pos); |
109 |
|
} |
110 |
|
|
119 |
|
|
120 |
|
//loop over the slices to calculate the densities |
121 |
|
for (i = 0; i < nRBins_; i++) { |
122 |
< |
double totalMass = 0; |
122 |
> |
RealType totalMass = 0; |
123 |
|
for (int k = 0; k < sliceSDLists_[i].size(); ++k) { |
124 |
|
totalMass += sliceSDLists_[i][k]->getMass(); |
125 |
|
} |
141 |
|
rdfStream << "#selection: (" << selectionScript_ << ")\n"; |
142 |
|
rdfStream << "#z\tdensity\n"; |
143 |
|
for (int i = 0; i < density_.size(); ++i) { |
144 |
< |
double r = deltaR_ * (i + 0.5); |
144 |
> |
RealType r = deltaR_ * (i + 0.5); |
145 |
|
rdfStream << r << "\t" << 1.660535*density_[i]/nProcessed_ << "\n"; |
146 |
|
} |
147 |
|
|