Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
633e4c9c
Commit
633e4c9c
authored
Apr 27, 2017
by
Mark OLESEN
Browse files
ENH: Use edgeHashes.H and labelPairHashes.H
- avoids some duplicate code.
parent
799490a3
Changes
26
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.C
View file @
633e4c9c
...
...
@@ -25,7 +25,7 @@ License
#include
"DelaunayMesh.H"
#include
"polyMesh.H"
#include
"labelPair.H"
#include
"labelPair
Hashes
.H"
#include
"PrintTable.H"
#include
"pointIOField.H"
#include
"scalarIOField.H"
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.H
View file @
633e4c9c
...
...
@@ -37,9 +37,7 @@ SourceFiles
#ifndef DelaunayMesh_H
#define DelaunayMesh_H
#include
"Pair.H"
#include
"HashSet.H"
#include
"FixedList.H"
#include
"labelPairHashes.H"
#include
"boundBox.H"
#include
"indexedVertex.H"
#include
"CGALTriangulation3Ddefs.H"
...
...
@@ -77,20 +75,6 @@ public:
typedef
typename
Triangulation
::
Finite_facets_iterator
Finite_facets_iterator
;
typedef
HashSet
<
Pair
<
label
>
,
FixedList
<
label
,
2
>::
Hash
<>
>
labelPairHashSet
;
typedef
HashTable
<
label
,
labelPair
,
FixedList
<
label
,
2
>::
Hash
<>
>
labelTolabelPairHashTable
;
private:
// Private data
...
...
@@ -263,7 +247,7 @@ public:
autoPtr
<
polyMesh
>
createMesh
(
const
fileName
&
name
,
label
TolabelPairHashTable
&
vertexMap
,
label
PairLookup
&
vertexMap
,
labelList
&
cellMap
,
const
bool
writeDelaunayData
=
true
)
const
;
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C
View file @
633e4c9c
...
...
@@ -337,7 +337,7 @@ Foam::autoPtr<Foam::polyMesh>
Foam
::
DelaunayMesh
<
Triangulation
>::
createMesh
(
const
fileName
&
name
,
label
TolabelPairHashTable
&
vertexMap
,
label
PairLookup
&
vertexMap
,
labelList
&
cellMap
,
const
bool
writeDelaunayData
)
const
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C
View file @
633e4c9c
...
...
@@ -31,9 +31,6 @@ License
#include
"indexedVertexEnum.H"
#include
"IOmanip.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
template
<
class
Triangulation
>
...
...
@@ -541,8 +538,7 @@ Foam::label Foam::DistributedDelaunayMesh<Triangulation>::referVertices
{
for
(
typename
labelPairHashSet
::
const_iterator
iter
=
pointsNotInserted
.
begin
();
labelPairHashSet
::
const_iterator
iter
=
pointsNotInserted
.
begin
();
iter
!=
pointsNotInserted
.
end
();
++
iter
)
...
...
@@ -863,7 +859,7 @@ void Foam::DistributedDelaunayMesh<Triangulation>::sync(const boundBox& bb)
template
<
class
Triangulation
>
template
<
class
PointIterator
>
typename
Foam
::
DistributedDelaunayMesh
<
Triangulation
>
::
labelPairHashSet
Foam
::
labelPairHashSet
Foam
::
DistributedDelaunayMesh
<
Triangulation
>::
rangeInsertReferredWithInfo
(
PointIterator
begin
,
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H
View file @
633e4c9c
...
...
@@ -71,10 +71,6 @@ public:
typedef
typename
Triangulation
::
All_cells_iterator
All_cells_iterator
;
typedef
typename
DelaunayMesh
<
Triangulation
>::
labelPairHashSet
labelPairHashSet
;
private:
autoPtr
<
List
<
boundBox
>>
allBackgroundMeshBounds_
;
...
...
@@ -193,12 +189,6 @@ public:
bool
printErrors
=
true
);
// distributeField();
// Queries
};
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C
View file @
633e4c9c
...
...
@@ -635,7 +635,7 @@ void Foam::cellShapeControlMesh::write() const
}
}
DelaunayMesh
<
CellSizeDelaunay
>::
labelTolabelPairHashTable
vertexMap
;
labelPairLookup
vertexMap
;
labelList
cellMap
;
autoPtr
<
polyMesh
>
meshPtr
=
DelaunayMesh
<
CellSizeDelaunay
>::
createMesh
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H
View file @
633e4c9c
...
...
@@ -105,7 +105,7 @@ public:
typedef
Delaunay
::
Facet
Facet
;
typedef
Delaunay
::
Point
Point
;
typedef
List
<
DynamicList
<
Pair
<
labelPair
>>>
labelPairPairDynListList
;
typedef
List
<
DynamicList
<
labelPair
Pair
>>
labelPairPairDynListList
;
typedef
Tuple2
<
pointIndexHit
,
label
>
pointIndexHitAndFeature
;
typedef
List
<
pointIndexHitAndFeature
>
pointIndexHitAndFeatureList
;
...
...
@@ -706,7 +706,7 @@ private:
(
labelList
&
owner
,
labelList
&
neighbour
,
const
HashSet
<
labelPair
,
labelPair
::
Hash
<>>
&
deferredCollapseFaces
const
labelPairHash
Set
&
deferredCollapseFaces
)
const
;
//- Check whether the cell sizes are fine enough. Creates a polyMesh.
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C
View file @
633e4c9c
...
...
@@ -673,7 +673,7 @@ void Foam::conformalVoronoiMesh::deferredCollapseFaceSet
(
labelList
&
owner
,
labelList
&
neighbour
,
const
HashSet
<
labelPair
,
labelPair
::
Hash
<>>
&
deferredCollapseFaces
const
labelPairHash
Set
&
deferredCollapseFaces
)
const
{
DynamicList
<
label
>
faceLabels
;
...
...
@@ -2131,14 +2131,14 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
// Use this processor's vertex index as the master
// for sorting
DynamicList
<
Pair
<
labelPair
>
>&
sortingIndex
=
DynamicList
<
labelPair
Pair
>&
sortingIndex
=
procPatchSortingIndex
[
patchIndex
];
if
(
vB
->
internalOrBoundaryPoint
()
&&
vB
->
referred
())
{
sortingIndex
.
append
(
Pair
<
labelPair
>
labelPair
Pair
(
labelPair
(
vA
->
index
(),
vA
->
procIndex
()),
labelPair
(
vB
->
index
(),
vB
->
procIndex
())
...
...
@@ -2149,7 +2149,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
{
sortingIndex
.
append
(
Pair
<
labelPair
>
labelPair
Pair
(
labelPair
(
vB
->
index
(),
vB
->
procIndex
()),
labelPair
(
vA
->
index
(),
vA
->
procIndex
())
...
...
@@ -2162,14 +2162,14 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
// Use the other processor's vertex index as the
// master for sorting
DynamicList
<
Pair
<
labelPair
>
>&
sortingIndex
=
DynamicList
<
labelPair
Pair
>&
sortingIndex
=
procPatchSortingIndex
[
patchIndex
];
if
(
vA
->
internalOrBoundaryPoint
()
&&
vA
->
referred
())
{
sortingIndex
.
append
(
Pair
<
labelPair
>
labelPair
Pair
(
labelPair
(
vA
->
index
(),
vA
->
procIndex
()),
labelPair
(
vB
->
index
(),
vB
->
procIndex
())
...
...
@@ -2180,7 +2180,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
{
sortingIndex
.
append
(
Pair
<
labelPair
>
labelPair
Pair
(
labelPair
(
vB
->
index
(),
vB
->
procIndex
()),
labelPair
(
vA
->
index
(),
vA
->
procIndex
())
...
...
@@ -2463,7 +2463,7 @@ void Foam::conformalVoronoiMesh::sortProcPatches
faceList
&
faces
=
patchFaces
[
patchi
];
labelList
&
owner
=
patchOwners
[
patchi
];
DynamicList
<
label
>&
slaves
=
patchPointPairSlaves
[
patchi
];
DynamicList
<
Pair
<
labelPair
>
>&
sortingIndices
DynamicList
<
labelPair
Pair
>&
sortingIndices
=
patchSortingIndices
[
patchi
];
if
(
!
sortingIndices
.
empty
())
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C
View file @
633e4c9c
...
...
@@ -199,7 +199,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
Info
<<
nl
<<
"Writing "
<<
"tetDualMesh"
<<
endl
;
DistributedDelaunayMesh
<
Delaunay
>::
labelTolabelPairHashTable
vertexMap
;
labelPairLookup
vertexMap
;
labelList
cellMap
;
autoPtr
<
polyMesh
>
tetMesh
=
createMesh
(
"tetDualMesh"
,
vertexMap
,
cellMap
);
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/pointPairs/pointPairs.C
View file @
633e4c9c
...
...
@@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template
<
class
Triangulation
>
inline
Foam
::
Pair
<
Foam
::
labelPair
>
inline
Foam
::
labelPair
Pair
Foam
::
pointPairs
<
Triangulation
>::
orderPointPair
(
const
labelPair
&
vA
,
...
...
@@ -38,8 +38,8 @@ Foam::pointPairs<Triangulation>::orderPointPair
return
(
(
vA
<
vB
)
?
Pair
<
labelPair
>
(
vA
,
vB
)
:
Pair
<
labelPair
>
(
vB
,
vA
)
?
labelPair
Pair
(
vA
,
vB
)
:
labelPair
Pair
(
vB
,
vA
)
);
}
...
...
@@ -85,7 +85,7 @@ inline bool Foam::pointPairs<Triangulation>::insertPointPair
template
<
class
Triangulation
>
Foam
::
pointPairs
<
Triangulation
>::
pointPairs
(
const
Triangulation
&
triangulation
)
:
ptPairTable
(),
StorageContainer
(),
triangulation_
(
triangulation
)
{}
...
...
@@ -181,7 +181,7 @@ void Foam::pointPairs<Triangulation>::reIndex(const Map<label>& oldToNewIndices)
forAllConstIter
(
pointPairs
,
*
this
,
iter
)
{
Pair
<
labelPair
>
e
=
iter
.
key
();
labelPair
Pair
e
=
iter
.
key
();
labelPair
&
start
=
e
.
first
();
labelPair
&
end
=
e
.
second
();
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/pointPairs/pointPairs.H
View file @
633e4c9c
...
...
@@ -39,20 +39,13 @@ Description
#ifndef pointPairs_H
#define pointPairs_H
#include
"labelPair.H"
#include
"HashSet.H"
#include
"labelPairHashes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
typedef
HashSet
<
Pair
<
labelPair
>
,
FixedList
<
labelPair
,
2
>::
Hash
<>
>
ptPairTable
;
/*---------------------------------------------------------------------------*\
Class pointPairs Declaration
\*---------------------------------------------------------------------------*/
...
...
@@ -60,11 +53,12 @@ typedef HashSet
template
<
class
Triangulation
>
class
pointPairs
:
public
ptPairTable
public
HashSet
<
labelPairPair
,
labelPairPair
::
Hash
<>>
{
// Private typedefs
typedef
typename
Triangulation
::
Vertex_handle
Vertex_handle
;
typedef
HashSet
<
labelPairPair
,
labelPairPair
::
Hash
<>>
StorageContainer
;
typedef
typename
Triangulation
::
Vertex_handle
Vertex_handle
;
// Private data
...
...
@@ -74,7 +68,7 @@ class pointPairs
// Private Member Functions
inline
Pair
<
labelPair
>
orderPointPair
inline
labelPair
Pair
orderPointPair
(
const
labelPair
&
vA
,
const
labelPair
&
vB
...
...
applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracks.C
View file @
633e4c9c
...
...
@@ -45,7 +45,7 @@ Description
#include
"timeSelector.H"
#include
"OFstream.H"
#include
"passiveParticleCloud.H"
#include
"labelPairHashes.H"
#include
"SortableList.H"
#include
"IOobjectList.H"
#include
"PtrList.H"
...
...
@@ -133,8 +133,6 @@ int main(int argc, char *argv[])
fileName
vtkPath
(
runTime
.
path
()
/
"VTK"
);
mkDir
(
vtkPath
);
typedef
HashTable
<
label
,
labelPair
,
labelPair
::
Hash
<>>
trackTableType
;
forAll
(
timeDirs
,
timeI
)
{
runTime
.
setTime
(
timeDirs
[
timeI
],
timeI
);
...
...
@@ -168,13 +166,14 @@ int main(int argc, char *argv[])
label
nTracks
=
0
;
{
trackTableType
trackTable
;
labelPairLookup
trackTable
;
forAll
(
particles
,
i
)
{
const
label
origProc
=
particles
[
i
].
origProc
();
const
label
origId
=
particles
[
i
].
origId
();
const
trackTableType
::
const_iterator
&
iter
=
labelPairLookup
::
const_iterator
iter
=
trackTable
.
find
(
labelPair
(
origProc
,
origId
));
if
(
iter
==
trackTable
.
end
())
...
...
src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C
View file @
633e4c9c
...
...
@@ -25,8 +25,7 @@ License
#include
"cyclicGAMGInterface.H"
#include
"addToRunTimeSelectionTable.H"
#include
"labelPair.H"
#include
"HashTable.H"
#include
"labelPairHashes.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -96,10 +95,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
);
// From coarse cell pair to coarse face
HashTable
<
label
,
labelPair
,
labelPair
::
Hash
<>>
cellsToCoarseFace
(
2
*
localRestrictAddressing
.
size
()
);
labelPairLookup
cellsToCoarseFace
(
2
*
localRestrictAddressing
.
size
());
forAll
(
localRestrictAddressing
,
ffi
)
{
...
...
@@ -126,8 +122,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
);
}
HashTable
<
label
,
labelPair
,
labelPair
::
Hash
<>>::
const_iterator
fnd
=
cellsToCoarseFace
.
find
(
cellPair
);
labelPairLookup
::
const_iterator
fnd
=
cellsToCoarseFace
.
find
(
cellPair
);
if
(
fnd
==
cellsToCoarseFace
.
end
())
{
...
...
src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/processorGAMGInterface/processorGAMGInterface.C
View file @
633e4c9c
...
...
@@ -25,8 +25,7 @@ License
#include
"processorGAMGInterface.H"
#include
"addToRunTimeSelectionTable.H"
#include
"HashTable.H"
#include
"labelPair.H"
#include
"labelPairHashes.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -84,10 +83,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
);
// From coarse cell pair to coarse face
HashTable
<
label
,
labelPair
,
labelPair
::
Hash
<>>
cellsToCoarseFace
(
2
*
localRestrictAddressing
.
size
()
);
labelPairLookup
cellsToCoarseFace
(
2
*
localRestrictAddressing
.
size
());
forAll
(
localRestrictAddressing
,
ffi
)
{
...
...
@@ -114,8 +110,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
);
}
HashTable
<
label
,
labelPair
,
labelPair
::
Hash
<>>::
const_iterator
fnd
=
cellsToCoarseFace
.
find
(
cellPair
);
labelPairLookup
::
const_iterator
fnd
=
cellsToCoarseFace
.
find
(
cellPair
);
if
(
fnd
==
cellsToCoarseFace
.
end
())
{
...
...
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C
View file @
633e4c9c
...
...
@@ -25,7 +25,7 @@ License
#include
"mapDistributeBase.H"
#include
"commSchedule.H"
#include
"Hash
Set
.H"
#include
"
labelPair
Hash
es
.H"
#include
"globalIndex.H"
#include
"ListOps.H"
...
...
@@ -50,7 +50,7 @@ Foam::List<Foam::labelPair> Foam::mapDistributeBase::schedule
List
<
labelPair
>
allComms
;
{
HashSet
<
labelPair
,
labelPair
::
Hash
<>>
commsSet
(
Pstream
::
nProcs
());
labelPairHash
Set
commsSet
(
Pstream
::
nProcs
());
// Find what communication is required
forAll
(
subMap
,
proci
)
...
...
src/conversion/fire/checkFireEdges.C
View file @
633e4c9c
...
...
@@ -25,8 +25,7 @@ License
#include
"checkFireEdges.H"
#include
"polyMesh.H"
#include
"edge.H"
#include
"HashSet.H"
#include
"edgeHashes.H"
#include
"ListOps.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -69,7 +68,6 @@ Foam::label Foam::checkFireEdges
{
label
nFailedEdges
=
0
;
const
bool
fullCheck
=
true
;
typedef
HashSet
<
edge
,
Hash
<
edge
>>
edgeHashSet
;
Info
<<
"Checking edges according to AVL/FIRE on-the-fly methodology..."
<<
endl
;
...
...
src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
View file @
633e4c9c
...
...
@@ -40,6 +40,7 @@ License
#include
"syncTools.H"
#include
"CompactListList.H"
#include
"fvMeshTools.H"
#include
"labelPairHashes.H"
#include
"ListOps.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -982,7 +983,7 @@ void Foam::fvMeshDistribute::findCouples
{
// Store domain neighbour as map so we can easily look for pair
// with same face+proc.
HashTable
<
label
,
labelPair
,
labelPair
::
Hash
<>>
map
(
domainFace
.
size
());
labelPairLookup
map
(
domainFace
.
size
());
forAll
(
domainProc
,
bFacei
)
{
...
...
@@ -1009,8 +1010,7 @@ void Foam::fvMeshDistribute::findCouples
{
labelPair
myData
(
sourceFace
[
bFacei
],
sourceProc
[
bFacei
]);
HashTable
<
label
,
labelPair
,
labelPair
::
Hash
<>>::
const_iterator
iter
=
map
.
find
(
myData
);
labelPairLookup
::
const_iterator
iter
=
map
.
find
(
myData
);
if
(
iter
!=
map
.
end
())
{
...
...
src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C
View file @
633e4c9c
...
...
@@ -36,6 +36,7 @@ License
#include
"faceSet.H"
#include
"cellSet.H"
#include
"pointSet.H"
#include
"labelPairHashes.H"
#include
"OFstream.H"
#include
"Time.H"
#include
"FaceCellWave.H"
...
...
@@ -4625,10 +4626,9 @@ void Foam::hexRef8::checkMesh() const
if
(
pp
.
coupled
())
{
// Check how many faces between owner and neighbour. Should
// be only one.
HashTable
<
label
,
labelPair
,
labelPair
::
Hash
<>>
cellToFace
(
2
*
pp
.
size
());
// Check how many faces between owner and neighbour.
// Should be only one.
labelPairLookup
cellToFace
(
2
*
pp
.
size
());
label
facei
=
pp
.
start
();
...
...
src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C
View file @
633e4c9c
...
...
@@ -128,7 +128,7 @@ void Foam::ParticleTracks<CloudType>::postFace
<<
"Cloud storage not allocated"
<<
abort
(
FatalError
);
}
hitTableType
::
iterator
iter
=
labelPairLookup
::
iterator
iter
=
faceHitCounter_
.
find
(
labelPair
(
p
.
origProc
(),
p
.
origId
()));
label
localI
=
-
1
;
...
...
src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.H
View file @
633e4c9c
...
...
@@ -39,6 +39,7 @@ SourceFiles
#define ParticleTracks_H
#include
"CloudFunctionObject.H"
#include
"labelPairHashes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -61,9 +62,6 @@ class ParticleTracks
//- Convenience typedef for parcel type
typedef
typename
CloudType
::
parcelType
parcelType
;
//- Convenience typedef for hash hit-table
typedef
HashTable
<
label
,
labelPair
,
typename
labelPair
::
Hash
<>>
hitTableType
;
//- Number of face-hit intervals between storing parcel data
label
trackInterval_
;
...
...
@@ -75,7 +73,7 @@ class ParticleTracks
Switch
resetOnWrite_
;
//- Table of number of times a particle has hit a face
hitTableType
faceHitCounter_
;
labelPairLookup
faceHitCounter_
;
//- Pointer to the cloud storage
autoPtr
<
Cloud
<
parcelType
>>
cloudPtr_
;
...
...
@@ -135,8 +133,8 @@ public:
//- Return const access to the reset on write flag
inline
const
Switch
&
resetOnWrite
()
const
;
//- Re
r
urn the table of number of times a particle has hit a face
inline
const
hitTableType
&
faceHitCounter
()
const
;
//- Re
t
urn the table of number of times a particle has hit a face
inline
const
labelPairLookup
&
faceHitCounter
()
const
;
//- Return const access to the cloud
inline
const
Cloud
<
parcelType
>&
cloud
()
const
;
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment