Changeset 11969


Ignore:
Timestamp:
04/12/12 21:09:43 (13 years ago)
Author:
Eric.Larour
Message:

Working python wrapper for TriMesh module. No need for Test anymore

Location:
issm/trunk-jpl/src/mex/TriMesh
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/mex/TriMesh/TriMesh.cpp

    r11932 r11969  
    55#include "./TriMesh.h"
    66
    7 WRAPPER(TriMesh, char* DOMAINOUTLINE, double AREA, bool ORDER){
     7WRAPPER(TriMesh){
    88       
    99        /* input: */
     
    3333        FetchData(&order,ORDER);
    3434
     35
    3536        /*Read domain outline: */
    3637        domain=DomainOutlineRead(domainname,false);
     
    3839        /*call x core: */
    3940        TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,area,order);
    40 
     41       
     42       
    4143        /*write outputs: */
    4244        WriteData(INDEX,index);
     
    5658        /*end module: */
    5759        MODULEEND();
     60
    5861}
    5962
    60 void TriMeshUsage(void)
     63void TriMeshUsage(void) //{{{1
    6164{
    6265        printf("\n");
     
    7073        printf("\n");
    7174}
    72 
    73 
    74 #ifdef _HAVE_PYTHON_
    75 BOOST_PYTHON_MODULE(TriMesh){
    76         boost::python::numeric::array::set_module_and_type( "numpy", "ndarray");
    77         def("TriMesh",TriMesh);
    78 }
    79 #endif
     75//}}}
  • issm/trunk-jpl/src/mex/TriMesh/TriMesh.h

    r11932 r11969  
    1313#endif
    1414
     15/*Very important definition in case we are compiling a python module!: needs to come before header files inclusion*/
     16#ifdef _HAVE_PYTHON_
     17#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
     18#endif
     19
    1520#include "../../c/include/globals.h"
     21#include "../../c/toolkits/toolkits.h"
    1622#include "../../c/include/include.h"
    1723#include "../../c/modules/modules.h"
     
    3541
    3642#endif
     43#ifdef _HAVE_PYTHON_
     44/* serial input macros: */
     45#define DOMAINOUTLINE     PyTuple_GetItem(args,0)
     46#define AREA        PyTuple_GetItem(args,1)
     47#define ORDER     PyTuple_GetItem(args,2)
     48
     49/* serial output macros: */
     50#define INDEX  output,0
     51#define X  output,1
     52#define Y   output,2
     53#define SEGMENTS   output,3
     54#define SEGMENTMARKERLIST output,4
     55#endif
    3756
    3857/* local prototypes: */
Note: See TracChangeset for help on using the changeset viewer.