diff --git a/src/OpenFOAM/primitives/Pair/labelPair.H b/src/OpenFOAM/primitives/Pair/labelPair.H index 5b75fb503e127ba24c23b4067b6427f1ad02e20d..0e798e7b1519da4f21ed1c4b427722b85f6f1354 100644 --- a/src/OpenFOAM/primitives/Pair/labelPair.H +++ b/src/OpenFOAM/primitives/Pair/labelPair.H @@ -25,7 +25,13 @@ Typedef Foam::labelPair Description - Label pair + A pair of labels. + +Typedef + Foam::labelPairPair + +Description + A pair of labelPairs. Typedef Foam::labelPairList @@ -33,20 +39,28 @@ Typedef Description List of labelPairs +Typedef + Foam::labelPairUList + +Description + UList of labelPairs + \*---------------------------------------------------------------------------*/ #ifndef labelPair_H #define labelPair_H -#include "Pair.H" #include "List.H" +#include "Pair.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef Pair<label> labelPair; + typedef Pair<labelPair> labelPairPair; typedef List<labelPair> labelPairList; + typedef UList<labelPair> labelPairUList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/triSurface/containers/labelPairLookup.H b/src/OpenFOAM/primitives/Pair/labelPairHashes.H similarity index 62% rename from src/meshTools/triSurface/containers/labelPairLookup.H rename to src/OpenFOAM/primitives/Pair/labelPairHashes.H index 7725255a9fcd72dfcc19897673210922a034cb6f..df8c95993e860c2d338a781383d08ecfb816b7b2 100644 --- a/src/meshTools/triSurface/containers/labelPairLookup.H +++ b/src/OpenFOAM/primitives/Pair/labelPairHashes.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -21,35 +21,47 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. +Alias + Foam::LabelPairMap + +Description + A HashTable to objects of type \<T\> with a labelPair key. + The hashing is based on labelPair (FixedList) and is thus non-commutative. + For commutative hashing, an EdgeMap can be used. + +Typedef + Foam::labelPairHashSet + +Description + A HashSet for a labelPair. + The hashing is based on labelPair (FixedList) and is thus non-commutative. + Typedef Foam::labelPairLookup Description - A HashTable for two labels to another label. + This is a Map of a labelPair to a label. Used for e.g. for face1, face2 to shared edge. - -Note - The hash table is based on a FixedList and not edge, since an edge - hashes commutatively! + The hashing is based on labelPair (FixedList) and is thus non-commutative. \*---------------------------------------------------------------------------*/ -#ifndef labelPairLookup_H -#define labelPairLookup_H +#ifndef labelPairHashes_H +#define labelPairHashes_H -#include "FixedList.H" -#include "HashTable.H" +#include "HashSet.H" +#include "labelPair.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef HashTable - < - label, - FixedList<label, 2>, - FixedList<label, 2>::Hash<> - > labelPairLookup; + template<class T> + using LabelPairMap = HashTable<T, labelPair, labelPair::Hash<>>; + + typedef HashSet<labelPair, labelPair::Hash<>> labelPairHashSet; + + typedef HashTable<label, labelPair, labelPair::Hash<>> labelPairLookup; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C index 559bcfc6e645849eeabebe43e4b12d3ee43e9602..8d15aebb2c20903c289804653a7344b6ce2bc8a9 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C @@ -25,7 +25,6 @@ License #include "edgeIntersections.H" #include "triSurfaceSearch.H" -#include "labelPairLookup.H" #include "OFstream.H" #include "HashSet.H" #include "triSurface.H" diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C index eb33629bfaf4a3d37c62ce710d13fd90b0a0f484..7114d09b437571eb856c7dffc37ba7fce0d4d121 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C @@ -25,7 +25,6 @@ License #include "surfaceIntersection.H" #include "triSurfaceSearch.H" -#include "labelPairLookup.H" #include "OFstream.H" #include "HashSet.H" #include "triSurface.H" diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.H b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.H index d316bf2915ccab24f2329845b904608006cf8e74..99265c9b353f5a90d9357015aa872348923eb5b9 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.H +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.H @@ -59,7 +59,7 @@ SourceFiles #include "DynamicList.H" #include "point.H" #include "edge.H" -#include "labelPairLookup.H" +#include "labelPairHashes.H" #include "typeInfo.H" #include "edgeList.H" #include "pointIndexHit.H" diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C index 3ae120f594261c86c5fd59863d534f1431f74e18..cd3af9da0c10aee2746a7f89600cfd85e6d874c5 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C @@ -25,7 +25,7 @@ License #include "surfaceIntersection.H" #include "triSurfaceSearch.H" -#include "labelPairLookup.H" +#include "labelPairHashes.H" #include "OFstream.H" #include "HashSet.H" #include "triSurface.H"