]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDPartitioner_Swig/MEDPartitionerCommon.i
Salome HOME
7ecf24f86e6d5f0d5908d31917a773b128f1f7d5
[tools/medcoupling.git] / src / MEDPartitioner_Swig / MEDPartitionerCommon.i
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 %module MEDPartitioner
21
22 %include std_string.i
23
24 %{
25 #include "MEDFileData.hxx"
26
27 #include "MEDPARTITIONER_MEDPartitioner.hxx"
28 #include "MEDPARTITIONER.hxx"
29 #include "MEDPARTITIONER_Graph.hxx"
30
31 using namespace MEDCoupling;
32 using namespace INTERP_KERNEL;
33 using namespace MEDPARTITIONER;
34 %}
35
36 %feature("autodoc", "1");
37 %feature("docstring");
38
39 %newobject MEDPARTITIONER::MEDPartitioner::New;
40 %newobject MEDPARTITIONER::MEDPartitioner::Graph;
41 %newobject MEDPARTITIONER::MEDPartitioner::getMEDFileData;
42 %feature("unref") MEDCoupling::MEDFileData "$this->decrRef();"
43
44 %nodefaultctor;
45
46 %rename (InterpKernelException) INTERP_KERNEL::Exception;
47
48 namespace MEDPARTITIONER
49 {
50   class Graph
51   {
52   public:
53     typedef enum {METIS,SCOTCH} splitter_type;
54   public:
55     virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0) throw(INTERP_KERNEL::Exception);
56     const MEDCoupling::MEDCouplingSkyLineArray *getGraph() const;
57     const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const;
58     int nbVertices() const;
59   };
60
61   class MEDPartitioner
62   {
63   public:
64     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);
65     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);
66     MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
67     static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0) throw(INTERP_KERNEL::Exception);
68     MEDCoupling::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception);
69     void write(const std::string& filename) throw(INTERP_KERNEL::Exception);
70   };
71 }
72