 Timestamp:
 Jul 17, 2008, 10:57:41 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py
r5520 r5521 368 368 from Numeric import ArrayType 369 369 370 371 370 # Treat special case: Polygon situation 372 371 # Location will be ignored and set to 'centroids' … … 376 375 # FIXME (Ole): Need to compute indices based on polygon (and location) and 377 376 # use existing code after that. 377 378 # Perhaps deprecate 'centroids' as a location option. It is really just a 379 # first order version of what is currently called vertices 378 380 379 381 if polygon is not None: … … 423 425 424 426 425 if location not in ['vertices', 'centroids', 'edges', 426 'unique vertices']: 427 if location == 'edges': 428 msg = 'edges has been deprecated as valid location' 429 raise Exception, msg 430 431 432 if location not in ['vertices', 'centroids', 'unique vertices']: 427 433 msg = 'Invalid location: %s' %location 428 434 raise Exception, msg … … 522 528 self.centroid_values[i] = X 523 529 524 elif location == 'edges':525 if indices is None:526 self.edge_values[:] = X527 else:528 # Brute force529 for i in indices:530 self.edge_values[i] = X530 #elif location == 'edges': 531 # if indices is None: 532 # self.edge_values[:] = X 533 # else: 534 # # Brute force 535 # for i in indices: 536 # self.edge_values[i] = X 531 537 532 538 elif location == 'unique vertices': … … 570 576 values: Numeric array 571 577 location: Where values are to be stored. 572 Permissible options are: vertices, edges,centroid, unique vertices578 Permissible options are: vertices, centroid, unique vertices 573 579 Default is 'vertices' 574 580 … … 621 627 self.centroid_values[indices[i]] = values[i] 622 628 623 elif location == 'edges':624 # FIXME (Ole): No mention of indices here. However, I don't625 # think we ever need to set values at edges anyway626 assert len(values.shape) == 2, 'Values array must be 2d'627 628 msg = 'Number of values must match number of elements'629 assert values.shape[0] == N, msg630 631 msg = 'Array must be N x 3'632 assert values.shape[1] == 3, msg633 634 self.edge_values = values629 #elif location == 'edges': 630 # # FIXME (Ole): No mention of indices here. However, I don't 631 # # think we ever need to set values at edges anyway 632 # assert len(values.shape) == 2, 'Values array must be 2d' 633 # 634 # msg = 'Number of values must match number of elements' 635 # assert values.shape[0] == N, msg 636 # 637 # msg = 'Array must be N x 3' 638 # assert values.shape[1] == 3, msg 639 # 640 # self.edge_values = values 635 641 636 642 elif location == 'unique vertices': … … 692 698 f: x, y > z Function where x, y and z are arrays 693 699 location: Where values are to be stored. 694 Permissible options are: vertices, centroid, edges,700 Permissible options are: vertices, centroid, 695 701 unique vertices 696 702 Default is "vertices" … … 1096 1102 1097 1103 1098 1104 # FIXME (Ole): Consider deprecating 'edges'  but not if it is used 1105 # elsewhere in ANUGA. 1099 1106 if location not in ['vertices', 'centroids', 'edges', 1100 1107 'unique vertices']:
Note: See TracChangeset
for help on using the changeset viewer.