[cig-commits] r5650 - in long/3D/Gale/trunk/src/PICellerator: . Weights/src

walter at geodynamics.org walter at geodynamics.org
Fri Jan 5 11:33:36 PST 2007


Author: walter
Date: 2007-01-05 11:32:31 -0800 (Fri, 05 Jan 2007)
New Revision: 5650

Modified:
   long/3D/Gale/trunk/src/PICellerator/
   long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.c
   long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.h
   long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.meta
Log:
 r548 at earth (orig r400):  LukeHodkinson | 2007-01-03 22:51:35 -0800
 Merged these files with the latest revision on
 the trunk repository.  Essentially, I was stuck
 using the old weights calculation scheme, which
 was mortally slow.
 
 



Property changes on: long/3D/Gale/trunk/src/PICellerator
___________________________________________________________________
Name: svk:merge
   - 00de75e2-39f1-0310-8538-9683d00a49cc:/branches/decomp3d:399
00de75e2-39f1-0310-8538-9683d00a49cc:/trunk:381
aee11096-cf10-0410-a191-eea5772ba81f:/cig:524
   + 00de75e2-39f1-0310-8538-9683d00a49cc:/branches/decomp3d:400
00de75e2-39f1-0310-8538-9683d00a49cc:/trunk:381
aee11096-cf10-0410-a191-eea5772ba81f:/cig:524

Modified: long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.c
===================================================================
--- long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.c	2007-01-05 19:22:49 UTC (rev 5649)
+++ long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.c	2007-01-05 19:32:31 UTC (rev 5650)
@@ -226,7 +226,8 @@
 ** Private Functions
 */
 
-void get_centroids( struct cell *cells,struct particle *pList,
+/** Get centroids of each voronoi region */
+void _DVCWeights_GetCentroids( struct cell *cells,struct particle *pList,
 		   int n, int m, int l,int nump,double vol){
   int i;
   int *count;
@@ -255,7 +256,8 @@
   }
   free(count);
 }
