Changeset 4459


Ignore:
Timestamp:
May 16, 2007, 4:42:58 PM (17 years ago)
Author:
duncan
Message:

clean up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/mesh_engine/mesh_engine_c_layer.c

    r4458 r4459  
    9090  PyObject  *ii;
    9191 
    92   int *points_connected;
    93   int *lone_verts;
    94  
    9592  /* used for testing numeric arrays*/
    9693  int n_test;     
     
    205202    { index : [ coordinates, [connections], Attribute ] }
    206203  */
    207   holder = PyDict_New();
    208      
    209   /* list of int's, used to keep track of which verts are connected to
    210      triangles.
    211   points_connected = (int *)malloc(out.numberofpoints*sizeof(int));
    212    lone_verts = (int *)malloc(out.numberofpoints*sizeof(int)); */
    213  
    214   /* Initialise lone vert list
    215   for(i=0; i<out.numberofpoints;i++){
    216     points_connected[i] = 0;
    217      lone_verts[i] = 0;
    218   } */
    219    
     204  holder = PyDict_New();   
    220205 
    221206  /* Add triangle list */
     
    227212                                    out.trianglelist[i*3  ], out.trianglelist [i*3+1], out.trianglelist [i*3+2]);   
    228213    PyList_SetItem(holderlist,i, mlist);
    229     /* printf(" A vert index %i\n",out.trianglelist[i*3] );
    230     printf(" A vert index %i\n",out.trianglelist[i*3+1] );
    231     printf(" A vert index %i\n",out.trianglelist[i*3+2] ); */
    232     /* points_connected[out.trianglelist[i*3]] = 1;
    233     points_connected[out.trianglelist[i*3+1]] = 1;
    234     points_connected[out.trianglelist[i*3+2]] = 1;*/
    235     /* lone_verts[out.trianglelist[i*3]] = 1;
    236     lone_verts[out.trianglelist[i*3+1]] = 1;
    237     lone_verts[out.trianglelist[i*3+2]] = 1; */
    238     /*  printf(" Add triangle list \n");*/
    239214  }   
    240215  ii=PyString_FromString("generatedtrianglelist");
    241216  PyDict_SetItem(holder, ii, holderlist); Py_DECREF(ii); Py_DECREF(holderlist);
    242  
    243   /* convert the points_connected vector from a true(1) false(0) vector, where
    244      index is the vert, to a vector of the lone verts, at the beggining
    245      of the vector.
    246   write_here = 0;   
    247   for(i=0; i<out.numberofpoints;i++){
    248     if (0 == points_connected[i]) {
    249       points_connected[write_here] = i;
    250       write_here ++;
    251     }
    252   }   */
    253   /* printf(" ******************** \n" );
    254   for(i=0; i<write_here;i++){
    255     printf(" A vert index %i\n",points_connected[i] );
    256     } */
    257  
    258   /*  *** since I'm passing -j in to the mode we don't need this list
    259   listsize = write_here;
    260   holderlist = PyList_New(listsize);
    261   for(i=0; i<listsize;i++){
    262    PyObject *mlist = Py_BuildValue((char *)"i", points_connected[i]);   
    263     PyList_SetItem(holderlist,i, mlist);
    264   }
    265   ii=PyString_FromString("lonepointlist");
    266   PyDict_SetItem(holder, ii, holderlist); Py_DECREF(ii); Py_DECREF(holderlist);
    267   */
    268      
    269  
     217     
    270218  /* Add pointlist */
    271219  listsize = out.numberofpoints;
     
    408356  }
    409357 
    410   /*if(!points_connected ){
    411     free(points_connected ); points_connected =NULL;
    412     }     */
    413358  return Py_BuildValue((char *)"O", holder);
    414359}
Note: See TracChangeset for help on using the changeset viewer.