[cig-commits] r4073 - in long/3D/Gale/trunk/src/StGermain: .
Discretisation/Geometry/tests
walter at geodynamics.org
walter at geodynamics.org
Thu Jul 20 20:10:09 PDT 2006
Author: walter
Date: 2006-07-20 20:10:07 -0700 (Thu, 20 Jul 2006)
New Revision: 4073
Modified:
long/3D/Gale/trunk/src/StGermain/
long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.0of1.expected
long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.0of2.expected
long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.c
Log:
r2544 at earth: boo | 2006-07-20 20:01:47 -0700
r2520 at earth (orig r3689): RaquibulHassan | 2006-07-18 23:29:03 -0700
Consolidating the tests in light of the recent bug fixes to the parallel triangulator.
Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
- 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2543
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3688
+ 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2544
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3689
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.0of1.expected
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.0of1.expected 2006-07-21 03:09:58 UTC (rev 4072)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.0of1.expected 2006-07-21 03:10:07 UTC (rev 4073)
@@ -1,13 +1,153 @@
StGermain Framework revision 3667. Copyright (C) 2003-2005 VPAC.
-Num points 1000
-Irregular point-set parallel triangulation test passed..
+Parallel Triangulator..
+Stg_Component (ptr): 0x1138ed8
+Stg_Object (ptr): 0x1138ed8
+ Stg_Class (ptr): 0x1138ed8
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x1138ed8)
+ Num Sites 100
+ Num Edges 0
+ Num Triangles 183
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x1138ed8)
-Num points 2000
-Irregular point-set parallel triangulation test passed..
+Parallel Triangulator..
+Stg_Component (ptr): 0x1138ec8
+Stg_Object (ptr): 0x1138ec8
+ Stg_Class (ptr): 0x1138ec8
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x1138ec8)
+ Num Sites 400
+ Num Edges 0
+ Num Triangles 787
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x1138ec8)
-Num points 3000
-Irregular point-set parallel triangulation test passed..
+Parallel Triangulator..
+Stg_Component (ptr): 0x1138ec8
+Stg_Object (ptr): 0x1138ec8
+ Stg_Class (ptr): 0x1138ec8
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x1138ec8)
+ Num Sites 900
+ Num Edges 0
+ Num Triangles 1780
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x1138ec8)
-Num points 4000
-Irregular point-set parallel triangulation test passed..
+Parallel Triangulator..
+Stg_Component (ptr): 0x1138ec8
+Stg_Object (ptr): 0x1138ec8
+ Stg_Class (ptr): 0x1138ec8
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x1138ec8)
+ Num Sites 1600
+ Num Edges 0
+ Num Triangles 3180
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x1138ec8)
+Testing irregular parallel triangulation..
+Parallel Voronoi Area test: passed
+Parallel Voronoi Sides test: passed
+
+Parallel Triangulator..
+Stg_Component (ptr): 0x1138ec8
+Stg_Object (ptr): 0x1138ec8
+ Stg_Class (ptr): 0x1138ec8
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _de
\ No newline at end of file
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.0of2.expected
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.0of2.expected 2006-07-21 03:09:58 UTC (rev 4072)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.0of2.expected 2006-07-21 03:10:07 UTC (rev 4073)
@@ -1,13 +1,289 @@
StGermain Framework revision 3667. Copyright (C) 2003-2005 VPAC.
-Num points 1000
-Irregular point-set parallel triangulation test passed..
+Parallel Triangulator..
+Stg_Component (ptr): 0x1139148
+Stg_Object (ptr): 0x1139148
+ Stg_Class (ptr): 0x1139148
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x1139148)
+ Num Sites 100
+ Num Edges 0
+ Num Triangles 183
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x1139148)
-Num points 2000
-Irregular point-set parallel triangulation test passed..
+Parallel Triangulator..
+Stg_Component (ptr): 0x113d038
+Stg_Object (ptr): 0x113d038
+ Stg_Class (ptr): 0x113d038
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x113d038)
+ Num Sites 400
+ Num Edges 0
+ Num Triangles 787
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x113d038)
-Num points 3000
-Irregular point-set parallel triangulation test passed..
+Parallel Triangulator..
+Stg_Component (ptr): 0x113d038
+Stg_Object (ptr): 0x113d038
+ Stg_Class (ptr): 0x113d038
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x113d038)
+ Num Sites 900
+ Num Edges 0
+ Num Triangles 1780
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x113d038)
-Num points 4000
-Irregular point-set parallel triangulation test passed..
+Parallel Triangulator..
+Stg_Component (ptr): 0x113d038
+Stg_Object (ptr): 0x113d038
+ Stg_Class (ptr): 0x113d038
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x113d038)
+ Num Sites 1600
+ Num Edges 0
+ Num Triangles 3180
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x113d038)
+Testing irregular parallel triangulation..
+Parallel Voronoi Area test: passed
+Parallel Voronoi Sides test: passed
+
+Parallel Triangulator..
+Stg_Component (ptr): 0x113d038
+Stg_Object (ptr): 0x113d038
+ Stg_Class (ptr): 0x113d038
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x113d038)
+ Num Sites 100
+ Num Edges 0
+ Num Triangles 162
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x113d038)
+
+Parallel Triangulator..
+Stg_Component (ptr): 0x113d038
+Stg_Object (ptr): 0x113d038
+ Stg_Class (ptr): 0x113d038
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x113d038)
+ Num Sites 400
+ Num Edges 0
+ Num Triangles 722
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x113d038)
+
+Parallel Triangulator..
+Stg_Component (ptr): 0x113d038
+Stg_Object (ptr): 0x113d038
+ Stg_Class (ptr): 0x113d038
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x113d038)
+ Num Sites 900
+ Num Edges 0
+ Num Triangles 1682
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x113d038)
+
+Parallel Triangulator..
+Stg_Component (ptr): 0x113d038
+Stg_Object (ptr): 0x113d038
+ Stg_Class (ptr): 0x113d038
+ sizeOfSelf: 296
+ _deleteSelf: Yes
+ type: ParallelDelaunay
+ _delete (func ptr): 0x55218
+ _print (func ptr): 0x55364
+ _copy (func ptr): 0x55438
+ name: Delaunay
+ nameAllocationType: NON_GLOBAL
+ _defaultConstructor (func ptr): 0x54a50
+ _construct (func ptr): 0x5546c
+ _build (func ptr): 0x5548c
+ _initialise (func ptr): 0x56770
+ _execute (func ptr): 0x56790
+ _destroy (func ptr): 0x567b0
+ isConstructed: False
+ isBuilt: True
+ isInitialised: False
+ hasExecuted: False
+ isDestroyed: False
+ constructor function name: Delaunay-Construct
+ build function name: Delaunay-Build
+ initialise function name: Delaunay-Initialise
+ execute function name: Delaunay-Execute
+ destroy function name: Delaunay-Destroy
+Delaunay (ptr): (0x113d038)
+ Num Sites 1600
+ Num Edges 0
+ Num Triangles 3042
+ Num Voronoi Vertices 0
+ParallelDelaunay (ptr): (0x113d038)
+
+Testing regular parallel triangulation..
+Parallel Voronoi Area test: passed
+Parallel Voronoi Sides test: passed
+
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.c 2006-07-21 03:09:58 UTC (rev 4072)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/tests/testParallelDelaunay.c 2006-07-21 03:10:07 UTC (rev 4073)
@@ -36,6 +36,7 @@
#include <stdio.h>
#include <assert.h>
#include <string.h>
+#include "visualizer.c"
typedef enum pointsType_t{
Irregular,
@@ -79,12 +80,71 @@
}
}
+int compareFunc( const void *a, const void *b )
+{
+ int *p, *q;
+
+ p = (int*)a;
+ q = (int*)b;
+
+ if( *p > *q ){
+ return 1;
+ }
+ else if( *p < *q ){
+ return -1;
+ }
+ else{
+ return 0;
+ }
+}
+
+int compareFunction( const void *a, const void *b )
+{
+ int *p, *q;
+
+ p = (int*)a;
+ q = (int*)b;
+
+ if( *p > *q ){
+ return 1;
+ }
+ else if ( *p < *q ){
+ return -1;
+ }
+ else{
+ return 0;
+ }
+}
+
+#define MAX_NEIGH 100
+#define TOLERANCE 0.0001
int main( int argc, char* argv[] ) {
MPI_Comm CommWorld;
int rank;
int numProcessors;
- int procToWatch;
+ Delaunay *d = NULL;
+ ParallelDelaunay *pd = NULL;
+ DelaunayAttributes attr;
+ CoordF *sites;
+ int i = 0, j = 0, k = 0, m = 0;
+ pointsType p;
+ int numSites = 0;
+ int dNeighbours[MAX_NEIGH];
+ int pdNeighbours[MAX_NEIGH];
+ int numNeighboursTest = 0;
+ int voronoiSidesTest = 0;
+ int voronoiAreaTest = 0;
+ int numSitesArray[4] = { 100, 400, 900, 1600 };
+
+ Dictionary *dictionary = NULL;
+ attr.BuildBoundingTriangle = 0;
+ attr.BuildTriangleIndices = 1;
+ attr.CreateVoronoiVertices = 1;
+ attr.CalculateVoronoiSides = 1;
+ attr.CalculateVoronoiSurfaceArea = 1;
+ attr.FindNeighbours = 1;
+
/* Initialise MPI, get world info */
MPI_Init( &argc, &argv );
MPI_Comm_dup( MPI_COMM_WORLD, &CommWorld );
@@ -95,77 +155,114 @@
DiscretisationGeometry_Init( &argc, &argv );
MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+
+ dictionary = Dictionary_New();
+
+ p = Irregular;
- if( argc >= 2 ) {
- procToWatch = atoi( argv[1] );
- }
- else {
- procToWatch = 0;
- }
- if( 1 ) {
- Delaunay *d = NULL;
- ParallelDelaunay *pd = NULL;
- DelaunayAttributes attr;
- CoordF *sites;
- int i = 0;
- pointsType p;
- Dictionary *dictionary = Dictionary_New();
+label: numNeighboursTest = 1;
+ voronoiAreaTest = 1;
+ voronoiSidesTest = 1;
+
+ for( i=0; i<4; i++ ){
+
+ numSites = numSitesArray[i];
- attr.BuildBoundingTriangle = 0;
- attr.BuildTriangleIndices = 1;
- attr.CreateVoronoiVertices = 1;
- attr.CalculateVoronoiSides = 1;
- attr.CalculateVoronoiSurfaceArea = 1;
- attr.FindNeighbours = 1;
+ if( rank == 0 ){
+ sites = malloc( sizeof( CoordF ) * numSites );
+ memset( sites, 0, sizeof( CoordF ) * numSites );
+
+ generatePoints( sites, numSites, &p );
+ }
+
+ pd = ParallelDelaunay_New( "Delaunay", dictionary, sites, numSites, rank, numProcessors, &CommWorld, &attr );
+ Stg_Component_Build( pd, NULL, True );
- /* Testing irregular point-set */
- {
- int pass = 1;
+ ParallelDelaunay_GatherTriangulation( pd );
+ MPI_Barrier( CommWorld );
+
+ if( rank == 0 ){
+
+ d = Delaunay_New( "Delaunay", dictionary, sites, numSites, 0, &attr );
+ Stg_Component_Build( d, NULL, True );
- for( i=1000; i<5000; i+=1000 ){
+ for( j=0; j<numSites; j++ ){
+
+ if( fabs(d->voronoiArea[j] - pd->voronoiArea[j]) > TOLERANCE ){
+ printf( "voronoi area %f of node %d not within tolerance\n", pd->voronoiArea[j], j );
+ voronoiAreaTest = 0;
+ }
+
+ assert( pd->numNeighbours[j] == d->numNeighbours[j] );
- p = Irregular;
- sites = malloc( sizeof( CoordF ) * i );
- memset( sites, 0, sizeof( CoordF ) * i );
-
- generatePoints( sites, i, &p );
+ memset( dNeighbours, 0, sizeof( dNeighbours ) );
+ memset( pdNeighbours, 0, sizeof( pdNeighbours ) );
+
+ memcpy( dNeighbours, d->neighbours[j], sizeof( int ) * d->numNeighbours[j] );
+ memcpy( pdNeighbours, pd->neighbours[j], sizeof( int ) * pd->numNeighbours[j] );
- if( rank == 0 ){
-
+ qsort( dNeighbours, d->numNeighbours[j], sizeof( int ), compareFunction );
+ qsort( pdNeighbours, pd->numNeighbours[j], sizeof( int ), compareFunction );
- d = Delaunay_New( "Delaunay", dictionary, sites, i, 0, &attr );
-
- Stg_Component_Build( d, NULL, True );
+ for( k=0; k<d->numNeighbours[j]; k++ ){
+ assert( dNeighbours[k] == pdNeighbours[k] );
+
+ for( m=0; m<d->numNeighbours[j]; m++ ){
+ if( d->neighbours[j][k] == pd->neighbours[j][m] ){
+ if( fabs(d->voronoiSides[j][k] - pd->voronoiSides[j][m]) > TOLERANCE ){
+ printf( "voronoi side %f of node %d not within tolerance\n", pd->voronoiSides[j][m], j );
+ voronoiSidesTest = 0;
+ }
+ }
+ }
}
+ }
+ Stg_Class_Delete( d );
+
+ printf( "Parallel Triangulator..\n" );
+ Stg_Class_Print( pd, Journal_Register( "stream", Info_Type ) );
+ printf( "\n" );
+ }
- pd = ParallelDelaunay_New( "Delaunay", dictionary, sites, i, rank, numProcessors, &CommWorld, &attr );
- Stg_Component_Build( pd, NULL, True );
+ Stg_Class_Delete( pd );
+
+ if( rank == 0 ){
+ free( sites );
+ }
+ }
- ParallelDelaunay_GatherTriangulation( pd );
- if( rank == 0 ){
- if( d->numTriangles != pd->numTriangles ) pass = 0;
- printf( "Num points %d\n", i );
- printf( "Irregular point-set parallel triangulation test %s\n\n", pass?"passed..":"failed..!" );
-
- Stg_Class_Delete( d );
- }
-
- Stg_Class_Delete( pd );
+ if (rank == 0){
- free( sites );
- }
+ if( p == Irregular ){
+ printf( "Testing irregular parallel triangulation..\n" );
}
-
- Stg_Class_Delete( dictionary );
+ else if ( p == Regular ){
+ printf( "Testing regular parallel triangulation..\n" );
+ }
+
+ if( voronoiAreaTest ){
+ printf( "Parallel Voronoi Area test: passed\n" );
+ }
+
+ if( voronoiSidesTest ){
+ printf( "Parallel Voronoi Sides test: passed\n\n" );
+ }
}
+ if(p == Irregular){
+ p = Regular;
+ goto label;
+ }
+
+ Stg_Class_Delete( dictionary );
+
DiscretisationGeometry_Finalise();
Base_Finalise();
/* Close off MPI */
MPI_Finalize();
-
+ sleep(500);
return 0;
}
More information about the cig-commits
mailing list