-void get_centroids2d( struct cell2d *cells,struct particle2d *pList,
+/** Get centroids of each voronoi region in 2D*/
+void _DVCWeights_GetCentroids2D( struct cell2d *cells,struct particle2d *pList,
 		   int n, int m, int nump,double vol){
   int i;
   int *count;
@@ -282,7 +284,8 @@
   free(count);
 }
 
-void claim_cells(struct chain **bbchain,struct cell **ccells,struct particle **pList,int p_i){
+/** Claim a cell for a particle in the list */
+void _DVCWeights_ClaimCells(struct chain **bbchain,struct cell **ccells,struct particle **pList,int p_i){
   int i,count;
   int cell_num0;
   double x0,y0,x1,y1,x2,y2,z0,z1,z2,dist1,dist2;
@@ -326,8 +329,8 @@
 	y0 = cells[cell_num0].y;
 	z0 = cells[cell_num0].z;
 	
-	dist1 = distance(x0,y0,z0,x1,y1,z1);
-	dist2 = distance(x0,y0,z0,x2,y2,z2);
+	dist1 = _DVCWeights_DistanceSquared(x0,y0,z0,x1,y1,z1);
+	dist2 = _DVCWeights_DistanceSquared(x0,y0,z0,x2,y2,z2);
 	if(dist1 > dist2){
 	  bchain->new_claimed_cells[count] = cell_num0;
 	  bchain->numclaimed++;
@@ -340,7 +343,8 @@
   bchain->new_claimed_cells[count] = -1;/*  end of list */
 }
 
-void claim_cells2d(struct chain **bbchain,struct cell2d **ccells,struct particle2d **pList,int p_i){
+/** Claim a cell for a particle in the list  in 2D*/
+void _DVCWeights_ClaimCells2D(struct chain **bbchain,struct cell2d **ccells,struct particle2d **pList,int p_i){
   int i,count;
   int cell_num0;
   double x0,y0,x1,y1,x2,y2,dist1,dist2;
@@ -381,8 +385,8 @@
 	x0 = cells[cell_num0].x;
 	y0 = cells[cell_num0].y;
 	
-	dist1 = distance2d(x0,y0,x1,y1);
-	dist2 = distance2d(x0,y0,x2,y2);
+	dist1 = _DVCWeights_DistanceSquared2D(x0,y0,x1,y1);
+	dist2 = _DVCWeights_DistanceSquared2D(x0,y0,x2,y2);
 	if(dist1 > dist2){
 	  bchain->new_claimed_cells[count] = cell_num0;
 	  bchain->numclaimed++;
@@ -396,7 +400,8 @@
 }
 
 
-void reset_grid(struct cell **cells, int n){
+/** Reset the values in the cells so that the grid over the element can be used again */
+void _DVCWeights_ResetGrid(struct cell **cells, int n){
   int i;
 
   for(i=0;i<n;i++){
@@ -404,7 +409,8 @@
     (*cells)[i].done = 0;
   }
 }
-void reset_grid2d(struct cell2d **cells, int n){
+/** Reset the values in the cells so that the grid over the element can be used again, in 2D */
+void _DVCWeights_ResetGrid2D(struct cell2d **cells, int n){
   int i;
 
   for(i=0;i<n;i++){
@@ -412,7 +418,9 @@
     (*cells)[i].done = 0;
   }
 }
-void update_bchain(struct chain **bbchain,struct cell **ccells,int p_i){
+/** Update the list of the cells on the boundary of the growing voronoi cells 
+	Add new particles on the boundary, and remove particles no longer on the boundary.*/
+void _DVCWeights_UpdateBchain(struct chain **bbchain,struct cell **ccells,int p_i){
   int i,k,count;
   int cell_num0,cell_num[6],cell_num1;
   struct chain *bchain = &(*bbchain)[p_i];
@@ -463,7 +471,9 @@
   }
 }
 
-void update_bchain2d(struct chain **bbchain,struct cell2d **ccells,int p_i){
+/** Update the list of the cells on the boundary of the growing voronoi cells 
+	Add new particles on the boundary, and remove particles no longer on the boundary. In 2D*/
+void _DVCWeights_UpdateBchain2D(struct chain **bbchain,struct cell2d **ccells,int p_i){
   int i,k,count;
   int cell_num0,cell_num[4],cell_num1;
   struct chain *bchain = &(*bbchain)[p_i];
@@ -513,10 +523,9 @@
 }
 
 
-/***********************************************************
-  n m l are z x y grid resolutions respectively.
-************************************************************/
-void construct_grid(struct cell **cell_list, int n, int m, int l,
+/** Construct the grid over the element. This grid is fixed. 
+ (n, m, l) are (z, x, y) grid resolutions respectively.*/
+void _DVCWeights_ConstructGrid(struct cell **cell_list, int n, int m, int l,
 		    double x0,double y0,double z0,double x1,double y1,double z1){
   struct cell *cells;
   int i,j,k;
@@ -570,10 +579,9 @@
   *cell_list = cells; 
 }
 
-/***********************************************************
-  m l are x y grid resolutions respectively.
-************************************************************/
-void construct_grid2d(struct cell2d **cell_list, int m, int l,
+/** Construct the grid over the element. This grid is fixed. 
+  (m, l) are (x, y) grid resolutions respectively.*/
+void _DVCWeights_ConstructGrid2D(struct cell2d **cell_list, int m, int l,
 		    double x0,double y0,double x1,double y1){
   struct cell2d *cells;
   int i,j;
@@ -612,14 +620,30 @@
 }
 
 
-double distance(double x0, double y0, double z0, double x1, double y1, double z1){
-  return (x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)+(z1-z0)*(z1-z0);
+/** Calculate the sqaure of the distance between two points */
+double _DVCWeights_DistanceSquared(double x0, double y0, double z0, double x1, double y1, double z1){
+	double  position0[3], position1[3], vectorDistance[3];
+	double  dist;
+	Vec_SetScalar3D( position0, x0, y0, z0 );
+	Vec_SetScalar3D( position1, x1, y1, z1 );
+	StGermain_VectorSubtraction( vectorDistance, position0, position1, 3 ) ;
+	dist = StGermain_VectorDotProduct(vectorDistance, vectorDistance, 3);
+	return dist;
 }
-double distance2d(double x0, double y0,double x1, double y1){
-  return (x1-x0)*(x1-x0)+(y1-y0)*(y1-y0);
+
+/** Calculate the sqaure of the distance between two points in 2D*/
+double _DVCWeights_DistanceSquared2D(double x0, double y0,double x1, double y1){
+	double  position0[2], position1[2], vectorDistance[2];
+	double dist;
+	Vec_SetScalar2D( position0, x0, y0);	
+	Vec_SetScalar2D( position1, x1, y1);
+	StGermain_VectorSubtraction( vectorDistance, position0, position1, 2 ) ;
+	dist = StGermain_VectorDotProduct(vectorDistance, vectorDistance, 2);
+	return dist;
 }
 
-void init_structs( struct chain **bchain, struct particle **pList, int nump){
+/** Allocate the internal structs for the bchain (boundary chain) and the plist (particle list) */
+void _DVCWeights_InitialiseStructs( struct chain **bchain, struct particle **pList, int nump){
 
    int i;
 /*        init the data structures */
@@ -635,21 +659,19 @@
 	 (*bchain)[i].new_bound_cells_malloced = INC;
       }
       if( (*pList = (struct particle *)malloc( nump*sizeof(struct particle ) )) == 0){
-	 printf("No memory for pList\nCannot continue.\n");
-	 exit(1);
+	 Journal_Firewall( 0 , Journal_Register(Error_Type, "DVC_Weights"),"No memory for pList in '%s'\nCannot continue.\n", __func__);
       }
 
 }
 
-void init_structs2d( struct chain **bchain, struct particle2d **pList, int nump){
+/** Allocate the internal structs for the bchain (boundary chain) and the plist (particle list) */
+void _DVCWeights_InitialiseStructs2D( struct chain **bchain, struct particle2d **pList, int nump){
 
    int i;
 /*        init the data structures */
       if( (*bchain = (struct chain *)malloc( nump*sizeof(struct chain ) )) == 0){
-	 printf("No memory for bchain\nCannot continue.\n");
-	 exit(1);
+	 Journal_Firewall( 0 , Journal_Register(Error_Type, "DVC_Weights"),"No memory for bchain in '%s'\nCannot continue.\n", __func__);
       }
-
       for(i=0;i<nump;i++){
 	 (*bchain)[i].new_claimed_cells = (int *)malloc(INC*sizeof(int));
 	 (*bchain)[i].new_claimed_cells_malloced = INC;
@@ -657,18 +679,15 @@
 	 (*bchain)[i].new_bound_cells_malloced = INC;
       }
       if( (*pList = (struct particle2d *)malloc( nump*sizeof(struct particle2d ) )) == 0){
-	 printf("No memory for pList\nCannot continue.\n");
-	 exit(1);
+	 Journal_Firewall( 0 , Journal_Register(Error_Type, "DVC_Weights"),"No memory for pList in '%s'\nCannot continue.\n", __func__);
       }
 
 }
-/********************************************************************
 
-  All the parameters passed into create_voronoi
-  must be initialised already.
-
-*********************************************************************/
-void create_voronoi( struct chain **bchain, struct particle **pList, struct cell **cells, 
+/** Create the Voronoi diagram by growing the voronoi cells from the particle locations.
+  All the parameters passed into _DVCWeights_CreateVoronoi
+  must be initialised already. */
+void _DVCWeights_CreateVoronoi( struct chain **bchain, struct particle **pList, struct cell **cells, 
 		     double dx, double dy, double dz,
 		     int nump,
 		     int numx, int numy, int numz, 
@@ -683,17 +702,21 @@
 	    k = ((*pList)[i].x - BBXMIN)/dx;
 	    j = ((*pList)[i].y - BBYMIN)/dy;
 	    l = ((*pList)[i].z - BBZMIN)/dz;
-	    (*cells)[k+j*numx+l*numx*numy].p = i; /* particle number i */
-	    (*bchain)[i].numclaimed = 1;/*  number of most recently claimed cells */
+        /* If a particle is exactly on the border then make sure it is in a valid cell inside the element */
+	    if (k == numx){  k--; }
+	    if (j == numy) { j--; }
+	    if (l == numz) { l--; }
+	    (*cells)[k+j*numx+l*numx*numy].p = i; //particle number i
+	    (*bchain)[i].numclaimed = 1;// number of most recently claimed cells
 	    (*bchain)[i].sizeofboundary = 0;
-	    (*bchain)[i].totalclaimed = 1;/*  total of claimed cells so far. */
+	    (*bchain)[i].totalclaimed = 1;// total of claimed cells so far.
 	    (*bchain)[i].done = 0;
-	    (*bchain)[i].index = k+j*numx+l*numx*numy;/*  ith particle is in cell # k+j*numx */
+	    (*bchain)[i].index = k+j*numx+l*numx*numy;// ith particle is in cell # k+j*numx
 	    (*bchain)[i].new_claimed_cells[0] = k+j*numx+l*numx*numy; 
-/* 	     ith particle has just claimed cell number k+j*numx+l*numx*numy */
-	    (*bchain)[i].new_claimed_cells[1] = -1;/*  denotes end of claimed_cells list */
-/* 	     when we have finished claiming cells we call this function. */
-	    update_bchain(bchain,cells,i);
+	    // ith particle has just claimed cell number k+j*numx+l*numx*numy
+	    (*bchain)[i].new_claimed_cells[1] = -1;// denotes end of claimed_cells list
+	    // when we have finished claiming cells we call this function.
+	    _DVCWeights_UpdateBchain(bchain,cells,i);
       }
       count = i;/*  number of particles */
       claimed = 1;
@@ -701,19 +724,17 @@
       while(claimed != 0){
 	    claimed = 0 ;
 	    for(i=0;i<count;i++){
-		  claim_cells(bchain,cells,pList,i);
+		  _DVCWeights_ClaimCells(bchain,cells,pList,i);
 		  claimed += (*bchain)[i].numclaimed;
-		  update_bchain(bchain,cells,i);
+		  _DVCWeights_UpdateBchain(bchain,cells,i);
 	    }
       }/* while */
 }
-/********************************************************************
 
-  All the parameters passed into create_voronoi
-  must be initialised already.
-
-*********************************************************************/
-void create_voronoi2d( struct chain **bchain, struct particle2d **pList, struct cell2d **cells, 
+/** Create the Voronoi diagram by growing the voronoi cells from the particle locations.
+  All the parameters passed into _DVCWeights_CreateVoronoi2D
+  must be initialised already. */
+void _DVCWeights_CreateVoronoi2D( struct chain **bchain, struct particle2d **pList, struct cell2d **cells, 
 		       double dx, double dy,
 		       int nump,
 		       int numx, int numy,
@@ -725,31 +746,41 @@
    for(i=0;i<nump;i++){
       k = ((*pList)[i].x - BBXMIN)/dx;
       j = ((*pList)[i].y - BBYMIN)/dy;
-	    	 
-      (*cells)[k+j*numx].p = i; /* particle number i */
+	/* If particle is on the border exactly, make sure it is
+	   put in a valid cell inside the element */
+	if (k == numx){
+		k--;
+	}
+	if ( j == numy) {
+		j--;
+	}
+	
+      (*cells)[k+j*numx].p = i; //particle number i
       
-      (*bchain)[i].numclaimed = 1;/*  number of most recently claimed cells */
+      (*bchain)[i].numclaimed = 1;// number of most recently claimed cells
       (*bchain)[i].sizeofboundary = 0;
-      (*bchain)[i].totalclaimed = 1;/*  total of claimed cells so far. */
+      (*bchain)[i].totalclaimed = 1;// total of claimed cells so far.
       (*bchain)[i].done = 0;
-      (*bchain)[i].index = k+j*numx;/*  ith particle is in cell # k+j*numx */
-      (*bchain)[i].new_claimed_cells[0] = k+j*numx; /*  ith particle has just claimed cell number k+j*numx */
-      (*bchain)[i].new_claimed_cells[1] = -1;/*  denotes end of claimed_cells list */
-/*        when we have finished claiming cells we call this function. */
-      update_bchain2d( bchain, cells, i);
-   }/* nump */
+      (*bchain)[i].index = k+j*numx;// ith particle is in cell # k+j*numx
+      (*bchain)[i].new_claimed_cells[0] = k+j*numx; // ith particle has just claimed cell number k+j*numx
+      (*bchain)[i].new_claimed_cells[1] = -1;// denotes end of claimed_cells list
+      // when we have finished claiming cells we call this function.
+      _DVCWeights_UpdateBchain2D( bchain, cells, i);
+   }//nump
    
    claimed = 1;
 
    while(claimed != 0){
       claimed = 0 ;
       for(i=0;i<nump;i++){
-	 claim_cells2d( bchain, cells, pList, i);
+	 _DVCWeights_ClaimCells2D( bchain, cells, pList, i);
 	 claimed += (*bchain)[i].numclaimed;
-	 update_bchain2d( bchain, cells, i);
+	 _DVCWeights_UpdateBchain2D( bchain, cells, i);
       }
    }/* while */
 }
+/* Calculate the integration weighting for each particle by contructing
+a voronoi diagram in an element in 3D*/
 void _DVCWeights_Calculate3D( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
 	DVCWeights*             self            = (DVCWeights*)  dvcWeights;
 	Swarm*                       swarm           = (Swarm*) _swarm;
@@ -796,9 +827,9 @@
 	}
 	
 	
-/* 	 init the data structures */
-	init_structs( &bchain, &pList, nump);
-	reset_grid(&cells,numz*numy*numx);
+	/* init the data structures */
+	_DVCWeights_InitialiseStructs( &bchain, &pList, nump);
+	_DVCWeights_ResetGrid(&cells,numz*numy*numx);
 	
 	particle = (IntegrationPoint**)malloc(nump*sizeof(IntegrationPoint*));
 	
@@ -813,10 +844,10 @@
 	      pList[i].z = particle[i]->xi[2];
 	      
 	}
-	create_voronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
-	get_centroids( cells, pList,numz,numy,numx,nump,da);
-/* 	 We are setting the integration points to be the centroids of the Voronoi regions here and */
-/* 	 the weight is the volume of each Voronoi region. */
+	_DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+	_DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
+	/* We are setting the integration points to be the centroids of the Voronoi regions here and
+	 the weight is the volume of each Voronoi region. */
 	for(i=0;i<nump;i++){
 
 	      particle[i]->xi[0] = pList[i].cx;
@@ -834,6 +865,8 @@
 	free(pList);
 
 }
+/* Calculate the integration weighting for each particle by contructing
+a voronoi diagram in an element in 2D*/
 void _DVCWeights_Calculate2D( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
 	DVCWeights*             self            = (DVCWeights*)  dvcWeights;
 	Swarm*                       swarm           = (Swarm*) _swarm;
@@ -876,9 +909,9 @@
 	}
 	
 	
-/* 	 init the data structures */
-	init_structs2d( &bchain, &pList, nump);
-	reset_grid2d(&cells,numy*numx);
+	/* init the data structures */
+	_DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);
+	_DVCWeights_ResetGrid2D(&cells,numy*numx);
 	
 	particle = (IntegrationPoint**)malloc(nump*sizeof(IntegrationPoint*));
 	
@@ -892,10 +925,10 @@
 	      pList[i].y = particle[i]->xi[1];
 	      
 	}
-	create_voronoi2d( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
-	get_centroids2d( cells, pList,numy,numx,nump,da);
-/* 	 We are setting the integration points to be the centroids of the Voronoi regions here and */
-/* 	 the weight is the volume of each Voronoi region. */
+	_DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+	_DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
+	/* We are setting the integration points to be the centroids of the Voronoi regions here and
+	 the weight is the volume of each Voronoi region. */
 	for(i=0;i<nump;i++){
 
 	      particle[i]->xi[0] = pList[i].cx;

Modified: long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.h
===================================================================
--- long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.h	2007-01-05 19:22:49 UTC (rev 5649)
+++ long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.h	2007-01-05 19:32:31 UTC (rev 5650)
@@ -72,7 +72,7 @@
 #define INC 50
 	
 struct cell{
-  int p;/*particle index number */
+  int p;/*particle index number*/
   int index;
   int N;
   int S;
@@ -86,7 +86,7 @@
   int done;
 };
 struct cell2d{
-  int p;/*particle index number*/
+  int p;/* particle index number */
   int index;
   int N;
   int S;
@@ -99,7 +99,7 @@
 struct chain{
   int p;/*particle index number*/
   int index;/*cell number in grid*/
-  int sizeofboundary; /* number of cells on boundary so far*/
+  int sizeofboundary; /* number of cells on boundary so far */
   int numclaimed;
   int totalclaimed;
   int new_bound_cells_malloced;
@@ -126,44 +126,95 @@
   double w;
   int index;
 };
-/* function prototypes*/
-void get_centroids( struct cell *cells,struct particle *pList,
-		   int n,int m, int l,int nump,double vol);
-void claim_cells(struct chain **bchain,struct cell **cells,struct particle **pList,int p_i);
-void update_bchain(struct chain **bchain,struct cell **cells,int p_i);
-void reset_grid(struct cell **cells, int n );
-void reset_grid2d(struct cell2d **cells, int n );
-double distance(double x0, double y0, double z0, double x1, double y1, double z1);
-void construct_grid(struct cell **cell_list, int n,int m, int l,
-		    double x0,double y0,double z0,double x1,double y1,double z1);
-void init_structs( struct chain **bchain, struct particle **pList, int nump);
-void create_voronoi( struct chain **bchain, struct particle **pList, struct cell **cells, 
-		     double dx, double dy, double dz,
-		     int nump,
-		     int numx, int numy, int numz, 
-		     double BBXMIN, double BBXMAX, 
-		     double BBYMIN, double BBYMAX,
-		     double BBZMIN, double BBZMAX);
+/* Private function prototypes in 3D */
+	void   _DVCWeights_GetCentroids(	
+				struct cell *cells,
+				struct particle *pList,
+				int n,
+				int m, 
+				int l,
+				int nump,
+				double vol);
+	void   _DVCWeights_ClaimCells(
+				struct chain **bchain,
+				struct cell **cells,
+				struct particle **pList,
+				int p_i);
+	void   _DVCWeights_UpdateBchain(
+				struct chain **bchain,
+				struct cell **cells,
+				int p_i);
+	void   _DVCWeights_ResetGrid(struct cell **cells, int n );
 
-void get_centroids2d( struct cell2d *cells, struct particle2d *pList,
-		      int n, int m, int nump,double vol);
-void claim_cells2d(struct chain **bchain,struct cell2d **cells,struct particle2d **pList,int p_i);
-void update_bchain2d(struct chain **bchain,struct cell2d **cells,int p_i);
+	double _DVCWeights_DistanceSquared(
+				double x0, double y0, double z0, 
+				double x1, double y1, double z1);
+	void   _DVCWeights_ConstructGrid(
+				struct cell **cell_list, 
+				int n, int m, int l,
+		    	double x0, double y0, double z0,
+				double x1, double y1, double z1);
+	void   _DVCWeights_InitialiseStructs( 
+				struct chain **bchain, 
+				struct particle **pList, 
+				int nump);
+	void   _DVCWeights_CreateVoronoi( 
+				struct chain **bchain, 
+				struct particle **pList, 
+				struct cell **cells, 
+		     	double dx, double dy, double dz,
+		     	int nump,
+		     	int numx, int numy, int numz, 
+		     	double BBXMIN, double BBXMAX, 
+		     	double BBYMIN, double BBYMAX,
+		     	double BBZMIN, double BBZMAX);
+/* Private function prototypes in 2D */
+	void   _DVCWeights_GetCentroids2D( 
+				struct cell2d *cells, 
+				struct particle2d *pList,
+				int n, 
+				int m, 
+				int nump,
+				double vol);
+	void   _DVCWeights_ClaimCells2D(
+				struct chain **bchain,
+				struct cell2d **cells,
+				struct particle2d **pList,
+				int p_i);
+	void   _DVCWeights_UpdateBchain2D(
+				struct chain **bchain,
+				struct cell2d **cells,
+				int p_i);
+	void   _DVCWeights_ResetGrid2D(struct cell2d **cells, int n );
+	double _DVCWeights_DistanceSquared2D(double x0, double y0, double x1, double y1);
+	void   _DVCWeights_ConstructGrid2D(
+				struct cell2d **cell_list, 
+				int m, int l,
+				double x0, double y0,
+				double x1, double y1);
+	void   _DVCWeights_InitialiseStructs2D( 
+				struct chain **bchain, 
+				struct particle2d **pList, 
+				int nump);
+	void   _DVCWeights_CreateVoronoi2D( 
+				struct chain **bchain, 
+				struct particle2d **pList, 
+				struct cell2d **cells, 
+				double dx, double dy,
+				int nump,
+				int numx, int numy,
+				double BBXMIN, double BBXMAX, 
+				double BBYMIN, double BBYMAX);
 
-double distance2d(double x0, double y0, double x1, double y1);
-void construct_grid2d(struct cell2d **cell_list, int m, int l,
-		      double x0,double y0,double x1,double y1);
-void init_structs2d( struct chain **bchain, struct particle2d **pList, int nump);
-void create_voronoi2d( struct chain **bchain, struct particle2d **pList, struct cell2d **cells, 
-		       double dx, double dy,
-		       int nump,
-		       int numx, int numy,
-		       double BBXMIN, double BBXMAX, 
-		       double BBYMIN, double BBYMAX);
+	void   _DVCWeights_Calculate2D( 
+				void* dvcWeights, 
+				void* _swarm, 
+				Cell_LocalIndex lCell_I );
+	void   _DVCWeights_Calculate3D( 
+				void* dvcWeights, 
+				void* _swarm, 
+				Cell_LocalIndex lCell_I );
 
-void _DVCWeights_Calculate2D( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I );
-void _DVCWeights_Calculate3D( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I );
-/* end prototypes*/
 
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors

Modified: long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.meta
===================================================================
--- long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.meta	2007-01-05 19:22:49 UTC (rev 5649)
+++ long/3D/Gale/trunk/src/PICellerator/Weights/src/DVCWeights.meta	2007-01-05 19:32:31 UTC (rev 5650)
@@ -4,7 +4,7 @@
 
 <param name="Name">DVCWeights</param>
 <param name="Organisation">MCC</param>
-<param name="Project">Underworld</param>
+<param name="Project">PICellerator</param>
 <param name="Location">./PICellerator/Weights/src/</param>
 <param name="Project Web">http://mcc.monash.edu.au/Underworld</param>
 <param name="Copyright">Copyright (C) 2006 Monash Cluster Computing.</param>



More information about the cig-commits mailing list