Changeset 4893


Ignore:
Timestamp:
Dec 21, 2007, 10:12:29 AM (17 years ago)
Author:
duncan
Message:

comments

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  
    122122    #print "segatts", segatts
    123123    #print "mode", mode
     124    #print "yeah"
    124125    mesh_dict = triang.genMesh(points,segments,holes,regions,
    125126                          pointatts,segatts, mode, segments.flat)
  • anuga_core/source/anuga/mesh_engine/mesh_engine_c_layer.c

    r4668 r4893  
    88
    99    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 then         
     10    purpose triangulation code. In doing so, Python Numeric data structures
     11     are passed to C for  use by "triangle" and the results are then         
    1212    converted back. This was accomplished using the Python/C API.           
    1313                                                                           
     
    3535     returned in the dic structre after they are used now, in alpha
    3636     shape and mesh_engine.
    37      
     37
     38     to return numeric arrays, check how it is done in
     39     quantity_ext.c compute_gradients
     40         
    3841     Precondition
    3942     End list in the pointattributelist has to have the same length
     
    8386  PyArrayObject *segmarkerlist;
    8487  PyArrayObject *test;
     88 
     89 
     90  PyArrayObject *r_test;
     91  PyObject *R;
     92
     93  int dimensions[1];
     94   
    8595  REAL Attr;
    86   int i, j, iatt, n, write_here;
     96  int i, j, iatt, n, write_here,N;
    8797  int a,b,c;
    8898  int marker;
     
    320330    Py_DECREF(ii); Py_DECREF(holderlist);
    321331  }   
     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 
    322340  /* Free in/out structure memory */
    323341 
     
    365383 
    366384  /*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;
    368388}
    369389
  • anuga_core/source/anuga/mesh_engine/test_generate_mesh.py

    r4449 r4893  
    4242        data = triang.genMesh(points,seglist,holelist,regionlist,
    4343                              pointattlist,segattlist, mode, test)
    44 
     44        print "data", data
    4545        self.failUnless(data['generatedtrianglelist'] ==[(1, 0, 2), (2, 3, 1)],
    4646                        'trianglelist is wrong!')
Note: See TracChangeset for help on using the changeset viewer.