Changeset 3193 for inundation/pmesh/mesh.py
- Timestamp:
- Jun 21, 2006, 3:33:49 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pmesh/mesh.py
r3180 r3193 31 31 from geospatial_data.geospatial_data import Geospatial_data, ensure_geospatial 32 32 33 try: 34 import kinds 35 except ImportError: 36 # Hand-built mockup of the things we need from the kinds package, since it 37 # was recently removed from the standard Numeric distro. Some users may 38 # not have it by default. 39 class _bunch: 40 pass 41 42 class _kinds(_bunch): 43 default_float_kind = _bunch() 44 default_float_kind.MIN = 2.2250738585072014e-308 #smallest +ve number 45 default_float_kind.MAX = 1.7976931348623157e+308 46 47 kinds = _kinds() 48 33 49 SET_COLOUR='red' 34 50 … … 225 241 226 242 def setMaxArea(self,MaxArea): 227 if self.isMaxArea(): 228 self.attributes[self.MAXAREA] = float(MaxArea) 229 else: 230 self.attributes.append( float(MaxArea) ) 243 if MaxArea is not None: 244 if self.isMaxArea(): 245 self.attributes[self.MAXAREA] = float(MaxArea) 246 else: 247 self.attributes.append( float(MaxArea) ) 231 248 232 249 def deleteMaxArea(self): … … 940 957 941 958 def generate_mesh(self, 942 maximum_triangle_area= None,959 maximum_triangle_area="", 943 960 minimum_triangle_angle=28.0, 944 verbose= False):961 verbose=True): 945 962 if verbose is True: 946 963 silent = '' … … 990 1007 if maxArea != None: 991 1008 self.mode += 'a' + str(maxArea) 992 #FIXME (DSG-DSG) This isn't explained. I don't think it works 993 # well with maxArea = None as well. 1009 #FIXME (DSG-DSG) This isn't explained. 994 1010 if isRegionalMaxAreas: 995 1011 self.mode += 'a' 996 1012 #print "mesh#generateMesh# self.mode",self.mode 997 1013 meshDict = self.Mesh2triangList() 998 1014 #print "*************************!@!@ This is going to triangle !@!@" … … 1783 1799 Structure: list of verts 1784 1800 """ 1785 # FIXME dsg!!! large is a hack 1786 #You want the kinds package, part of Numeric: 1787 #In [2]: import kinds 1788 1789 #In [3]: kinds.default_float_kind.M 1790 #kinds.default_float_kind.MAX kinds.default_float_kind.MIN 1791 #kinds.default_float_kind.MAX_10_EXP kinds.default_float_kind.MIN_10_EXP 1792 #kinds.default_float_kind.MAX_EXP kinds.default_float_kind.MIN_EXP 1793 1794 #In [3]: kinds.default_float_kind.MIN 1795 #Out[3]: 2.2250738585072014e-308 1796 1797 large = 1e100 1801 1802 large = kinds.default_float_kind.MAX 1798 1803 xmin= large 1799 1804 xmax=-large … … 1827 1832 Structure: [xmin, ymin, xmax, ymax] 1828 1833 """ 1829 # FIXME dsg!!! large is a hack 1830 #You want the kinds package, part of Numeric: 1831 #In [2]: import kinds 1832 1833 #In [3]: kinds.default_float_kind.M 1834 #kinds.default_float_kind.MAX kinds.default_float_kind.MIN 1835 #kinds.default_float_kind.MAX_10_EXP kinds.default_fltesting oat_kind.MIN_10_EXP 1836 #kinds.default_float_kind.MAX_EXP kinds.default_float_kind.MIN_EXP 1837 1838 #In [3]: kinds.default_float_kind.MIN 1839 #Out[3]: 2.2250738585072014e-308 1840 1841 large = 1e100 1834 1835 large = kinds.default_float_kind.MAX 1842 1836 xmin= large 1843 1837 xmax=-large … … 1862 1856 Structure: [xmin, ymin, xmax, ymax] 1863 1857 """ 1864 # FIXME dsg!!! large is a hacktesting 1865 #You want the kinds package, part of Numeric: 1866 #In [2]: import kinds 1867 1868 #In [3]: kinds.default_float_kind.M 1869 #kinds.default_float_kind.MAX kinds.default_float_kind.MIN 1870 #kinds.default_float_kind.MAX_10_EXP kinds.default_float_kind.MIN_10_EXP 1871 #kinds.default_float_kind.MAX_EXP kinds.default_float_kind.MIN_EXP 1872 1873 #In [3]: kinds.default_float_kind.MIN 1874 #Out[3]: 2.2250738585072014e-308 1875 1876 large = 1e100 1858 1859 large = kinds.default_float_kind.MAX 1877 1860 min= large 1878 1861 max=-large
Note: See TracChangeset
for help on using the changeset viewer.