Changeset 8820 for trunk/anuga_core/source
- Timestamp:
- Apr 8, 2013, 9:28:42 PM (12 years ago)
- Location:
- trunk/anuga_core/source/anuga
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py
r8690 r8820 1556 1556 # Prepare the C extensions. 1557 1557 ###### 1558 1559 from anuga.utilities import compile 1560 1561 if compile.can_use_C_extension('quantity_ext.c'): 1562 # Underlying C implementations can be accessed 1563 1564 from quantity_ext import \ 1558 from quantity_ext import \ 1565 1559 average_vertex_values,\ 1566 1560 backup_centroid_values,\ … … 1582 1576 set_vertex_values_c, \ 1583 1577 update 1584 else:1585 msg = 'C implementations could not be accessed by %s.\n ' % __file__1586 msg += 'Make sure compile_all.py has been run as described in '1587 msg += 'the ANUGA installation guide.'1588 raise Exception(msg) -
trunk/anuga_core/source/anuga/caching/caching.py
r8709 r8820 1114 1114 from anuga.fit_interpolate.general_fit_interpolate import FitInterpolate 1115 1115 1116 # Setup for quad_tree extension 1117 from anuga.utilities import compile 1118 if compile.can_use_C_extension('quad_tree_ext.c'): 1119 import quad_tree_ext 1120 else: 1121 msg = "C implementation of quad tree extension not avaliable" 1122 raise Exception(msg) 1123 1124 # Setup for sparse_matrix extension 1125 from anuga.utilities import compile 1126 if compile.can_use_C_extension('sparse_matrix_ext.c'): 1127 import sparse_matrix_ext 1128 else: 1129 msg = "C implementation of sparse_matrix extension not avaliable" 1130 raise Exception(msg) 1131 1116 import quad_tree_ext 1117 import sparse_matrix_ext 1132 1118 from anuga.geometry.aabb import AABB 1133 1119 -
trunk/anuga_core/source/anuga/file_conversion/asc2dem.py
r8780 r8820 192 192 193 193 #Store data 194 n = len(lines[6:]) 195 for i, line in enumerate(lines[6:]): 196 fields = line.split() 197 if verbose and i % ((n+10)/10) == 0: 198 log.critical('Processing row %d of %d' % (i, nrows)) 199 200 if len(fields) != ncols: 201 msg = 'Wrong number of columns in file "%s" line %d\n' % (name_in, i) 202 msg += 'I got %d elements, but there should have been %d\n' % (len(fields), ncols) 203 raise Exception, msg 204 205 elevation[i, :] = num.array([float(x) for x in fields]) 194 import numpy 195 196 datafile = open(name_in) 197 elevation[:,:] = numpy.loadtxt(datafile, skiprows=6) 198 datafile.close() 199 200 # n = len(lines[6:]) 201 # for i, line in enumerate(lines[6:]): 202 # fields = line.split() 203 # if verbose and i % ((n+10)/10) == 0: 204 # log.critical('Processing row %d of %d' % (i, nrows)) 205 # 206 # if len(fields) != ncols: 207 # msg = 'Wrong number of columns in file "%s" line %d\n' % (name_in, i) 208 # msg += 'I got %d elements, but there should have been %d\n' % (len(fields), ncols) 209 # raise Exception, msg 210 # 211 # elevation[i, :] = num.array([float(x) for x in fields]) 206 212 207 213 fid.close() -
trunk/anuga_core/source/anuga/geometry/polygon.py
r8819 r8820 1116 1116 ################################################################################ 1117 1117 1118 from anuga.utilities import compile 1119 if compile.can_use_C_extension('polygon_ext.c'): 1120 # Underlying C implementations can be accessed 1121 from polygon_ext import _point_on_line 1122 from polygon_ext import _separate_points_by_polygon 1123 from polygon_ext import _interpolate_polyline 1124 from polygon_ext import _polygon_overlap 1125 from polygon_ext import _line_intersect 1126 from polygon_ext import _is_inside_triangle 1127 #from polygon_ext import _intersection 1128 1129 else: 1130 ERROR_MSG = 'C implementations could not be accessed by %s.\n ' % __file__ 1131 ERROR_MSG += 'Make sure compile_all.py has been run as described in ' 1132 ERROR_MSG += 'the ANUGA installation guide.' 1133 raise Exception(ERROR_MSG) 1118 from polygon_ext import _point_on_line 1119 from polygon_ext import _separate_points_by_polygon 1120 from polygon_ext import _interpolate_polyline 1121 from polygon_ext import _polygon_overlap 1122 from polygon_ext import _line_intersect 1123 from polygon_ext import _is_inside_triangle 1124 #from polygon_ext import _intersection 1125 1126 1134 1127 1135 1128 -
trunk/anuga_core/source/anuga/shallow_water/boundaries.py
r8810 r8820 29 29 import anuga.utilities.log as log 30 30 31 32 from anuga.utilities import compile 33 if compile.can_use_C_extension('shallow_water_ext.c'): 34 # Underlying C implementations can be accessed 35 from shallow_water_ext import rotate 36 else: 37 msg = 'C implementations could not be accessed by %s.\n ' % __file__ 38 msg += 'Make sure compile_all.py has been run as described in ' 39 msg += 'the ANUGA installation guide.' 40 raise Exception, msg 31 from shallow_water_ext import rotate 32 33 #from anuga.utilities import compile 34 #if compile.can_use_C_extension('shallow_water_ext.c'): 35 # # Underlying C implementations can be accessed 36 # from shallow_water_ext import rotate 37 #else: 38 # msg = 'C implementations could not be accessed by %s.\n ' % __file__ 39 # msg += 'Make sure compile_all.py has been run as described in ' 40 # msg += 'the ANUGA installation guide.' 41 # raise Exception, msg 41 42 42 43 -
trunk/anuga_core/source/anuga/utilities/cg_solve.py
r8690 r8820 10 10 11 11 # Setup for C conjugate gradient solver 12 from anuga.utilities import compile 13 if compile.can_use_C_extension('cg_ext.c'): 14 from cg_ext import cg_solve_c 15 from cg_ext import cg_solve_c_precon 16 from cg_ext import jacobi_precon_c 17 else: 18 msg = "C implementation of conjugate gradient (cg_ext.c) not avalaible" 19 raise Exception(msg) 12 from cg_ext import cg_solve_c 13 from cg_ext import cg_solve_c_precon 14 from cg_ext import jacobi_precon_c 15 20 16 21 17 class Stats: -
trunk/anuga_core/source/anuga/utilities/numerical_tools.py
r8690 r8820 389 389 #Initialise module 390 390 391 from anuga.utilities import compile 392 if compile.can_use_C_extension('util_ext.c'): 393 from util_ext import gradient, gradient2 394 else: 395 gradient = gradient_python 396 gradient2 = gradient2_python 391 from util_ext import gradient, gradient2 397 392 398 393 -
trunk/anuga_core/source/anuga/utilities/sparse.py
r8154 r8820 327 327 328 328 # Setup for C extensions 329 from anuga.utilities import compile 330 if compile.can_use_C_extension('sparse_ext.c'): 331 # Access underlying c implementations 332 from sparse_ext import csr_mv 329 from sparse_ext import csr_mv 333 330 334 331
Note: See TracChangeset
for help on using the changeset viewer.