[cig-commits] r5700 - in long/3D/Gale/trunk/src/Gale: . plugins/SurfaceProcess

walter at geodynamics.org walter at geodynamics.org
Mon Jan 8 23:47:51 PST 2007


Author: walter
Date: 2007-01-08 23:47:51 -0800 (Mon, 08 Jan 2007)
New Revision: 5700

Modified:
   long/3D/Gale/trunk/src/Gale/
   long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c
Log:
 r108 at earth:  boo | 2007-01-08 23:47:11 -0800
  r106 at earth (orig r75):  WalterLandry | 2007-01-08 15:35:31 -0800
  Make surface process compile
 



Property changes on: long/3D/Gale/trunk/src/Gale
___________________________________________________________________
Name: svk:merge
   - 4e4aea6e-fd02-0410-981f-80ab108a5659:/trunk:74
8f887497-cf10-0410-afc2-df8ae19c7fb0:/cig:107
   + 4e4aea6e-fd02-0410-981f-80ab108a5659:/trunk:75
8f887497-cf10-0410-afc2-df8ae19c7fb0:/cig:108

Modified: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c	2007-01-09 07:47:48 UTC (rev 5699)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c	2007-01-09 07:47:51 UTC (rev 5700)
@@ -71,24 +71,32 @@
 	/*
 	** SURFACE PROCESS CODE GOES HERE, SHOULD MODIFY THE HEIGHTS ONLY.
 	*/
-#if 0
+#if 1
 	{
-		for( n_i = 0; n_i < surface->nodeDomainCount; n_i++ ) {
-			if( surface->topo->nDims == 1 ) {
-				if( n_i > 0 && n_i < self->nodeDomainCount - 1 ) {
-					double	dx = surface->nodeCoord[n_i][0] - surface->nodeCoord[n_i - 1][0];
+          if( surface->topo->nDims == 1 ) {
+            int n_i;
+            int nx=Mesh_GetLocalSize(surface,MT_VERTEX);
+            double newVal[nx];
 
-					newVal = (surface->heights[n_i - 1] - 2.0 * surface->heights[n_i] + surface->heights[n_i + 1]) / 
-						(dx * dx);
-				}
-			}
-			else {
-				abort();
-			}
-
-			surface->heights[n_i] += newVal / dt;
-		}
-	}
+            for( n_i = 0; n_i < nx; n_i++ ) {
+              if( n_i > 0 && n_i < nx - 1 ) {
+                double	dx = surface->verts[n_i][0]
+                  - surface->verts[n_i - 1][0];
+                
+                newVal[n_i] = (heights[n_i - 1] - 2.0 * heights[n_i]
+                               + heights[n_i + 1]) / (dx * dx);
+              }
+            }
+            for( n_i = 0; n_i < nx; n_i++ ) {
+              if( n_i > 0 && n_i < nx - 1 ) {
+                heights[n_i] = heights[n_i] + newVal[n_i]*dt;
+              }
+            }
+          }
+          else {
+            abort();
+          }
+        }
 #endif
 	/*
 	** END SURFACE PROCESS CODE.



More information about the cig-commits mailing list