Changeset 4254


Ignore:
Timestamp:
Feb 12, 2007, 5:18:20 PM (18 years ago)
Author:
duncan
Message:

the point file blocking line size can now be changed in domain

Location:
anuga_core/source/anuga
Files:
6 edited

Legend:

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

    r4253 r4254  
    2121from anuga.geospatial_data.geospatial_data import Geospatial_data
    2222from anuga.fit_interpolate.fit import fit_to_mesh
     23from anuga.config import points_file_block_line_size as default_block_line_size
    2324
    2425class Quantity:
     
    356357                                        use_cache = use_cache)
    357358        elif filename is not None:
     359            if hasattr(self.domain, 'points_file_block_line_size'):
     360                max_read_lines = self.domain.points_file_block_line_size
     361            else:
     362                max_read_lines = default_block_line_size
    358363            self.set_values_from_file(filename, attribute_name, alpha,
    359364                                      location, indices,
    360365                                      verbose = verbose,
     366                                      max_read_lines=max_read_lines,
    361367                                      use_cache = use_cache)
    362368        else:
     
    738744        coordinates = self.domain.get_nodes(absolute=True)
    739745        triangles = self.domain.triangles      #FIXME
    740        
     746            
    741747        vertex_attributes = fit_to_mesh(coordinates, triangles,filename,
    742748                                        alpha=alpha,
  • anuga_core/source/anuga/config.py

    r4239 r4254  
    129129
    130130minimum_storable_height = 1.0e-5 #Water depth below which it is *stored* as 0
     131
     132points_file_block_line_size = 500 # Number of lines read in from a points file
     133                                  # when blocking
  • anuga_core/source/anuga/geospatial_data/geospatial_data.py

    r4252 r4254  
    2020from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm
    2121from anuga.utilities.anuga_exceptions import ANUGAError
    22 
    23 MAX_READ_LINES = 500       
     22from anuga.config import points_file_block_line_size as MAX_READ_LINES   
     23
    2424class Geospatial_data:
    2525
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r4238 r4254  
    44274427    geo = URS_points_needed(boundary_polygon, ll_lat, ll_long, grid_spacing,
    44284428                      lat_amount, long_amount, zone=zone)
    4429     if not file[-4:] == ".urs":
    4430         file += ".urs"
     4429    if not file_name[-4:] == ".urs":
     4430        file_name += ".urs"
    44314431    geo.export_points_file(file_name)
    44324432   
     
    44444444
    44454445    """
     4446   
    44464447    from sets import ImmutableSet
    44474448   
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r4239 r4254  
    227227
    228228
     229    def set_points_file_block_line_size(self,points_file_block_line_size):
     230        """
     231        Set the minimum depth that will be recognised when writing
     232        to an sww file. This is useful for removing thin water layers
     233        that seems to be caused by friction creep.
     234
     235        The minimum allowed sww depth is in meters.
     236        """
     237        self.points_file_block_line_size = points_file_block_line_size
     238       
    229239    def set_quantities_to_be_stored(self, q):
    230240        """Specify which quantities will be stored in the sww file.
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r4238 r4254  
    50925092                assert False
    50935093       
     5094   
     5095    def dave_test_URS_points_needed(self):
     5096        ll_lat = -21.51667
     5097        ll_long = 114.51667
     5098        grid_spacing = 2./60.
     5099        lat_amount = 15
     5100        long_amount = 15
     5101
     5102       
     5103        boundary_polygon = [[250000,7660000],[280000,7660000],
     5104                             [280000,7630000],[250000,7630000]]
     5105        URS_points_needed_to_file('a_test_example',boundary_polygon, ll_lat, ll_long, grid_spacing, \
     5106                      lat_amount, long_amount)
    50945107       
    50955108    def X_test_URS_points_neededII(self):
     
    51015114
    51025115        # change this so lats and longs are inputed, then converted
     5116       
    51035117        #boundary_polygon = [[7660000,250000],[7660000,280000],
    51045118        #                     [7630000,280000],[7630000,250000]]
     
    51105124#-------------------------------------------------------------
    51115125if __name__ == "__main__":
    5112     suite = unittest.makeSuite(Test_Data_Manager,'test_URS_points_needed')
    5113     #suite = unittest.makeSuite(Test_Data_Manager,'test_get_min_max_indexes_lat_ascending')
     5126    #suite = unittest.makeSuite(Test_Data_Manager,'test_URS_points_needed')
     5127    #suite = unittest.makeSuite(Test_Data_Manager,'dave_test_URS_points_needed')
    51145128    #suite = unittest.makeSuite(Test_Data_Manager,'test_ferret2sww_lat_long')
    5115     #suite = unittest.makeSuite(Test_Data_Manager,'test')
     5129    suite = unittest.makeSuite(Test_Data_Manager,'test')
    51165130    runner = unittest.TextTestRunner()
    51175131    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.