46 label newFacesProc(0);
49 const label nMeshes(meshes_.size());
51 for (label i=0; i < nMeshes; ++i)
53 forAll(meshes_[i].interfaces(), patchI)
62 label newFacesPatch(0);
63 label newFacesProcPatch(0);
67 newFaces += newFacesPatch;
68 newFacesProc += newFacesProcPatch;
73 <<
"The number of faces on either side of the "
74 <<
"coupled patch " << patchI <<
" are not "
76 <<
"This might be due to the decomposition used. "
77 <<
"Please use decomposition preserving implicit "
78 <<
"patches on a single processor."
82 cellBoundMap_[i][patchI].setSize(newFacesPatch, -1);
83 facePatchFaceMap_[i][patchI].setSize(newFacesPatch, -1);
84 faceBoundMap_[i][patchI].setSize(newFacesPatch, -1);
87 const label meshNrbId = findNbrMeshId(pp, i);
89 cellBoundMap_[meshNrbId][nbrId].setSize
94 facePatchFaceMap_[meshNrbId][nbrId].setSize
99 faceBoundMap_[meshNrbId][nbrId].setSize
108 patchMap_[i][patchI] = newPatches;
109 patchLocalToGlobalMap_[i][patchI] = newPatches;
115 label virtualPatches = newPatches;
119 for (label i=0; i < nMeshes; ++i)
121 forAll(meshes_[i].interfaces(), patchI)
123 if (patchLocalToGlobalMap_[i][patchI] == -1)
125 patchLocalToGlobalMap_[i][patchI] = virtualPatches++;
135 for (label i=0; i < nMeshes; ++i)
137 newFaces += meshes_[i].lduAddr().upperAddr().size();
138 oldFaces += meshes_[i].lduAddr().upperAddr().size();
143 Info<<
" old total faces : " << oldFaces
144 <<
" new total faces (internal) : " << newFaces
145 <<
" new faces (remote) : " << newFacesProc
146 <<
" new Faces : " << newFaces - oldFaces <<
endl;
148 Info<<
" new patches : " << newPatches <<
endl;
150 Info<<
"Local to Global patch Map : "
151 << patchLocalToGlobalMap_ <<
endl;
155 patchAddr_.setSize(newPatches);
157 for (label i=0; i < nMeshes; ++i)
161 forAll(interfacesLst, patchI)
163 label globalPatchId = patchMap_[i][patchI];
165 if (globalPatchId != -1)
168 meshes_[i].lduAddr().patchAddr(patchI);
173 patchAddr_[globalPatchId].setSize(
faceCells.size(), -1);
175 for (label celli = 0; celli <
faceCells.size(); ++celli)
177 patchAddr_[globalPatchId][celli] =
186 interfaces().setSize(newPatches);
188 primitiveInterfaces().setSize(newPatches);
191 for (label i=0; i < nMeshes; ++i)
195 forAll(interfacesLst, patchI)
197 label globalPatchId = patchMap_[i][patchI];
198 if (globalPatchId != -1)
200 if (interfacesLst.
set(patchI))
207 if (isA<cyclicLduInterface>(interfacesLst[patchI]))
212 interfacesLst[patchI]
215 label globalNbr = patchMap()[i][nbrId];
217 primitiveInterfaces().set
224 patchAddr_[globalNbr],
225 patchAddr_[globalPatchId],
233 &primitiveInterfaces()[globalPatchId]
238 isA<cyclicAMILduInterface>(interfacesLst[patchI])
245 >(pp).neighbPatchID();
247 label globalNbr = patchMap()[i][nbrId];
249 primitiveInterfaces().set
256 patchAddr_[globalNbr],
257 patchAddr_[globalPatchId],
264 &primitiveInterfaces()[globalPatchId]
269 isA<cyclicACMILduInterface>(interfacesLst[patchI])
276 >(pp).neighbPatchID();
278 label globalNbr = patchMap()[i][nbrId];
284 >(pp).nonOverlapPatchID();
286 label globalnonOverlId = patchMap()[i][nonOverlId];
288 primitiveInterfaces().set
295 patchAddr_[globalNbr],
296 patchAddr_[globalPatchId],
304 &primitiveInterfaces()[globalPatchId]
309 primitiveInterfaces().set
317 interfacesLst(patchI)
326 lowerAddr().setSize(newFaces, -1);
327 upperAddr().setSize(newFaces, -1);
329 label startIndex = 0;
331 for (label i=0; i < nMeshes; ++i)
333 faceMap_[i].setSize(meshes_[i].lduAddr().lowerAddr().size(), -1);
335 const label nFaces = meshes_[i].lduAddr().upperAddr().size();
339 meshes_[i].lduAddr().lowerAddr();
342 meshes_[i].lduAddr().upperAddr();
345 label localFacei = 0;
347 for (label facei=startIndex; facei < startIndex + nFaces; ++facei)
349 lowerAddr()[facei] += cellOffsets_[i];
350 upperAddr()[facei] += cellOffsets_[i];
352 faceMap_[i][localFacei++] = facei;
355 startIndex += nFaces;
362 label nFaces = startIndex;
364 for (label i=0; i < nMeshes; ++i)
368 forAll(interfacesLst, patchI)
376 label meshNrbId = this->findNbrMeshId(pp, i);
397 const labelList& facesIds = localFaceToFace[faceI];
401 label nbrFaceId = facesIds[j];
404 const label nbrCellI =
405 nbrFaceCells[nbrFaceId]
406 + cellOffsets_[meshNrbId];
408 lowerAddr()[nFaces] =
min(cellI, nbrCellI);
409 upperAddr()[nFaces] =
max(cellI, nbrCellI);
411 cellBoundMap_[i][patchI][subFaceI] = nbrCellI;
412 cellBoundMap_[meshNrbId][nbrPatchId][subFaceI] =
415 facePatchFaceMap_[i][patchI][subFaceI] = faceI;
416 facePatchFaceMap_[meshNrbId][nbrPatchId][subFaceI]
419 faceBoundMap_[i][patchI][subFaceI] = nFaces;
420 faceBoundMap_[meshNrbId][nbrPatchId][subFaceI] =
433 if (newFaces != nFaces)
436 <<
"Incorrrect total number of faces in the assembled lduMatrix: "
437 << newFaces <<
" != " << nFaces <<
nl
459 facei = oldToNew[facei];
471 facei = oldToNew[facei];
487 (checkUpperTriangular(lduAddr().size(), lowerAddr(), upperAddr()));