43 MGridGenGAMGAgglomeration,
51 void Foam::MGridGenGAMGAgglomeration::swap
55 PtrList<labelList>& nbrValues
63 if (interfaces.set(inti))
65 interfaces[inti].initInternalFieldTransfer
79 nbrValues.setSize(interfaces.size());
82 if (interfaces.set(inti))
89 interfaces[inti].internalFieldTransfer
101 void Foam::MGridGenGAMGAgglomeration::getNbrAgglom
103 const lduAddressing& addr,
105 const PtrList<labelList>& nbrGlobalAgglom,
109 cellToNbrAgglom.setSize(addr.size());
110 cellToNbrAgglom = -1;
114 if (interfaces.set(inti))
116 if (isA<processorLduInterface>(interfaces[inti]))
118 const processorLduInterface& pldui =
119 refCast<const processorLduInterface>(interfaces[inti]);
121 if (pldui.myProcNo() > pldui.neighbProcNo())
124 interfaces[inti].faceCells();
125 const labelList& nbrData = nbrGlobalAgglom[inti];
129 cellToNbrAgglom[faceCells[i]] = nbrData[i];
138 void Foam::MGridGenGAMGAgglomeration::detectSharedFaces
150 sharedFaces.resize(addr.lowerAddr().size()/100);
155 label lowerData = value[
lower[facei]];
156 label upperData = value[
upper[facei]];
158 if (lowerData != -1 && lowerData == upperData)
160 sharedFaces.insert(facei);
168 Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
183 label nProcConsistencyIter
212 magSb[own[facei]] +=
mag(Sf[facei]);
220 label nCreatedLevels = 0;
224 label nCoarseCells = -1;
226 tmp<labelField> finalAgglomPtr = agglomerate
238 for (
int i=0; i<nProcConsistencyIter; i++)
247 const globalIndex globalNumbering(nCoarseCells);
252 globalAgglom[celli] = globalNumbering.toGlobal(agglom[celli]);
256 PtrList<labelList> nbrGlobalAgglom;
257 swap(interfaces, globalAgglom, nbrGlobalAgglom);
263 getNbrAgglom(addr, interfaces, nbrGlobalAgglom, cellToNbrAgglom);
268 detectSharedFaces(
mesh, cellToNbrAgglom, sharedFaces);
275 for (
const label facei : sharedFaces)
277 weights[facei] *= 2.0;
281 finalAgglomPtr = agglomerate
295 nCells_[nCreatedLevels] = nCoarseCells;
341 magSfPtr = aggMagSfPtr;
352 restrictField(*aggMagSbPtr, *magSbPtr, nCreatedLevels,
false);
355 magSbPtr = aggMagSbPtr;