Changeset 7340


Ignore:
Timestamp:
Aug 8, 2009, 2:19:58 AM (15 years ago)
Author:
ole
Message:

More refactoring in preparation for ticket:191
These are mostly simplifications of sww file creation

Location:
anuga_core/source/anuga
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py

    r7276 r7340  
    1717from anuga.pmesh.mesh import Mesh
    1818from anuga.shallow_water import Domain, Transmissive_boundary
    19 from anuga.shallow_water.data_manager import get_dataobject
     19from anuga.shallow_water.data_manager import SWW_file
    2020from csv import reader,writer
    2121import time
     
    169169        #Now read data from sww and check
    170170        from Scientific.IO.NetCDF import NetCDFFile
    171         filename = domain1.get_name() + '.' + domain1.format
     171        filename = domain1.get_name() + '.sww'
    172172        fid = NetCDFFile(filename)
    173173
     
    381381        #Now read data from sww and check
    382382        from Scientific.IO.NetCDF import NetCDFFile
    383         filename = domain1.get_name() + '.' + domain1.format
     383        filename = domain1.get_name() + '.sww'
    384384        fid = NetCDFFile(filename)
    385385
     
    630630        domain.set_name(filename)
    631631        domain.store = True
    632         domain.format = 'sww'   #Native netcdf visualisation format
    633632
    634633        #print points
     
    656655            #Store and advance time
    657656            domain.time = t
    658             domain.store_timestep(domain.conserved_quantities)
     657            domain.store_timestep()
    659658            t += dt
    660659
     
    796795        domain.set_name(filename)
    797796        domain.store = True
    798         domain.format = 'sww'   #Native netcdf visualisation format
    799797
    800798        #print points
     
    16141612
    16151613        domain.set_name('datatest' + str(time.time()))
    1616         domain.format = 'sww'
    16171614        domain.smooth = True
    16181615        domain.reduction = mean
    16191616
    16201617
    1621         sww = get_dataobject(domain)
     1618        sww = SWW_file(domain)
    16221619        sww.store_connectivity()
    16231620        sww.store_timestep(['stage', 'xmomentum', 'ymomentum','elevation'])
     
    16871684        from anuga.pmesh.mesh import Mesh
    16881685        from anuga.shallow_water import Domain, Transmissive_boundary
    1689         from anuga.shallow_water.data_manager import get_dataobject
    16901686        from csv import reader,writer
    16911687        import time
     
    17371733
    17381734        domain.set_name('datatest' + str(time.time()))
    1739         domain.format = 'sww'
    17401735        domain.smooth = True
    17411736        domain.reduction = mean
    17421737
    1743         sww = get_dataobject(domain)
     1738        sww = SWW_file(domain)
    17441739        sww.store_connectivity()
    17451740        sww.store_timestep(['stage', 'xmomentum', 'ymomentum'])
     
    18571852
    18581853        domain.set_name('datatest' + str(time.time()))
    1859         domain.format = 'sww'
    18601854        domain.smooth = True
    18611855        domain.reduction = mean
    18621856
    1863         sww = get_dataobject(domain)
     1857        sww = SWW_file(domain)
    18641858        sww.store_connectivity()
    18651859        sww.store_timestep(['stage', 'xmomentum', 'ymomentum','elevation'])
  • anuga_core/source/anuga/damage_modelling/test_inundation_damage.py

    r7276 r7340  
    1515from anuga.shallow_water import Domain, Transmissive_boundary
    1616from anuga.utilities.numerical_tools import mean
    17 from anuga.shallow_water.data_manager import get_dataobject
     17from anuga.shallow_water.data_manager import SWW_file
    1818
    1919import numpy as num
     
    112112        self.domain.reduction = mean
    113113
    114         sww = get_dataobject(self.domain)
     114        sww = SWW_file(self.domain)
    115115        sww.store_connectivity()
    116116        sww.store_timestep(['stage', 'xmomentum', 'ymomentum'])
     
    182182        domain.reduction = mean
    183183
    184         sww = get_dataobject(domain)
     184        sww = SWW_file(domain)
    185185        sww.store_connectivity()
    186186        sww.store_timestep(['stage', 'xmomentum', 'ymomentum'])
     
    282282        domain.reduction = mean
    283283
    284         sww = get_dataobject(domain)
     284        sww = SWW_file(domain)
    285285        sww.store_connectivity()
    286286        sww.store_timestep(['stage', 'xmomentum', 'ymomentum'])
     
    354354        domain.reduction = mean
    355355
    356         sww = get_dataobject(domain)
     356        sww = SWW_file(domain)
    357357        sww.store_connectivity()
    358358        sww.store_timestep(['stage', 'xmomentum', 'ymomentum'])
  • anuga_core/source/anuga/fit_interpolate/test_interpolate.py

    r7276 r7340  
    2424from anuga.shallow_water import Domain, Transmissive_boundary
    2525from anuga.utilities.numerical_tools import mean, NAN
    26 from anuga.shallow_water.data_manager import get_dataobject
     26from anuga.shallow_water.data_manager import SWW_file
    2727from anuga.geospatial_data.geospatial_data import Geospatial_data
    2828from anuga.pmesh.mesh import Mesh
     
    17101710
    17111711        domain.set_name('datatest' + str(time.time()))
    1712         domain.format = 'sww'
    17131712        domain.smooth = True
    17141713        domain.reduction = mean
    17151714
    1716         sww = get_dataobject(domain)
     1715        sww = SWW_file(domain)
    17171716        sww.store_connectivity()
    17181717        sww.store_timestep(['stage', 'xmomentum', 'ymomentum'])
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r7339 r7340  
    329329##
    330330# @brief Class for storing output to e.g. visualisation
    331 class Data_format_sww(Data_format):
     331class SWW_file(Data_format):
    332332    """Interface to native NetCDF format (.sww) for storing model output
    333333
     
    434434        fid = NetCDFFile(self.filename, netcdf_mode_a)
    435435
    436 #        # Get the variables
    437 #        x = fid.variables['x']
    438 #        y = fid.variables['y']
    439 #        z = fid.variables['elevation']
    440 #        volumes = fid.variables['volumes']
    441 
    442436        # Get X, Y and bed elevation Z
    443437        Q = domain.quantities['elevation']
     
    456450
    457451    ##
    458     # @brief Store time and named quantities to the underlying data file.
    459     # @param names The names of the quantities to store.
    460     # @note If 'names' not supplied, store a standard set of quantities.
     452    # @brief Store time and time dependent quantities
     453    # to the underlying data file.
    461454    def store_timestep(self, names=None):
    462         """Store time and named quantities to file
     455        """Store time and time dependent quantities
    463456        """
    464457
     
    468461        from os import stat
    469462
    470         if names is None:
    471             # Standard shallow water wave equation quantitites in ANUGA
    472             names = ['stage', 'xmomentum', 'ymomentum']
     463        # Get names of quantities to be stored every time step
     464        names = self.writer.dynamic_quantities   
    473465
    474466        # Get NetCDF
     
    521513
    522514            # Build a new data_structure.
    523             next_data_structure = Data_format_sww(self.domain, mode=self.mode,
     515            next_data_structure = SWW_file(self.domain, mode=self.mode,
    524516                                                  max_size=self.max_size,
    525517                                                  recursion=self.recursion+1)
     
    618610##
    619611# @brief Class for handling checkpoints data
    620 class Data_format_cpt(Data_format):
    621     """Interface to native NetCDF format (.cpt)
     612# @note This is not operational at the moment
     613class CPT_file(Data_format):
     614    """Interface to native NetCDF format (.cpt) to be
     615    used for checkpointing (one day)
    622616    """
    623617
     
    705699
    706700    ##
    707     # @brief Store tiem and named quantities to underlying data file.
     701    # @brief Store time and named quantities to underlying data file.
    708702    # @param name
    709703    def store_timestep(self, name):
     
    14641458    infile.close()
    14651459    outfile.close()
    1466 
    1467 
    1468 ##
    1469 # @brief Return instance of class of given format using filename.
    1470 # @param domain Data domain (eg, 'sww', etc).
    1471 # @param mode The mode to open domain in.
    1472 # @return A class instance of required domain and mode.
    1473 #Get data objects
    1474 def get_dataobject(domain, mode=netcdf_mode_w):
    1475     """Return instance of class of given format using filename
    1476     """
    1477 
    1478     cls = eval('Data_format_%s' % domain.format)
    1479     return cls(domain, mode)
    14801460
    14811461
     
    39873967                        domain.format))
    39883968
    3989     sww = get_dataobject(domain)
     3969    sww = SWW_file(domain)
    39903970    sww.store_connectivity()
    39913971    sww.store_timestep()
     
    53235303    volumes = mesh_dic['generatedtrianglelist']
    53245304
    5325     # write sww intro and grid stuff.
     5305    # Write sww intro and grid stuff.
    53265306    if basename_out is None:
    53275307        swwname = basename_in + '.sww'
     
    59835963            outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
    59845964
    5985         # FIXME: Backwartds compat get rid of z once old view has retired       
    5986                                
     5965        # FIXME: Backwards compat - get rid of z once old view has retired
    59875966        outfile.createVariable('z', sww_precision,
    5988                                ('number_of_points',))                               
     5967                               ('number_of_points',))
    59895968                               
    59905969        for q in self.dynamic_quantities:
     
    60005979
    60015980        if isinstance(times, (list, num.ndarray)):
    6002             outfile.variables['time'][:] = times    #Store time relative
     5981            outfile.variables['time'][:] = times    # Store time relative
    60035982
    60045983        if verbose:
     
    60976076            log.critical('------------------------------------------------')
    60986077
    6099         #z = resize(bath_grid, outfile.variables['z'][:].shape)
    61006078        outfile.variables['x'][:] = points[:,0] #- geo_ref.get_xllcorner()
    61016079        outfile.variables['y'][:] = points[:,1] #- geo_ref.get_yllcorner()
     
    61186096    # @param verbose True if this function is to be verbose.
    61196097    # @param **quant
    6120     def store_quantities(self, outfile, sww_precision=num.float32,
    6121                          slice_index=None, time=None,
    6122                          verbose=False, **quant):
     6098    def store_quantities(self,
     6099                         outfile,
     6100                         sww_precision=num.float32,
     6101                         slice_index=None,
     6102                         time=None,
     6103                         verbose=False,
     6104                         **quant):
    61236105        """
    6124         Write the quantity info.
     6106        Write the quantity info at each timestep.
    61256107
    61266108        **quant is extra keyword arguments passed in. These must be
    6127           the sww quantities, currently; stage, xmomentum, ymomentum.
     6109          the numpy arrays to be stored in the sww file at each timestep.
    61286110
    61296111        if the time array is already been built, use the slice_index
     
    61406122
    61416123        Precondition:
    6142             triangulation and
    6143             header have been called.
     6124            store_triangulation and
     6125            store_header have been called.
    61446126        """
    61456127
     
    61496131            file_time[slice_index] = time
    61506132        else:
    6151             slice_index = int(slice_index) # In case it was numpy.int   
    6152 
    6153         # Write the conserved quantities from Domain.
    6154         # Typically stage,  xmomentum, ymomentum
    6155         # other quantities will be ignored, silently.
    6156         # Also write the ranges: stage_range,
    6157         # xmomentum_range and ymomentum_range
     6133            slice_index = int(slice_index) # Has to be cast in case it was numpy.int   
     6134
     6135        # Write the named dynamic quantities
     6136        # The dictionary quant must contain numpy arrays for each name.
     6137        # These will typically be the conserved quantities from Domain
     6138        # (Typically stage,  xmomentum, ymomentum).
     6139        #
     6140        # Arrays not listed in dynamic_quantitiues will be ignored, silently.
     6141        #
     6142        # This method will also write the ranges for each quantity,
     6143        # e.g. stage_range, xmomentum_range and ymomentum_range
    61586144        for q in self.dynamic_quantities:
    61596145            if not quant.has_key(q):
    6160                 msg = 'SWW file can not write quantity %s' % q
     6146                msg = 'Values for quantity %s was not specified in ' % q
     6147                msg += 'store_quantities so they cannot be stored.'
    61616148                raise NewQuantity, msg
    61626149            else:
  • anuga_core/source/anuga/shallow_water/data_manager_joaquims_patch.py

    r4814 r7340  
    292292
    293293#Class for storing output to e.g. visualisation
    294 class Data_format_sww(Data_format):
     294class SWW_file(Data_format):
    295295    """Interface to native NetCDF format (.sww) for storing model output
    296296
     
    487487            # Build a new data_structure.
    488488            next_data_structure=\
    489                 Data_format_sww(self.domain, mode=self.mode,\
     489                SWW_file(self.domain, mode=self.mode,\
    490490                                max_size = self.max_size,\
    491491                                recursion = self.recursion+1)
     
    12261226    infile.close()
    12271227    outfile.close()
    1228 
    1229 
    1230 #Get data objects
    1231 def get_dataobject(domain, mode='w'):
    1232     """Return instance of class of given format using filename
    1233     """
    1234 
    1235     cls = eval('Data_format_%s' %domain.format)
    1236     return cls(domain, mode)
    1237 
    12381228
    12391229
     
    35793569        print "Output written to " + domain.get_datadir() + sep + \
    35803570              domain.get_name() + "." + domain.format
    3581     sww = get_dataobject(domain)
     3571    sww = SWW_file(domain)
    35823572    sww.store_connectivity()
    35833573    sww.store_timestep('stage')
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r7326 r7340  
    209209        # Stored output
    210210        self.store = True
    211         self.format = 'sww'
     211        #self.format = 'sww'
    212212        self.set_store_vertices_uniquely(False)
    213213        self.minimum_storable_height = minimum_storable_height
     
    638638        if self.store is True and self.time == 0.0:
    639639            self.initialise_storage()
    640         else:
    641             pass
    642             # print 'Results will not be stored.'
    643             # print 'To store results set domain.store = True'
    644             # FIXME: Diagnostic output should be controlled by
    645             # a 'verbose' flag living in domain (or in a parent class)
    646640
    647641        # Call basic machinery from parent class
     
    651645            # Store model data, e.g. for subsequent visualisation
    652646            if self.store is True:
    653                 self.store_timestep(self.quantities_to_be_stored)
    654 
    655             # FIXME: Could maybe be taken from specified list
    656             # of 'store every step' quantities
     647                self.store_timestep()
    657648
    658649            # Pass control on to outer loop for more specific actions
     
    666657        """
    667658
    668         from anuga.shallow_water.data_manager import get_dataobject
     659        from anuga.shallow_water.data_manager import SWW_file
    669660
    670661        # Initialise writer
    671         self.writer = get_dataobject(self, mode=netcdf_mode_w)
     662        self.writer = SWW_file(self)
    672663
    673664        # Store vertices and connectivity
     
    677668    # @brief
    678669    # @param name
    679     def store_timestep(self, name):
    680         """Store named quantity and time.
     670    def store_timestep(self):
     671        """Store time dependent quantities and time.
    681672
    682673        Precondition:
    683            self.write has been initialised
    684         """
    685 
    686         self.writer.store_timestep(name)
     674           self.writer has been initialised
     675        """
     676
     677        self.writer.store_timestep()
    687678
    688679    ##
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r7339 r7340  
    179179        self.domain.smooth = False
    180180       
    181         sww = get_dataobject(self.domain)
     181        sww = SWW_file(self.domain)
    182182        sww.store_connectivity()
    183183
     
    211211        self.domain.smooth = False
    212212
    213         sww = get_dataobject(self.domain)
     213        sww = SWW_file(self.domain)
    214214        sww.store_connectivity()
    215215
     
    240240        self.domain.set_store_vertices_uniquely(True)
    241241       
    242         sww = get_dataobject(self.domain)       
     242        sww = SWW_file(self.domain)       
    243243
    244244        dqs = self.domain.get_quantity('stage')
     
    327327       
    328328       
    329         sww = get_dataobject(domain)
     329        sww = SWW_file(domain)
    330330
    331331        for t in domain.evolve(yieldstep = 1, finaltime = 1):
     
    379379        self.domain.smooth = True
    380380
    381         sww = get_dataobject(self.domain)
     381        sww = SWW_file(self.domain)
    382382        sww.store_connectivity()
    383383
     
    419419        self.domain.reduction = mean
    420420
    421         sww = get_dataobject(self.domain)
     421        sww = SWW_file(self.domain)
    422422        sww.store_connectivity()
    423423        sww.store_timestep()
     
    466466        self.domain.reduction = mean
    467467
    468         sww = get_dataobject(self.domain)
     468        sww = SWW_file(self.domain)
    469469        sww.store_connectivity()
    470470        sww.store_timestep()
     
    522522        self.domain.reduction = min
    523523
    524         sww = get_dataobject(self.domain)
     524        sww = SWW_file(self.domain)
    525525        sww.store_connectivity()
    526526        sww.store_timestep()
     
    624624        self.domain.minimum_storable_height = 100
    625625
    626         sww = get_dataobject(self.domain)
     626        sww = SWW_file(self.domain)
    627627        sww.store_connectivity()
    628628        sww.store_timestep()
     
    678678        self.domain.reduction = mean
    679679
    680         sww = get_dataobject(self.domain)
     680        sww = SWW_file(self.domain)
    681681        sww.store_connectivity()
    682682        sww.store_timestep()
     
    12571257        self.domain.geo_reference = Geo_reference(56, 308500, 6189000)
    12581258
    1259         sww = get_dataobject(self.domain)
     1259        sww = SWW_file(self.domain)
    12601260        sww.store_connectivity()
    12611261        sww.store_timestep()
     
    14581458        self.domain.geo_reference = Geo_reference(56,308500,6189000)
    14591459
    1460         sww = get_dataobject(self.domain)
     1460        sww = SWW_file(self.domain)
    14611461        sww.store_connectivity()
    14621462        sww.store_timestep()
     
    15391539        self.domain.geo_reference = Geo_reference(56,308500,6189000)
    15401540
    1541         sww = get_dataobject(self.domain)
     1541        sww = SWW_file(self.domain)
    15421542        sww.store_connectivity()
    1543         sww.store_timestep() #'stage')
     1543        sww.store_timestep()
    15441544        self.domain.evolve_to_end(finaltime = 0.01)
    1545         sww.store_timestep() #'stage')
     1545        sww.store_timestep()
    15461546
    15471547        cellsize = 0.25
     
    16771677        self.domain.geo_reference = Geo_reference(56,308500,6189000)
    16781678       
    1679         sww = get_dataobject(self.domain)
     1679        sww = SWW_file(self.domain)
    16801680        sww.store_connectivity()
    16811681        sww.store_timestep() #'stage')
     
    18161816        self.domain.geo_reference = Geo_reference(56,308500,6189000)
    18171817
    1818         sww = get_dataobject(self.domain)
     1818        sww = SWW_file(self.domain)
    18191819        sww.store_connectivity()
    18201820        sww.store_timestep()
     
    18231823        self.domain.set_name(base_name+'_P1_8')
    18241824        swwfile2 = self.domain.get_name() + '.sww'
    1825         sww = get_dataobject(self.domain)
     1825        sww = SWW_file(self.domain)
    18261826        sww.store_connectivity()
    18271827        sww.store_timestep()
     
    19811981
    19821982        #
    1983         sww = get_dataobject(domain)
     1983        sww = SWW_file(domain)
    19841984        sww.store_connectivity()
    19851985        sww.store_timestep()
     
    21722172
    21732173        #
    2174         sww = get_dataobject(domain)
     2174        sww = SWW_file(domain)
    21752175        sww.store_connectivity()
    21762176        sww.store_timestep()
     
    23212321
    23222322
    2323         sww = get_dataobject(self.domain)
     2323        sww = SWW_file(self.domain)
    23242324        sww.store_connectivity()
    23252325        sww.store_timestep()
     
    24332433
    24342434
    2435         sww = get_dataobject(self.domain)
     2435        sww = SWW_file(self.domain)
    24362436        sww.store_connectivity()
    24372437        sww.store_timestep()
     
    25862586        domain.geo_reference = Geo_reference(56,308500,6189000)
    25872587
    2588         sww = get_dataobject(domain)
     2588        sww = SWW_file(domain)
    25892589        sww.store_connectivity()
    25902590        sww.store_timestep()
     
    26922692        self.domain.geo_reference = Geo_reference(56,308500,6189000)
    26932693
    2694         sww = get_dataobject(self.domain)
     2694        sww = SWW_file(self.domain)
    26952695        sww.store_connectivity()
    26962696        sww.store_timestep()
     
    27902790        self.domain.geo_reference = Geo_reference(56,308500,6189000)
    27912791
    2792         sww = get_dataobject(self.domain)
     2792        sww = SWW_file(self.domain)
    27932793        sww.store_connectivity()
    27942794        sww.store_timestep()
     
    35483548
    35493549
    3550         sww = get_dataobject(self.domain)
     3550        sww = SWW_file(self.domain)
    35513551        sww.store_connectivity()
    35523552        sww.store_timestep()
  • anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py

    r7276 r7340  
    14651465        # Cleanup
    14661466        try:
    1467             os.remove(domain.get_name() + '.' + domain.format)
     1467            os.remove(domain.get_name() + '.sww')
    14681468        except:
    14691469            pass
     
    51485148        # Boundary conditions
    51495149        Br = Reflective_boundary(domain2)
    5150         Bf = Field_boundary(domain1.get_name() + '.' + domain1.format, domain2)
     5150        Bf = Field_boundary(domain1.get_name() + '.sww', domain2)
    51515151        domain2.set_boundary({'right':Br, 'bottom':Br, 'diagonal':Bf})
    51525152        domain2.check_integrity()
     
    51685168
    51695169        # Cleanup
    5170         os.remove(domain1.get_name() + '.' + domain1.format)
    5171         os.remove(domain2.get_name() + '.' + domain2.format)
     5170        os.remove(domain1.get_name() + '.sww')
     5171        os.remove(domain2.get_name() + '.sww')
    51725172
    51735173    def test_spatio_temporal_boundary_2(self):
     
    52515251        # Read results for specific timesteps t=1 and t=2
    52525252        from Scientific.IO.NetCDF import NetCDFFile
    5253         fid = NetCDFFile(domain1.get_name() + '.' + domain1.format)
     5253        fid = NetCDFFile(domain1.get_name() + '.sww')
    52545254
    52555255        x = fid.variables['x'][:]
     
    52735273        # Boundary conditions
    52745274        Br = Reflective_boundary(domain2)
    5275         Bf = Field_boundary(domain1.get_name() + '.' + domain1.format,
     5275        Bf = Field_boundary(domain1.get_name() + '.sww',
    52765276                            domain2, verbose=False)
    52775277        domain2.set_boundary({'right':Br, 'bottom':Br, 'diagonal':Bf})
     
    53385338
    53395339        # Cleanup
    5340         os.remove(domain1.get_name() + '.' + domain1.format)
     5340        os.remove(domain1.get_name() + '.sww')
    53415341
    53425342    def test_spatio_temporal_boundary_3(self):
     
    54255425        # Read results for specific timesteps t=1 and t=2
    54265426        from Scientific.IO.NetCDF import NetCDFFile
    5427         fid = NetCDFFile(domain1.get_name() + '.' + domain1.format)
     5427        fid = NetCDFFile(domain1.get_name() + '.sww')
    54285428
    54295429        x = fid.variables['x'][:]
     
    54475447        # Boundary conditions
    54485448        Br = Reflective_boundary(domain2)
    5449         Bf = Field_boundary(domain1.get_name() + '.' + domain1.format,
     5449        Bf = Field_boundary(domain1.get_name() + '.sww',
    54505450                            domain2, mean_stage=mean_stage, verbose=False)
    54515451
     
    55165516
    55175517        # Cleanup
    5518         os.remove(domain1.get_name() + '.' + domain1.format)
     5518        os.remove(domain1.get_name() + '.sww')
    55195519
    55205520    def test_spatio_temporal_boundary_outside(self):
     
    55985598        # Read results for specific timesteps t=1 and t=2
    55995599        from Scientific.IO.NetCDF import NetCDFFile
    5600         fid = NetCDFFile(domain1.get_name() + '.' + domain1.format)
     5600        fid = NetCDFFile(domain1.get_name() + '.sww')
    56015601
    56025602        x = fid.variables['x'][:]
     
    56165616        # Boundary conditions
    56175617        Br = Reflective_boundary(domain2)
    5618         Bf = Field_boundary(domain1.get_name() + '.' + domain1.format,
     5618        Bf = Field_boundary(domain1.get_name() + '.sww',
    56195619                            domain2, mean_stage=1, verbose=False)
    56205620
     
    56325632
    56335633        #Cleanup
    5634         os.remove(domain1.get_name() + '.' + domain1.format)
     5634        os.remove(domain1.get_name() + '.sww')
    56355635
    56365636    def test_extrema(self):
     
    57305730
    57315731        # Cleanup
    5732         os.remove(domain.get_name() + '.' + domain.format)
     5732        os.remove(domain.get_name() + '.sww')
    57335733
    57345734    def test_tight_slope_limiters(self):
     
    57395739        import time, os
    57405740        from Scientific.IO.NetCDF import NetCDFFile
    5741         from data_manager import get_dataobject, extent_sww
     5741        from data_manager import extent_sww
    57425742        from mesh_factory import rectangular
    57435743
     
    57875787
    57885788        domain.set_name('tight_limiters')
    5789         domain.format = 'sww'
    57905789        domain.smooth = True
    57915790        domain.reduction = mean
  • anuga_core/source/anuga/shallow_water/tsh2sww.py

    r7317 r7340  
    1313from anuga.pyvolution.pmesh2domain import pmesh_to_domain_instance
    1414import time, os
    15 from anuga.pyvolution.data_manager import get_dataobject   
     15from anuga.pyvolution.data_manager import SWW_file
    1616from anuga.utilities.numerical_tools import mean
    1717import anuga.utilities.log as log
     
    4949                     % (domain.get_datadir(), sep, domain.get_name(),
    5050                        domain.format)
    51     sww = get_dataobject(domain)
     51    sww = SWW_file(domain)
    5252    sww.store_connectivity()
    5353    sww.store_timestep('stage')
Note: See TracChangeset for help on using the changeset viewer.