BUG: face: Revert commit 51db019 and add special test for face of size 1

This commit is contained in:
laurence
2013-01-11 12:10:20 +00:00
parent 52c3237876
commit 75a4267684
2 changed files with 19 additions and 4 deletions

View File

@ -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;

View File

@ -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