48 int main(
int argc,
char *argv[])
58 #include "createFields.H" 65 Info<<
"Scanning times to determine track data for cloud " <<
cloudName 74 Info<<
" Reading particle positions" <<
endl;
78 <<
" particles" <<
endl;
82 label origId = iter().origId();
83 label origProc = iter().origProc();
85 if (origProc >= maxIds.size())
87 maxIds.setSize(origProc+1, -1);
90 maxIds[origProc] =
max(maxIds[origProc], origId);
96 Info<<
"Detected particles originating from " << maxNProcs
97 <<
" processors." <<
nl <<
endl;
99 maxIds.setSize(maxNProcs, -1);
109 Info<<
" Found " << numIds[proci] <<
" particles originating" 110 <<
" from processor " << proci <<
endl;
117 for (
label i = 0; i < numIds.
size()-1; i++)
119 startIds[i+1] += startIds[i] + numIds[i];
121 label nParticle = startIds.
last() + numIds[startIds.size()-1];
130 Info<<
"\nGenerating " << nTracks <<
" particle tracks for cloud " 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]);
220 scalarFormatterPtr().getFileName
229 vtkPath/(
"particleTracks." + vtkFile.ext())
233 <<
" format to " << vtkTracks.name()
236 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 > &)
label maxPositions(propsDict.lookup< label >("maxPositions"))
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.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
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.
const fileName & rootPath() const
Return root path.
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const fileName & globalCaseName() const
Return global case name.
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.
static autoPtr< setWriter > New(const word &writeFormat)
Return a reference to the selected setWriter.
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...
label sampleFrequency(propsDict.lookup< label >("sampleFrequency"))
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...
const word cloudName(propsDict.lookup("cloudName"))
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 const Vector< scalar > zero
word setFormat(propsDict.lookupOrDefault< word >("setFormat", "vtk"))
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.