[cig-commits] r4332 - in long/3D/Gale/trunk/src/StGermain: . Discretisation/Utils/src

walter at geodynamics.org walter at geodynamics.org
Thu Aug 17 17:17:30 PDT 2006


Author: walter
Date: 2006-08-17 17:17:28 -0700 (Thu, 17 Aug 2006)
New Revision: 4332

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/SobolGenerator.c
Log:
 r2710 at earth:  boo | 2006-08-17 17:14:22 -0700
  r2664 at earth (orig r3745):  PatrickSunter | 2006-08-03 03:10:21 -0700
  Updated the SobolGenerator_NewFromTable so that if it runs through the
  whole list of sobol generator numbers (currently 100 different sets),
  it starts again from the beginning.
  
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2709
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3744
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2710
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3745

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/SobolGenerator.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/SobolGenerator.c	2006-08-18 00:17:26 UTC (rev 4331)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/SobolGenerator.c	2006-08-18 00:17:28 UTC (rev 4332)
@@ -473,15 +473,20 @@
 	Index             generatorIndex;
 
 	generatorIndex = generatorCount;
-	generatorCount++;
 
 	/* Make sure that the number generators used from this function is smaller than the number in the table */
 	Journal_Firewall(
-		generatorCount <= sizeof(SobolGenerator_PolynomialDegree)/sizeof(unsigned int),
+		generatorIndex < sizeof(SobolGenerator_PolynomialDegree)/sizeof(unsigned int),
 		Journal_Register( Error_Type, SobolGenerator_Type ),
 		"Error in func '%s' - Trying to instantiate a %dth SobolGenerator ('%s') using table, "
 		"but only %d initial directional numbers have been implemented. Please contact developers.\n",
 		__func__, generatorIndex + 1, name, sizeof(SobolGenerator_PolynomialDegree)/sizeof(unsigned int) );
+	
+	generatorCount++;
+	/* If we reach the end of the array of generators, restart from the first one - PatrickSunter, 3 August 2006 */
+	if ( generatorCount >= sizeof(SobolGenerator_PolynomialDegree)/sizeof(unsigned int) ) {
+		generatorCount = 0;
+	}
 		
 	return SobolGenerator_New( 
 			name,



More information about the cig-commits mailing list