diff --git a/applications/test/Circulator/Test-Circulator.C b/applications/test/Circulator/Test-Circulator.C index 1369ef6e59ba7f27e974105724b538c1130b8f34..2d8ecd3765aed3ac8892e38a10053d2aad2be6a0 100644 --- a/applications/test/Circulator/Test-Circulator.C +++ b/applications/test/Circulator/Test-Circulator.C @@ -131,6 +131,10 @@ int main(int argc, char *argv[]) Info<< "Compare " << face1 << " and " << face1 << " Match = " << face::compare(face1, face1) << endl; + face face2(identity(1)+1); + Info<< "Compare " << face1 << " and " << face2 + << " Match = " << face::compare(face1, face2) << endl; + Info<< nl << nl << "Zero face" << nl << endl; face fZero; diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index fcf273cc353294a72d250e01547f13f7d22eed1d..21576535e9aad00966b892337190341a071ef953 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -318,6 +318,17 @@ int Foam::face::compare(const face& a, const face& b) { return 0; } + else if (sizeA == 1) + { + if (a[0] == b[0]) + { + return 1; + } + else + { + return 0; + } + } const_circulator<face> aCirc(a); const_circulator<face> bCirc(b); @@ -338,10 +349,10 @@ int Foam::face::compare(const face& a, const face& b) // If the circulator has stopped then faces a and b do not share a matching // point. Doesn't work on matching, single element face. - //if (!bCirc.circulate()) - //{ - // return 0; - //} + if (!bCirc.circulate()) + { + return 0; + } // Look forwards around the faces for a match do