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