Changeset 287


Ignore:
Timestamp:
Sep 10, 2004, 1:52:02 PM (20 years ago)
Author:
ole
Message:

Cleanup

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

Legend:

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

    r283 r287  
    1818    s = s.strip()
    1919    s = s.replace(' ', '_')
    20     #s = s.replace('(', '{')
    21     #s = s.replace(')', '}')
    2220    s = s.replace('(', '')
    2321    s = s.replace(')', '')
     
    268266
    269267
    270 #Function for storing out to e.g. visualisation
     268#Generic class for storing output to e.g. visualisation or checkpointing
    271269class Data_format:
    272270    """Generic interface to data formats
     
    281279
    282280        #Create filename
    283         #FIXME: This may change if separate timesteps are stored in separate files.
    284281        self.filename = create_filename(domain.get_name(), extension, len(domain))
    285282        self.timestep = 0
     
    287284        self.domain = domain
    288285   
    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       
    305301   
    306302    #FIXME: Should we have a general set_precision function?
    307303   
    308304
    309 #Function for storing out to e.g. visualisation
     305#Function for storing output to e.g. visualisation
    310306class Data_format_sww(Data_format):
    311307    """Interface to native NetCDF format (.sww)
     
    458454
    459455
    460 #Function for storing out to e.g. visualisation
     456
     457
     458#Function for storing xya output
    461459#FIXME Not done yet for this version
    462460class Data_format_xya(Data_format):
     
    523521        #close
    524522        fd.close()
    525 
    526 
    527        
    528523
    529524
  • inundation/ga/storm_surge/pyvolution/netherlands.py

    r286 r287  
    9191N = 264
    9292
    93 N = 600
     93N = 600 #Size = 720000
     94N = 100
     95
    9496
    9597print 'Creating domain'
  • inundation/ga/storm_surge/pyvolution/shallow_water.py

    r281 r287  
    121121            #Store model data, e.g. for subsequent visualisation   
    122122            if self.store is True:
    123                 self.writer.store_timestep('level')
     123                self.store_timestep('level')
    124124                #FIXME: Could maybe be taken from specified list
    125125                #of 'store every step' quantities       
     
    131131
    132132    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
    134135        """
    135136
     
    141142        #Store vertices and connectivity
    142143        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)
    143152       
    144        
    145 
    146     def store_quantity(self, name):
    147         """Store named quantity to file using format and filename
    148         """
    149 
    150         #FIXME: NOT IN USE
    151        
    152         Q = self.quantities[name]
    153         Q.store(self.filename, self.format)
    154        
    155         #FIXME: Use data_manager
    156         #FIXME:
    157         #  Initialisation
    158         #  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         pass   
    166 
    167    
    168 
    169153#Rotation of momentum vector
    170154def rotate(q, normal, direction = 1):
  • inundation/ga/storm_surge/pyvolution/show_balanced_limiters.py

    r282 r287  
    8383for t in domain.evolve(yieldstep = 0.1, finaltime = 30):
    8484    domain.write_time()
    85     #print domain.quantities['level'].centroid_values[:6]
     85
    8686print 'Done'   
    8787   
Note: See TracChangeset for help on using the changeset viewer.