STYLE: use bitSet class instead of PackedBoolList typedef

This commit is contained in:
Mark Olesen
2020-03-18 11:52:31 +01:00
parent d0522f7300
commit 5f115371d1
4 changed files with 52 additions and 52 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2015-2018 OpenCFD Ltd. Copyright (C) 2015-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -189,7 +189,7 @@ Foam::tetDecomposer::tetDecomposer(const polyMesh& mesh)
void Foam::tetDecomposer::setRefinement void Foam::tetDecomposer::setRefinement
( (
const decompositionType decomposeType, const decompositionType decomposeType,
const PackedBoolList& decomposeCell, const bitSet& decomposeCell,
polyTopoChange& meshMod polyTopoChange& meshMod
) )
{ {
@ -213,7 +213,7 @@ void Foam::tetDecomposer::setRefinement
// Determine for every face whether it borders a cell that is decomposed // Determine for every face whether it borders a cell that is decomposed
PackedBoolList decomposeFace(mesh_.nFaces()); bitSet decomposeFace(mesh_.nFaces());
{ {
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++) for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{ {

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd. Copyright (C) 2018-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -42,7 +42,7 @@ SourceFiles
#define tetDecomposer_H #define tetDecomposer_H
#include "DynamicList.H" #include "DynamicList.H"
#include "PackedBoolList.H" #include "bitSet.H"
#include "boolList.H" #include "boolList.H"
#include "typeInfo.H" #include "typeInfo.H"
#include "Enum.H" #include "Enum.H"
@ -192,7 +192,7 @@ public:
void setRefinement void setRefinement
( (
const decompositionType decomposeType, const decompositionType decomposeType,
const PackedBoolList& decomposeCell, const bitSet& decomposeCell,
polyTopoChange& meshMod polyTopoChange& meshMod
); );

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -55,7 +55,7 @@ Foam::label Foam::shortestPathSet::findMinFace
const polyMesh& mesh, const polyMesh& mesh,
const label cellI, const label cellI,
const List<topoDistanceData>& allFaceInfo, const List<topoDistanceData>& allFaceInfo,
const PackedBoolList& isLeakPoint, const bitSet& isLeakPoint,
const bool distanceMode, const bool distanceMode,
const point& origin const point& origin
) )
@ -235,8 +235,8 @@ void Foam::shortestPathSet::calculateDistance
void Foam::shortestPathSet::sync void Foam::shortestPathSet::sync
( (
const polyMesh& mesh, const polyMesh& mesh,
PackedBoolList& isLeakFace, bitSet& isLeakFace,
PackedBoolList& isLeakPoint, bitSet& isLeakPoint,
const label celli, const label celli,
point& origin, point& origin,
bool& findMinDistance bool& findMinDistance
@ -286,8 +286,8 @@ bool Foam::shortestPathSet::touchesWall
const polyMesh& mesh, const polyMesh& mesh,
const label facei, const label facei,
PackedBoolList& isLeakFace, bitSet& isLeakFace,
const PackedBoolList& isLeakPoint const bitSet& isLeakPoint
) const ) const
{ {
// Check if facei touches leakPoint // Check if facei touches leakPoint
@ -378,7 +378,7 @@ bool Foam::shortestPathSet::genSingleLeakPath
const bool markLeakPath, const bool markLeakPath,
const label iter, const label iter,
const polyMesh& mesh, const polyMesh& mesh,
const PackedBoolList& isBlockedFace, const bitSet& isBlockedFace,
const point& insidePoint, const point& insidePoint,
const label insideCelli, const label insideCelli,
const point& outsidePoint, const point& outsidePoint,
@ -393,9 +393,9 @@ bool Foam::shortestPathSet::genSingleLeakPath
DynamicList<scalar>& samplingCurveDist, DynamicList<scalar>& samplingCurveDist,
// State of current leak paths // State of current leak paths
PackedBoolList& isLeakCell, bitSet& isLeakCell,
PackedBoolList& isLeakFace, bitSet& isLeakFace,
PackedBoolList& isLeakPoint, bitSet& isLeakPoint,
// Work storage // Work storage
List<topoDistanceData>& allFaceInfo, List<topoDistanceData>& allFaceInfo,
@ -558,7 +558,7 @@ bool Foam::shortestPathSet::genSingleLeakPath
// Loop until we hit a boundary face // Loop until we hit a boundary face
PackedBoolList isNewLeakPoint(isLeakPoint); bitSet isNewLeakPoint(isLeakPoint);
while (mesh.isInternalFace(frontFaceI)) while (mesh.isInternalFace(frontFaceI))
{ {
if (isBlockedFace.size() && isBlockedFace[frontFaceI]) if (isBlockedFace.size() && isBlockedFace[frontFaceI])
@ -780,8 +780,8 @@ bool Foam::shortestPathSet::genSingleLeakPath
Foam::label Foam::shortestPathSet::erodeFaceSet Foam::label Foam::shortestPathSet::erodeFaceSet
( (
const polyMesh& mesh, const polyMesh& mesh,
const PackedBoolList& isBlockedPoint, const bitSet& isBlockedPoint,
PackedBoolList& isLeakFace bitSet& isLeakFace
) const ) const
{ {
if if
@ -805,7 +805,7 @@ Foam::label Foam::shortestPathSet::erodeFaceSet
while (true) while (true)
{ {
PackedBoolList newIsLeakFace(isLeakFace); bitSet newIsLeakFace(isLeakFace);
// Get number of edges // Get number of edges
@ -827,7 +827,7 @@ Foam::label Foam::shortestPathSet::erodeFaceSet
// Match pp edges to coupled edges // Match pp edges to coupled edges
labelList patchEdges; labelList patchEdges;
labelList coupledEdges; labelList coupledEdges;
PackedBoolList sameEdgeOrientation; bitSet sameEdgeOrientation;
PatchTools::matchEdges PatchTools::matchEdges
( (
pp, pp,
@ -913,7 +913,7 @@ void Foam::shortestPathSet::genSamples
const bool addLeakPath, const bool addLeakPath,
const label maxIter, const label maxIter,
const polyMesh& mesh, const polyMesh& mesh,
const PackedBoolList& isBoundaryFace, const bitSet& isBoundaryFace,
const point& insidePoint, const point& insidePoint,
const label insideCelli, const label insideCelli,
const point& outsidePoint, const point& outsidePoint,
@ -923,9 +923,9 @@ void Foam::shortestPathSet::genSamples
DynamicList<label>& samplingFaces, DynamicList<label>& samplingFaces,
DynamicList<label>& samplingSegments, DynamicList<label>& samplingSegments,
DynamicList<scalar>& samplingCurveDist, DynamicList<scalar>& samplingCurveDist,
PackedBoolList& isLeakCell, bitSet& isLeakCell,
PackedBoolList& isLeakFace, bitSet& isLeakFace,
PackedBoolList& isLeakPoint bitSet& isLeakPoint
) const ) const
{ {
// Mark all paths needed to close a single combination of insidePoint, // Mark all paths needed to close a single combination of insidePoint,
@ -949,7 +949,7 @@ void Foam::shortestPathSet::genSamples
// Boundary face + additional temporary blocks (to force leakpath to // Boundary face + additional temporary blocks (to force leakpath to
// outside) // outside)
autoPtr<PackedBoolList> isBlockedFace; autoPtr<bitSet> isBlockedFace;
label iter; label iter;
bool markLeakPath = false; bool markLeakPath = false;
@ -1051,7 +1051,7 @@ void Foam::shortestPathSet::genSamples
if (!isBlockedFace.valid()) if (!isBlockedFace.valid())
{ {
//Pout<< "** Starting from original boundary faces." << endl; //Pout<< "** Starting from original boundary faces." << endl;
isBlockedFace.set(new PackedBoolList(isBoundaryFace)); isBlockedFace.reset(new bitSet(isBoundaryFace));
} }
markLeakPath = true; markLeakPath = true;
@ -1147,7 +1147,7 @@ void Foam::shortestPathSet::genSamples
const label maxIter, const label maxIter,
const polyMesh& mesh, const polyMesh& mesh,
const labelUList& wallPatches, const labelUList& wallPatches,
const PackedBoolList& isBlockedFace const bitSet& isBlockedFace
) )
{ {
// Storage for sample points // Storage for sample points
@ -1158,7 +1158,7 @@ void Foam::shortestPathSet::genSamples
DynamicList<scalar> samplingCurveDist; DynamicList<scalar> samplingCurveDist;
// Seed faces and points on 'real' boundary // Seed faces and points on 'real' boundary
PackedBoolList isBlockedPoint(mesh.nPoints()); bitSet isBlockedPoint(mesh.nPoints());
{ {
// Real boundaries // Real boundaries
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
@ -1202,11 +1202,11 @@ void Foam::shortestPathSet::genSamples
} }
PackedBoolList isLeakPoint(isBlockedPoint); bitSet isLeakPoint(isBlockedPoint);
// Newly closed faces // Newly closed faces
PackedBoolList isLeakFace(mesh.nFaces()); bitSet isLeakFace(mesh.nFaces());
// All cells along leak paths // All cells along leak paths
PackedBoolList isLeakCell(mesh.nCells()); bitSet isLeakCell(mesh.nCells());
label prevSegmenti = 0; label prevSegmenti = 0;
scalar prevDistance = 0.0; scalar prevDistance = 0.0;
@ -1399,7 +1399,7 @@ Foam::shortestPathSet::shortestPathSet
maxIter, maxIter,
mesh, mesh,
wallPatches, wallPatches,
PackedBoolList(isBlockedFace) bitSet(isBlockedFace)
); );
} }
@ -1431,7 +1431,7 @@ Foam::shortestPathSet::shortestPathSet
} }
} }
genSamples(markLeakPath, maxIter, mesh, wallPatches, PackedBoolList()); genSamples(markLeakPath, maxIter, mesh, wallPatches, bitSet());
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 OpenCFD Ltd. Copyright (C) 2017-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -75,7 +75,7 @@ SourceFiles
#define shortestPathSet_H #define shortestPathSet_H
#include "sampledSet.H" #include "sampledSet.H"
#include "PackedBoolList.H" #include "bitSet.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -112,7 +112,7 @@ class shortestPathSet
const polyMesh& mesh, const polyMesh& mesh,
const label cellI, const label cellI,
const List<topoDistanceData>& allFaceInfo, const List<topoDistanceData>& allFaceInfo,
const PackedBoolList& isLeakPoint, const bitSet& isLeakPoint,
const bool minDistance, const bool minDistance,
const point& origin const point& origin
); );
@ -121,8 +121,8 @@ class shortestPathSet
void sync void sync
( (
const polyMesh& mesh, const polyMesh& mesh,
PackedBoolList& isLeakFace, bitSet& isLeakFace,
PackedBoolList& isLeakPoint, bitSet& isLeakPoint,
const label celli, const label celli,
point& origin, point& origin,
bool& findMinDistance bool& findMinDistance
@ -145,8 +145,8 @@ class shortestPathSet
const polyMesh& mesh, const polyMesh& mesh,
const label facei, const label facei,
PackedBoolList& isLeakFace, bitSet& isLeakFace,
const PackedBoolList& isLeakPoint const bitSet& isLeakPoint
) const; ) const;
//- Removes open-edged faces from set. Ignores edges with both points //- Removes open-edged faces from set. Ignores edges with both points
@ -154,8 +154,8 @@ class shortestPathSet
label erodeFaceSet label erodeFaceSet
( (
const polyMesh& mesh, const polyMesh& mesh,
const PackedBoolList& isBlockedPoint, const bitSet& isBlockedPoint,
PackedBoolList& isLeakFace bitSet& isLeakFace
) const; ) const;
//- Mark faces inbetween leak cells //- Mark faces inbetween leak cells
@ -172,7 +172,7 @@ class shortestPathSet
const bool markLeakPath, const bool markLeakPath,
const label iter, const label iter,
const polyMesh& mesh, const polyMesh& mesh,
const PackedBoolList& isBlockedFace, const bitSet& isBlockedFace,
const point& insidePoint, const point& insidePoint,
const label insideCelli, const label insideCelli,
const point& outsidePoint, const point& outsidePoint,
@ -187,9 +187,9 @@ class shortestPathSet
DynamicList<scalar>& samplingCurveDist, DynamicList<scalar>& samplingCurveDist,
// State of current leak paths // State of current leak paths
PackedBoolList& isLeakCell, bitSet& isLeakCell,
PackedBoolList& isLeakFace, bitSet& isLeakFace,
PackedBoolList& isLeakPoint, bitSet& isLeakPoint,
// Work storage // Work storage
List<topoDistanceData>& allFaceInfo, List<topoDistanceData>& allFaceInfo,
@ -206,7 +206,7 @@ class shortestPathSet
const bool markLeakPath, const bool markLeakPath,
const label maxIter, const label maxIter,
const polyMesh& mesh, const polyMesh& mesh,
const PackedBoolList& isBlockedFace, const bitSet& isBlockedFace,
const point& insidePoint, const point& insidePoint,
const label insideCelli, const label insideCelli,
const point& outsidePoint, const point& outsidePoint,
@ -216,9 +216,9 @@ class shortestPathSet
DynamicList<label>& samplingFaces, DynamicList<label>& samplingFaces,
DynamicList<label>& samplingSegments, DynamicList<label>& samplingSegments,
DynamicList<scalar>& samplingCurveDist, DynamicList<scalar>& samplingCurveDist,
PackedBoolList& isLeakCell, bitSet& isLeakCell,
PackedBoolList& isLeakFace, bitSet& isLeakFace,
PackedBoolList& isLeakPoint bitSet& isLeakPoint
) const; ) const;
//- Generate whole path. With markLeakPath it will block all faces //- Generate whole path. With markLeakPath it will block all faces
@ -232,7 +232,7 @@ class shortestPathSet
const label maxIter, const label maxIter,
const polyMesh& mesh, const polyMesh& mesh,
const labelUList& wallPatches, const labelUList& wallPatches,
const PackedBoolList& blockedFace const bitSet& blockedFace
); );