1 | /*
|
---|
2 | * analysis.cpp
|
---|
3 | *
|
---|
4 | * Created on: Oct 13, 2009
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include <iostream>
|
---|
9 |
|
---|
10 | #include "analysis_correlation.hpp"
|
---|
11 | #include "element.hpp"
|
---|
12 | #include "info.hpp"
|
---|
13 | #include "log.hpp"
|
---|
14 | #include "molecule.hpp"
|
---|
15 | #include "tesselation.hpp"
|
---|
16 | #include "tesselationhelpers.hpp"
|
---|
17 | #include "triangleintersectionlist.hpp"
|
---|
18 | #include "vector.hpp"
|
---|
19 | #include "verbose.hpp"
|
---|
20 | #include "World.hpp"
|
---|
21 |
|
---|
22 |
|
---|
23 | /** Calculates the pair correlation between given elements.
|
---|
24 | * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si))
|
---|
25 | * \param *out output stream for debugging
|
---|
26 | * \param *molecules list of molecules structure
|
---|
27 | * \param *type1 first element or NULL (if any element)
|
---|
28 | * \param *type2 second element or NULL (if any element)
|
---|
29 | * \return Map of doubles with values the pair of the two atoms.
|
---|
30 | */
|
---|
31 | PairCorrelationMap *PairCorrelation(MoleculeListClass * const &molecules, const element * const type1, const element * const type2 )
|
---|
32 | {
|
---|
33 | Info FunctionInfo(__func__);
|
---|
34 | PairCorrelationMap *outmap = NULL;
|
---|
35 | double distance = 0.;
|
---|
36 |
|
---|
37 | if (molecules->ListOfMolecules.empty()) {
|
---|
38 | DoeLog(1) && (eLog()<< Verbose(1) <<"No molecule given." << endl);
|
---|
39 | return outmap;
|
---|
40 | }
|
---|
41 | outmap = new PairCorrelationMap;
|
---|
42 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++){
|
---|
43 | if ((*MolWalker)->ActiveFlag) {
|
---|
44 | DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
|
---|
45 | eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
|
---|
46 | for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
|
---|
47 | DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
|
---|
48 | if ((type1 == NULL) || ((*iter)->type == type1)) {
|
---|
49 | for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++){
|
---|
50 | if ((*MolOtherWalker)->ActiveFlag) {
|
---|
51 | DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);
|
---|
52 | for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) {
|
---|
53 | DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
|
---|
54 | if ((*iter)->getId() < (*runner)->getId()){
|
---|
55 | if ((type2 == NULL) || ((*runner)->type == type2)) {
|
---|
56 | distance = (*iter)->node->PeriodicDistance(*(*runner)->node, World::getInstance().getDomain());
|
---|
57 | //Log() << Verbose(1) <<"Inserting " << *(*iter) << " and " << *(*runner) << endl;
|
---|
58 | outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) );
|
---|
59 | }
|
---|
60 | }
|
---|
61 | }
|
---|
62 | }
|
---|
63 | }
|
---|
64 | }
|
---|
65 | }
|
---|
66 | }
|
---|
67 | }
|
---|
68 | return outmap;
|
---|
69 | };
|
---|
70 |
|
---|
71 | /** Calculates the pair correlation between given elements.
|
---|
72 | * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si))
|
---|
73 | * \param *out output stream for debugging
|
---|
74 | * \param *molecules list of molecules structure
|
---|
75 | * \param *type1 first element or NULL (if any element)
|
---|
76 | * \param *type2 second element or NULL (if any element)
|
---|
77 | * \param ranges[NDIM] interval boundaries for the periodic images to scan also
|
---|
78 | * \return Map of doubles with values the pair of the two atoms.
|
---|
79 | */
|
---|
80 | PairCorrelationMap *PeriodicPairCorrelation(MoleculeListClass * const &molecules, const element * const type1, const element * const type2, const int ranges[NDIM] )
|
---|
81 | {
|
---|
82 | Info FunctionInfo(__func__);
|
---|
83 | PairCorrelationMap *outmap = NULL;
|
---|
84 | double distance = 0.;
|
---|
85 | int n[NDIM];
|
---|
86 | Vector checkX;
|
---|
87 | Vector periodicX;
|
---|
88 | int Othern[NDIM];
|
---|
89 | Vector checkOtherX;
|
---|
90 | Vector periodicOtherX;
|
---|
91 |
|
---|
92 | if (molecules->ListOfMolecules.empty()) {
|
---|
93 | DoeLog(1) && (eLog()<< Verbose(1) <<"No molecule given." << endl);
|
---|
94 | return outmap;
|
---|
95 | }
|
---|
96 | outmap = new PairCorrelationMap;
|
---|
97 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
98 | if ((*MolWalker)->ActiveFlag) {
|
---|
99 | double * FullMatrix = ReturnFullMatrixforSymmetric(World::getInstance().getDomain());
|
---|
100 | double * FullInverseMatrix = InverseMatrix(FullMatrix);
|
---|
101 | DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
|
---|
102 | for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
|
---|
103 | DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
|
---|
104 | if ((type1 == NULL) || ((*iter)->type == type1)) {
|
---|
105 | periodicX = *(*iter)->node;
|
---|
106 | periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3
|
---|
107 | // go through every range in xyz and get distance
|
---|
108 | for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++)
|
---|
109 | for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
|
---|
110 | for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
|
---|
111 | checkX = Vector(n[0], n[1], n[2]) + periodicX;
|
---|
112 | checkX.MatrixMultiplication(FullMatrix);
|
---|
113 | for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
|
---|
114 | if ((*MolOtherWalker)->ActiveFlag) {
|
---|
115 | DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);
|
---|
116 | for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) {
|
---|
117 | DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
|
---|
118 | if ((*iter)->nr < (*runner)->nr)
|
---|
119 | if ((type2 == NULL) || ((*runner)->type == type2)) {
|
---|
120 | periodicOtherX = *(*runner)->node;
|
---|
121 | periodicOtherX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3
|
---|
122 | // go through every range in xyz and get distance
|
---|
123 | for (Othern[0]=-ranges[0]; Othern[0] <= ranges[0]; Othern[0]++)
|
---|
124 | for (Othern[1]=-ranges[1]; Othern[1] <= ranges[1]; Othern[1]++)
|
---|
125 | for (Othern[2]=-ranges[2]; Othern[2] <= ranges[2]; Othern[2]++) {
|
---|
126 | checkOtherX = Vector(Othern[0], Othern[1], Othern[2]) + periodicOtherX;
|
---|
127 | checkOtherX.MatrixMultiplication(FullMatrix);
|
---|
128 | distance = checkX.distance(checkOtherX);
|
---|
129 | //Log() << Verbose(1) <<"Inserting " << *(*iter) << " and " << *(*runner) << endl;
|
---|
130 | outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) );
|
---|
131 | }
|
---|
132 | }
|
---|
133 | }
|
---|
134 | }
|
---|
135 | }
|
---|
136 | }
|
---|
137 | }
|
---|
138 | delete[](FullMatrix);
|
---|
139 | delete[](FullInverseMatrix);
|
---|
140 | }
|
---|
141 |
|
---|
142 | return outmap;
|
---|
143 | };
|
---|
144 |
|
---|
145 | /** Calculates the distance (pair) correlation between a given element and a point.
|
---|
146 | * \param *out output stream for debugging
|
---|
147 | * \param *molecules list of molecules structure
|
---|
148 | * \param *type element or NULL (if any element)
|
---|
149 | * \param *point vector to the correlation point
|
---|
150 | * \return Map of dobules with values as pairs of atom and the vector
|
---|
151 | */
|
---|
152 | CorrelationToPointMap *CorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point )
|
---|
153 | {
|
---|
154 | Info FunctionInfo(__func__);
|
---|
155 | CorrelationToPointMap *outmap = NULL;
|
---|
156 | double distance = 0.;
|
---|
157 |
|
---|
158 | if (molecules->ListOfMolecules.empty()) {
|
---|
159 | DoLog(1) && (Log() << Verbose(1) <<"No molecule given." << endl);
|
---|
160 | return outmap;
|
---|
161 | }
|
---|
162 | outmap = new CorrelationToPointMap;
|
---|
163 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
164 | if ((*MolWalker)->ActiveFlag) {
|
---|
165 | DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
|
---|
166 | for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
|
---|
167 | DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
|
---|
168 | if ((type == NULL) || ((*iter)->type == type)) {
|
---|
169 | distance = (*iter)->node->PeriodicDistance(*point, World::getInstance().getDomain());
|
---|
170 | DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl);
|
---|
171 | outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> ((*iter), point) ) );
|
---|
172 | }
|
---|
173 | }
|
---|
174 | }
|
---|
175 |
|
---|
176 | return outmap;
|
---|
177 | };
|
---|
178 |
|
---|
179 | /** Calculates the distance (pair) correlation between a given element, all its periodic images and a point.
|
---|
180 | * \param *out output stream for debugging
|
---|
181 | * \param *molecules list of molecules structure
|
---|
182 | * \param *type element or NULL (if any element)
|
---|
183 | * \param *point vector to the correlation point
|
---|
184 | * \param ranges[NDIM] interval boundaries for the periodic images to scan also
|
---|
185 | * \return Map of dobules with values as pairs of atom and the vector
|
---|
186 | */
|
---|
187 | CorrelationToPointMap *PeriodicCorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point, const int ranges[NDIM] )
|
---|
188 | {
|
---|
189 | Info FunctionInfo(__func__);
|
---|
190 | CorrelationToPointMap *outmap = NULL;
|
---|
191 | double distance = 0.;
|
---|
192 | int n[NDIM];
|
---|
193 | Vector periodicX;
|
---|
194 | Vector checkX;
|
---|
195 |
|
---|
196 | if (molecules->ListOfMolecules.empty()) {
|
---|
197 | DoLog(1) && (Log() << Verbose(1) <<"No molecule given." << endl);
|
---|
198 | return outmap;
|
---|
199 | }
|
---|
200 | outmap = new CorrelationToPointMap;
|
---|
201 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
202 | if ((*MolWalker)->ActiveFlag) {
|
---|
203 | double * FullMatrix = ReturnFullMatrixforSymmetric(World::getInstance().getDomain());
|
---|
204 | double * FullInverseMatrix = InverseMatrix(FullMatrix);
|
---|
205 | DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
|
---|
206 | for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
|
---|
207 | DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
|
---|
208 | if ((type == NULL) || ((*iter)->type == type)) {
|
---|
209 | periodicX = *(*iter)->node;
|
---|
210 | periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3
|
---|
211 | // go through every range in xyz and get distance
|
---|
212 | for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++)
|
---|
213 | for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
|
---|
214 | for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
|
---|
215 | checkX = Vector(n[0], n[1], n[2]) + periodicX;
|
---|
216 | checkX.MatrixMultiplication(FullMatrix);
|
---|
217 | distance = checkX.distance(*point);
|
---|
218 | DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl);
|
---|
219 | outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (*iter, point) ) );
|
---|
220 | }
|
---|
221 | }
|
---|
222 | }
|
---|
223 | delete[](FullMatrix);
|
---|
224 | delete[](FullInverseMatrix);
|
---|
225 | }
|
---|
226 |
|
---|
227 | return outmap;
|
---|
228 | };
|
---|
229 |
|
---|
230 | /** Calculates the distance (pair) correlation between a given element and a surface.
|
---|
231 | * \param *out output stream for debugging
|
---|
232 | * \param *molecules list of molecules structure
|
---|
233 | * \param *type element or NULL (if any element)
|
---|
234 | * \param *Surface pointer to Tesselation class surface
|
---|
235 | * \param *LC LinkedCell structure to quickly find neighbouring atoms
|
---|
236 | * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
|
---|
237 | */
|
---|
238 | CorrelationToSurfaceMap *CorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC )
|
---|
239 | {
|
---|
240 | Info FunctionInfo(__func__);
|
---|
241 | CorrelationToSurfaceMap *outmap = NULL;
|
---|
242 | double distance = 0;
|
---|
243 | class BoundaryTriangleSet *triangle = NULL;
|
---|
244 | Vector centroid;
|
---|
245 |
|
---|
246 | if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) {
|
---|
247 | DoeLog(1) && (eLog()<< Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl);
|
---|
248 | return outmap;
|
---|
249 | }
|
---|
250 | outmap = new CorrelationToSurfaceMap;
|
---|
251 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
252 | if ((*MolWalker)->ActiveFlag) {
|
---|
253 | DoLog(1) && (Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl);
|
---|
254 | for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
|
---|
255 | //Log() << Verbose(3) << "Current atom is " << *(*iter) << "." << endl;
|
---|
256 | if ((type == NULL) || ((*iter)->type == type)) {
|
---|
257 | TriangleIntersectionList Intersections((*iter)->node,Surface,LC);
|
---|
258 | distance = Intersections.GetSmallestDistance();
|
---|
259 | triangle = Intersections.GetClosestTriangle();
|
---|
260 | outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> ((*iter), triangle) ) );
|
---|
261 | }
|
---|
262 | }
|
---|
263 | } else
|
---|
264 | DoLog(1) && (Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl);
|
---|
265 |
|
---|
266 | return outmap;
|
---|
267 | };
|
---|
268 |
|
---|
269 | /** Calculates the distance (pair) correlation between a given element, all its periodic images and and a surface.
|
---|
270 | * Note that we also put all periodic images found in the cells given by [ -ranges[i], ranges[i] ] and i=0,...,NDIM-1.
|
---|
271 | * I.e. We multiply the atom::node with the inverse of the domain matrix, i.e. transform it to \f$[0,0^3\f$, then add per
|
---|
272 | * axis an integer from [ -ranges[i], ranges[i] ] onto it and multiply with the domain matrix to bring it back into
|
---|
273 | * the real space. Then, we Tesselation::FindClosestTriangleToPoint() and DistanceToTrianglePlane().
|
---|
274 | * \param *out output stream for debugging
|
---|
275 | * \param *molecules list of molecules structure
|
---|
276 | * \param *type element or NULL (if any element)
|
---|
277 | * \param *Surface pointer to Tesselation class surface
|
---|
278 | * \param *LC LinkedCell structure to quickly find neighbouring atoms
|
---|
279 | * \param ranges[NDIM] interval boundaries for the periodic images to scan also
|
---|
280 | * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
|
---|
281 | */
|
---|
282 | CorrelationToSurfaceMap *PeriodicCorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
|
---|
283 | {
|
---|
284 | Info FunctionInfo(__func__);
|
---|
285 | CorrelationToSurfaceMap *outmap = NULL;
|
---|
286 | double distance = 0;
|
---|
287 | class BoundaryTriangleSet *triangle = NULL;
|
---|
288 | Vector centroid;
|
---|
289 | int n[NDIM];
|
---|
290 | Vector periodicX;
|
---|
291 | Vector checkX;
|
---|
292 |
|
---|
293 | if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) {
|
---|
294 | DoLog(1) && (Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl);
|
---|
295 | return outmap;
|
---|
296 | }
|
---|
297 | outmap = new CorrelationToSurfaceMap;
|
---|
298 | double ShortestDistance = 0.;
|
---|
299 | BoundaryTriangleSet *ShortestTriangle = NULL;
|
---|
300 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
301 | if ((*MolWalker)->ActiveFlag) {
|
---|
302 | double * FullMatrix = ReturnFullMatrixforSymmetric(World::getInstance().getDomain());
|
---|
303 | double * FullInverseMatrix = InverseMatrix(FullMatrix);
|
---|
304 | DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
|
---|
305 | for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
|
---|
306 | DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
|
---|
307 | if ((type == NULL) || ((*iter)->type == type)) {
|
---|
308 | periodicX = *(*iter)->node;
|
---|
309 | periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3
|
---|
310 | // go through every range in xyz and get distance
|
---|
311 | ShortestDistance = -1.;
|
---|
312 | for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++)
|
---|
313 | for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
|
---|
314 | for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
|
---|
315 | checkX = Vector(n[0], n[1], n[2]) + periodicX;
|
---|
316 | checkX.MatrixMultiplication(FullMatrix);
|
---|
317 | TriangleIntersectionList Intersections(&checkX,Surface,LC);
|
---|
318 | distance = Intersections.GetSmallestDistance();
|
---|
319 | triangle = Intersections.GetClosestTriangle();
|
---|
320 | if ((ShortestDistance == -1.) || (distance < ShortestDistance)) {
|
---|
321 | ShortestDistance = distance;
|
---|
322 | ShortestTriangle = triangle;
|
---|
323 | }
|
---|
324 | }
|
---|
325 | // insert
|
---|
326 | outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(ShortestDistance, pair<atom *, BoundaryTriangleSet*> (*iter, ShortestTriangle) ) );
|
---|
327 | //Log() << Verbose(1) << "INFO: Inserting " << Walker << " with distance " << ShortestDistance << " to " << *ShortestTriangle << "." << endl;
|
---|
328 | }
|
---|
329 | }
|
---|
330 | delete[](FullMatrix);
|
---|
331 | delete[](FullInverseMatrix);
|
---|
332 | }
|
---|
333 |
|
---|
334 | return outmap;
|
---|
335 | };
|
---|
336 |
|
---|
337 | /** Returns the index of the bin for a given value.
|
---|
338 | * \param value value whose bin to look for
|
---|
339 | * \param BinWidth width of bin
|
---|
340 | * \param BinStart first bin
|
---|
341 | */
|
---|
342 | int GetBin ( const double value, const double BinWidth, const double BinStart )
|
---|
343 | {
|
---|
344 | Info FunctionInfo(__func__);
|
---|
345 | int bin =(int) (floor((value - BinStart)/BinWidth));
|
---|
346 | return (bin);
|
---|
347 | };
|
---|
348 |
|
---|
349 |
|
---|
350 | /** Prints correlation (double, int) pairs to file.
|
---|
351 | * \param *file file to write to
|
---|
352 | * \param *map map to write
|
---|
353 | */
|
---|
354 | void OutputCorrelation( ofstream * const file, const BinPairMap * const map )
|
---|
355 | {
|
---|
356 | Info FunctionInfo(__func__);
|
---|
357 | *file << "BinStart\tCount" << endl;
|
---|
358 | for (BinPairMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
|
---|
359 | *file << setprecision(8) << runner->first << "\t" << runner->second << endl;
|
---|
360 | }
|
---|
361 | };
|
---|
362 |
|
---|
363 | /** Prints correlation (double, (atom*,atom*) ) pairs to file.
|
---|
364 | * \param *file file to write to
|
---|
365 | * \param *map map to write
|
---|
366 | */
|
---|
367 | void OutputPairCorrelation( ofstream * const file, const PairCorrelationMap * const map )
|
---|
368 | {
|
---|
369 | Info FunctionInfo(__func__);
|
---|
370 | *file << "BinStart\tAtom1\tAtom2" << endl;
|
---|
371 | for (PairCorrelationMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
|
---|
372 | *file << setprecision(8) << runner->first << "\t" << *(runner->second.first) << "\t" << *(runner->second.second) << endl;
|
---|
373 | }
|
---|
374 | };
|
---|
375 |
|
---|
376 | /** Prints correlation (double, int) pairs to file.
|
---|
377 | * \param *file file to write to
|
---|
378 | * \param *map map to write
|
---|
379 | */
|
---|
380 | void OutputCorrelationToPoint( ofstream * const file, const CorrelationToPointMap * const map )
|
---|
381 | {
|
---|
382 | Info FunctionInfo(__func__);
|
---|
383 | *file << "BinStart\tAtom::x[i]-point.x[i]" << endl;
|
---|
384 | for (CorrelationToPointMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
|
---|
385 | *file << runner->first;
|
---|
386 | for (int i=0;i<NDIM;i++)
|
---|
387 | *file << "\t" << setprecision(8) << (runner->second.first->node->at(i) - runner->second.second->at(i));
|
---|
388 | *file << endl;
|
---|
389 | }
|
---|
390 | };
|
---|
391 |
|
---|
392 | /** Prints correlation (double, int) pairs to file.
|
---|
393 | * \param *file file to write to
|
---|
394 | * \param *map map to write
|
---|
395 | */
|
---|
396 | void OutputCorrelationToSurface( ofstream * const file, const CorrelationToSurfaceMap * const map )
|
---|
397 | {
|
---|
398 | Info FunctionInfo(__func__);
|
---|
399 | *file << "BinStart\tTriangle" << endl;
|
---|
400 | if (!map->empty())
|
---|
401 | for (CorrelationToSurfaceMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
|
---|
402 | *file << setprecision(8) << runner->first << "\t" << *(runner->second.first) << "\t" << *(runner->second.second) << endl;
|
---|
403 | }
|
---|
404 | };
|
---|
405 |
|
---|