Skip to content
Snippets Groups Projects
Commit 1779687e authored by mattijs's avatar mattijs
Browse files

duplicate function removed

parent d4d4f728
Branches
Tags
No related merge requests found
...@@ -31,168 +31,6 @@ License ...@@ -31,168 +31,6 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Calculates per face a list of global cell/face indices.
void Foam::extendedStencil::calcFaceStencil
(
const labelListList& globalCellCells,
labelListList& faceStencil
)
{
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
const labelList& own = mesh_.faceOwner();
const labelList& nei = mesh_.faceNeighbour();
// Determine neighbouring global cell Cells
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
labelListList neiGlobalCellCells(nBnd);
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
label faceI = pp.start();
forAll(pp, i)
{
neiGlobalCellCells[faceI-mesh_.nInternalFaces()] =
globalCellCells[own[faceI]];
faceI++;
}
}
}
syncTools::swapBoundaryFaceList(mesh_, neiGlobalCellCells, false);
// Construct stencil in global numbering
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
faceStencil.setSize(mesh_.nFaces());
labelHashSet faceStencilSet;
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
{
faceStencilSet.clear();
const labelList& ownCCells = globalCellCells[own[faceI]];
label globalOwn = ownCCells[0];
// Insert cellCells
forAll(ownCCells, i)
{
faceStencilSet.insert(ownCCells[i]);
}
const labelList& neiCCells = globalCellCells[nei[faceI]];
label globalNei = neiCCells[0];
// Insert cellCells
forAll(neiCCells, i)
{
faceStencilSet.insert(neiCCells[i]);
}
// Guarantee owner first, neighbour second.
faceStencil[faceI].setSize(faceStencilSet.size());
label n = 0;
faceStencil[faceI][n++] = globalOwn;
faceStencil[faceI][n++] = globalNei;
forAllConstIter(labelHashSet, faceStencilSet, iter)
{
if (iter.key() != globalOwn && iter.key() != globalNei)
{
faceStencil[faceI][n++] = iter.key();
}
}
//Pout<< "internalface:" << faceI << " toc:" << faceStencilSet.toc()
// << " faceStencil:" << faceStencil[faceI] << endl;
}
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
label faceI = pp.start();
if (pp.coupled())
{
forAll(pp, i)
{
faceStencilSet.clear();
const labelList& ownCCells = globalCellCells[own[faceI]];
label globalOwn = ownCCells[0];
forAll(ownCCells, i)
{
faceStencilSet.insert(ownCCells[i]);
}
// And the neighbours of the coupled cell
const labelList& neiCCells =
neiGlobalCellCells[faceI-mesh_.nInternalFaces()];
label globalNei = neiCCells[0];
forAll(neiCCells, i)
{
faceStencilSet.insert(neiCCells[i]);
}
// Guarantee owner first, neighbour second.
faceStencil[faceI].setSize(faceStencilSet.size());
label n = 0;
faceStencil[faceI][n++] = globalOwn;
faceStencil[faceI][n++] = globalNei;
forAllConstIter(labelHashSet, faceStencilSet, iter)
{
if (iter.key() != globalOwn && iter.key() != globalNei)
{
faceStencil[faceI][n++] = iter.key();
}
}
//Pout<< "coupledface:" << faceI
// << " toc:" << faceStencilSet.toc()
// << " faceStencil:" << faceStencil[faceI] << endl;
faceI++;
}
}
else if (!isA<emptyPolyPatch>(pp))
{
forAll(pp, i)
{
faceStencilSet.clear();
const labelList& ownCCells = globalCellCells[own[faceI]];
label globalOwn = ownCCells[0];
forAll(ownCCells, i)
{
faceStencilSet.insert(ownCCells[i]);
}
// Guarantee owner first, neighbour second.
faceStencil[faceI].setSize(faceStencilSet.size());
label n = 0;
faceStencil[faceI][n++] = globalOwn;
forAllConstIter(labelHashSet, faceStencilSet, iter)
{
if (iter.key() != globalOwn)
{
faceStencil[faceI][n++] = iter.key();
}
}
//Pout<< "boundaryface:" << faceI
// << " toc:" << faceStencilSet.toc()
// << " faceStencil:" << faceStencil[faceI] << endl;
faceI++;
}
}
}
}
Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap
( (
const globalIndex& globalNumbering, const globalIndex& globalNumbering,
......
...@@ -75,13 +75,6 @@ protected: ...@@ -75,13 +75,6 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Collect cell neighbours into extended stencil
void calcFaceStencil
(
const labelListList& globalCellCells,
labelListList& faceStencil
);
//- Calculate distribute map //- Calculate distribute map
autoPtr<mapDistribute> calcDistributeMap autoPtr<mapDistribute> calcDistributeMap
( (
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment