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