]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/PyWrapping/medcoupling.i
Salome HOME
bos #26458 Versioning of sources via git commit id (sha1)
[tools/medcoupling.git] / src / PyWrapping / medcoupling.i
1 // Copyright (C) 2017-2021  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 // Author : Anthony Geay (EDF R&D)
21
22 %module medcoupling
23
24 #define MEDCOUPLINGREMAPPER_EXPORT
25 #define INTERPKERNEL_EXPORT
26 #define MEDCOUPLING_EXPORT
27 #define MEDLOADER_EXPORT
28
29 %include "MEDCouplingCommon.i"
30
31 %include "MEDCouplingRemapperCommon.i"
32
33 %include "ICoCoMEDField.i"
34
35 #ifdef WITH_MED_FILE
36 %include "MEDLoaderCommon.i"
37 #endif
38
39 #ifdef WITH_RENUMBER
40 %include "MEDRenumberImpl.i"
41 #endif
42
43 #ifdef WITH_PARTITIONER
44 %include "MEDPartitionerCommon.i"
45 #endif
46
47 #ifdef WITH_PARALLEL_INTERPOLATOR
48 %include "ParaMEDMEMCommon.i"
49 #endif
50
51 %constant const char __version__[]=MEDCOUPLING_GIT_SHA1;
52
53 %{
54   static const char SEQ_INTERPOL_EXT[]="Sequential interpolator";
55   static const char MEDFILEIO_EXT[]="MED file I/O";
56   static const char RENUM_EXT[]="Renumberer";
57   static const char PART_EXT[]="Partitioner";
58   static const char PAR_INTERPOL_EXT[]="Parallel interpolator (SPMD paradigm)";
59   
60   static const char *EXTENSIONS[]={SEQ_INTERPOL_EXT,MEDFILEIO_EXT,RENUM_EXT,PART_EXT,PAR_INTERPOL_EXT};
61   static const int NB_OF_EXTENSIONS=sizeof(EXTENSIONS)/sizeof(const char *);
62 %}
63
64 %inline
65 {
66   std::vector<std::string> AllPossibleExtensions()
67   {
68     std::vector<std::string> ret(EXTENSIONS,EXTENSIONS+NB_OF_EXTENSIONS);
69     return ret;
70   }
71
72   bool HasMEDFileExt()
73   {
74 #ifdef WITH_MED_FILE
75     return true;
76 #else
77     return false;
78 #endif
79   }
80
81   bool HasRenumberExt()
82   {
83 #ifdef WITH_RENUMBER
84     return true;
85 #else
86     return false;
87 #endif
88   }
89
90   bool HasPartitionerExt()
91   {
92 #ifdef WITH_PARTITIONER
93     return true;
94 #else
95     return false;
96 #endif
97   }
98
99   bool HasScotchPartitionerAlg()
100   {
101 #ifdef WITH_PARTITIONER
102     return MEDPartitioner::HasScotchAlg();
103 #else
104     return false;
105 #endif    
106   }
107
108   bool HasPTScotchPartitionerAlg()
109   {
110 #ifdef WITH_PARTITIONER
111     return MEDPartitioner::HasPTScotchAlg();
112 #else
113     return false;
114 #endif    
115   }
116
117   bool HasMetisPartitionerAlg()
118   {
119 #ifdef WITH_PARTITIONER
120     return MEDPartitioner::HasMetisAlg();
121 #else
122     return false;
123 #endif    
124   }
125   
126   bool HasParallelInterpolatorExt()
127   {
128 #ifdef WITH_PARALLEL_INTERPOLATOR
129     return true;
130 #else
131     return false;
132 #endif
133   }
134   
135   std::vector<std::string> ActiveExtensions()
136   {
137     std::vector<std::string> ret;
138     ret.push_back(std::string(SEQ_INTERPOL_EXT));
139 #ifdef WITH_MED_FILE
140     ret.push_back(std::string(MEDFILEIO_EXT));
141 #endif
142 #ifdef WITH_RENUMBER
143     ret.push_back(std::string(RENUM_EXT));
144 #endif
145 #ifdef WITH_PARTITIONER
146     ret.push_back(std::string(PART_EXT));
147 #endif
148 #ifdef WITH_PARALLEL_INTERPOLATOR
149     ret.push_back(std::string(PAR_INTERPOL_EXT));
150 #endif
151     return ret;
152   }
153 }
154
155 %pythoncode %{
156 def MEDCouplingDataArrayDoubleIadd(self,*args):
157     import _medcoupling
158     return _medcoupling.DataArrayDouble____iadd___(self, self, *args)
159 def MEDCouplingDataArrayDoubleIsub(self,*args):
160     import _medcoupling
161     return _medcoupling.DataArrayDouble____isub___(self, self, *args)
162 def MEDCouplingDataArrayDoubleImul(self,*args):
163     import _medcoupling
164     return _medcoupling.DataArrayDouble____imul___(self, self, *args)
165 def MEDCouplingDataArrayDoubleIdiv(self,*args):
166     import _medcoupling
167     return _medcoupling.DataArrayDouble____idiv___(self, self, *args)
168 def MEDCouplingDataArrayDoubleIpow(self,*args):
169     import _medcoupling
170     return _medcoupling.DataArrayDouble____ipow___(self, self, *args)
171 def MEDCouplingFieldDoubleIadd(self,*args):
172     import _medcoupling
173     return _medcoupling.MEDCouplingFieldDouble____iadd___(self, self, *args)
174 def MEDCouplingFieldDoubleIsub(self,*args):
175     import _medcoupling
176     return _medcoupling.MEDCouplingFieldDouble____isub___(self, self, *args)
177 def MEDCouplingFieldDoubleImul(self,*args):
178     import _medcoupling
179     return _medcoupling.MEDCouplingFieldDouble____imul___(self, self, *args)
180 def MEDCouplingFieldDoubleIdiv(self,*args):
181     import _medcoupling
182     return _medcoupling.MEDCouplingFieldDouble____idiv___(self, self, *args)
183 def MEDCouplingFieldDoubleIpow(self,*args):
184     import _medcoupling
185     return _medcoupling.MEDCouplingFieldDouble____ipow___(self, self, *args)
186 def MEDCouplingDataArrayInt32Iadd(self,*args):
187     import _medcoupling
188     return _medcoupling.DataArrayInt32____iadd___(self, self, *args)
189 def MEDCouplingDataArrayInt32Isub(self,*args):
190     import _medcoupling
191     return _medcoupling.DataArrayInt32____isub___(self, self, *args)
192 def MEDCouplingDataArrayInt32Imul(self,*args):
193     import _medcoupling
194     return _medcoupling.DataArrayInt32____imul___(self, self, *args)
195 def MEDCouplingDataArrayInt32Idiv(self,*args):
196     import _medcoupling
197     return _medcoupling.DataArrayInt32____idiv___(self, self, *args)
198 def MEDCouplingDataArrayInt32Imod(self,*args):
199     import _medcoupling
200     return _medcoupling.DataArrayInt32____imod___(self, self, *args)
201 def MEDCouplingDataArrayInt32Ipow(self,*args):
202     import _medcoupling
203     return _medcoupling.DataArrayInt32____ipow___(self, self, *args)
204 def MEDCouplingDataArrayInt64Iadd(self,*args):
205     import _medcoupling
206     return _medcoupling.DataArrayInt64____iadd___(self, self, *args)
207 def MEDCouplingDataArrayInt64Isub(self,*args):
208     import _medcoupling
209     return _medcoupling.DataArrayInt64____isub___(self, self, *args)
210 def MEDCouplingDataArrayInt64Imul(self,*args):
211     import _medcoupling
212     return _medcoupling.DataArrayInt64____imul___(self, self, *args)
213 def MEDCouplingDataArrayInt64Idiv(self,*args):
214     import _medcoupling
215     return _medcoupling.DataArrayInt64____idiv___(self, self, *args)
216 def MEDCouplingDataArrayInt64Imod(self,*args):
217     import _medcoupling
218     return _medcoupling.DataArrayInt64____imod___(self, self, *args)
219 def MEDCouplingDataArrayInt64Ipow(self,*args):
220     import _medcoupling
221     return _medcoupling.DataArrayInt64____ipow___(self, self, *args)
222 def MEDCouplingDataArrayFloatIadd(self,*args):
223     import _medcoupling
224     return _medcoupling.DataArrayFloat____iadd___(self, self, *args)
225 def MEDCouplingDataArrayFloatIsub(self,*args):
226     import _medcoupling
227     return _medcoupling.DataArrayFloat____isub___(self, self, *args)
228 def MEDCouplingDataArrayFloatImul(self,*args):
229     import _medcoupling
230     return _medcoupling.DataArrayFloat____imul___(self, self, *args)
231 def MEDCouplingDataArrayFloatIdiv(self,*args):
232     import _medcoupling
233     return _medcoupling.DataArrayFloat____idiv___(self, self, *args)
234 def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
235     import _medcoupling
236     return _medcoupling.DataArrayDoubleTuple____iadd___(self, self, *args)
237 def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
238     import _medcoupling
239     return _medcoupling.DataArrayDoubleTuple____isub___(self, self, *args)
240 def MEDCouplingDataArrayDoubleTupleImul(self,*args):
241     import _medcoupling
242     return _medcoupling.DataArrayDoubleTuple____imul___(self, self, *args)
243 def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
244     import _medcoupling
245     return _medcoupling.DataArrayDoubleTuple____idiv___(self, self, *args)
246 def MEDCouplingDataArrayInt32TupleIadd(self,*args):
247     import _medcoupling
248     return _medcoupling.DataArrayInt32Tuple____iadd___(self, self, *args)
249 def MEDCouplingDataArrayInt32TupleIsub(self,*args):
250     import _medcoupling
251     return _medcoupling.DataArrayInt32Tuple____isub___(self, self, *args)
252 def MEDCouplingDataArrayInt32TupleImul(self,*args):
253     import _medcoupling
254     return _medcoupling.DataArrayInt32Tuple____imul___(self, self, *args)
255 def MEDCouplingDataArrayInt32TupleIdiv(self,*args):
256     import _medcoupling
257     return _medcoupling.DataArrayInt32Tuple____idiv___(self, self, *args)
258 def MEDCouplingDataArrayInt32TupleImod(self,*args):
259     import _medcoupling
260     return _medcoupling.DataArrayInt32Tuple____imod___(self, self, *args)
261 def MEDCouplingDataArrayInt64TupleIadd(self,*args):
262     import _medcoupling
263     return _medcoupling.DataArrayInt64Tuple____iadd___(self, self, *args)
264 def MEDCouplingDataArrayInt64TupleIsub(self,*args):
265     import _medcoupling
266     return _medcoupling.DataArrayInt64Tuple____isub___(self, self, *args)
267 def MEDCouplingDataArrayInt64TupleImul(self,*args):
268     import _medcoupling
269     return _medcoupling.DataArrayInt64Tuple____imul___(self, self, *args)
270 def MEDCouplingDataArrayInt64TupleIdiv(self,*args):
271     import _medcoupling
272     return _medcoupling.DataArrayInt64Tuple____idiv___(self, self, *args)
273 def MEDCouplingDataArrayInt64TupleImod(self,*args):
274     import _medcoupling
275     return _medcoupling.DataArrayInt64Tuple____imod___(self, self, *args)
276 def MEDCouplingDenseMatrixIadd(self,*args):
277     import _medcoupling
278     return _medcoupling.DenseMatrix____iadd___(self, self, *args)
279 def MEDCouplingDenseMatrixIsub(self,*args):
280     import _medcoupling
281     return _medcoupling.DenseMatrix____isub___(self, self, *args)
282 %}
283
284 %include "MEDCouplingFinalize.i"
285
286 #ifdef WITH_MED_FILE
287 %include "MEDLoaderFinalize.i"
288 #endif
289
290 %include "medcoupling_pycode"
291