Changeset 13864


Ignore:
Timestamp:
11/01/12 11:04:25 (12 years ago)
Author:
jschierm
Message:

CHG: Removed mexCallMATLAB and associated Matlab dependencies from MeshProfileIntersection to create Python version.

Location:
issm/trunk-jpl/src/wrappers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/wrappers/MeshProfileIntersection/MeshProfileIntersection.cpp

    r13236 r13864  
    1111                filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)
    1212        output:
    13                 segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremitis for a segment
     13                segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremities for a segment
    1414                belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the
    1515                mesh.
     
    2626        _printLine_("        filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)");
    2727        _printLine_("   output:");
    28         _printLine_("        segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremitis for a segment ");
     28        _printLine_("        segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremities for a segment ");
    2929        _printLine_("        belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the ");
    3030        _printLine_("        mesh.");
     
    4545       
    4646        //contours
    47         mxArray*  matlabstructure=NULL;
     47        DataSet *domain = NULL;
    4848        Contour<double>** contours=NULL;
    4949        int       numcontours;
     
    5757        MODULEBOOT();
    5858
    59         /*checks on arguments on the matlab side: */
    60         CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&MeshProfileIntersectionUsage);
    61 
    62         /*First, call expread on filename to build a contour array in the matlab workspace: */
    63         mexCallMATLAB( 1, &matlabstructure, 1, (mxArray**)&FILENAME, "expread");
     59        /*checks on arguments: */
     60        CHECKARGUMENTS(NLHS,NRHS,&MeshProfileIntersectionUsage);
    6461
    6562        /*Fetch inputs: */
     
    7875
    7976        //contours
    80         numcontours=mxGetNumberOfElements(matlabstructure);
     77        FetchData(&domain,FILENAME);
     78        // MeshProfileIntersectionx should be modified to take DataSet directly (and perhaps SeqMat and SeqVec).
     79        numcontours=domain->Size();
    8180        contours=xNew<Contour<double>*>(numcontours);
    82         for(i=0;i<numcontours;i++){
    83                 //allocate
    84                 contouri=xNew<Contour<double> >(1);
    85                 //retrieve dimension of this contour.
    86                 contouri->nods=(int)mxGetScalar(mxGetField(matlabstructure,i,"nods"));
    87                 //set pointers.
    88                 contouri->x=mxGetPr(mxGetField(matlabstructure,i,"x"));
    89                 contouri->y=mxGetPr(mxGetField(matlabstructure,i,"y"));
    90                 *(contours+i)=contouri;
    91         }
     81        for(i=0;i<numcontours;i++)
     82                *(contours+i)=(Contour<double>*)domain->GetObjectByOffset(i);
    9283
    9384        /* Debugging of contours :{{{1*/
  • issm/trunk-jpl/src/wrappers/python/Makefile.am

    r13831 r13864  
    3333                                                EnumToString.la\
    3434                                                InterpFromMeshToMesh2d.la\
     35                                                MeshProfileIntersection.la\
    3536                                                NodeConnectivity.la\
    3637                                                StringToEnum.la\
     
    108109InterpFromMeshToMesh2d_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB)
    109110
     111MeshProfileIntersection_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp\
     112                                                                                ../MeshProfileIntersection/MeshProfileIntersection.h
     113MeshProfileIntersection_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)
     114
    110115NodeConnectivity_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp\
    111116                                                                                ../NodeConnectivity/NodeConnectivity.h
Note: See TracChangeset for help on using the changeset viewer.