MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / write

Function write

src/functionObjects/field/streamLine/streamLine.C:400–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398
399
400bool Foam::functionObjects::streamLine::write()
401{
402 Info<< type() << " " << name() << " write:" << nl;
403
404 const Time& runTime = obr_.time();
405
406 // Do all injection and tracking
407 track();
408
409
410 if (Pstream::parRun())
411 {
412 // Append slave tracks to master ones
413 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
414
415 globalIndex globalTrackIDs(allTracks_.size());
416
417 // Construct a distribution map to pull all to the master.
418 labelListList sendMap(Pstream::nProcs());
419 labelListList recvMap(Pstream::nProcs());
420
421 if (Pstream::master())
422 {
423 // Master: receive all. My own first, then consecutive
424 // processors.
425 label trackI = 0;
426
427 forAll(recvMap, proci)
428 {
429 labelList& fromProc = recvMap[proci];
430 fromProc.setSize(globalTrackIDs.localSize(proci));
431 forAll(fromProc, i)
432 {
433 fromProc[i] = trackI++;
434 }
435 }
436 }
437
438 labelList& toMaster = sendMap[0];
439 toMaster.setSize(globalTrackIDs.localSize());
440 forAll(toMaster, i)
441 {
442 toMaster[i] = i;
443 }
444
445 const mapDistribute distMap
446 (
447 globalTrackIDs.size(),
448 sendMap.xfer(),
449 recvMap.xfer()
450 );
451
452
453 // Distribute the track positions. Note: use scheduled comms
454 // to prevent buffering.
455 mapDistributeBase::distribute
456 (
457 Pstream::commsTypes::scheduled,

Callers

nothing calls this directly

Calls 15

flipOpClass · 0.85
OFstreamClass · 0.85
timeMethod · 0.80
localSizeMethod · 0.80
constructSizeMethod · 0.80
shrinkMethod · 0.80
trackFunction · 0.70
typeEnum · 0.50
nameFunction · 0.50
forAllFunction · 0.50
mkDirFunction · 0.50
coordSetClass · 0.50

Tested by

no test coverage detected