Changeset 3113


Ignore:
Timestamp:
Jun 8, 2006, 12:06:16 PM (18 years ago)
Author:
ole
Message:

Added test for duplicate tags - it fails at the moment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pmesh/test_mesh_interface.py

    r3056 r3113  
    222222
    223223    def test_create_mesh_from_regions_interior_regions(self):
    224         ### Test that create_mesh_from_regions fails when an interior region is
    225         ### outside bounding polygon.
     224        """Test that create_mesh_from_regions fails when an interior region is
     225         outside bounding polygon.       """
    226226       
    227227
     
    262262            raise msg
    263263
     264
     265
     266    def test_create_mesh_with_multiply_tagged_segments(self):
     267        """Test that create_mesh_from_regions fails when
     268        segments are listed repeatedly in boundary_tags.
     269        """
     270       
     271       
     272       
     273
     274        # These are the absolute values
     275        min_x = 10
     276        min_y = 88
     277        polygon = [[min_x,min_y],[1000,100],[1000,1000],[100,1000]]
     278
     279       
     280        boundary_tags = {'walls':[0,1],'bom':[1,2]}
     281
     282        # This one is inside bounding polygon - should pass
     283        inner_polygon = [[800,400],[900,500],[800,600]]
     284       
     285        interior_regions = [(inner_polygon, 5)]
     286        m = create_mesh_from_regions(polygon,
     287                                     boundary_tags,
     288                                     10000000,
     289                                     interior_regions=interior_regions)
     290
     291
     292        # This one sticks outside bounding polygon - should fail
     293        inner_polygon = [[800,400],[900,500],[800,600]]
     294        interior_regions = [(inner_polygon, 5)]
     295
     296
     297
     298        try:
     299            m = create_mesh_from_regions(polygon,
     300                                         boundary_tags,
     301                                         10000000,
     302                                         interior_regions=interior_regions)
     303        except:
     304            pass
     305        else:
     306            msg = 'Tags are listed repeatedly, but create mesh from regions '
     307            msg += 'does not cause an Exception to be raised'
     308            raise msg
     309
    264310       
    265311
Note: See TracChangeset for help on using the changeset viewer.