diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.H b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.H index 292bb61cfa0f5d3b1dcc7286faf8b077c9be05ce..40db9f8b17036d1a9f683db402ff51d1fb2c1ca0 100644 --- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.H +++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.H @@ -54,6 +54,7 @@ SourceFiles #define fvMeshDistribute_H #include "Field.H" +#include "uLabel.H" #include "fvMeshSubset.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -114,14 +115,12 @@ class fvMeshDistribute labelPairHash() {} - label operator()(const labelPair& p) const + label operator()(const labelPair& p, const uLabel tableSize) const { - return label(p[0]*p[0]+p[0]+p[1]); - } - - label operator()(const labelPair& p, const label tableSize) const - { - return mag(operator()(p)) % tableSize; + uLabel p0 = static_cast<uLabel>(p[0]); + uLabel p1 = static_cast<uLabel>(p[1]); + uLabel key = p0*p0+p0+p1; + return key % tableSize; } };