Changeset 8556


Ignore:
Timestamp:
Sep 5, 2012, 10:54:19 AM (13 years ago)
Author:
steve
Message:

Added in Yuyang's C code for build_boundary_dictionary

Location:
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/neighbour_mesh.py

    r8552 r8556  
    347347
    348348
    349 
    350     def build_boundary_dictionary(self, boundary = None):
     349    def build_boundary_dictionary(self, boundary=None):
     350        """Build or check the dictionary of boundary tags.
     351        self.boundary is a dictionary of tags,
     352        keyed by volume id and edge:
     353        { (id, edge): tag, ... }
     354
     355        Postconditions:
     356        self.boundary is defined.
     357        """
     358
     359        from anuga.config import default_boundary_tag
     360
     361        #arr_neighbours = num.array(self.neighbours)
     362
     363       
     364        if boundary is None:
     365            boundary = {}
     366
     367        from neighbour_mesh_ext import boundary_dictionary_construct
     368        boundary = boundary_dictionary_construct(len(self), default_boundary_tag, self.neighbours, boundary)
     369       
     370
     371        self.boundary = boundary
     372        self.boundary_length = len(self.boundary)
     373
     374
     375
     376    def build_boundary_dictionary_old(self, boundary = None):
    351377        """Build or check the dictionary of boundary tags.
    352378         self.boundary is a dictionary of tags,
  • trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_neighbour_mesh.py

    r8501 r8556  
    689689        #    raise Exception('Should have raised an exception')
    690690
    691         #Specifying wrong non existing segment
     691        #Specifying wrong non existing segment       
    692692        try:
    693693            mesh = Mesh(points, vertices, {(5,0): 'x'})
     
    18431843
    18441844if __name__ == "__main__":
    1845     suite = unittest.makeSuite(Test_Mesh, 'test')
     1845    suite = unittest.makeSuite(Test_Mesh, 'test_')
    18461846    runner = unittest.TextTestRunner()
    18471847    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.