[cig-commits] r5515 - in long/3D/Gale/trunk/src/Underworld: . Rheology/tests Rheology/tests/expected Rheology/tests/testDirectorRandomness

walter at geodynamics.org walter at geodynamics.org
Thu Dec 7 14:15:01 PST 2006


Author: walter
Date: 2006-12-07 14:15:01 -0800 (Thu, 07 Dec 2006)
New Revision: 5515

Modified:
   long/3D/Gale/trunk/src/Underworld/
   long/3D/Gale/trunk/src/Underworld/Rheology/tests/expected/testDirector2D_RandomDirs.0of1.testDirectorRandomness.dat.expected
   long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorPerMaterial.xml
   long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorRandom.xml
   long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorRandomness/testDirectorRandomness.c
Log:
 r768 at earth:  boo | 2006-12-07 14:13:25 -0800
  r747 at earth (orig r389):  KathleenHumble | 2006-11-22 18:25:01 -0800
  Increasing the no of particlesPerCell so that these
  tests will work with new weights function DVCWeights
  This required a rewrite of testDirectorRandomness.c as it 
  was hardcoded to expect 2 particlesPerCell. 
  Unfortunately this test cannot be rewritten to be more generic, as there
  is no real way to predict the standard Deviation without calculating
  it from the particle direction distributions. SO this test is now
  set up for particlesInCell = 20 , and will only work for this number
  
 



Property changes on: long/3D/Gale/trunk/src/Underworld
___________________________________________________________________
Name: svk:merge
   - 9570c393-cf10-0410-b476-9a651db1e55a:/cig:767
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:388
   + 9570c393-cf10-0410-b476-9a651db1e55a:/cig:768
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:389

Modified: long/3D/Gale/trunk/src/Underworld/Rheology/tests/expected/testDirector2D_RandomDirs.0of1.testDirectorRandomness.dat.expected
===================================================================
--- long/3D/Gale/trunk/src/Underworld/Rheology/tests/expected/testDirector2D_RandomDirs.0of1.testDirectorRandomness.dat.expected	2006-12-07 22:14:58 UTC (rev 5514)
+++ long/3D/Gale/trunk/src/Underworld/Rheology/tests/expected/testDirector2D_RandomDirs.0of1.testDirectorRandomness.dat.expected	2006-12-07 22:15:01 UTC (rev 5515)
@@ -1,5 +1,6 @@
-Swarm has 200 local particles, therefore expect average of 5.6 director normals in each 10 degrees of arc.
+Swarm has 2000 local particles, therefore expect average of 55.6 director normals in each 10 degrees of arc.
 
-The standard deviation of director normals is within tolerance, 1.0, of expected standard deviation, 2.8 
+For confidence interval of 99 percent:
+The standard deviation of director normals is within tolerance, 1.0, of expected standard deviation, 13.6 
 
 All circle angle counts are within range.

Modified: long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorPerMaterial.xml
===================================================================
--- long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorPerMaterial.xml	2006-12-07 22:14:58 UTC (rev 5514)
+++ long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorPerMaterial.xml	2006-12-07 22:15:01 UTC (rev 5515)
@@ -100,7 +100,7 @@
 	<param name="outputPath">./output</param>
 	<param name="dumpEvery"> 1 </param>	
 
-	<param name="particlesPerCell">  2    </param>
+	<param name="particlesPerCell">  20    </param>
 	<param name="SimpleShearFactor">  2    </param>
 
 	<!-- Journal Control -->

Modified: long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorRandom.xml
===================================================================
--- long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorRandom.xml	2006-12-07 22:14:58 UTC (rev 5514)
+++ long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorRandom.xml	2006-12-07 22:15:01 UTC (rev 5515)
@@ -57,7 +57,7 @@
 	<param name="outputPath">./output</param>
 	<param name="dumpEvery"> 1 </param>	
 
-	<param name="particlesPerCell">  2    </param>
+	<param name="particlesPerCell">  20    </param>
 	<param name="SimpleShearFactor">  2    </param>
 
 	<!-- Journal Control -->

Modified: long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorRandomness/testDirectorRandomness.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorRandomness/testDirectorRandomness.c	2006-12-07 22:14:58 UTC (rev 5514)
+++ long/3D/Gale/trunk/src/Underworld/Rheology/tests/testDirectorRandomness/testDirectorRandomness.c	2006-12-07 22:15:01 UTC (rev 5515)
@@ -6,6 +6,7 @@
 #include <Underworld/Rheology/Rheology.h>
 
 #include <assert.h>
+#include <math.h>
 
 #define TEST_RAND_DIR_ERROR 1.0
 
@@ -26,6 +27,8 @@
 	int                     circleAngleSum;
 	double                  circleAngleAverage;
 	double                  circleAngleStdDev;
+	int                  circleAngleLowerBound;
+	int                  circleAngleUpperBound;
 	
 	assert( alignment );
 
@@ -55,11 +58,21 @@
 		"normals in each 10 degrees of arc.\n\n", swarm->particleLocalCount,
 		(double) swarm->particleLocalCount / 36 );
 	circleAngleAverage = (double)swarm->particleLocalCount / 36;
+	/*NB. This definition is determined based on a set no. of particlesPerCell.
+		  Currently this value is = 20 */
+	#define TheoreticalStandardDeviation 13.64
+	circleAngleLowerBound = (int)(floor(circleAngleAverage - 3*TheoreticalStandardDeviation));
+	if (circleAngleLowerBound < 0 ) {
+		circleAngleLowerBound = 0;
+	}
+	circleAngleUpperBound = (int)(floor(circleAngleAverage + 3*TheoreticalStandardDeviation));
+	
+	Journal_Printf( stream, "For confidence interval of 99 percent:\n");
     circleAngleSum = 0;
 	for ( ii =0; ii < 36; ii++ ) {	
-		if (( circleAngleCounts[ii] < 1 )|| (circleAngleCounts[ii] > 14)) {
-			Journal_Printf( stream, "Error: Circle angle %d-%d count = %d is outside range [1, 14].\n"
-				, ii*10, ii*10+9, circleAngleCounts[ii] );
+		if (( circleAngleCounts[ii] < circleAngleLowerBound )|| (circleAngleCounts[ii] > circleAngleUpperBound)) {
+			Journal_Printf( stream, "Error: Circle angle %d-%d count = %d is outside range [%d, %d].\n"
+				, ii*10, ii*10+9, circleAngleCounts[ii], circleAngleLowerBound, circleAngleUpperBound );
 			circleErrorFlag = True;			
 		}
 		circleAngleSum = ((circleAngleAverage - circleAngleCounts[ii]) * 
@@ -67,9 +80,10 @@
 	}
 	/* Calculate standard deviation */
 	circleAngleStdDev = sqrt(circleAngleSum / (36-1));
+	//Journal_Printf( stream, "Standard Deviation = %.2f\n", circleAngleStdDev);
 	
-	#define TheoreticalStandardDeviation 2.82843
 	
+	
 	if (fabs(circleAngleStdDev - TheoreticalStandardDeviation) < TEST_RAND_DIR_ERROR ) {
 		Journal_Printf( stream, "The standard deviation of director normals is within "
 		"tolerance, %.1f, of expected standard deviation, %.1f \n\n", 



More information about the cig-commits mailing list