45 label nChangedFaces(0);
52 const label start = patch.start();
55 changedFaces[nChangedFaces++] = start + faceI;
63 fvMeshSubset subSetMesh(
mesh_, zoneCells);
64 const fvMesh& subMesh = subSetMesh.subMesh();
68 const label
patchID(subMesh.boundaryMesh().findPatchID(patchName));
69 const polyPatch& subMeshPatch = subMesh.boundaryMesh()[
patchID];
72 const label start = subMeshPatch.start();
76 forAll(subMeshPatch.faceCentres(), faceI)
78 changedFaces[nChangedFaces++] =
faceMap[start + faceI];
85 for (label faceI : zoneFaces)
87 changedFaces[nChangedFaces++] = faceI;
90 changedFaces.setSize(nChangedFaces);
91 List<wallPointData<bool>> changedFacesInfo(nChangedFaces);
95 changedFacesInfo[fI] =
96 wallPointData<bool>(faceCentres[changedFaces[fI]],
true, 0.0);
99 meshWave_.setFaceInfo(changedFaces, changedFacesInfo);
108 if (!isFixedCell_[cellID])
124 if (nVisited < marchingStep_ + 1)
126 const labelList& cellCells = mesh_.cellCells()[cI];
127 for (label neiCellI : cellCells)
129 if (!isFixedCell_[neiCellI])
131 if (!isActiveCell_[neiCellI])
133 isActiveCell_[neiCellI] =
true;
134 newlyAddedCells.append(neiCellI);
136 march(nVisited, neiCellI, newlyAddedCells);
145Foam::marchingCells::marchingCells
161 mesh_.cellZones().indices
168 mesh_.faceZones().indices
173 marchingStep_(
dict.
get<label>(
"marchingStep")),
174 isActiveCell_(mesh_.nCells(), false),
175 isFixedCell_(mesh_.nCells(), false),
180 allFaceInfo_(mesh_.nFaces()),
197 meshWave_.iterate(
iters*marchingStep_);
200 addedCells_ =
labelList(mesh_.nCells(), -1);
201 label nAddedCells(0);
204 if (allCellInfo_[cI].data() && !isActiveCell_[cI] && !isFixedCell_[cI])
206 addedCells_[nAddedCells++] = cI;
207 isActiveCell_[cI] =
true;
210 addedCells_.setSize(nAddedCells);
213 activeCells_.append(addedCells_);
221 "activeCells" +
name(nIters_),
224 for (label cellI : activeCells_)
226 activeCellList.insert(cellI);
228 activeCellList.write();
241 for (
const label
cellZoneID : fixedCellZoneIDs)
254 for (
const label cI : fixedCellIDs)
256 isFixedCell_[cI] =
true;
257 isActiveCell_[cI] =
false;
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void append(const T &val)
Append an element at the end of the list.
void setSize(label n)
Alias for resize().
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A collection of cell labels.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the su...
static word exposedPatchName
Name for exposed internal faces (default: oldInternalFaces).
const labelList & faceMap() const
Return face map.
const fvMesh & subMesh() const
Return reference to subset mesh.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
FaceCellWave< wallPointData< bool > > meshWave_
Engine propagating the active cells.
List< wallPointData< bool > > allFaceInfo_
Information for all faces.
void appendSeedCell(const label cellID)
Append cell to seed cells.
List< wallPointData< bool > > allCellInfo_
Information for all cells.
void initialise()
Initialise the active cells from the seeding patches.
labelList addedCells_
Which are the added cells.
bool initialised_
Has the initial seeding been conducted.
label nIters_
Iterations conducted thus far.
boolList isFixedCell_
Should this cell remain incative.
label marchingStep_
Marching step.
boolList isActiveCell_
Whether each cell is curently active or not.
void addFixedCells(const cellZoneMesh &cellZoneMesh, const labelList &fixedCellZoneIDs)
Add fixed cells through cellZone IDs.
labelList seedFaceZoneIDs_
Face zones used as seeds in the marching algorithm.
void update(const label iters=1)
Update active cells.
DynamicList< label > activeCells_
Which are the active cells.
labelHashSet seedPatches_
Patches used as seeds in the marching algorithm.
void march(label nVisited, const label cI, labelList &newlyAddedCells)
labelList seedCellZoneIDs_
Cell zones, the boundary faces of which are used as seeds in the marching algorithm.
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
const vectorField::subField faceCentres() const
Return face centres.
label start() const noexcept
Return start label of this patch in the polyMesh face list.
label nFaces() const noexcept
Number of mesh faces.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
Holds information (coordinate and normal) regarding nearest wall point.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Namespace for handling debugging switches.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
List< label > labelList
A List of labels.
DynamicID< cellZoneMesh > cellZoneID
Foam::cellZoneID.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with cellZone content on a polyMesh.
Field< vector > vectorField
Specialisation of Field<T> for vector.
DynamicID< faceZoneMesh > faceZoneID
Foam::faceZoneID.
static bool initialised_(false)
loopControl iters(runTime, aMesh.solutionDict(), "solution")
#define forAll(list, i)
Loop across all elements in list.