mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: remove old/dead decompositionMethod::calcCellCells code
- alternative calcCellCells that handled explicitConnections was deactivated (2014 or earlier) and finally removed APR-2018.
This commit is contained in:
@ -900,374 +900,9 @@ void Foam::decompositionMethod::calcCellCells
|
||||
}
|
||||
|
||||
|
||||
//void Foam::decompositionMethod::calcCellCells
|
||||
//(
|
||||
// const polyMesh& mesh,
|
||||
// const boolList& blockedFace,
|
||||
// const List<labelPair>& explicitConnections,
|
||||
// const labelList& agglom,
|
||||
// const label nLocalCoarse,
|
||||
// const bool parallel,
|
||||
// CompactListList<label>& cellCells
|
||||
//)
|
||||
//{
|
||||
// const labelList& faceOwner = mesh.faceOwner();
|
||||
// const labelList& faceNeighbour = mesh.faceNeighbour();
|
||||
// const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
//
|
||||
//
|
||||
// // Create global cell numbers
|
||||
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// globalIndex globalAgglom
|
||||
// (
|
||||
// nLocalCoarse,
|
||||
// Pstream::msgType(),
|
||||
// Pstream::worldComm,
|
||||
// parallel
|
||||
// );
|
||||
//
|
||||
//
|
||||
// // Get agglomerate owner on other side of coupled faces
|
||||
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// labelList globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
|
||||
//
|
||||
// for (const polyPatch& pp : patches)
|
||||
// {
|
||||
// if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
// {
|
||||
// label facei = pp.start();
|
||||
// label bFacei = pp.start() - mesh.nInternalFaces();
|
||||
//
|
||||
// forAll(pp, i)
|
||||
// {
|
||||
// globalNeighbour[bFacei] = globalAgglom.toGlobal
|
||||
// (
|
||||
// agglom[faceOwner[facei]]
|
||||
// );
|
||||
//
|
||||
// ++facei;
|
||||
// ++bFacei;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Get the cell on the other side of coupled patches
|
||||
// syncTools::swapBoundaryFaceList(mesh, globalNeighbour);
|
||||
//
|
||||
//
|
||||
// // Count number of faces (internal + coupled)
|
||||
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// // Number of faces per coarse cell
|
||||
// labelList nFacesPerCell(nLocalCoarse, 0);
|
||||
//
|
||||
// // 1. Internal faces
|
||||
// for (label facei = 0; facei < mesh.nInternalFaces(); ++facei)
|
||||
// {
|
||||
// if (!blockedFace[facei])
|
||||
// {
|
||||
// const label own = agglom[faceOwner[facei]];
|
||||
// const label nei = agglom[faceNeighbour[facei]];
|
||||
//
|
||||
// nFacesPerCell[own]++;
|
||||
// nFacesPerCell[nei]++;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 2. Coupled faces
|
||||
// for (const polyPatch& pp : patches)
|
||||
// {
|
||||
// if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
// {
|
||||
// label facei = pp.start();
|
||||
// label bFacei = pp.start()-mesh.nInternalFaces();
|
||||
//
|
||||
// forAll(pp, i)
|
||||
// {
|
||||
// if (!blockedFace[facei])
|
||||
// {
|
||||
// const label own = agglom[faceOwner[facei]];
|
||||
// const label globalNei = globalNeighbour[bFacei];
|
||||
//
|
||||
// if
|
||||
// (
|
||||
// !globalAgglom.isLocal(globalNei)
|
||||
// || globalAgglom.toLocal(globalNei) != own
|
||||
// )
|
||||
// {
|
||||
// nFacesPerCell[own]++;
|
||||
// }
|
||||
//
|
||||
// ++facei;
|
||||
// ++bFacei;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 3. Explicit connections between non-coupled boundary faces
|
||||
// forAll(explicitConnections, i)
|
||||
// {
|
||||
// const labelPair& baffle = explicitConnections[i];
|
||||
// label f0 = baffle.first();
|
||||
// label f1 = baffle.second();
|
||||
//
|
||||
// if (!blockedFace[f0] && blockedFace[f1])
|
||||
// {
|
||||
// label f0Own = agglom[faceOwner[f0]];
|
||||
// label f1Own = agglom[faceOwner[f1]];
|
||||
//
|
||||
// // Always count the connection between the two owner sides
|
||||
// if (f0Own != f1Own)
|
||||
// {
|
||||
// nFacesPerCell[f0Own]++;
|
||||
// nFacesPerCell[f1Own]++;
|
||||
// }
|
||||
//
|
||||
// // Add any neighbour side connections
|
||||
// if (mesh.isInternalFace(f0))
|
||||
// {
|
||||
// label f0Nei = agglom[faceNeighbour[f0]];
|
||||
//
|
||||
// if (mesh.isInternalFace(f1))
|
||||
// {
|
||||
// // Internal faces
|
||||
// label f1Nei = agglom[faceNeighbour[f1]];
|
||||
//
|
||||
// if (f0Own != f1Nei)
|
||||
// {
|
||||
// nFacesPerCell[f0Own]++;
|
||||
// nFacesPerCell[f1Nei]++;
|
||||
// }
|
||||
// if (f0Nei != f1Own)
|
||||
// {
|
||||
// nFacesPerCell[f0Nei]++;
|
||||
// nFacesPerCell[f1Own]++;
|
||||
// }
|
||||
// if (f0Nei != f1Nei)
|
||||
// {
|
||||
// nFacesPerCell[f0Nei]++;
|
||||
// nFacesPerCell[f1Nei]++;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // f1 boundary face
|
||||
// if (f0Nei != f1Own)
|
||||
// {
|
||||
// nFacesPerCell[f0Nei]++;
|
||||
// nFacesPerCell[f1Own]++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (mesh.isInternalFace(f1))
|
||||
// {
|
||||
// label f1Nei = agglom[faceNeighbour[f1]];
|
||||
// if (f0Own != f1Nei)
|
||||
// {
|
||||
// nFacesPerCell[f0Own]++;
|
||||
// nFacesPerCell[f1Nei]++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // Fill in offset and data
|
||||
// // ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// cellCells.setSize(nFacesPerCell);
|
||||
//
|
||||
// nFacesPerCell = 0;
|
||||
//
|
||||
// labelList& m = cellCells.m();
|
||||
// const labelList& offsets = cellCells.offsets();
|
||||
//
|
||||
// // 1. For internal faces is just offsetted owner and neighbour
|
||||
// for (label facei = 0; facei < mesh.nInternalFaces(); ++facei)
|
||||
// {
|
||||
// if (!blockedFace[facei])
|
||||
// {
|
||||
// label own = agglom[faceOwner[facei]];
|
||||
// label nei = agglom[faceNeighbour[facei]];
|
||||
//
|
||||
// m[offsets[own] + nFacesPerCell[own]++] =
|
||||
// globalAgglom.toGlobal(nei);
|
||||
// m[offsets[nei] + nFacesPerCell[nei]++] =
|
||||
// globalAgglom.toGlobal(own);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 2. For boundary faces is offsetted coupled neighbour
|
||||
// for (const polyPatch& pp : patches)
|
||||
// {
|
||||
// if (pp.coupled() && (parallel || !isA<processorPolyPatch>(pp)))
|
||||
// {
|
||||
// label facei = pp.start();
|
||||
// label bFacei = pp.start()-mesh.nInternalFaces();
|
||||
//
|
||||
// forAll(pp, i)
|
||||
// {
|
||||
// if (!blockedFace[facei])
|
||||
// {
|
||||
// label own = agglom[faceOwner[facei]];
|
||||
//
|
||||
// label globalNei = globalNeighbour[bFacei];
|
||||
//
|
||||
// if
|
||||
// (
|
||||
// !globalAgglom.isLocal(globalNei)
|
||||
// || globalAgglom.toLocal(globalNei) != own
|
||||
// )
|
||||
// {
|
||||
// m[offsets[own] + nFacesPerCell[own]++] = globalNei;
|
||||
// }
|
||||
//
|
||||
// ++facei;
|
||||
// ++bFacei;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 3. Explicit connections between non-coupled boundary faces
|
||||
// forAll(explicitConnections, i)
|
||||
// {
|
||||
// const labelPair& baffle = explicitConnections[i];
|
||||
// label f0 = baffle.first();
|
||||
// label f1 = baffle.second();
|
||||
//
|
||||
// if (!blockedFace[f0] && blockedFace[f1])
|
||||
// {
|
||||
// label f0Own = agglom[faceOwner[f0]];
|
||||
// label f1Own = agglom[faceOwner[f1]];
|
||||
//
|
||||
// // Always count the connection between the two owner sides
|
||||
// if (f0Own != f1Own)
|
||||
// {
|
||||
// m[offsets[f0Own] + nFacesPerCell[f0Own]++] =
|
||||
// globalAgglom.toGlobal(f1Own);
|
||||
// m[offsets[f1Own] + nFacesPerCell[f1Own]++] =
|
||||
// globalAgglom.toGlobal(f0Own);
|
||||
// }
|
||||
//
|
||||
// // Add any neighbour side connections
|
||||
// if (mesh.isInternalFace(f0))
|
||||
// {
|
||||
// label f0Nei = agglom[faceNeighbour[f0]];
|
||||
//
|
||||
// if (mesh.isInternalFace(f1))
|
||||
// {
|
||||
// // Internal faces
|
||||
// label f1Nei = agglom[faceNeighbour[f1]];
|
||||
//
|
||||
// if (f0Own != f1Nei)
|
||||
// {
|
||||
// m[offsets[f0Own] + nFacesPerCell[f0Own]++] =
|
||||
// globalAgglom.toGlobal(f1Nei);
|
||||
// m[offsets[f1Nei] + nFacesPerCell[f1Nei]++] =
|
||||
// globalAgglom.toGlobal(f1Nei);
|
||||
// }
|
||||
// if (f0Nei != f1Own)
|
||||
// {
|
||||
// m[offsets[f0Nei] + nFacesPerCell[f0Nei]++] =
|
||||
// globalAgglom.toGlobal(f1Own);
|
||||
// m[offsets[f1Own] + nFacesPerCell[f1Own]++] =
|
||||
// globalAgglom.toGlobal(f0Nei);
|
||||
// }
|
||||
// if (f0Nei != f1Nei)
|
||||
// {
|
||||
// m[offsets[f0Nei] + nFacesPerCell[f0Nei]++] =
|
||||
// globalAgglom.toGlobal(f1Nei);
|
||||
// m[offsets[f1Nei] + nFacesPerCell[f1Nei]++] =
|
||||
// globalAgglom.toGlobal(f0Nei);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // f1 boundary face
|
||||
// if (f0Nei != f1Own)
|
||||
// {
|
||||
// m[offsets[f0Nei] + nFacesPerCell[f0Nei]++] =
|
||||
// globalAgglom.toGlobal(f1Own);
|
||||
// m[offsets[f1Own] + nFacesPerCell[f1Own]++] =
|
||||
// globalAgglom.toGlobal(f0Nei);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (mesh.isInternalFace(f1))
|
||||
// {
|
||||
// label f1Nei = agglom[faceNeighbour[f1]];
|
||||
// if (f0Own != f1Nei)
|
||||
// {
|
||||
// m[offsets[f0Own] + nFacesPerCell[f0Own]++] =
|
||||
// globalAgglom.toGlobal(f1Nei);
|
||||
// m[offsets[f1Nei] + nFacesPerCell[f1Nei]++] =
|
||||
// globalAgglom.toGlobal(f0Own);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // Check for duplicates connections between cells
|
||||
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// // Done as postprocessing step since we now have cellCells.
|
||||
// label newIndex = 0;
|
||||
// labelHashSet nbrCells;
|
||||
//
|
||||
//
|
||||
// if (cellCells.size() == 0)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// label startIndex = cellCells.offsets()[0];
|
||||
//
|
||||
// forAll(cellCells, celli)
|
||||
// {
|
||||
// nbrCells.clear();
|
||||
// nbrCells.insert(globalAgglom.toGlobal(celli));
|
||||
//
|
||||
// label endIndex = cellCells.offsets()[celli+1];
|
||||
//
|
||||
// for (label i = startIndex; i < endIndex; ++i)
|
||||
// {
|
||||
// if (nbrCells.insert(cellCells.m()[i]))
|
||||
// {
|
||||
// cellCells.m()[newIndex++] = cellCells.m()[i];
|
||||
// }
|
||||
// }
|
||||
// startIndex = endIndex;
|
||||
// cellCells.offsets()[celli+1] = newIndex;
|
||||
// }
|
||||
//
|
||||
// cellCells.m().setSize(newIndex);
|
||||
//
|
||||
// //forAll(cellCells, celli)
|
||||
// //{
|
||||
// // Pout<< "Original: Coarse cell " << celli << endl;
|
||||
// // forAll(mesh.cellCells()[celli], i)
|
||||
// // {
|
||||
// // Pout<< " nbr:" << mesh.cellCells()[celli][i] << endl;
|
||||
// // }
|
||||
// // Pout<< "Compacted: Coarse cell " << celli << endl;
|
||||
// // const labelUList cCells = cellCells[celli];
|
||||
// // forAll(cCells, i)
|
||||
// // {
|
||||
// // Pout<< " nbr:" << cCells[i] << endl;
|
||||
// // }
|
||||
// //}
|
||||
//}
|
||||
|
||||
// NOTE:
|
||||
// - alternative calcCellCells that handled explicitConnections was
|
||||
// deactivated (2014 or earlier) and finally removed APR-2018.
|
||||
|
||||
Foam::labelList Foam::decompositionMethod::decompose
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user