Changeset 4893
- Timestamp:
- Dec 21, 2007, 10:12:29 AM (17 years ago)
- Location:
- anuga_core/source/anuga/mesh_engine
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/mesh_engine/mesh_engine.py
r4668 r4893 122 122 #print "segatts", segatts 123 123 #print "mode", mode 124 #print "yeah" 124 125 mesh_dict = triang.genMesh(points,segments,holes,regions, 125 126 pointatts,segatts, mode, segments.flat) -
anuga_core/source/anuga/mesh_engine/mesh_engine_c_layer.c
r4668 r4893 8 8 9 9 This code interfaces pmesh directly with "triangle", a general 10 purpose triangulation code. In doing so, Python Numeric data structures 11 are passed to C for use by "triangle" and the results are then10 purpose triangulation code. In doing so, Python Numeric data structures 11 are passed to C for use by "triangle" and the results are then 12 12 converted back. This was accomplished using the Python/C API. 13 13 … … 35 35 returned in the dic structre after they are used now, in alpha 36 36 shape and mesh_engine. 37 37 38 to return numeric arrays, check how it is done in 39 quantity_ext.c compute_gradients 40 38 41 Precondition 39 42 End list in the pointattributelist has to have the same length … … 83 86 PyArrayObject *segmarkerlist; 84 87 PyArrayObject *test; 88 89 90 PyArrayObject *r_test; 91 PyObject *R; 92 93 int dimensions[1]; 94 85 95 REAL Attr; 86 int i, j, iatt, n, write_here ;96 int i, j, iatt, n, write_here,N; 87 97 int a,b,c; 88 98 int marker; … … 320 330 Py_DECREF(ii); Py_DECREF(holderlist); 321 331 } 332 /* 333 // Testing passing a numeric array out 334 dimensions[0] = 4; 335 // Allocate space for return vectors a and b (don't DECREF) 336 // This is crashing - don't know why 337 r_test = (PyArrayObject *) PyArray_FromDims(1, dimensions, PyArray_DOUBLE); 338 */ 339 322 340 /* Free in/out structure memory */ 323 341 … … 365 383 366 384 /*Py_DECREF(holder);*/ 367 return Py_BuildValue((char *)"O", holder); 385 R = Py_BuildValue((char *)"O", holder); 386 /*Py_DECREF(holder);* Try this to fix memory problems */ 387 return R; 368 388 } 369 389 -
anuga_core/source/anuga/mesh_engine/test_generate_mesh.py
r4449 r4893 42 42 data = triang.genMesh(points,seglist,holelist,regionlist, 43 43 pointattlist,segattlist, mode, test) 44 44 print "data", data 45 45 self.failUnless(data['generatedtrianglelist'] ==[(1, 0, 2), (2, 3, 1)], 46 46 'trianglelist is wrong!')
Note: See TracChangeset
for help on using the changeset viewer.