Changeset 5911
- Timestamp:
- Nov 6, 2008, 4:33:48 PM (16 years ago)
- Location:
- anuga_core/source_numpy_conversion/anuga/mesh_engine
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source_numpy_conversion/anuga/mesh_engine/mesh_engine.py
r4916 r5911 11 11 #import anuga.mesh_engine.list_dic as triang 12 12 13 from Numeric import array, Float, Int32, reshape 13 import numpy 14 14 15 15 from anuga.utilities.numerical_tools import ensure_numeric … … 46 46 47 47 try: 48 points = ensure_numeric(points, Float)48 points = ensure_numeric(points, numpy.float) 49 49 except ValueError: 50 50 msg = 'ERROR: Inconsistent points array.' … … 61 61 try: 62 62 # If Int is used, instead of Int32, it fails in Linux 63 segments = ensure_numeric(segments, Int32)63 segments = ensure_numeric(segments, numpy.int32) 64 64 65 65 except ValueError: … … 72 72 73 73 try: 74 holes = ensure_numeric(holes, Float)74 holes = ensure_numeric(holes, numpy.float) 75 75 except ValueError: 76 76 msg = 'ERROR: Inconsistent holess array.' … … 80 80 regions = add_area_tag(regions) 81 81 try: 82 regions = ensure_numeric(regions, Float)82 regions = ensure_numeric(regions, numpy.float) 83 83 except (ValueError, TypeError): 84 84 msg = 'ERROR: Inconsistent regions array.' … … 90 90 91 91 try: 92 pointatts = ensure_numeric(pointatts, Float)92 pointatts = ensure_numeric(pointatts, numpy.float) 93 93 except (ValueError, TypeError): 94 94 msg = 'ERROR: Inconsistent point attributes array.' … … 100 100 raise ANUGAError, msg 101 101 if len(pointatts.shape) == 1: 102 pointatts = reshape(pointatts,(pointatts.shape[0],1))103 104 try: 105 segatts = ensure_numeric(segatts, Int32)102 pointatts = numpy.reshape(pointatts,(pointatts.shape[0],1)) 103 104 try: 105 segatts = ensure_numeric(segatts, numpy.int32) 106 106 except ValueError: 107 107 msg = 'ERROR: Inconsistent point attributes array.' -
anuga_core/source_numpy_conversion/anuga/mesh_engine/mesh_engine_c_layer.c
r4917 r5911 64 64 #define PY_ARRAY_UNIQUE_SYMBOL API_YEAH 65 65 //#define NO_IMPORT_ARRAY 66 #include "Numeric/arrayobject.h" 66 //#include "numpy/oldnumeric.h" 67 #include "numpy/arrayobject.h" 67 68 #include <sys/types.h> 68 69 -
anuga_core/source_numpy_conversion/anuga/mesh_engine/test_generate_mesh.py
r5875 r5911 5 5 level of the code, using the -j flag in triangle. 6 6 """ 7 8 9 #FIXME (Ole): Go through this file and check that array's10 # aren't compared using ==. Need to use either alltrue11 # (on 1D integer arrays) or allclose.12 13 14 7 import sys 15 8 … … 17 10 from anuga.mesh_engine.mesh_engine import generate_mesh 18 11 19 from Numeric import array, Float, Int 12 import numpy 20 13 21 14 from anuga.utilities.numerical_tools import ensure_numeric … … 45 38 mode = "Qzp" 46 39 47 points = ensure_numeric(points, Float)48 seglist = test = ensure_numeric(seglist, Int)40 points = ensure_numeric(points, numpy.float) 41 seglist = test = ensure_numeric(seglist, numpy.int) 49 42 data = triang.genMesh(points,seglist,holelist,regionlist, 50 43 pointattlist,segattlist, mode, test)
Note: See TracChangeset
for help on using the changeset viewer.