Changeset 4969
- Timestamp:
- Jan 23, 2008, 8:34:11 PM (16 years ago)
- Location:
- anuga_core/source/anuga/advection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/advection/advection.py
r4967 r4969 259 259 260 260 261 print 'N = ',N262 print 'timestep = ',timestep263 print 'huge_timestep = ',huge_timestep261 #print 'N = ',N 262 #print 'timestep = ',timestep 263 #print 'huge_timestep = ',huge_timestep 264 264 265 265 timestep = compute_fluxes(stage_edge,stage_bdry,stage_update, … … 269 269 huge_timestep,max_timestep,v,N) 270 270 271 print 'timestep out2 =',timestep271 #print 'timestep out2 =',timestep 272 272 273 273 self.timestep = timestep -
anuga_core/source/anuga/advection/advection_ext.c
r4967 r4969 25 25 double optimal_timestep; 26 26 double timestep; 27 int I,M,K;27 int k_i,n_m,k_i_j; 28 28 int k,i,j,n,m; 29 29 30 30 timestep = max_timestep; 31 31 32 printf("N = %i\n",N);33 printf("timestep = %g\n",timestep);34 printf("huge_timestep = %g\n",huge_timestep);32 //printf("N = %i\n",N); 33 //printf("timestep = %g\n",timestep); 34 //printf("huge_timestep = %g\n",huge_timestep); 35 35 36 37 36 for (k=0; k<N; k++){ 38 37 optimal_timestep = huge_timestep; 39 38 flux = 0.0; //Reset work array 40 39 for (i=0; i<3; i++){ 41 I = 6*k+i;40 k_i = 3*k+i; 42 41 //Quantities inside volume facing neighbour i 43 ql = stage_edge[I]; 42 ql = stage_edge[k_i]; 43 //printf("stage_edge[%i] = %g\n",k_i,stage_edge[k_i]); 44 44 45 45 //Quantities at neighbour on nearest face 46 n = neighbours[ I];46 n = neighbours[k_i]; 47 47 if (n < 0) { 48 48 m = -n-1; //Convert neg flag to index 49 49 qr = stage_bdry[m]; 50 50 } else { 51 m = neighbour_edges[ I];52 M = 6*n+m;53 qr = stage_edge[ M];51 m = neighbour_edges[k_i]; 52 n_m = 3*n+m; 53 qr = stage_edge[n_m]; 54 54 } 55 55 … … 57 57 //Outward pointing normal vector 58 58 for (j=0; j<2; j++){ 59 K= 6*k+2*i+j;60 normal[j] = normals[ K];59 k_i_j = 6*k+2*i+j; 60 normal[j] = normals[k_i_j]; 61 61 } 62 62 … … 72 72 73 73 max_speed = fabs(normal_velocity); 74 flux = flux - edgeflux * edgelengths[ K];74 flux = flux - edgeflux * edgelengths[k_i]; 75 75 76 76 //Update optimal_timestep … … 91 91 } 92 92 93 printf("timestep out = %g\n",timestep);93 //printf("timestep out = %g\n",timestep); 94 94 95 95 return timestep;
Note: See TracChangeset
for help on using the changeset viewer.