Changeset 14714
- Timestamp:
- 04/23/13 08:09:48 (12 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 7 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r14708 r14714 804 804 ./modules/HoleFillerx/HoleFillerx.cpp\ 805 805 ./modules/HoleFillerx/HoleFillerx.h\ 806 ./modules/EdgeDetectionx/EdgeDetectionx.cpp\ 807 ./modules/EdgeDetectionx/EdgeDetectionx.h\ 806 808 ./modules/AverageFilterx/AverageFilterx.cpp\ 807 809 ./modules/AverageFilterx/AverageFilterx.h\ -
issm/trunk-jpl/src/c/modules/modules.h
r14650 r14714 25 25 #include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h" 26 26 #include "./ElementConnectivityx/ElementConnectivityx.h" 27 #include "./EdgeDetectionx/EdgeDetectionx.h" 27 28 #include "./EnumToStringx/EnumToStringx.h" 28 29 #include "./StringToEnumx/StringToEnumx.h" -
issm/trunk-jpl/src/wrappers/matlab/Makefile.am
r14656 r14714 46 46 ContourToMesh.la\ 47 47 ContourToNodes.la\ 48 EdgeDetection.la\ 48 49 ElementConnectivity.la\ 49 50 EnumToString.la\ … … 216 217 Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) 217 218 219 EdgeDetection_la_SOURCES = ../EdgeDetection/EdgeDetection.cpp\ 220 ../EdgeDetection/EdgeDetection.h 221 218 222 ExpSimplify_la_SOURCES = ../ExpSimplify/ExpSimplify.cpp\ 219 223 ../ExpSimplify/ExpSimplify.h -
issm/trunk-jpl/src/wrappers/matlab/io/WriteMatlabData.cpp
r14673 r14714 360 360 } 361 361 /*}}}*/ 362 /*FUNCTION WriteData(mxArray** pdataref,DataSet* contours){{{*/ 363 void WriteData(mxArray** pdataref,DataSet* contours){ 364 365 /*Intermediary*/ 366 367 int i; 368 mxArray *dataref = NULL; 369 const int numfields = 6; 370 const char *fnames[numfields]; 371 mwSize ndim = 2; 372 mwSize dimensions[2] = {1,1}; 373 char id[100]; 374 375 376 /*Initialize field names*/ 377 i=0; 378 fnames[i++] = "name"; 379 fnames[i++] = "nods"; 380 fnames[i++] = "density"; 381 fnames[i++] = "x"; 382 fnames[i++] = "y"; 383 fnames[i++] = "closed"; 384 _assert_(i==numfields); 385 386 /*Initialize matlab structure of dimension numrifts*/ 387 dimensions[0]=contours->Size(); 388 dataref=mxCreateStructArray(ndim,dimensions,numfields,fnames); 389 390 /*set each matlab each field*/ 391 for(int i=0;i<contours->Size();i++){ 392 Contour<IssmPDouble>* contour=(Contour<IssmPDouble>*)contours->GetObjectByOffset(i); 393 394 /*create a name for this contour from the contour id and set it: */ 395 sprintf(id,"%i",contour->id); 396 SetStructureFieldi(dataref,i,"name",id); 397 398 /*number of nods: */ 399 SetStructureFieldi(dataref,i,"nods" ,contour->nods); 400 401 /*density: */ 402 SetStructureFieldi(dataref,i,"density" ,1); 403 404 /*x and y: */ 405 SetStructureFieldi(dataref,i,"x" ,contour->nods, 1,contour->x); 406 SetStructureFieldi(dataref,i,"y" ,contour->nods, 1,contour->y); 407 408 /*closed: */ 409 SetStructureFieldi(dataref,i,"closed" ,(int)contour->closed); 410 } 411 412 /*Assign output*/ 413 *pdataref=dataref; 414 } 415 /*}}}*/ 362 416 363 417 /*Toolkit*/ 364 /*FUNCTION SetStructureField {{{*/418 /*FUNCTION SetStructureField(mxArray* dataref,const char* fieldname,int M,int N,double* fieldpointer){{{*/ 365 419 void SetStructureField(mxArray* dataref,const char* fieldname,int M,int N,double* fieldpointer){ 366 420 … … 372 426 /*Assign to structure*/ 373 427 mxSetField(dataref,0,fieldname,field); 428 } 429 /*}}}*/ 430 /*FUNCTION SetStructureFieldi(mxArray* dataref,const char* fieldname,char* string) {{{*/ 431 void SetStructureFieldi(mxArray* dataref,int i,const char* fieldname,char* string){ 432 433 mxArray* field = NULL; 434 435 /*Convert field*/ 436 WriteData(&field,string); 437 438 /*Assign to structure*/ 439 mxSetField(dataref,i,fieldname,field); 374 440 } 375 441 /*}}}*/ -
issm/trunk-jpl/src/wrappers/matlab/io/matlabio.h
r14673 r14714 69 69 void SetStructureFieldi(mxArray* dataref,int i,const char* fieldname,int field); 70 70 void SetStructureFieldi(mxArray* dataref,int i,const char* fieldname,double field); 71 void SetStructureFieldi(mxArray* dataref,int i,const char* fieldname,char* string); 71 72 int CheckNumMatlabArguments(int nlhs,int NLHS, int nrhs,int NRHS, const char* THISFUNCTION, void (*function)( void )); 72 73
Note:
See TracChangeset
for help on using the changeset viewer.