46 cf[fineToCoarse[i]] += ff[i];
56 const label fineLevelIndex,
60 const labelList& fineToCoarse = restrictAddressing_[fineLevelIndex];
62 if (!procAgglom && ff.size() != fineToCoarse.
size())
65 <<
"field does not correspond to level " << fineLevelIndex
66 <<
" sizes: field = " << ff.size()
67 <<
" level = " << fineToCoarse.
size()
71 restrictField(cf, ff, fineToCoarse);
73 const label coarseLevelIndex = fineLevelIndex+1;
75 if (procAgglom && hasProcMesh(coarseLevelIndex))
77 const label coarseComm =
80 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
81 const labelList& offsets = cellOffsets(coarseLevelIndex);
101 const label fineLevelIndex
104 const labelList& fineToCoarse = faceRestrictAddressing_[fineLevelIndex];
106 if (ff.size() != fineToCoarse.
size())
109 <<
"field does not correspond to level " << fineLevelIndex
110 <<
" sizes: field = " << ff.size()
111 <<
" level = " << fineToCoarse.
size()
117 forAll(fineToCoarse, ffacei)
119 label cFace = fineToCoarse[ffacei];
123 cf[cFace] += ff[ffacei];
134 const label levelIndex,
135 const bool procAgglom
138 const labelList& fineToCoarse = restrictAddressing_[levelIndex];
140 const label coarseLevelIndex = levelIndex+1;
142 if (procAgglom && hasProcMesh(coarseLevelIndex))
144 const label coarseComm =
147 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
148 const labelList& offsets = cellOffsets(coarseLevelIndex);
150 const label localSize = nCells_[levelIndex];
166 ff[i] = allCf[fineToCoarse[i]];
173 ff[i] = cf[fineToCoarse[i]];
Generic templated 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.
void restrictFaceField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex) const
Restrict (integrate by summation) face field.
void size(const label n)
Older name for setAddressableSize.
@ nonBlocking
"nonBlocking"
static int & msgType() noexcept
Message tag of standard messages.
static void gather(const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking)
Collect data in processor order on master (== procIDs[0]).
static void scatter(const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking)
Distribute data in processor order.
splitCell * parent() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
#define forAll(list, i)
Loop across all elements in list.