Changeset 13353
- Timestamp:
- 09/13/12 10:42:06 (13 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
r13216 r13353 609 609 } 610 610 /*}}}*/ 611 /*FUNCTION FetchData(Options** poptions,const mxArray* 611 /*FUNCTION FetchData(Options** poptions,const mxArray** pdataref){{{*/ 612 612 void FetchData(Options** poptions,int istart, int nrhs,const mxArray** pdataref){ 613 613 … … 634 634 } 635 635 /*}}}*/ 636 /*FUNCTION FetchData(DataSet** pcontours,const mxArray* dataref){{{*/ 637 void FetchData(DataSet** pcontours,const mxArray* dataref){ 638 639 int numcontours,index,test1,test2; 640 char *contourname = NULL; 641 DataSet *contours = NULL; 642 Contour<double> *contouri = NULL; 643 644 if (mxIsClass(dataref,"char")){ 645 FetchData(&contourname,dataref); 646 contours=DomainOutlineRead<double>(contourname); 647 } 648 else if(mxIsClass(dataref,"struct")){ 649 650 contours=new DataSet(0); 651 numcontours=mxGetNumberOfElements(dataref); 652 653 for(int i=0;i<numcontours;i++){ 654 655 contouri=xNew<Contour<double> >(1); 656 657 index = mxGetFieldNumber(dataref,"nods"); 658 if(index==-1) _error_("input structure does not have a 'nods' field"); 659 FetchData(&contouri->nods,mxGetFieldByNumber(dataref,i,index)); 660 661 index = mxGetFieldNumber(dataref,"x"); 662 if(index==-1) _error_("input structure does not have a 'x' field"); 663 FetchData(&contouri->x,&test1,&test2,mxGetFieldByNumber(dataref,i,index)); 664 if(test1!=contouri->nods || test2!=1) _error_("field x should be of size ["<<contouri->nods<<" 1]"); 665 666 index = mxGetFieldNumber(dataref,"y"); 667 if(index==-1) _error_("input structure does not have a 'y' field"); 668 FetchData(&contouri->y,&test1,&test2,mxGetFieldByNumber(dataref,i,index)); 669 if(test1!=contouri->nods || test2!=1) _error_("field y should be of size ["<<contouri->nods<<" 1]"); 670 671 contours->AddObject(contouri); 672 } 673 } 674 else{ 675 _error_("Contour is neither a string nor a structure and cannot be loaded ("<<mxGetClassName(dataref)<<" not supported)"); 676 } 677 678 /*clean-up and assign output pointer*/ 679 xDelete<char>(contourname); 680 *pcontours=contours; 681 } 682 /*}}}*/ -
issm/trunk-jpl/src/c/matlab/io/matlabio.h
r13267 r13353 49 49 void FetchData(BamgOpts** bamgopts,const mxArray* dataref); 50 50 void FetchData(Options** poptions,int istart, int nrhs,const mxArray** pdataref); 51 void FetchData(DataSet** pcontours,const mxArray* dataref); 51 52 52 53 Option* OptionParse(char* name, const mxArray* prhs[]); -
issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp
r13310 r13353 235 235 } 236 236 /*}}}*/ 237 /*FUNCTION FetchData(DataSet** pcontours,PyObject* py_dict){{{*/ 238 void FetchData(DataSet** pcontours,PyObject* py_dict){ 239 240 _error_("not supported yet"); 241 } 242 /*}}}*/ 237 243 238 244 /*Python version dependent: */ -
issm/trunk-jpl/src/c/python/io/pythonio.h
r13310 r13353 35 35 void FetchData(BamgOpts** bamgopts,PyObject* py_dict); 36 36 void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments); 37 void FetchData(DataSet** pcontours,PyObject* py_dict); 37 38 38 39 int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void )); -
issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp
r13056 r13353 12 12 13 13 int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname){ 14 15 14 16 15 /*Error management: */ … … 56 55 return noerr; 57 56 } 58 -
issm/trunk-jpl/src/c/shared/Exp/exp.h
r13293 r13353 175 175 176 176 /*intermediary: */ 177 int nprof;178 int *profnvertices = NULL;179 doubletype **pprofx = NULL;180 doubletype **pprofy = NULL;181 Contour<doubletype> *contour = NULL;177 int nprof; 178 int *profnvertices = NULL; 179 doubletype **pprofx = NULL; 180 doubletype **pprofy = NULL; 181 Contour<doubletype> *contour = NULL; 182 182 183 183 /*output: */ 184 DataSet * domain=NULL;184 DataSet *domain = NULL; 185 185 186 186 /*If domainname is an empty string, return empty dataset*/ -
issm/trunk-jpl/src/m/mesh/bamg.m
r13329 r13353 66 66 domain=expread(domainfile); 67 67 68 %Write temporary file, with only the domain outline (exclude holes)69 expwrite(domain(1),[domainfile '_TEMPouterboundary.exp']);70 71 68 %Build geometry 72 69 count=0; … … 80 77 %Checks that all holes are INSIDE the principle domain outline 81 78 if i>1, 82 flags=ContourToNodes(domain(i).x,domain(i).y, [domainfile '_TEMPouterboundary.exp'],0);79 flags=ContourToNodes(domain(i).x,domain(i).y,domain(1),0); 83 80 if any(~flags), 84 81 error('bamg error message: All holes should be stricly inside the principal domain'); … … 109 106 110 107 %detect wether all points of the rift are inside the domain 111 flags=ContourToNodes(rift(i).x,rift(i).y, [domainfile '_TEMPouterboundary.exp'],0);108 flags=ContourToNodes(rift(i).x,rift(i).y,domain(1),0); 112 109 if ~flags, 113 110 error('one Rift has all his points outside of the domain outline'), … … 241 238 242 239 %only keep those inside 243 flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2), [domainfile '_TEMPouterboundary.exp'],0);240 flags=ContourToNodes(requiredvertices(:,1),requiredvertices(:,2),domain(1),0); 244 241 requiredvertices=requiredvertices(find(flags),:); 245 242 … … 255 252 %process geom 256 253 %bamg_geometry=processgeometry(bamg_geometry,getfieldvalue(options,'tol',NaN),domain(1)); 257 delete([domainfile '_TEMPouterboundary.exp']);258 254 259 255 elseif isstruct(md.private.bamg) & isfield(md.private.bamg,'geometry'), -
issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
r13330 r13353 36 36 FetchData(&x,&nods,NULL,XHANDLE); 37 37 FetchData(&y,NULL,NULL,YHANDLE); 38 FetchData(&edgevalue,EDGEVALUEHANDLE); 39 FetchData(&contourname,CONTOURNAME); 40 contours=DomainOutlineRead<double>(contourname); 38 FetchData(&edgevalue,EDGEVALUE); 39 FetchData(&contours,CONTOUR); 41 40 42 41 /*Run x layer */ -
issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.h
r13330 r13353 28 28 #ifdef _HAVE_MATLAB_MODULES_ 29 29 /* input macros: */ 30 #define XHANDLE 31 #define YHANDLE 32 #define CONTOUR NAMEprhs[2]33 #define EDGEVALUE HANDLEprhs[3]30 #define XHANDLE prhs[0] 31 #define YHANDLE prhs[1] 32 #define CONTOUR prhs[2] 33 #define EDGEVALUE prhs[3] 34 34 35 35 /* serial output macros: */ … … 39 39 #ifdef _HAVE_PYTHON_MODULES_ 40 40 /* input macros: */ 41 #define XHANDLE 42 #define YHANDLE 43 #define CONTOUR NAMEPyTuple_GetItem(args,2)44 #define EDGEVALUE HANDLEPyTuple_GetItem(args,3)41 #define XHANDLE PyTuple_GetItem(args,0) 42 #define YHANDLE PyTuple_GetItem(args,1) 43 #define CONTOUR PyTuple_GetItem(args,2) 44 #define EDGEVALUE PyTuple_GetItem(args,3) 45 45 46 46 /* serial output macros: */
Note:
See TracChangeset
for help on using the changeset viewer.