42 if (Pstream::myProcNo(comm) == procIDs[0])
51 Pstream::commsTypes::scheduled,
58 fromSlave >> allVals[i];
65 Pstream::commsTypes::scheduled,
88 cf[fineToCoarse[i]] += ff[i];
98 const label fineLevelIndex,
102 const labelList& fineToCoarse = restrictAddressing_[fineLevelIndex];
104 if (!procAgglom && ff.
size() != fineToCoarse.
size())
107 <<
"field does not correspond to level " << fineLevelIndex
108 <<
" sizes: field = " << ff.
size()
109 <<
" level = " << fineToCoarse.
size()
113 restrictField(cf, ff, fineToCoarse);
115 label coarseLevelIndex = fineLevelIndex+1;
117 if (procAgglom && hasProcMesh(coarseLevelIndex))
119 label fineComm = UPstream::parent(procCommunicator_[coarseLevelIndex]);
121 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
122 const labelList& offsets = cellOffsets(coarseLevelIndex);
131 Pstream::commsTypes::nonBlocking
142 const label fineLevelIndex
145 const labelList& fineToCoarse = faceRestrictAddressing_[fineLevelIndex];
147 if (ff.
size() != fineToCoarse.
size())
150 <<
"field does not correspond to level " << fineLevelIndex
151 <<
" sizes: field = " << ff.
size()
152 <<
" level = " << fineToCoarse.
size()
158 forAll(fineToCoarse, ffacei)
160 label cFace = fineToCoarse[ffacei];
164 cf[cFace] += ff[ffacei];
175 const label levelIndex,
176 const bool procAgglom
179 const labelList& fineToCoarse = restrictAddressing_[levelIndex];
181 label coarseLevelIndex = levelIndex+1;
183 if (procAgglom && hasProcMesh(coarseLevelIndex))
185 label coarseComm = UPstream::parent
187 procCommunicator_[coarseLevelIndex]
190 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
191 const labelList& offsets = cellOffsets(coarseLevelIndex);
193 label localSize = nCells_[levelIndex];
204 Pstream::commsTypes::nonBlocking
209 ff[i] = allCf[fineToCoarse[i]];
216 ff[i] = cf[fineToCoarse[i]];
#define forAll(list, i)
Loop across all elements in list.
void restrictField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex, const bool procAgglom) const
Restrict (integrate by summation) cell field.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void restrictFaceField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex) const
Restrict (integrate by summation) face field.
void size(const label)
Override size to be inconsistent with allocated storage.
Input inter-processor communications stream.
Pre-declare SubField and related Field type.
void prolongField(Field< Type > &ff, const Field< Type > &cf, const label coarseLevelIndex, const bool procAgglom) const
Prolong (interpolate by injection) cell field.
errorManip< error > abort(error &err)
Output inter-processor communications stream.
void setSize(const label)
Reset size of List.
static void gatherList(const label comm, const labelList &procIDs, const Type &myVal, List< Type > &allVals, const int tag=Pstream::msgType())
Gather value from all procIDs onto procIDs[0].