105 |
|
|
106 |
|
Vector3d pos1 = sd1->getPos(); |
107 |
|
Vector3d pos2 = sd2->getPos(); |
108 |
< |
Vector3d r12 = pos1 - pos2; |
108 |
> |
Vector3d r12 = pos2 - pos1; |
109 |
|
currentSnapshot_->wrapVector(r12); |
110 |
|
|
111 |
|
double distance = r12.length(); |
127 |
|
rdfStream << "#radial distribution function\n"; |
128 |
|
rdfStream << "#selection1: (" << selectionScript1_ << ")\t"; |
129 |
|
rdfStream << "selection2: (" << selectionScript2_ << ")\n"; |
130 |
< |
rdfStream << "#r\tcorrValue\n"; |
130 |
> |
rdfStream << "#nRBins = " << nRBins_ << "\t maxLen = " << len_ << "deltaR = " << deltaR_ <<"\n"; |
131 |
> |
rdfStream << "#nAngleBins =" << nAngleBins_ << "deltaCosAngle = " << deltaCosAngle_ << "\n"; |
132 |
|
for (int i = 0; i < avgGofr_.size(); ++i) { |
133 |
|
double r = deltaR_ * (i + 0.5); |
134 |
|
|
135 |
|
for(int j = 0; j < avgGofr_[i].size(); ++j) { |
136 |
|
double cosAngle = -1.0 + (j + 0.5)*deltaCosAngle_; |
137 |
< |
rdfStream << r << "\t" << cosAngle << "\t" << avgGofr_[i][j]/nProcessed_ << "\n"; |
137 |
> |
rdfStream << avgGofr_[i][j]/nProcessed_ << "\t"; |
138 |
|
} |
139 |
+ |
|
140 |
+ |
rdfStream << "\n"; |
141 |
|
} |
142 |
|
|
143 |
|
} else { |
144 |
< |
|
145 |
< |
|
144 |
> |
sprintf(painCave.errMsg, "GofRAngle: unable to open %s\n", outputFilename_.c_str()); |
145 |
> |
painCave.isFatal = 1; |
146 |
> |
simError(); |
147 |
|
} |
148 |
|
|
149 |
|
rdfStream.close(); |
152 |
|
double GofRTheta::evaluateAngle(StuntDouble* sd1, StuntDouble* sd2) { |
153 |
|
Vector3d pos1 = sd1->getPos(); |
154 |
|
Vector3d pos2 = sd2->getPos(); |
155 |
< |
Vector3d r12 = pos1 - pos2; |
155 |
> |
Vector3d r12 = pos2 - pos1; |
156 |
|
currentSnapshot_->wrapVector(r12); |
157 |
|
r12.normalize(); |
158 |
|
Vector3d dipole = sd1->getElectroFrame().getColumn(2); |