42 if (Pstream::myProcNo(comm) == procIDs[0])
47 for (
label i = 1; i < procIDs.
size(); i++)
58 fromSlave >> allVals[i];
88 cf[fineToCoarse[i]] += ff[i];
98 const label fineLevelIndex,
102 const labelList& fineToCoarse = restrictAddressing_[fineLevelIndex];
104 if (!procAgglom && ff.
size() != fineToCoarse.
size())
108 "void GAMGAgglomeration::restrictField" 109 "(Field<Type>& cf, const Field<Type>& ff, " 110 "const label fineLevelIndex) const" 111 ) <<
"field does not correspond to level " << fineLevelIndex
112 <<
" sizes: field = " << ff.
size()
113 <<
" level = " << fineToCoarse.
size()
117 restrictField(cf, ff, fineToCoarse);
119 label coarseLevelIndex = fineLevelIndex+1;
121 if (procAgglom && hasProcMesh(coarseLevelIndex))
123 label fineComm = UPstream::parent(procCommunicator_[coarseLevelIndex]);
125 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
126 const labelList& offsets = cellOffsets(coarseLevelIndex);
146 const label fineLevelIndex
149 const labelList& fineToCoarse = faceRestrictAddressing_[fineLevelIndex];
151 if (ff.
size() != fineToCoarse.
size())
155 "void GAMGAgglomeration::restrictFaceField" 156 "(Field<Type>& cf, const Field<Type>& ff, " 157 "const label fineLevelIndex) const" 158 ) <<
"field does not correspond to level " << fineLevelIndex
159 <<
" sizes: field = " << ff.
size()
160 <<
" level = " << fineToCoarse.
size()
166 forAll(fineToCoarse, ffacei)
168 label cFace = fineToCoarse[ffacei];
172 cf[cFace] += ff[ffacei];
183 const label levelIndex,
184 const bool procAgglom
187 const labelList& fineToCoarse = restrictAddressing_[levelIndex];
189 label coarseLevelIndex = levelIndex+1;
191 if (procAgglom && hasProcMesh(coarseLevelIndex))
193 label coarseComm = UPstream::parent
195 procCommunicator_[coarseLevelIndex]
198 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
199 const labelList& offsets = cellOffsets(coarseLevelIndex);
201 label localSize = nCells_[levelIndex];
217 ff[i] = allCf[fineToCoarse[i]];
224 ff[i] = cf[fineToCoarse[i]];
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
Output inter-processor communications stream.
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].
void setSize(const label)
Reset size of List.
Pre-declare SubField and related Field type.
errorManip< error > abort(error &err)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Traits class for primitives.
Input inter-processor communications stream.
void restrictFaceField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex) const
Restrict (integrate by summation) face field.
void restrictField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex, const bool procAgglom) const
Restrict (integrate by summation) cell field.
void prolongField(Field< Type > &ff, const Field< Type > &cf, const label coarseLevelIndex, const bool procAgglom) const
Prolong (interpolate by injection) cell field.