Changeset 4923
- Timestamp:
- Jan 9, 2008, 4:25:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/pmesh/mesh.py
r4906 r4923 25 25 26 26 27 #class NoTrianglesError(exceptions.Exception): pass28 29 #import load_mesh30 27 from anuga.coordinate_transforms.geo_reference import Geo_reference, \ 31 28 DEFAULT_ZONE … … 53 50 kinds = _kinds() 54 51 55 #FIXME: this is not tested.56 from anuga.utilities.numerical_tools import gradient57 58 59 52 60 53 # 1st and third values must be the same … … 62 55 initialconversions = ['', 'exterior', ''] 63 56 64 #from os import sep65 #sys.path.append('..'+sep+'pmesh')66 #print "sys.path",sys.path67 57 68 58 class MeshObject: … … 1603 1593 return alpha_segs_no_user_segs, segs2delete, optimum_alpha 1604 1594 1605 def _boundary2mesh_old(self, raw_boundary=True,1606 remove_holes=False,1607 smooth_indents=False,1608 expand_pinch=False):1609 """1610 Precon there must be a shape object.1611 """1612 self.shape.set_boundary_type(raw_boundary=raw_boundary,1613 remove_holes=remove_holes,1614 smooth_indents=smooth_indents,1615 expand_pinch=expand_pinch)1616 boundary_segs = self.shape.get_boundary()1617 #print "boundary_segs",boundary_segs1618 segs2delete = self.alphaUserSegments1619 1620 #FIXME(DSG-DSG) this algorithm needs comments1621 #FIXME(DSG-DSG) can it be sped up? It's slow1622 new_segs = []1623 alpha_segs = []1624 user_segs = []1625 for seg in boundary_segs:1626 v1 = self.userVertices[int(seg[0])]1627 v2 = self.userVertices[int(seg[1])]1628 alpha_seg = self.representedAlphaUserSegment(v1, v2)1629 user_seg = self.representedUserSegment(v1, v2)1630 #DSG!!!1631 assert not(not (alpha_seg == None) and not (user_seg == None))1632 if not alpha_seg == None:1633 alpha_segs.append(alpha_seg)1634 elif not user_seg == None:1635 user_segs.append(user_seg)1636 else:1637 unique_seg = Segment(v1, v2)1638 new_segs.append(unique_seg)1639 1640 for seg in alpha_segs:1641 try:1642 segs2delete.remove(seg)1643 except:1644 pass1645 1646 self.alphaUserSegments = []1647 self.alphaUserSegments.extend(new_segs)1648 self.alphaUserSegments.extend(alpha_segs)1649 1650 optimum_alpha = self.shape.get_alpha()1651 # need to draw newsegs1652 return new_segs, segs2delete, optimum_alpha1653 1595 1654 1596 def representedAlphaUserSegment(self, v1,v2): … … 2439 2381 2440 2382 2441 2442 2443 2383 def unique(s): 2444 2384 """Return a list of the elements in s, but without duplicates.
Note: See TracChangeset
for help on using the changeset viewer.