46 label newFacesProc(0);
49 const label nMeshes(meshes_.size());
51 for (label i=0; i < nMeshes; ++i)
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);
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)
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);
175 for (label celli = 0; celli <
faceCells.size(); ++celli)
177 patchAddr_[globalPatchId][celli] =
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];
224 patchAddr_[globalNbr],
225 patchAddr_[globalPatchId],
238 isA<cyclicAMILduInterface>(interfacesLst[patchI])
245 >(pp).neighbPatchID();
247 label globalNbr =
patchMap()[i][nbrId];
256 patchAddr_[globalNbr],
257 patchAddr_[globalPatchId],
269 isA<cyclicACMILduInterface>(interfacesLst[patchI])
276 >(pp).neighbPatchID();
278 label globalNbr =
patchMap()[i][nbrId];
284 >(pp).nonOverlapPatchID();
286 label globalnonOverlId =
patchMap()[i][nonOverlId];
295 patchAddr_[globalNbr],
296 patchAddr_[globalPatchId],
317 interfacesLst(patchI)
329 label startIndex = 0;
331 for (label i=0; i < nMeshes; ++i)
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)
352 faceMap_[i][localFacei++] = facei;
362 label
nFaces = startIndex;
364 for (label i=0; i < nMeshes; ++i)
368 forAll(interfacesLst, patchI)
397 const labelList& facesIds = localFaceToFace[faceI];
401 label nbrFaceId = facesIds[j];
404 const label nbrCellI =
405 nbrFaceCells[nbrFaceId]
406 + cellOffsets_[meshNrbId];
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] =
436 <<
"Incorrrect total number of faces in the assembled lduMatrix: "
437 << newFaces <<
" != " <<
nFaces <<
nl
459 facei = oldToNew[facei];
471 facei = oldToNew[facei];
An assembly of lduMatrix that is specific inter-region coupling through mapped patches.
Generic GeometricField class.
void setSize(const label n)
Alias for resize()
A List obtained as a section of another List.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const T * set(const label i) const
void setSize(const label n)
Alias for resize()
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI).
Cyclic patch for Arbitrary Mesh Interface (AMI)
An abstract base class for cyclic coupled interfaces.
Smooth ATC in cells next to a set of patches supplied by type.
const fvMesh & mesh() const noexcept
Return the mesh reference.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
bool useImplicit() const noexcept
Use implicit formulation for coupled patches only.
virtual bool update()
Update the mesh for both mesh motion and topology change.
label size() const
Return number of equations.
label findNbrMeshId(const polyPatch &pp, const label iMesh) const
Find nrb mesh Id for mapped patches.
const labelListList & patchMap() const
Return patchMap.
const labelListList & faceMap() const
Return faceMap.
virtual const labelUList & upperAddr() const
Return Upper addressing.
static void checkUpperTriangular(const label size, const labelUList &l, const labelUList &u)
Check if in upper-triangular ordering.
PtrList< const lduInterface > & primitiveInterfaces()
Return a non-const list of primitive interfaces.
static labelList upperTriOrder(const label nCells, const labelUList &lower, const labelUList &upper)
Calculate upper-triangular order.
virtual lduInterfacePtrsList interfaces() const
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
virtual const labelUList & lowerAddr() const
Return Lower addressing.
A patch is a list of labels that address the faces in the global face list.
virtual void newInternalProcFaces(label &, label &) const
Return number of new internal of this polyPatch faces.
virtual label neighbPolyPatchID() const
Return nbr patchID.
virtual bool masterImplicit() const
Return implicit master.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
virtual const labelUList & nbrCells() const
Return nbrCells.
virtual refPtr< labelListList > mapCollocatedFaces() const
Return mapped collocated faces.
const labelUList & faceCells() const
Return face-cell addressing.
A class for managing references or pointers (no reference counting)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
#define DebugInfo
Report an information message using Foam::Info.
#define DebugVar(var)
Report a variable name and value.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
To & refCast(From &r)
Reference type cast template function.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.