Changeset 4932 for anuga_core/source/anuga/utilities/quad.py
- Timestamp:
- Jan 14, 2008, 8:17:29 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/quad.py
r4808 r4932 130 130 def contains(*args): 131 131 """True only if P's coordinates lie within cell boundaries 132 This methods has two forms: 133 134 cell.contains(index) 135 #True if cell contains indexed point 136 cell.contains(x, y) 137 #True if cell contains point (x,y) 138 139 """ 140 141 self = args[0] 142 if len(args) == 2: 143 point_id = int(args[1]) 132 This methods has two forms: 133 134 cell.contains(index) 135 #True if cell contains indexed point 136 cell.contains(x, y) 137 #True if cell contains point (x,y) 138 """ 139 self = args[0] 140 if len(args) == 2: 141 point_id = int(args[1]) 144 142 x, y = self.mesh.get_node(point_id, absolute=True) 145 146 147 148 149 150 143 elif len(args) == 3: 144 x = float(args[1]) 145 y = float(args[2]) 146 else: 147 msg = 'Number of arguments to method must be two or three' 148 raise msg 151 149 152 150 if y < self.southern: return False … … 302 300 #FIXME, mincellsize removed. base it on side length, if needed 303 301 304 305 306 302 #Protect against silly thresholds such as -1 303 if threshold < 1: 304 return 307 305 308 306 if not self.children: # Leaf cell
Note: See TracChangeset
for help on using the changeset viewer.