Changeset 3447 for inundation/pyvolution/test_domain.py
- Timestamp:
- Aug 2, 2006, 5:14:16 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/test_domain.py
r2765 r3447 536 536 537 537 538 def test_region_tags2(self): 539 """ 540 get values based on triangle lists. 541 """ 542 from mesh_factory import rectangular 543 from shallow_water import Domain 544 from Numeric import zeros, Float 545 546 #Create basic mesh 547 points, vertices, boundary = rectangular(1, 3) 548 549 #Create shallow water domain 550 domain = Domain(points, vertices, boundary) 551 domain.build_tagged_elements_dictionary({'bottom':[0,1], 552 'top':[4,5], 553 'all':[0,1,2,3,4,5]}) 554 555 556 #Set friction 557 manning = 0.07 558 domain.set_quantity('friction', manning) 559 560 domain.set_region('top', 'friction', 1.0) 561 domain.set_region('bottom', 'friction', 0.09) 562 563 #print domain.quantities['friction'].get_values() 564 assert allclose(domain.quantities['friction'].get_values(),\ 565 [[ 0.09, 0.09, 0.09], 566 [ 0.09, 0.09, 0.09], 567 [ 0.07, 0.07, 0.07], 568 [ 0.07, 0.07, 0.07], 569 [ 1.0, 1.0, 1.0], 570 [ 1.0, 1.0, 1.0]]) 571 572 domain.set_region([set_bottom_friction, set_top_friction]) 573 #print domain.quantities['friction'].get_values() 574 assert allclose(domain.quantities['friction'].get_values(),\ 575 [[ 0.09, 0.09, 0.09], 576 [ 0.09, 0.09, 0.09], 577 [ 0.07, 0.07, 0.07], 578 [ 0.07, 0.07, 0.07], 579 [ 1.0, 1.0, 1.0], 580 [ 1.0, 1.0, 1.0]]) 581 582 domain.set_region([set_all_friction]) 583 #print domain.quantities['friction'].get_values() 584 assert allclose(domain.quantities['friction'].get_values(), 585 [[ 10.09, 10.09, 10.09], 586 [ 10.09, 10.09, 10.09], 587 [ 10.07, 10.07, 10.07], 588 [ 10.07, 10.07, 10.07], 589 [ 11.0, 11.0, 11.0], 590 [ 11.0, 11.0, 11.0]]) 538 591 539 592 #-------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.