[cig-commits] commit: Found a bug in the particle splitting code for

Mercurial hg at geodynamics.org
Mon Nov 24 11:31:10 PST 2008


changeset:   116:05b31774b616
user:        LukeHodkinson
date:        Sat Sep 06 14:45:03 2008 +0000
files:       Utils/src/PCDVC.c
description:
Found a bug in the particle splitting code for
3D systems. Particles being split were created
in "sheets" in the Z direction, one sheet per
element. Fixed.


diff -r 890d548d459c -r 05b31774b616 Utils/src/PCDVC.c
--- a/Utils/src/PCDVC.c	Sat Sep 06 14:12:37 2008 +0000
+++ b/Utils/src/PCDVC.c	Sat Sep 06 14:45:03 2008 +0000
@@ -891,7 +891,7 @@ void _PCDVC_Calculate3D( void* pcdvc, vo
 	      // Add a random number of new particles...
 	      // But Need to add them where they are needed. 
 	      for(i=0;i<ParticlesPerCell;i++){
-		    j  =  (int) ( numx*numy * (rand() / (RAND_MAX + 1.0)));
+		    j  =  (int) ( numx*numy*numz * (rand() / (RAND_MAX + 1.0)));
 		    xi[0] = cells[ j ].x;
 		    xi[1] = cells[ j ].y;
 		    xi[2] = cells[ j ].z;



More information about the CIG-COMMITS mailing list