Go to the documentation of this file.
28 #include "uindirectPrimitivePatch.H"
54 nAgglom[patchI] =
max(agglom[patchI])+1;
58 if (agglom[patchI][i] < 0 || agglom[patchI][i] >= pp.size())
61 <<
"agglomeration on patch " << patchI
62 <<
" is out of range 0.." << pp.size()-1
82 nbrAgglom[offset+i] = agglom[patchI][i];
86 syncTools::swapBoundaryFaceList(
mesh, nbrAgglom);
102 label bFaceI = offset+i;
103 label myZone = agglom[patchI][i];
104 label nbrZone = nbrAgglom[bFaceI];
108 if (iter == localToNbr.end())
112 localToNbr.insert(myZone, nbrZone);
117 if (iter() != nbrZone)
120 <<
"agglomeration is not synchronised across"
121 <<
" coupled patch " << pp.
name()
123 <<
"Local agglomeration " << myZone
124 <<
". Remote agglomeration " << nbrZone
137 coarseI += nAgglom[patchI];
146 patchFaceMap_.setSize(oldPatches.
size());
149 reverseFaceMap_.setSize(
mesh.nFaces());
150 reverseFaceMap_.labelList::operator=(-1);
156 forAll(oldPatches, patchI)
158 patchStarts[patchI] = coarseI;
160 const polyPatch& pp = oldPatches[patchI];
164 patchFaceMap_[patchI].
setSize(nAgglom[patchI]);
173 labelList agglomToFace(nAgglom[patchI], -1);
177 label myAgglom = agglom[patchI][i];
179 if (agglomToFace[myAgglom] == -1)
186 label coarsePatchFaceI = coarseI - patchStarts[patchI];
187 patchFaceMap_[patchI][coarsePatchFaceI] = myAgglom;
188 agglomToFace[myAgglom] = coarsePatchFaceI;
190 const labelList& fineFaces = agglomToPatch[myAgglom];
195 reverseFaceMap_[pp.
start()+fineFaces[fineI]] = coarseI;
208 <<
"agglomeration does not create a"
209 <<
" single, non-manifold"
210 <<
" face for agglomeration " << myAgglom
211 <<
" on patch " << patchI
227 patchSizes[patchI] = coarseI-patchStarts[patchI];
235 reversePointMap_.labelList::operator=(-1);
244 if (reversePointMap_[
f[fp]] == -1)
246 reversePointMap_[
f[fp]] = newI++;
249 f[fp] = reversePointMap_[
f[fp]];
253 pointMap_ =
invert(newI, reversePointMap_);
260 forAll(oldPatches, patchI)
262 newPatches[patchI] = oldPatches[patchI].
clone
292 cellZones().setSize(
mesh.cellZones().size());
322 faceZones().setSize(
mesh.faceZones().size());
333 label newFaceI = reverseFaceMap_[oldFz[i]];
337 newAddressing.
append(newFaceI);
338 newFlipMap.
append(oldFz.flipMap()[i]);
357 pointZones().clear();
358 pointZones().setSize(
mesh.pointZones().size());
368 label newPointI = reversePointMap_[oldFz[i]];
371 newAddressing.
append(newPointI);
407 patchFaceAgglomeration_
411 "patchFaceAgglomeration",
431 mesh.boundaryMesh().size()
477 forAll(oldPatches, patchI)
479 agglom[patchI] =
identity(oldPatches[patchI].size());
482 agglomerateMesh(
mesh, agglom);
502 patchFaceAgglomeration_
506 "patchFaceAgglomeration",
513 patchFaceAgglomeration
526 mesh.boundaryMesh().size()
568 agglomerateMesh(
mesh, patchFaceAgglomeration);
575 patchFaceAgglomeration_
579 "patchFaceAgglomeration",
vectorField pointField
pointField is a vectorField.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const Field< PointType > & points() const
Return reference to global points.
List< label > labelList
A List of labels.
#define forAll(list, i)
Loop across all elements in list.
labelListList invertOneToMany(const label len, const labelUList &)
Invert one-to-many map. Unmapped elements will be size 0.
virtual autoPtr< cellZone > clone(const cellZoneMesh &zm) const
Construct and return a clone, resetting the zone mesh.
virtual autoPtr< pointZone > clone(const pointZoneMesh &zm) const
Construct and return a clone, resetting the zone mesh.
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
singleCellFvMesh(const singleCellFvMesh &)
Disallow default bitwise copy construct.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const fileName & instance() const
writeOption writeOpt() const
labelList patchFaces(const polyBoundaryMesh &patches, const wordList &names)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
readOption readOpt() const
A subset of mesh faces organised as a primitive patch.
A patch is a list of labels that address the faces in the global face list.
void clear()
Clear the addressed list, i.e. set the size to zero.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Mesh data needed to do the Finite Volume discretisation.
label start() const
Return start label of this patch in the polyMesh face list.
void agglomerateMesh(const fvMesh &, const labelListList &)
Calculate agglomerated mesh.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
Xfer< T > xferCopy(const T &)
Construct by copying the contents of the arg.
const labelListList & edgeLoops() const
Return list of closed loops of boundary vertices.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Foam::autoPtr< IOobject > clone() const
Clone.
label size() const
Return the number of elements in the PtrList.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
mesh addFvPatches(patches)
A List with indirect addressing.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const word & name() const
Return name.
virtual autoPtr< faceZone > clone(const faceZoneMesh &zm) const
Construct and return a clone, resetting the zone mesh.
static void renumber(const labelList &map, labelList &elems)
A list of faces which address into the list of points.