BUG: incorrect HashTable / HashSet instances

- Eg instead of using labelHashSet, used HashSet<label> which uses
  the string::hash for hashing. Other places inadvertently using the
  string::hash instead of Hash<label> for hashing.

STYLE: use Map<..> instead of HashTable<.., label, Hash<label>>

- reduces clutter
This commit is contained in:
Mark Olesen
2018-02-09 09:30:02 +01:00
parent 806b668418
commit 09a6e94073
15 changed files with 47 additions and 88 deletions

View File

@ -451,8 +451,8 @@ void Foam::triSurfaceTools::getMergedEdges
const triSurface& surf,
const label edgeI,
const labelHashSet& collapsedFaces,
HashTable<label, label, Hash<label>>& edgeToEdge,
HashTable<label, label, Hash<label>>& edgeToFace
Map<label>& edgeToEdge,
Map<label>& edgeToFace
)
{
const edge& e = surf.edges()[edgeI];
@ -534,8 +534,8 @@ Foam::scalar Foam::triSurfaceTools::edgeCosAngle
const label v1,
const point& pt,
const labelHashSet& collapsedFaces,
const HashTable<label, label, Hash<label>>& edgeToEdge,
const HashTable<label, label, Hash<label>>& edgeToFace,
const Map<label>& edgeToEdge,
const Map<label>& edgeToFace,
const label facei,
const label edgeI
)
@ -630,8 +630,8 @@ Foam::scalar Foam::triSurfaceTools::collapseMinCosAngle
const label v1,
const point& pt,
const labelHashSet& collapsedFaces,
const HashTable<label, label, Hash<label>>& edgeToEdge,
const HashTable<label, label, Hash<label>>& edgeToFace
const Map<label>& edgeToEdge,
const Map<label>& edgeToFace
)
{
const labelList& v1Faces = surf.pointFaces()[v1];
@ -684,8 +684,8 @@ bool Foam::triSurfaceTools::collapseCreatesFold
const label v1,
const point& pt,
const labelHashSet& collapsedFaces,
const HashTable<label, label, Hash<label>>& edgeToEdge,
const HashTable<label, label, Hash<label>>& edgeToFace,
const Map<label>& edgeToEdge,
const Map<label>& edgeToFace,
const scalar minCos
)
{
@ -749,7 +749,7 @@ bool Foam::triSurfaceTools::collapseCreatesFold
// // neighbours actually contains the
// // edge with which triangle connects to collapsedFaces.
//
// HashTable<label, label, Hash<label>> neighbours;
// Map<label> neighbours;
//
// labelList collapsed = collapsedFaces.toc();
//

View File

@ -54,6 +54,7 @@ SourceFiles
#include "triadFieldFwd.H"
#include "DynamicList.H"
#include "HashSet.H"
#include "Map.H"
#include "FixedList.H"
#include "Pair.H"
#include "vector2D.H"
@ -159,8 +160,8 @@ class triSurfaceTools
const triSurface& surf,
const label edgeI,
const labelHashSet& collapsedFaces,
HashTable<label, label, Hash<label>>& edgeToEdge,
HashTable<label, label, Hash<label>>& edgeToFace
Map<label>& edgeToEdge,
Map<label>& edgeToFace
);
//- Calculates (cos of) angle across edgeI of facei,
@ -172,8 +173,8 @@ class triSurfaceTools
const label v1,
const point& pt,
const labelHashSet& collapsedFaces,
const HashTable<label, label, Hash<label>>& edgeToEdge,
const HashTable<label, label, Hash<label>>& edgeToFace,
const Map<label>& edgeToEdge,
const Map<label>& edgeToFace,
const label facei,
const label edgeI
);
@ -188,8 +189,8 @@ class triSurfaceTools
const label v1,
const point& pt,
const labelHashSet& collapsedFaces,
const HashTable<label, label, Hash<label>>& edgeToEdge,
const HashTable<label, label, Hash<label>>& edgeToFace
const Map<label>& edgeToEdge,
const Map<label>& edgeToFace
);
//- Like collapseMinCosAngle but return true for value < minCos
@ -199,8 +200,8 @@ class triSurfaceTools
const label v1,
const point& pt,
const labelHashSet& collapsedFaces,
const HashTable<label, label, Hash<label>>& edgeToEdge,
const HashTable<label, label, Hash<label>>& edgeToFace,
const Map<label>& edgeToEdge,
const Map<label>& edgeToFace,
const scalar minCos
);
@ -210,7 +211,7 @@ class triSurfaceTools
//(
// const triSurface& surf,
// const label edgeI,
// const HashTable<bool, label, Hash<label>>& collapsedFaces
// const Map<bool>& collapsedFaces
//);
// Tracking