Changeset 5531
- Timestamp:
- Jul 18, 2008, 2:49:09 PM (16 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/test_data_manager.py
r5529 r5531 76 76 77 77 78 domain.distribute_to_vertices_and_edges() 78 domain.distribute_to_vertices_and_edges() 79 79 self.initial_stage = copy.copy(domain.quantities['stage'].vertex_values) 80 80 … … 580 580 for t in self.domain.evolve(yieldstep = 1.0, finaltime = 4.0): 581 581 582 582 #########self.domain.write_time(track_speeds=True) 583 583 stage = self.domain.quantities['stage'].vertex_values 584 584 … … 6902 6902 6903 6903 def test_file_boundary_stsIII(self): 6904 """Read correct points from order file6904 """Read correct points from ordering file 6905 6905 """ 6906 6906 from anuga.shallow_water import Domain … … 8490 8490 def test_get_mesh_and_quantities_from_sww_file(self): 8491 8491 """test_get_mesh_and_quantities_from_sww_file(self): 8492 """ 8493 8494 8495 8496 8492 """ 8493 8494 # Generate a test sww file with non trivial georeference 8495 8496 import time, os 8497 8497 from Numeric import array, zeros, allclose, Float, concatenate 8498 8498 from Scientific.IO.NetCDF import NetCDFFile … … 8524 8524 8525 8525 8526 8526 # Read it 8527 8527 8528 8528 # Get mesh and quantities from sww file … … 8541 8541 8542 8542 # Check that time has been recovered 8543 8543 assert allclose(time, range(t_end+1)) 8544 8544 8545 8545 # Check that quantities have been recovered 8546 8546 # (sww files use single precision) 8547 8547 z=domain.get_quantity('elevation').get_values(location='unique vertices') 8548 8548 assert allclose(quantities['elevation'], z) 8549 8549 8550 8550 for q in ['stage', 'xmomentum', 'ymomentum']: -
anuga_core/source/anuga/shallow_water/urs_ext.c
r5530 r5531 116 116 if (!fname) 117 117 { 118 118 //printf("error\n"); 119 119 PyErr_SetString(PyExc_ValueError, "filename not a string"); 120 120 return NULL; … … 256 256 { 257 257 FILE *fp; 258 int nsta, nsta0, i, isrc, ista ;258 int nsta, nsta0, i, isrc, ista, k; 259 259 struct tgsrwg *mytgs=0, *mytgs0=0; 260 260 char *muxFileName; … … 299 299 } 300 300 301 /* loop over remaining sources, check compatibility, and read them into 302 *muxData */ 303 for (isrc = 0; isrc < numSrc; isrc++) 301 /* loop over all sources, read headers and check compatibility */ 302 for (isrc = 0; isrc < numSrc; isrc++) 304 303 { 305 304 muxFileName = muxFileNameArray[isrc]; … … 376 375 377 376 /* make array(s) to hold the demuxed data */ 378 //FIXME: This can be reduced to only contain stations in orderfile377 //FIXME: This can be reduced to only contain stations given in permutation file 379 378 sts_data = (float**)malloc(nsta0*sizeof(float *)); 380 379 if (sts_data == NULL) … … 432 431 433 432 /* loop over stations */ 433 /* This is where we should only take stations with indices in the permutation array 434 (and in that order) */ 435 436 //for i in range(len(permution)): 437 // ista = permutation[i] 438 // use ista with mux data 439 // use i with the processed data to be returned 440 i=0; 441 434 442 for(ista = 0; ista < nsta0; ista++) 435 443 { … … 438 446 439 447 /* weight appropriately and add */ 440 for( i = 0; i < mytgs0[ista].nt; i++)448 for(k = 0; k < mytgs0[ista].nt; k++) 441 449 { 442 if((isdata(sts_data[ista][ i])) && isdata(temp_sts_data[i]))450 if((isdata(sts_data[ista][k])) && isdata(temp_sts_data[k])) 443 451 { 444 sts_data[ista][ i] += temp_sts_data[i] * weights[isrc];445 //printf("%d,%d,%f\n",ista, i,sts_data[ista][i]);452 sts_data[ista][k] += temp_sts_data[k] * weights[isrc]; 453 //printf("%d,%d,%f\n",ista,k,sts_data[ista][k]); 446 454 } 447 455 else 448 456 { 449 sts_data[ista][ i] = NODATA;457 sts_data[ista][k] = NODATA; 450 458 } 451 459 }
Note: See TracChangeset
for help on using the changeset viewer.