Skip to content

Commit

Permalink
added first layer of cells to molecule
Browse files Browse the repository at this point in the history
  • Loading branch information
iBatistic committed Nov 20, 2024
1 parent 4ee11b4 commit 6d598db
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,47 @@ void higherOrderGrad::makeStencils() const
const label cellID = faceCells[faceI];
const label gI = faceI + boundaryMesh[patchI].start();
cellBoundaryFaces[cellID].append(gI);

// Here I will add first layer of cells to the boundary molecule

// List of cells surrounding this boundary face cell
const labelList & bouCellCells = cellCells[cellID];

forAll(bouCellCells, cellI)
{
const label cellID = bouCellCells[cellI];

// Get the face labels of the cell
const labelList& cellFaces = mesh.cells()[cellID];

// Loop over faces and add faces to the molecule only if
// they are not gradient, empty or coupled
forAll(cellFaces, faceI)
{
const label faceID = cellFaces[faceI];

if (faceID > mesh.nInternalFaces())
{
forAll(boundaryMesh, patchI)
{
if
(
includePatchInStencils_[patchI]
&& boundaryMesh[patchI].type() != emptyPolyPatch::typeName
&& !boundaryMesh[patchI].coupled()
)
{
const label start = boundaryMesh[patchI].start();
const label nFaces = boundaryMesh[patchI].nFaces();
if (faceID >= start && faceID < start + nFaces)
{
cellBoundaryFaces[cellID].append(faceID);
}
}
}
}
}
}
}
}
}
Expand Down

0 comments on commit 6d598db

Please sign in to comment.