Changeset 7701
- Timestamp:
- Apr 29, 2010, 3:14:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/fit_interpolate/search_functions.py
r7700 r7701 8 8 import time 9 9 10 from anuga.utilities.numerical_tools import get_machine_precision 11 from anuga.utilities.numerical_tools import ensure_numeric 12 from anuga.config import max_float 13 10 14 from anuga.utilities import compile 11 15 if compile.can_use_C_extension('polygon_ext.c'): 12 16 # Underlying C implementations can be accessed 13 from polygon_ext import _is_inside_triangle 14 15 #from anuga.utilities.polygon import is_inside_triangle 16 from anuga.utilities.numerical_tools import get_machine_precision 17 from anuga.config import max_float 17 from polygon_ext import _is_inside_triangle 18 else: 19 msg = 'C implementations could not be accessed by %s.\n ' %__file__ 20 msg += 'Make sure compile_all.py has been run as described in ' 21 msg += 'the ANUGA installation guide.' 22 raise Exception, msg 18 23 19 24 import numpy as num … … 97 102 """ 98 103 global last_triangle 104 105 x = ensure_numeric(x, num.float) 99 106 100 107 # These statments are needed if triangles is empty … … 107 114 for k, tri_verts_norms in triangles: 108 115 tri = tri_verts_norms[0] 116 tri = ensure_numeric(tri) 109 117 # k is the triangle index 110 118 # tri is a list of verts (x, y), representing a tringle 111 119 # Find triangle that contains x (if any) and interpolate 112 113 # Input check disabled to speed things up. 114 if _is_inside_triangle(x, tri, 115 int(True), 1.0e-12, 1.0e-12): 120 121 # Input check disabled to speed things up. 122 if bool(_is_inside_triangle(x, tri, int(True), 1.0e-12, 1.0e-12)): 116 123 117 124 n0, n1, n2 = tri_verts_norms[1]
Note: See TracChangeset
for help on using the changeset viewer.