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_);
279 std::move(boundaryPoints),
280 std::move(patchFaces),
297 DynamicList<label> newAddressing;
317 DynamicList<label> newAddressing(oldFz.size());
319 if (oldFz.oriented())
321 DynamicList<bool> newFlipMap(oldFz.size());
325 label newFacei = reverseFaceMap_[oldFz[i]];
329 newAddressing.append(newFacei);
330 newFlipMap.append(oldFz.flipMap()[i]);
349 label newFacei = reverseFaceMap_[oldFz[i]];
353 newAddressing.append(newFacei);
378 DynamicList<label> newAddressing(oldPz.size());
420 patchFaceAgglomeration_
424 "patchFaceAgglomeration",
495 agglomerateMesh(
mesh, agglom);
515 patchFaceAgglomeration_
519 "patchFaceAgglomeration",
526 patchFaceAgglomeration
581 agglomerateMesh(
mesh, patchFaceAgglomeration);
588 patchFaceAgglomeration_
592 "patchFaceAgglomeration",
#define forAll(list, i)
Loop across all elements in list.
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.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
void addFvPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
label size() const
Return fvMesh size.
const labelUList & neighbour() const
Internal face neighbour.
const polyMesh & poly() const
Return reference to polyMesh.
Motion of the mesh specified as a list of pointMeshMovers.
const pointZoneList & pointZones() const
Return point zones.
const cellZoneList & cellZones() const
Return cell zones.
const polyBoundaryMesh & boundary() const
Return boundary mesh.
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.
virtual const pointField & points() const
Return raw points.
label nInternalFaces() const
singleCellFvMesh(const IOobject &io, const fvMesh &)
Construct from fvMesh and no agglomeration.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
void offset(label &lst, const label o)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
faceListList boundary(nPatches)