Salome HOME
Update copyrights
[tools/medcoupling.git] / src / ParaMEDMEM_Swig / ParaMEDMEMCommon.i
1 // Copyright (C) 2017-2019  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 %include std_set.i
21
22 %template() std::set<int>;
23
24 %{
25 #include "CommInterface.hxx"
26 #include "ProcessorGroup.hxx"
27 #include "Topology.hxx"
28 #include "MPIProcessorGroup.hxx"
29 #include "DEC.hxx"
30 #include "InterpKernelDEC.hxx"
31 #include "NonCoincidentDEC.hxx"
32 #include "StructuredCoincidentDEC.hxx"
33 #include "ParaMESH.hxx"
34 #include "ParaFIELD.hxx"
35 #include "ICoCoMEDField.hxx"
36 #include "ComponentTopology.hxx"
37
38 using namespace INTERP_KERNEL;
39 using namespace MEDCoupling;
40 using namespace ICoCo;
41 %}
42
43 %include "InterpolationOptions.hxx"
44 %include "CommInterface.hxx"
45 %include "ProcessorGroup.hxx"
46 %include "DECOptions.hxx"
47 %include "ParaMESH.hxx"
48 %include "ParaFIELD.hxx"
49 %include "MPIProcessorGroup.hxx"
50 %include "ComponentTopology.hxx"
51 %include "DEC.hxx"
52 %include "DisjointDEC.hxx"
53 %include "InterpKernelDEC.hxx"
54 %include "StructuredCoincidentDEC.hxx"
55
56 %include "ICoCoField.hxx"
57 %rename(ICoCoMEDField) ICoCo::MEDField;
58 %include "ICoCoMEDField.hxx"
59
60 %nodefaultctor;
61
62 /* This object can be used only if MED_ENABLE_FVM is defined*/
63 #ifdef MED_ENABLE_FVM
64 class NonCoincidentDEC : public DEC
65 {
66 public:
67   NonCoincidentDEC(ProcessorGroup& source, ProcessorGroup& target);
68 };
69 #endif
70
71 %extend MEDCoupling::ParaMESH
72 {
73   PyObject *getGlobalNumberingCell2() const
74   {
75     const int *tmp=self->getGlobalNumberingCell();
76     int size=self->getCellMesh()->getNumberOfCells();
77     PyObject *ret=PyList_New(size);
78     for(int i=0;i<size;i++)
79       PyList_SetItem(ret,i,PyInt_FromLong(tmp[i])); 
80     return ret;
81   }
82
83   PyObject *getGlobalNumberingFace2() const
84   {
85     const int *tmp=self->getGlobalNumberingFace();
86     int size=self->getFaceMesh()->getNumberOfCells();
87     PyObject *ret=PyList_New(size);
88     for(int i=0;i<size;i++)
89       PyList_SetItem(ret,i,PyInt_FromLong(tmp[i])); 
90     return ret;
91   }
92
93   PyObject *getGlobalNumberingNode2() const
94   {
95     const int *tmp=self->getGlobalNumberingNode();
96     int size=self->getCellMesh()->getNumberOfNodes();
97     PyObject *ret=PyList_New(size);
98     for(int i=0;i<size;i++)
99       PyList_SetItem(ret,i,PyInt_FromLong(tmp[i])); 
100     return ret;
101   }
102 }