79 int main(
int argc,
char *argv[])
93 fileName vtkPath(runTime.path()/
"VTK");
96 Info<<
"Scanning times to determine track data for cloud " <<
cloudName
102 runTime.setTime(timeDirs[timeI], timeI);
103 Info<<
"Time = " << runTime.timeName() <<
endl;
105 Info<<
" Reading particle positions" <<
endl;
108 <<
" particles" <<
endl;
112 label origId = iter().origId();
113 label origProc = iter().origProc();
115 maxIds[origProc] =
max(maxIds[origProc], origId);
126 Info<<
" Found " << numIds[procI] <<
" particles originating"
127 <<
" from processor " << procI <<
endl;
134 for (label i = 0; i < numIds.
size()-1; i++)
136 startIds[i+1] += startIds[i] + numIds[i];
138 label nParticle = startIds[startIds.size()-1] + numIds[startIds.size()-1];
148 Info<<
"\nGenerating " << nTracks <<
" particle tracks for cloud "
153 runTime.setTime(timeDirs[timeI], timeI);
154 Info<<
"Time = " << runTime.timeName() <<
endl;
161 Info<<
" Reading particle positions" <<
endl;
190 forAll(allPositions, procI)
192 forAll(allPositions[procI], i)
195 startIds[allOrigProcs[procI][i]]
196 + allOrigIds[procI][i];
203 allTracks[trackId].append
205 allPositions[procI][i]
216 OFstream vtkTracks(vtkPath/
"particleTracks.vtk");
218 Info<<
"\nWriting particle tracks to " << vtkTracks.name()
225 nPoints += allTracks[trackI].size();
229 <<
"# vtk DataFile Version 2.0" <<
nl
230 <<
"particleTracks" <<
nl
232 <<
"DATASET POLYDATA" <<
nl
233 <<
"POINTS " << nPoints <<
" float" <<
nl;
238 forAll(allTracks[trackI], i)
240 const vector& pt = allTracks[trackI][i];
241 vtkTracks << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
246 vtkTracks <<
"LINES " << nTracks <<
' ' << nPoints+nTracks <<
nl;
252 vtkTracks << allTracks[trackI].size();
254 forAll(allTracks[trackI], i)
256 vtkTracks <<
' ' << globalPtI;