Ignore:
Timestamp:
Jun 9, 2005, 11:23:16 AM (19 years ago)
Author:
matthew
Message:

The re-initialization of semi_implicit_update[k] to 0.0 is now done in the _update C function of quantity_ext.c, instead of the method update_conserved_quantities of domain.py. For run_profile.py, with N=128, the time spend in update_conserved_quantities is cut from 14.00 secs to 8.31 secs (averaged over three runs).

Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/domain.py

    r1464 r1506  
    609609            #Clean up
    610610            #Note that Q.explicit_update is reset by compute_fluxes
    611             Q.semi_implicit_update[:] = 0.0
     611
     612            #MH090605 commented out the following since semi_implicit_update is now re-initialized
     613            #at the end of the _update function in quantity_ext.c (This is called by the
     614            #preceeding Q.update(timestep) statement above).
     615            #For run_profile.py with N=128, the time of update_conserved_quantities is cut from 14.00 secs
     616            #to 8.35 secs
     617           
     618            #Q.semi_implicit_update[:] = 0.0
    612619
    613620    def update_ghosts(self):
  • inundation/ga/storm_surge/pyvolution/quantity_ext.c

    r1486 r1506  
    195195  for (k=0; k<N; k++) {
    196196    denominator = 1.0 - timestep*semi_implicit_update[k];
    197 
    198197    if (denominator == 0.0) {
    199198      return -1;
     
    203202    }
    204203  }
     204  //MH080605 set semi_impliit_update[k] to 0.0 here, rather than in update_conserved_quantities.py
     205  for (k=0;k<N;k++)
     206    semi_implicit_update[k]=0.0;
    205207  return 0;
    206208}
     
    227229
    228230  N = centroid_values -> dimensions[0];
    229 
    230231
    231232  err = _update(N, timestep,
Note: See TracChangeset for help on using the changeset viewer.