Salome HOME
Move medtool folder to MED base repository
[modules/med.git] / medtool / src / MEDPartitioner_Swig / MEDPartitionerCommon.i
1 // Copyright (C) 2007-2015  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 ParaMEDMEM;
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") ParaMEDMEM::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     virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0) throw(INTERP_KERNEL::Exception);
54     const ParaMEDMEM::MEDCouplingSkyLineArray *getGraph() const;
55     const ParaMEDMEM::MEDCouplingSkyLineArray *getPartition() const;
56     int nbVertices() const;
57   };
58
59   class MEDPartitioner
60   {
61   public:
62     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);
63     MEDPartitioner(const ParaMEDMEM::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);
64     MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
65     static MEDPARTITIONER::Graph* Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0) throw(INTERP_KERNEL::Exception);
66     ParaMEDMEM::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception);
67     void write(const std::string& filename) throw(INTERP_KERNEL::Exception);
68   };
69 }
70