Go to the documentation of this file.
27 #include "parLagrangianRedistributor.H"
34 const fvMesh& srcMesh,
35 const fvMesh& tgtMesh,
36 const label nSrcCells,
37 const mapDistributePolyMesh& distMap
48 cellMap.reverseDistribute(nSrcCells, destinationProcID_);
50 destinationCell_ =
identity(tgtMesh_.nCells());
51 cellMap.reverseDistribute(nSrcCells, destinationCell_);
77 cloudNames.setSize(localCloudDirs.size());
80 cloudNames[i] = localCloudDirs[i];
87 objectNames.setSize(cloudNames.size());
92 IOobjectList sprayObjs
99 if (sprayObjs.lookup(word(
"positions")))
105 objectNames[cloudI].setSize(sprayObjs.size());
109 const word&
name = iter.key();
110 if (
name !=
"positions")
112 objectNames[cloudI][objectI++] =
name;
115 objectNames[cloudI].setSize(objectI);
120 forAll(objectNames, cloudI)
131 passiveParticleCloud& lpi
156 passiveParticle& ppi = iter();
158 label destProcI = destinationProcID_[ppi.cell()];
159 label destCellI = destinationCell_[ppi.cell()];
161 ppi.cell() = destCellI;
162 destProc[particleI++] = destProcI;
165 particleTransferLists[destProcI].append(lpi.remove(&ppi));
174 forAll(particleTransferLists, procI)
178 if (particleTransferLists[procI].size())
180 UOPstream particleStream(procI, pBufs);
181 particleStream << particleTransferLists[procI];
189 pBufs.finishedSends(allNTrans);
200 passiveParticleCloud lagrangianPositions
204 IDLList<passiveParticle>()
218 UIPstream particleStream(procI, pBufs);
220 IDLList<passiveParticle> newParticles
223 passiveParticle::iNew(tgtMesh_)
228 IDLList<passiveParticle>,
233 passiveParticle& newp = newpIter();
235 lagrangianPositions.addParticle(newParticles.remove(&newp));
243 IOPosition<passiveParticleCloud>(lagrangianPositions).write();
256 nsTransPs[sendProcI] = subMap[sendProcI].size();
262 label constructSize = 0;
263 forAll(constructMap, procI)
272 map[i] = constructSize++;
278 return autoPtr<mapDistributeBase>
280 new mapDistributeBase
296 (void)srcMesh_.tetBasePtIs();
297 (void)tgtMesh_.tetBasePtIs();
313 passiveParticleCloud lpi(srcMesh_,
cloudName,
false);
317 return redistributeLagrangianPositions(lpi);
autoPtr< mapDistributeBase > redistributeLagrangianPositions(passiveParticleCloud &cloud) const
Redistribute and write lagrangian positions.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
List< label > labelList
A List of labels.
#define forAll(list, i)
Loop across all elements in list.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
labelListList invertOneToMany(const label len, const labelUList &)
Invert one-to-many map. Unmapped elements will be size 0.
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
parLagrangianRedistributor(const parLagrangianRedistributor &)
Disallow default bitwise copy construct.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const mapDistribute & cellMap() const
Cell distribute map.
List< word > wordList
A List of words.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fileName timePath() const
Return current time path.
fileCheckTypes
Types of communications.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
static void findClouds(const fvMesh &, wordList &cloudNames, List< wordList > &objectNames)
Find all clouds (on all processors) and for each cloud all.
static void combineGather(const List< commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
const mapDistributePolyMesh & distMap_
Distribution map reference.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
List< fileName > fileNameList
A List of fileNames.
static const word prefix
The prefix to local: lagrangian.
static fileCheckTypes fileModificationChecking
void setSize(const label)
Reset size of List.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
List< labelList > labelListList
A List of labelList.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const word cloudName(propsDict.lookup("cloudName"))
const Time & time() const
Return the top-level database.
Various functions to operate on Lists.
fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true)
Read a directory and return the entries as a string list.
static void combineScatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
word name(const complex &)
Return a string representation of a complex.