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())
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))
121 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
122 const labelList& offsets = cellOffsets(coarseLevelIndex);
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))
187 procCommunicator_[coarseLevelIndex]
190 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
191 const labelList& offsets = cellOffsets(coarseLevelIndex);
193 label localSize = nCells_[levelIndex];
209 ff[i] = allCf[fineToCoarse[i]];
216 ff[i] = cf[fineToCoarse[i]];
#define forAll(list, i)
Loop across all elements in list.
Pre-declare SubField and related Field type.
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.
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 restrictFaceField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex) const
Restrict (integrate by summation) face field.
Input inter-processor communications stream.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
Output inter-processor communications stream.
static label parent(const label communicator)
static int & msgType()
Message tag of standard messages.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static void gather(const labelUList &offsets, const label comm, const labelList &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking)
Collect data in processor order on master (== procIDs[0]).
static void scatter(const labelUList &offsets, const label comm, const labelList &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking)
Distribute data in processor order. Requires fld to be sized!
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)