Changeset 3847


Ignore:
Timestamp:
Oct 24, 2006, 1:44:30 PM (16 years ago)
Author:
ole
Message:

Shorthand for setting all beta values for the limiters and some cleanup

Location:
anuga_core/source/anuga
Files:
3 edited

Legend:

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

    r3649 r3847  
    162162
    163163class File_boundary(Boundary):
    164     """Boundary values obtained from file and interpolated.
    165     conserved quantities as a function of time.
     164    """The File_boundary reads values for the conserved
     165    quantities from an sww NetCDF file, and returns interpolated values
     166    at the midpoints of each associated boundary segment.
     167    Time dependency is interpolated linearly.
    166168
    167169    Assumes that file contains a time series and possibly
    168     also spatial info.
    169     See docstring for File_function in util.py for details about
    170     admissible file formats
    171 
    172     The full solution history is not exactly the same as if
    173     the models were coupled:
     170    also spatial info. See docstring for File_function in util.py
     171    for details about admissible file formats
     172
    174173    File boundary must read and interpolate from *smoothed* version
    175174    as stored in sww and cannot work with the discontinuos triangles.
    176175
    177     """
     176    Example:
     177    Bf = File_boundary('source_file.sww', domain)
     178
     179
     180    Note that the resulting solution history is not exactly the same as if
     181    the models were coupled as there is no feedback into the source model.
     182    """
     183
     184    # FIXME (Ole): I kind of like the name Spatio_Temporal_boundary for this
     185    # rather than File_boundary
    178186
    179187    def __init__(self, filename, domain, verbose = False):
     
    190198        #Compute midpoint coordinates for all boundary elements
    191199        #Only a subset may be invoked when boundary is evaluated but
    192         #we don't know which ones at this stage since this object can be attached to
     200        #we don't know which ones at this stage since this object can
     201        #be attached to
    193202        #any tagged boundary later on.
    194203
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r3804 r3847  
    166166               
    167167
     168    def set_all_limiters(beta):
     169        """Shorthand to assign one constant value [0,1[ to all limiters.
     170        0 Corresponds to first order, where as larger values make use of
     171        the second order scheme.
     172        """
     173
     174        self.beta_w      = beta
     175        self.beta_w_dry  = beta
     176        self.beta_uh     = beta
     177        self.beta_uh_dry = beta
     178        self.beta_vh     = beta
     179        self.beta_vh_dry = beta
     180        self.beta_h      = beta
     181       
    168182
    169183    def set_store_vertices_uniquely(self, flag, reduction=None):
     
    13631377
    13641378
    1365 #class Spatio_temporal_boundary(Boundary):
    1366 #    """The spatio-temporal boundary, reads values for the conserved
    1367 #    quantities from an sww NetCDF file, and returns interpolated values
    1368 #    at the midpoints of each associated boundaty segment.
    1369 #    Time dependency is interpolated linearly as in util.File_function.#
    1370 #
    1371 #    Example:
    1372 #    Bf = Spatio_temporal_boundary('source_file.sww', domain)
    1373 #
    1374 #    """
    1375 Spatio_temporal_boundary = File_boundary
    1376 
    1377 
    13781379
    13791380
  • anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py

    r3846 r3847  
    34883488        # Boundary conditions
    34893489        Br = Reflective_boundary(domain2)
    3490         Bf = Spatio_temporal_boundary(domain1.get_name() + '.' +\
    3491                                       domain1.format, domain2)
     3490        #Bf = Spatio_temporal_boundary(domain1.get_name() + '.' +\
     3491        #                              domain1.format, domain2)
     3492        Bf = File_boundary(domain1.get_name() + '.' +\
     3493                           domain1.format, domain2)       
    34923494        domain2.set_boundary({'right':Br, 'bottom':Br, 'diagonal':Bf})
    34933495        domain2.check_integrity()
     
    36273629        # Boundary conditions
    36283630        Br = Reflective_boundary(domain2)
    3629         Bf = Spatio_temporal_boundary(domain1.get_name() + '.' + domain1.format,
    3630                                       domain2)
     3631        #Bf = Spatio_temporal_boundary(domain1.get_name() + '.' + domain1.format,
     3632        #                              domain2)
     3633        Bf = File_boundary(domain1.get_name() + '.' + domain1.format,
     3634                           domain2)       
    36313635        domain2.set_boundary({'right':Br, 'bottom':Br, 'diagonal':Bf})
    36323636        domain2.check_integrity()
Note: See TracChangeset for help on using the changeset viewer.