32 void Foam::singleCellFvMesh::agglomerateMesh
50 const polyPatch& pp = oldPatches[
patchi];
57 if (agglom[
patchi][i] < 0 || agglom[
patchi][i] >= pp.size())
60 <<
"agglomeration on patch " <<
patchi
61 <<
" is out of range 0.." << pp.size()-1
74 const polyPatch& pp = oldPatches[
patchi];
89 Map<label> localToNbr(nbrAgglom.size()/10);
93 const polyPatch& pp = oldPatches[
patchi];
103 label nbrZone = nbrAgglom[bFacei];
107 if (iter == localToNbr.end())
111 localToNbr.insert(myZone, nbrZone);
116 if (iter() != nbrZone)
119 <<
"agglomeration is not synchronised across"
120 <<
" coupled patch " << pp.name()
122 <<
"Local agglomeration " << myZone
123 <<
". Remote agglomeration " << nbrZone
136 coarseI += nAgglom[
patchi];
141 labelList patchStarts(oldPatches.size());
145 patchFaceMap_.setSize(oldPatches.size());
149 reverseFaceMap_.labelList::operator=(-1);
157 patchStarts[
patchi] = coarseI;
159 const polyPatch& pp = oldPatches[
patchi];
178 if (agglomToFace[myAgglom] == -1)
185 label coarsePatchFacei = coarseI - patchStarts[
patchi];
186 patchFaceMap_[
patchi][coarsePatchFacei] = myAgglom;
187 agglomToFace[myAgglom] = coarsePatchFacei;
189 const labelList& fineFaces = agglomToPatch[myAgglom];
194 reverseFaceMap_[pp.start()+fineFaces[fineI]] = coarseI;
200 UIndirectList<face>(pp, fineFaces),
204 if (upp.edgeLoops().size() != 1)
207 <<
"agglomeration does not create a"
208 <<
" single, non-manifold"
209 <<
" face for agglomeration " << myAgglom
214 patchFaces[coarseI++] = face
234 reversePointMap_.labelList::operator=(-1);
237 forAll(patchFaces, coarseI)
239 face&
f = patchFaces[coarseI];
243 if (reversePointMap_[
f[fp]] == -1)
245 reversePointMap_[
f[fp]] = newI++;
248 f[fp] = reversePointMap_[
f[fp]];
252 pointMap_ =
invert(newI, reversePointMap_);
258 List<polyPatch*> newPatches(oldPatches.size());
279 std::move(boundaryPoints),
280 std::move(patchFaces),
297 DynamicList<label> newAddressing;
318 DynamicList<label> newAddressing(oldFz.size());
319 DynamicList<bool> newFlipMap(oldFz.size());
323 label newFacei = reverseFaceMap_[oldFz[i]];
327 newAddressing.append(newFacei);
328 newFlipMap.append(oldFz.flipMap()[i]);
353 DynamicList<label> newAddressing(oldPz.size());
395 patchFaceAgglomeration_
399 "patchFaceAgglomeration",
419 mesh.boundaryMesh().size()
470 agglomerateMesh(
mesh, agglom);
490 patchFaceAgglomeration_
494 "patchFaceAgglomeration",
501 patchFaceAgglomeration
514 mesh.boundaryMesh().size()
556 agglomerateMesh(
mesh, patchFaceAgglomeration);
563 patchFaceAgglomeration_
567 "patchFaceAgglomeration",
#define forAll(list, i)
Loop across all elements in list.
label size() const
Return number of elements in table.
friend class const_iterator
Declare friendship with the const_iterator.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
autoPtr< T > set(const label, const word &key, T *)
Set element to pointer provided and return old element.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
label size() const
Return the number of elements in the UPtrList.
void clear()
Clear the zones.
Mesh data needed to do the Finite Volume discretisation.
const labelUList & owner() const
Internal face owner.
void addFvPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
const labelUList & neighbour() const
Internal face neighbour.
const polyMesh & mesh() const
Return reference to polyMesh.
const pointZoneList & pointZones() const
Return point zones.
const cellZoneList & cellZones() const
Return cell zones.
void resetPrimitives(pointField &&points, faceList &&faces, labelList &&owner, labelList &&neighbour, const labelList &patchSizes, const labelList &patchStarts, const bool validBoundary=true)
Reset mesh primitive data. Assumes all patch info correct.
const faceZoneList & faceZones() const
Return face zones.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
label nInternalFaces() const
singleCellFvMesh(const IOobject &io, const fvMesh &)
Construct from fvMesh and no agglomeration.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
vectorField pointField
pointField is a vectorField.
labelListList invertOneToMany(const label len, const labelUList &)
Invert one-to-many map. Unmapped elements will be size 0.
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
Foam::uindirectPrimitivePatch.
List< labelList > labelListList
A List of labelList.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
void offset(label &lst, const label o)