clawpack / clawutil

General utility programs
BSD 3-Clause "New" or "Revised" License
10 stars 31 forks source link

Add function for replacing a rundata data object #73

Closed mandli closed 10 years ago

mandli commented 10 years ago

This adds a simple function for replacing a rundata's data object. This functionality came up in a particular application of GeoClaw where all the rundata objects were essentially the same save for one and it was nice to replace only the one. Care had to be taken to make sure to delete the object's member as well as the object from the data_list as not doing so would mean the object would be replaced by the newer object but the when the write routine was called the older object's write would be called.

Arguably it would be better to in general construct one's own rundata similar to how the basic types are done (classic, amrclaw, geoclaw) but I think this will provide users an easy way to do this themselves with a minimum of fuss.