Go to the documentation of this file.
46 allVals.
setSize(procIDs.size());
49 for (label i=1; i<procIDs.size(); i++)
60 fromSlave >> allVals[i];
82 const Field<Type>&
ff,
90 cf[fineToCoarse[i]] +=
ff[i];
99 const Field<Type>&
ff,
100 const label fineLevelIndex,
101 const bool procAgglom
104 const labelList& fineToCoarse = restrictAddressing_[fineLevelIndex];
106 if (!procAgglom &&
ff.size() != fineToCoarse.size())
109 <<
"field does not correspond to level " << fineLevelIndex
110 <<
" sizes: field = " <<
ff.size()
111 <<
" level = " << fineToCoarse.size()
115 restrictField(cf,
ff, fineToCoarse);
117 label coarseLevelIndex = fineLevelIndex+1;
119 if (procAgglom && hasProcMesh(coarseLevelIndex))
123 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
124 const labelList& offsets = cellOffsets(coarseLevelIndex);
143 const Field<Type>&
ff,
144 const label fineLevelIndex
147 const labelList& fineToCoarse = faceRestrictAddressing_[fineLevelIndex];
149 if (
ff.size() != fineToCoarse.size())
152 <<
"field does not correspond to level " << fineLevelIndex
153 <<
" sizes: field = " <<
ff.size()
154 <<
" level = " << fineToCoarse.size()
160 forAll(fineToCoarse, ffacei)
162 label cFace = fineToCoarse[ffacei];
166 cf[cFace] +=
ff[ffacei];
176 const Field<Type>& cf,
177 const label levelIndex,
178 const bool procAgglom
181 const labelList& fineToCoarse = restrictAddressing_[levelIndex];
183 label coarseLevelIndex = levelIndex+1;
185 if (procAgglom && hasProcMesh(coarseLevelIndex))
189 procCommunicator_[coarseLevelIndex]
192 const List<label>& procIDs = agglomProcIDs(coarseLevelIndex);
193 const labelList& offsets = cellOffsets(coarseLevelIndex);
195 label localSize = nCells_[levelIndex];
197 Field<Type> allCf(localSize);
211 ff[i] = allCf[fineToCoarse[i]];
218 ff[i] = cf[fineToCoarse[i]];
List< label > labelList
A List of labels.
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 Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
static constexpr const zero Zero
Output inter-processor communications stream.
void restrictFaceField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex) const
void setSize(const label n)
static void gatherList(const label comm, const labelList &procIDs, const Type &myVal, List< Type > &allVals, const int tag=Pstream::msgType())
errorManip< error > abort(error &err)
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)
#define FatalErrorInFunction
static int & msgType() noexcept
static int myProcNo(const label communicator=worldComm)
void restrictField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex, const bool procAgglom) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void prolongField(Field< Type > &ff, const Field< Type > &cf, const label coarseLevelIndex, const bool procAgglom) const
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 Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
Input inter-processor communications stream.
static label parent(const label communicator)