X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner_Swig%2FMEDPartitionerCommon.i;h=aeb343a2724d6ca3b10ebad18e98c6bb9021ee13;hb=13899c724fb58fb7769615febfeb95172f923314;hp=3f73621dbd7d590fdbd9597b5e57ffcea70839aa;hpb=79386ac5c73f8365c428b8ef595c4ef004959667;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner_Swig/MEDPartitionerCommon.i b/src/MEDPartitioner_Swig/MEDPartitionerCommon.i index 3f73621db..aeb343a27 100644 --- a/src/MEDPartitioner_Swig/MEDPartitionerCommon.i +++ b/src/MEDPartitioner_Swig/MEDPartitionerCommon.i @@ -17,52 +17,56 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -%module MEDPartitioner - -%include std_string.i - %{ -#include "MEDFileData.hxx" - #include "MEDPARTITIONER_MEDPartitioner.hxx" #include "MEDPARTITIONER.hxx" #include "MEDPARTITIONER_Graph.hxx" -using namespace MEDCoupling; -using namespace INTERP_KERNEL; using namespace MEDPARTITIONER; %} -%feature("autodoc", "1"); -%feature("docstring"); + %newobject MEDPARTITIONER::MEDPartitioner::New; %newobject MEDPARTITIONER::MEDPartitioner::Graph; +%newobject MEDPARTITIONER::MEDPartitioner::Graph::getGraph; +%newobject MEDPARTITIONER::MEDPartitioner::Graph::getPartition; %newobject MEDPARTITIONER::MEDPartitioner::getMEDFileData; -%feature("unref") MEDCoupling::MEDFileData "$this->decrRef();" - -%nodefaultctor; - -%rename (InterpKernelException) INTERP_KERNEL::Exception; namespace MEDPARTITIONER { class Graph { + public: + typedef enum {METIS,SCOTCH} splitter_type; public: virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0) throw(INTERP_KERNEL::Exception); - const MEDCoupling::MEDCouplingSkyLineArray *getGraph() const; - const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const; + MEDCoupling::MEDCouplingSkyLineArray *getGraph() const + { + const MEDCoupling::MEDCouplingSkyLineArray *ret(self->getGraph()); + if(ret) + ret->incrRef(); + return const_cast(ret); + } + const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const + { + const MEDCoupling::MEDCouplingSkyLineArray *ret(self->getPartition()); + if(ret) + ret->incrRef(); + return const_cast(ret); + } int nbVertices() const; }; class MEDPartitioner { public: - MEDPartitioner(const std::string& filename, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); - MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); - MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); - static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0) throw(INTERP_KERNEL::Exception); + MEDPartitioner(const std::string& filename, int ndomains=1, const std::string& library="metis",bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); + MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); + MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); + static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0, MEDCoupling::DataArrayInt* vlbloctab=0) throw(INTERP_KERNEL::Exception); + static std::vector AvailableAlgorithms(); + static std::vector AllAlgorithms(); MEDCoupling::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception); void write(const std::string& filename) throw(INTERP_KERNEL::Exception); };