47 int main(
int argc,
char *argv[])
57 #include "createFields.H" 61 fileName vtkPath(runTime.path()/
"VTK");
64 Info<<
"Scanning times to determine track data for cloud " <<
cloudName 70 runTime.setTime(timeDirs[timeI], timeI);
71 Info<<
"Time = " << runTime.timeName() <<
endl;
73 Info<<
" Reading particle positions" <<
endl;
76 <<
" particles" <<
endl;
80 label origId = iter().origId();
81 label origProc = iter().origProc();
83 if (origProc >= maxIds.size())
86 maxIds.setSize(origProc+1, -1);
89 maxIds[origProc] =
max(maxIds[origProc], origId);
95 Info<<
"Detected particles originating from " << maxNProcs
96 <<
" processors." <<
nl <<
endl;
98 maxIds.setSize(maxNProcs, -1);
108 Info<<
" Found " << numIds[proci] <<
" particles originating" 109 <<
" from processor " << proci <<
endl;
116 for (
label i = 0; i < numIds.
size()-1; i++)
118 startIds[i+1] += startIds[i] + numIds[i];
120 label nParticle = startIds.
last() + numIds[startIds.size()-1];
130 Info<<
"\nGenerating " << nTracks <<
" particle tracks for cloud " 135 runTime.setTime(timeDirs[timeI], timeI);
136 Info<<
"Time = " << runTime.timeName() <<
endl;
143 Info<<
" Reading particle positions" <<
endl;
172 forAll(allPositions, proci)
174 forAll(allPositions[proci], i)
177 startIds[allOrigProcs[proci][i]]
178 + allOrigIds[proci][i];
185 allTracks[trackId].append
187 allPositions[proci][i]
211 tracks[trackI].transfer(allTracks[trackI]);
222 scalarFormatterPtr().getFileName
232 /
"particleTracks." + vtkFile.ext()
236 <<
" format to " << vtkTracks.name()
240 scalarFormatterPtr().write
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
const word cloudName(propsDict.lookup("cloudName"))
word setFormat(propsDict.lookupOrDefault< word >("setFormat","vtk"))
label sampleFrequency(readLabel(propsDict.lookup("sampleFrequency")))
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
A Cloud of passive particles.
Holds list of sampling positions.
label maxPositions(readLabel(propsDict.lookup("maxPositions")))
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static autoPtr< writer > New(const word &writeFormat)
Return a reference to the selected writer.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
word name(const complex &)
Return a string representation of a complex.
List< word > wordList
A List of words.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
static const Vector< scalar > zero
T & last()
Return the last element of the list.
Foam::argList args(argc, argv)
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.