Changeset 287
- Timestamp:
- Sep 10, 2004, 1:52:02 PM (21 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/data_manager.py
r283 r287 18 18 s = s.strip() 19 19 s = s.replace(' ', '_') 20 #s = s.replace('(', '{')21 #s = s.replace(')', '}')22 20 s = s.replace('(', '') 23 21 s = s.replace(')', '') … … 268 266 269 267 270 # Function for storing out to e.g. visualisation268 #Generic class for storing output to e.g. visualisation or checkpointing 271 269 class Data_format: 272 270 """Generic interface to data formats … … 281 279 282 280 #Create filename 283 #FIXME: This may change if separate timesteps are stored in separate files.284 281 self.filename = create_filename(domain.get_name(), extension, len(domain)) 285 282 self.timestep = 0 … … 287 284 self.domain = domain 288 285 289 290 291 def store_connectivity(self): 292 """Writes x,y,z coordinates of triangles constituting 293 the bed elevation. 294 """ 295 296 msg = 'Method should be overridden in concrete class' 297 raise msg 298 299 def store_timestep(self, t, V0, V1, V2): 300 """Store time, water heights (and momentums) to file 301 """ 302 303 msg = 'Method should be overridden in concrete class' 304 raise msg 286 287 # def store_connectivity(self): 288 # """Writes x,y,z coordinates of triangles constituting 289 # the bed elevation. 290 # """ 291 292 # msg = 'Method should be overridden in concrete class' 293 # raise msg 294 295 # def store_timestep(self, t, V0, V1, V2): 296 # """Store time, water heights (and momentums) to file 297 # """ 298 299 # msg = 'Method should be overridden in concrete class' 300 # raise msg 305 301 306 302 #FIXME: Should we have a general set_precision function? 307 303 308 304 309 #Function for storing out to e.g. visualisation305 #Function for storing output to e.g. visualisation 310 306 class Data_format_sww(Data_format): 311 307 """Interface to native NetCDF format (.sww) … … 458 454 459 455 460 #Function for storing out to e.g. visualisation 456 457 458 #Function for storing xya output 461 459 #FIXME Not done yet for this version 462 460 class Data_format_xya(Data_format): … … 523 521 #close 524 522 fd.close() 525 526 527 528 523 529 524 -
inundation/ga/storm_surge/pyvolution/netherlands.py
r286 r287 91 91 N = 264 92 92 93 N = 600 93 N = 600 #Size = 720000 94 N = 100 95 94 96 95 97 print 'Creating domain' -
inundation/ga/storm_surge/pyvolution/shallow_water.py
r281 r287 121 121 #Store model data, e.g. for subsequent visualisation 122 122 if self.store is True: 123 self. writer.store_timestep('level')123 self.store_timestep('level') 124 124 #FIXME: Could maybe be taken from specified list 125 125 #of 'store every step' quantities … … 131 131 132 132 def initialise_storage(self): 133 """Save x,y and bed elevation 133 """Create and initialise self.writer object for storing data. 134 Also, save x,y and bed elevation 134 135 """ 135 136 … … 141 142 #Store vertices and connectivity 142 143 self.writer.store_connectivity() 144 145 def store_timestep(self, name): 146 """Store named quantity and time. 147 148 Precondition: 149 self.write has been initialised 150 """ 151 self.writer.store_timestep(name) 143 152 144 145 146 def store_quantity(self, name):147 """Store named quantity to file using format and filename148 """149 150 #FIXME: NOT IN USE151 152 Q = self.quantities[name]153 Q.store(self.filename, self.format)154 155 #FIXME: Use data_manager156 #FIXME:157 # Initialisation158 # Storing of vertices (static)159 #160 # Storing of elevation (typically static, but...)161 #162 # Storing of level (dynamic)163 # Storing of time (dynamic)164 #165 pass166 167 168 169 153 #Rotation of momentum vector 170 154 def rotate(q, normal, direction = 1): -
inundation/ga/storm_surge/pyvolution/show_balanced_limiters.py
r282 r287 83 83 for t in domain.evolve(yieldstep = 0.1, finaltime = 30): 84 84 domain.write_time() 85 #print domain.quantities['level'].centroid_values[:6] 85 86 86 print 'Done' 87 87
Note: See TracChangeset
for help on using the changeset viewer.