Changeset 7346


Ignore:
Timestamp:
Aug 9, 2009, 5:34:33 PM (13 years ago)
Author:
ole
Message:

Verified that variable elevation can be stored as a time dependent quantity.
Also, ensured backwards compatibility with old viewer.

Location:
anuga_core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/documentation/user_manual/demos/channel_variable.py

    r7345 r7346  
    2323                                               len1=length, len2=width)
    2424domain = Domain(points, vertices, boundary)
    25 domain.set_name('channel3')                  # Output name
     25domain.set_name('channel_variable')                  # Output name
    2626print domain.statistics()
     27domain.set_quantities_to_be_stored({'elevation': 1, #2,
     28                                    'stage': 2})
    2729
    2830#------------------------------------------------------------------------------
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r7342 r7346  
    60036003            outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
    60046004
    6005         # FIXME: Backwards compat - get rid of z once old view has retired
    6006         outfile.createVariable('z', sww_precision,
    6007                                ('number_of_points',))
     6005        if 'elevation' in self.static_quantities:   
     6006            # FIXME: Backwards compat - get rid of z once old view has retired
     6007            outfile.createVariable('z', sww_precision,
     6008                                   ('number_of_points',))
    60086009                               
    60096010        for q in self.dynamic_quantities:
     
    61676168                # This populates the _range values
    61686169                outfile.variables[q + Write_sww.RANGE][0] = num.min(x)
    6169                 outfile.variables[q + Write_sww.RANGE][1] = num.max(x)               
     6170                outfile.variables[q + Write_sww.RANGE][1] = num.max(x)
    61706171                   
    6171         outfile.variables['z'][:] = outfile.variables['elevation'][:] #FIXME HACK
     6172        # FIXME: Hack for backwards compatibility with old viewer
     6173        if 'elevation' in self.static_quantities:
     6174            outfile.variables['z'][:] = outfile.variables['elevation'][:]
    61726175
    61736176                   
Note: See TracChangeset for help on using the changeset viewer.