Changeset 13640
- Timestamp:
- 10/12/12 11:49:54 (12 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/python/io/WritePythonData.cpp
r13622 r13640 100 100 } 101 101 /*}}}*/ 102 /*FUNCTION PyArrayFromCopiedData(int dims[2],double* data){{{*/103 PyObject* PyArrayFromCopiedData(int dims[2],double* data){104 105 double* pydata;106 npy_intp pydims[2]={0,0};107 108 /* note that PyArray_SimpleNewFromData does not copy the data, so that when the original109 object (e.g. bamggeom,bamgmesh) is deleted, the data is gone. */110 111 pydims[0]=(npy_intp)dims[0];112 pydims[1]=(npy_intp)dims[1];113 pydata=xNew<IssmDouble>(dims[0]*dims[1]);114 memcpy(pydata,data,dims[0]*dims[1]*sizeof(double));115 return PyArray_SimpleNewFromData(2,pydims,NPY_DOUBLE,pydata);116 }117 /*}}}*/118 102 /*FUNCTION WriteData(PyObject* py_tuple,int index,SeqMat<double>* matrix){{{*/ 119 103 void WriteData(PyObject* py_tuple,int index,SeqMat<double>* matrix){ … … 149 133 } 150 134 /*}}}*/ 135 /*FUNCTION WriteData(PyObject* py_tuple,int index,RiftStruct* riftstruct){{{*/ 136 void WriteData(PyObject* py_tuple,int index,RiftStruct* riftstruct){ 137 138 _error_("not implemented yet... good luck John!"); 139 } 140 /*}}}*/ 141 142 /*Utils*/ 143 /*FUNCTION PyArrayFromCopiedData(int dims[2],double* data){{{*/ 144 PyObject* PyArrayFromCopiedData(int dims[2],double* data){ 145 146 double* pydata; 147 npy_intp pydims[2]={0,0}; 148 149 /* note that PyArray_SimpleNewFromData does not copy the data, so that when the original 150 object (e.g. bamggeom,bamgmesh) is deleted, the data is gone. */ 151 152 pydims[0]=(npy_intp)dims[0]; 153 pydims[1]=(npy_intp)dims[1]; 154 pydata=xNew<IssmDouble>(dims[0]*dims[1]); 155 memcpy(pydata,data,dims[0]*dims[1]*sizeof(double)); 156 return PyArray_SimpleNewFromData(2,pydims,NPY_DOUBLE,pydata); 157 } 158 /*}}}*/ -
issm/trunk-jpl/src/c/python/io/pythonio.h
r13448 r13640 24 24 void WriteData(PyObject* py_tuple,int index, BamgGeom* bamggeom); 25 25 void WriteData(PyObject* py_tuple,int index, BamgMesh* bamgmesh); 26 void WriteData(PyObject* py_tuple,int index, RiftStruct* riftstruct); 26 27 27 28 void FetchData(double** pvector,int* pM,PyObject* py_ref); -
issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp
r13634 r13640 346 346 347 347 return noerr; 348 }/*}}}*/349 /*FUNCTION pnpoly{{{*/350 int pnpoly(int npol, double *xp, double *yp, double x, double y) {351 int i, j, c = 0;352 for (i = 0, j = npol-1; i < npol; j = i++) {353 if ((((yp[i]<=y) && (y<yp[j])) ||354 ((yp[j]<=y) && (y<yp[i]))) &&355 (x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))356 c = !c;357 }358 return c;359 348 }/*}}}*/ 360 349 /*FUNCTION FindElement{{{*/ -
issm/trunk-jpl/src/c/shared/TriMesh/trimesh.h
r12080 r13640 22 22 int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int node,double* index,int nel); 23 23 int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs,int nods,int nel); 24 int pnpoly(int npol, double *xp, double *yp, double x, double y);25 24 int FindElement(double A,double B,double* index,int nel); 26 25 int RemoveRifts(double** pindex,double** px,double** py,int* pnods,double** psegments,int* pnumsegs,int numrifts1,int* rifts1numsegs,double** rifts1segments,double** rifts1pairs,int nel); -
issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.h
r13639 r13640 48 48 #define YIN PyTuple_GetItem(args,2) 49 49 #define SEGMENTSIN PyTuple_GetItem(args,3) 50 #define SEGMENT SMARKERSIN PyTuple_GetItem(args,4)50 #define SEGMENTMARKERSIN PyTuple_GetItem(args,4) 51 51 /* serial output macros: */ 52 52 #define INDEXOUT output,0 -
issm/trunk-jpl/src/modules/python/Makefile.am
r13464 r13640 14 14 NodeConnectivity.la\ 15 15 StringToEnum.la\ 16 TriMesh.la 16 TriMesh.la\ 17 TriMeshProcessRifts.la 17 18 endif 18 19 #}}} … … 97 98 ../TriMesh/TriMesh.h 98 99 TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB) 100 101 TriMeshProcessRifts_la_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\ 102 ../TriMeshProcessRifts/TriMeshProcessRifts.h 103 TriMeshProcessRifts_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 99 104 #}}}
Note:
See TracChangeset
for help on using the changeset viewer.