Changeset 13330
- Timestamp:
- 09/11/12 15:01:24 (13 years ago)
- Location:
- issm/trunk-jpl/src/modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
r13236 r13330 29 29 WRAPPER(ContourToMesh){ 30 30 31 int i,j;32 33 31 /* required input: */ 34 int edgevalue;35 double *index= NULL;36 int nel;37 double *x= NULL;38 int nods;39 double *y= NULL;40 char *interptype= NULL;41 char * contourname= NULL;42 DataSet * contours= NULL;32 int edgevalue; 33 double *index = NULL; 34 int nel; 35 double *x = NULL; 36 int nods; 37 double *y = NULL; 38 char *interptype = NULL; 39 char *contourname = NULL; 40 DataSet *contours = NULL; 43 41 44 42 /* output: */ … … 91 89 /*end module: */ 92 90 MODULEEND(); 93 94 91 } -
issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
r13236 r13330 11 11 _printLine_(" x,y: list of nodes."); 12 12 _printLine_(" contourname: name of .exp file containing the contours, or resulting structure from call to expread."); 13 _printLine_(" interptype: string definining type of interpolation ('element', or 'node').");14 13 _printLine_(" edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons."); 15 14 _printLine_(" flags: vector of flags (0 or 1), of size nods."); … … 18 17 WRAPPER(ContourToNodes){ 19 18 20 int i,j; 21 22 /* required input: */ 23 int edgevalue; 24 double *x = NULL; 25 double *y = NULL; 26 char *interptype = NULL; 19 /* input: */ 20 int edgevalue,nods; 21 double *x = NULL; 22 double *y = NULL; 23 char *contourname = NULL; 24 DataSet *contours = NULL; 27 25 28 26 /* output: */ 29 27 SeqVec<double> *flags = NULL; 30 int nods;31 32 /*contours*/33 int numcontours;34 mxArray *matlabstructure = NULL;35 Contour<double> **contours = NULL;36 Contour<double> *contouri = NULL;37 28 38 29 /*Boot module: */ … … 40 31 41 32 /*checks on arguments on the matlab side: */ 42 C heckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToNodesUsage);33 CHECKARGUMENTS(NLHS,NRHS,&ContourToNodesUsage); 43 34 44 35 /*Fetch inputs: */ … … 46 37 FetchData(&y,NULL,NULL,YHANDLE); 47 38 FetchData(&edgevalue,EDGEVALUEHANDLE); 39 FetchData(&contourname,CONTOURNAME); 40 contours=DomainOutlineRead<double>(contourname); 48 41 49 /*Fetch contours*/ 50 if(mxIsChar(FILENAME)){ 51 /*Call expread on filename to build a contour array in the matlab workspace: */ 52 mexCallMATLAB(1,&matlabstructure,1,(mxArray**)&FILENAME,"expread"); 53 } 54 else{ 55 /*FILENAME is actually a structure, coming directly from expread: */ 56 matlabstructure=(mxArray*)FILENAME; 57 } 58 59 numcontours=mxGetNumberOfElements(matlabstructure); 60 contours=xNew<Contour<double>*>(numcontours); 61 for(i=0;i<numcontours;i++){ 62 //allocate 63 contouri=xNew<Contour<double> >(1); 64 //retrieve dimension of this contour. 65 contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods")); 66 //set pointers. 67 contouri->x=mxGetPr(mxGetField(matlabstructure,i,"x")); 68 contouri->y=mxGetPr(mxGetField(matlabstructure,i,"y")); 69 *(contours+i)=contouri; 70 } 71 72 /*Run interpolation routine: */ 73 ContourToNodesx(&flags,x,y,nods,contours,numcontours,edgevalue); 42 /*Run x layer */ 43 ContourToNodesx(&flags,x,y,nods,contours,edgevalue); 74 44 75 45 /* output: */ -
issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
r13236 r13330 30 30 #define XHANDLE prhs[0] 31 31 #define YHANDLE prhs[1] 32 #define FILENAMEprhs[2]32 #define CONTOURNAME prhs[2] 33 33 #define EDGEVALUEHANDLE prhs[3] 34 34 … … 41 41 #define XHANDLE PyTuple_GetItem(args,0) 42 42 #define YHANDLE PyTuple_GetItem(args,1) 43 #define FILENAMEPyTuple_GetItem(args,2)43 #define CONTOURNAME PyTuple_GetItem(args,2) 44 44 #define EDGEVALUEHANDLE PyTuple_GetItem(args,3) 45 45 -
issm/trunk-jpl/src/modules/python/Makefile.am
r13287 r13330 7 7 lib_LTLIBRARIES = BamgConvertMesh.la\ 8 8 BamgMesher.la\ 9 ContourToNodes.la\ 9 10 ElementConnectivity.la\ 10 11 EnumToString.la\ … … 64 65 BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 65 66 67 ContourToNodes_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp\ 68 ../ContourToNodes/ContourToNodes.h 69 ContourToNodes_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 70 66 71 ElementConnectivity_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp\ 67 72 ../ElementConnectivity/ElementConnectivity.h
Note:
See TracChangeset
for help on using the changeset viewer.