From a6e8df4aa2bc9d5450fb90e1346d2e0af7d441fb Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Thu, 3 Feb 2011 22:20:32 +0000 Subject: [PATCH] ENH: Test-syncTools : remove warning about transformations --- applications/test/syncTools/Test-syncTools.C | 38 ++++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/applications/test/syncTools/Test-syncTools.C b/applications/test/syncTools/Test-syncTools.C index e7fa0ae0b01..094068e94ab 100644 --- a/applications/test/syncTools/Test-syncTools.C +++ b/applications/test/syncTools/Test-syncTools.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,6 +130,7 @@ void testPackedList(const polyMesh& mesh, Random& rndGen) { FatalErrorIn("testPackedList()") << "point:" << i + << " at:" << mesh.points()[i] << " minlabel:" << pointValues[i] << " minbits:" << bits.get(i) << " maxLabel:" << maxPointValues[i] @@ -186,6 +187,10 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { Info<< nl << "Testing Map synchronisation." << endl; + WarningIn("testSparseData()") + << "Position test of sparse data only correct for cases without cyclics" + << " with shared points." << endl; + primitivePatch allBoundary ( SubList<face> @@ -204,7 +209,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) { // Create some data. Use slightly perturbed positions. - Map<vector> sparseData; + Map<point> sparseData; pointField fullData(mesh.nPoints(), point::max); forAll(localPoints, i) @@ -223,14 +228,14 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) ( mesh, sparseData, - minEqOp<vector>() + minMagSqrEqOp<point>() // true // apply separation ); syncTools::syncPointList ( mesh, fullData, - minEqOp<vector>(), + minMagSqrEqOp<point>(), point::max // true // apply separation ); @@ -257,7 +262,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen) } // 2. Does sparseData contain more? - forAllConstIter(Map<vector>, sparseData, iter) + forAllConstIter(Map<point>, sparseData, iter) { const point& sparsePt = iter(); label meshPointI = iter.key(); @@ -374,16 +379,12 @@ void testPointSync(const polyMesh& mesh, Random& rndGen) // Test position. { - WarningIn("testPointSync()") - << "Position test only correct for cases without cyclics" - << " with shared points." << endl; - pointField syncedPoints(mesh.points()); - syncTools::syncPointList + syncTools::syncPointPositions ( mesh, syncedPoints, - minEqOp<point>(), + minMagSqrEqOp<point>(), point::max ); @@ -450,20 +451,16 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen) // Test position. { - WarningIn("testEdgeSync()") - << "Position test only correct for cases without cyclics" - << " with shared edges." << endl; - pointField syncedMids(edges.size()); forAll(syncedMids, edgeI) { syncedMids[edgeI] = edges[edgeI].centre(mesh.points()); } - syncTools::syncEdgeList + syncTools::syncEdgePositions ( mesh, syncedMids, - minEqOp<point>(), + minMagSqrEqOp<point>(), point::max ); @@ -509,10 +506,11 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen) { if (nMasters[edgeI] != 1) { + const edge& e = edges[edgeI]; //FatalErrorIn("testEdgeSync()") WarningIn("testEdgeSync()") << "Edge " << edgeI - << " midpoint " << edges[edgeI].centre(mesh.points()) + << " at:" << mesh.points()[e[0]] << mesh.points()[e[1]] << " has " << nMasters[edgeI] << " masters." //<< exit(FatalError); @@ -532,11 +530,11 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen) { pointField syncedFc(mesh.faceCentres()); - syncTools::syncFaceList + syncTools::syncFacePositions ( mesh, syncedFc, - maxEqOp<point>() + maxMagSqrEqOp<point>() ); forAll(syncedFc, faceI) -- GitLab