Salome HOME
1112710783ffe227cbdfa4ab2be0d4c4260b2a4a
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2007-2013  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.
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 MEDCoupling
21
22 #define MEDCOUPLING_EXPORT
23
24 %include std_vector.i
25 %include std_string.i
26
27 %{
28 #include "MEDCouplingMemArray.hxx"
29 #include "MEDCouplingUMesh.hxx"
30 #include "MEDCouplingExtrudedMesh.hxx"
31 #include "MEDCouplingCMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingTypemaps.i"
44
45 #include "InterpKernelAutoPtr.hxx"
46
47 using namespace ParaMEDMEM;
48 using namespace INTERP_KERNEL;
49
50 %}
51
52 %template(ivec) std::vector<int>;
53 %template(dvec) std::vector<double>;
54 %template(svec) std::vector<std::string>;
55
56 ////////////////////
57 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
58 {
59   $result=convertMesh($1,$owner);
60 }
61
62 %typemap(out) MEDCouplingMesh*
63 {
64   $result=convertMesh($1,$owner);
65 }
66 //$$$$$$$$$$$$$$$$$$
67
68 ////////////////////
69 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
70 {
71   $result=convertMesh($1,$owner);
72 }
73
74 %typemap(out) MEDCouplingPointSet*
75 {
76   $result=convertMesh($1,$owner);
77 }
78 //$$$$$$$$$$$$$$$$$$
79
80
81 ////////////////////
82 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
83 {
84   $result=convertMesh($1,$owner);
85 }
86
87 %typemap(out) MEDCoupling1GTUMesh*
88 {
89   $result=convertMesh($1,$owner);
90 }
91 //$$$$$$$$$$$$$$$$$$
92
93 ////////////////////
94 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
95 {
96   $result=convertMesh($1,$owner);
97 }
98
99 %typemap(out) MEDCouplingStructuredMesh*
100 {
101   $result=convertMesh($1,$owner);
102 }
103 //$$$$$$$$$$$$$$$$$$
104
105 ////////////////////
106 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
107 {
108   $result=convertFieldDiscretization($1,$owner);
109 }
110
111 %typemap(out) MEDCouplingFieldDiscretization*
112 {
113   $result=convertFieldDiscretization($1,$owner);
114 }
115 //$$$$$$$$$$$$$$$$$$
116
117 ////////////////////
118 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
119 {
120   $result=convertMultiFields($1,$owner);
121 }
122
123 %typemap(out) MEDCouplingMultiFields*
124 {
125   $result=convertMultiFields($1,$owner);
126 }
127 //$$$$$$$$$$$$$$$$$$
128
129 ////////////////////
130 %typemap(out) ParaMEDMEM::DataArray*
131 {
132   $result=convertDataArray($1,$owner);
133 }
134
135 %typemap(out) DataArray*
136 {
137   $result=convertDataArray($1,$owner);
138 }
139 //$$$$$$$$$$$$$$$$$$
140
141 ////////////////////
142 %typemap(out) ParaMEDMEM::DataArrayChar*
143 {
144   $result=convertDataArrayChar($1,$owner);
145 }
146
147 %typemap(out) DataArrayChar*
148 {
149   $result=convertDataArrayChar($1,$owner);
150 }
151 //$$$$$$$$$$$$$$$$$$
152
153 #ifdef WITH_NUMPY
154 %init %{ import_array(); %}
155 #endif
156
157 %feature("autodoc", "1");
158 %feature("docstring");
159
160 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::New;
161 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
162 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy;
163 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
164 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
165 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePartRange;
166 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
167 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
168 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
169 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
170 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
171 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
172 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
173 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
174 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
213 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
214 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
215 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
216 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
217 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
218 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
219 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
220 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
221 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
222 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
223 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
224 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
225 %newobject ParaMEDMEM::DataArrayInt::New;
226 %newobject ParaMEDMEM::DataArrayInt::__iter__;
227 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
228 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
229 %newobject ParaMEDMEM::DataArrayInt::performCpy;
230 %newobject ParaMEDMEM::DataArrayInt::substr;
231 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
232 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
233 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
234 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
235 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
236 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
237 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
238 %newobject ParaMEDMEM::DataArrayInt::renumber;
239 %newobject ParaMEDMEM::DataArrayInt::renumberR;
240 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
241 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
242 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
243 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
244 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
245 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
246 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
247 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
248 %newobject ParaMEDMEM::DataArrayInt::negate;
249 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
250 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
251 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
252 %newobject ParaMEDMEM::DataArrayInt::Meld;
253 %newobject ParaMEDMEM::DataArrayInt::Add;
254 %newobject ParaMEDMEM::DataArrayInt::Substract;
255 %newobject ParaMEDMEM::DataArrayInt::Multiply;
256 %newobject ParaMEDMEM::DataArrayInt::Divide;
257 %newobject ParaMEDMEM::DataArrayInt::Pow;
258 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
259 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
260 %newobject ParaMEDMEM::DataArrayInt::Range;
261 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
262 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
263 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
264 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
265 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
266 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
267 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
268 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
269 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
270 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
271 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
272 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
273 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
274 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
275 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
276 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
277 %newobject ParaMEDMEM::DataArrayInt::__neg__;
278 %newobject ParaMEDMEM::DataArrayInt::__add__;
279 %newobject ParaMEDMEM::DataArrayInt::__radd__;
280 %newobject ParaMEDMEM::DataArrayInt::__sub__;
281 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
282 %newobject ParaMEDMEM::DataArrayInt::__mul__;
283 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
284 %newobject ParaMEDMEM::DataArrayInt::__div__;
285 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
286 %newobject ParaMEDMEM::DataArrayInt::__mod__;
287 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
288 %newobject ParaMEDMEM::DataArrayInt::__pow__;
289 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
290 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
291 %newobject ParaMEDMEM::DataArrayChar::deepCpy;
292 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
293 %newobject ParaMEDMEM::DataArrayChar::renumber;
294 %newobject ParaMEDMEM::DataArrayChar::renumberR;
295 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
296 %newobject ParaMEDMEM::DataArrayChar::selectByTupleIdSafe;
297 %newobject ParaMEDMEM::DataArrayChar::selectByTupleId2;
298 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
299 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
300 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
301 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
302 %newobject ParaMEDMEM::DataArrayChar::Meld;
303 %newobject ParaMEDMEM::DataArrayByte::New;
304 %newobject ParaMEDMEM::DataArrayByte::__iter__;
305 %newobject ParaMEDMEM::DataArrayByte::performCpy;
306 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
307 %newobject ParaMEDMEM::DataArrayChar::substr;
308 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
309 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
310 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
311 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
312 %newobject ParaMEDMEM::DataArrayDouble::New;
313 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
314 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
315 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
316 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
317 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
318 %newobject ParaMEDMEM::DataArrayDouble::Meld;
319 %newobject ParaMEDMEM::DataArrayDouble::Dot;
320 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
321 %newobject ParaMEDMEM::DataArrayDouble::Add;
322 %newobject ParaMEDMEM::DataArrayDouble::Substract;
323 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
324 %newobject ParaMEDMEM::DataArrayDouble::Divide;
325 %newobject ParaMEDMEM::DataArrayDouble::Pow;
326 %newobject ParaMEDMEM::DataArrayDouble::substr;
327 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
328 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
329 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
330 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
331 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
332 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
333 %newobject ParaMEDMEM::DataArrayDouble::negate;
334 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
335 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
336 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
337 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
338 %newobject ParaMEDMEM::DataArrayDouble::determinant;
339 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
340 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
341 %newobject ParaMEDMEM::DataArrayDouble::inverse;
342 %newobject ParaMEDMEM::DataArrayDouble::trace;
343 %newobject ParaMEDMEM::DataArrayDouble::deviator;
344 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
345 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
346 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
347 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
348 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
349 %newobject ParaMEDMEM::DataArrayDouble::renumber;
350 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
351 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
352 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
353 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
354 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
355 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
356 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
357 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
358 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
359 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
360 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
361 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
362 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
363 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
364 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
365 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
366 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
367 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
368 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
369 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
370 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
371 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
372 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
373 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
374 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
375 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
376 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
377 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
378 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
379 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
380 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
381 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
382 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
383 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
384 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
385 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
386 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
387 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
389 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
390 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
391 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
392 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
393 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
394 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
395 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
396 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
397 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
398 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
399 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
400 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
432 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
433 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
434 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
435 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
436 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
437 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
438 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
439 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
440 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
441 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
442 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
443 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
444 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
445 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
446 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
447 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
448 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
449 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
450 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
451 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
452 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
453 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
454 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
455 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
456 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
457 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
458 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
459 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
460 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
461 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
462 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
463 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
464 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
465 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
466 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
467 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
468 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
469 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
470 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
471 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
472
473 %feature("unref") DataArray "$this->decrRef();"
474 %feature("unref") DataArrayDouble "$this->decrRef();"
475 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
476 %feature("unref") MEDCouplingMesh "$this->decrRef();"
477 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
478 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
479 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
480 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
481 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
482 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
483 %feature("unref") DataArrayInt "$this->decrRef();"
484 %feature("unref") DataArrayChar "$this->decrRef();"
485 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
486 %feature("unref") DataArrayByte "$this->decrRef();"
487 %feature("unref") MEDCouplingField "$this->decrRef();"
488 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
489 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
490 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
491 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
492 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
493 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
494 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
495 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
496 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
497
498 %rename(assign) *::operator=;
499 %ignore ParaMEDMEM::RefCountObject::decrRef;
500 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
501 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
502 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
503 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
504
505 %nodefaultctor;
506
507 %rename (InterpKernelException) INTERP_KERNEL::Exception;
508
509 namespace INTERP_KERNEL
510 {
511   class Exception
512   {
513   public:
514     Exception(const char* what);
515     ~Exception() throw ();
516     const char *what() const throw ();
517     %extend
518     {
519       std::string __str__() const
520         {
521           return std::string(self->what());
522         }
523     }
524   };
525 }
526
527 namespace ParaMEDMEM
528 {
529   class TimeLabel
530   {
531   public:
532     void declareAsNew() const;
533     virtual void updateTime() const;
534     unsigned int getTimeOfThis() const;
535   protected:
536     ~TimeLabel();
537   };
538 }
539
540 namespace ParaMEDMEM
541 {
542   typedef enum
543     {
544       C_DEALLOC = 2,
545       CPP_DEALLOC = 3
546     } DeallocType;
547
548   typedef enum
549     {
550       ON_CELLS = 0,
551       ON_NODES = 1,
552       ON_GAUSS_PT = 2,
553       ON_GAUSS_NE = 3,
554       ON_NODES_KR = 4
555     } TypeOfField;
556
557   typedef enum
558     {
559       NO_TIME = 4,
560       ONE_TIME = 5,
561       LINEAR_TIME = 6,
562       CONST_ON_TIME_INTERVAL = 7
563     } TypeOfTimeDiscretization;
564
565   const char *MEDCouplingVersionStr();
566   int MEDCouplingVersion();
567   int MEDCouplingSizeOfVoidStar();
568
569   class RefCountObject
570   {
571   protected:
572     RefCountObject();
573     RefCountObject(const RefCountObject& other);
574     ~RefCountObject();
575   public:
576     bool decrRef() const;
577     void incrRef() const;
578     int getRCValue() const;
579     virtual std::size_t getHeapMemorySize() const;
580   };
581 }
582
583 %inline
584 {
585   PyObject *MEDCouplingVersionMajMinRel()
586   {
587     int tmp0=0,tmp1=0,tmp2=0;
588     MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
589     PyObject *res = PyList_New(3);
590     PyList_SetItem(res,0,SWIG_From_int(tmp0));
591     PyList_SetItem(res,1,SWIG_From_int(tmp1));
592     PyList_SetItem(res,2,SWIG_From_int(tmp2));
593     return res;
594   }
595
596   bool MEDCouplingHasNumPyBindings()
597   {
598 #ifdef WITH_NUMPY
599     return true;
600 #else
601     return false;
602 #endif
603   }
604
605   std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
606   {
607     static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
608     std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
609     if(PyRun_SimpleString(script)!=0)
610       throw INTERP_KERNEL::Exception(oss.str().c_str());
611     return std::string(script);
612   }
613 }
614
615 %include "MEDCouplingMemArray.i"
616
617 namespace ParaMEDMEM
618 {
619   typedef enum
620     {
621       UNSTRUCTURED = 5,
622       UNSTRUCTURED_DESC = 6,
623       CARTESIAN = 7,
624       EXTRUDED = 8,
625       CURVE_LINEAR = 9
626     } MEDCouplingMeshType;
627
628   class DataArrayInt;
629   class DataArrayDouble;
630   class MEDCouplingUMesh;
631   class MEDCouplingFieldDouble;
632
633   %extend RefCountObject
634   {
635     std::string getHiddenCppPointer() const
636     {
637       std::ostringstream oss; oss << "C++ Pointer address is : " << self;
638       return oss.str();
639     }
640   }
641
642   %extend MEDCouplingGaussLocalization
643   {
644     std::string __str__() const throw(INTERP_KERNEL::Exception)
645     {
646       return self->getStringRepr();
647     }
648
649     std::string __repr__() const throw(INTERP_KERNEL::Exception)
650     {
651       std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
652       oss << self->getStringRepr();
653       return oss.str();
654     }
655   }
656
657   //== MEDCouplingMesh
658   
659   class MEDCouplingMesh : public RefCountObject, public TimeLabel
660   {
661   public:
662     void setName(const char *name);
663     std::string getName() const;
664     void setDescription(const char *descr);
665     std::string getDescription() const;
666     void setTime(double val, int iteration, int order);
667     void setTimeUnit(const char *unit);
668     const char *getTimeUnit() const;
669     virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
670     bool isStructured() const throw(INTERP_KERNEL::Exception);
671     virtual MEDCouplingMesh *deepCpy() const;
672     virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
673     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
674     virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
675     virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
676     virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
677     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
678     virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
679     virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
680     virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
681     virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
682     virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
683     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
684     virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
685     virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
686     virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
687     virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
688     virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
689     virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
690     virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
691     virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
692     virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
693     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
694     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
695     void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
696     // tools
697     virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
698     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
699     virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
700     virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
701     virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
702     virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
703     virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
704     virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
705     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
706     virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
707     static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
708     static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
709     static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
710     static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
711     static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
712     static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
713     static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
714     %extend
715        {
716          std::string __str__() const throw(INTERP_KERNEL::Exception)
717          {
718            return self->simpleRepr();
719          }
720
721          PyObject *getTime() throw(INTERP_KERNEL::Exception)
722          {
723            int tmp1,tmp2;
724            double tmp0=self->getTime(tmp1,tmp2);
725            PyObject *res = PyList_New(3);
726            PyList_SetItem(res,0,SWIG_From_double(tmp0));
727            PyList_SetItem(res,1,SWIG_From_int(tmp1));
728            PyList_SetItem(res,2,SWIG_From_int(tmp2));
729            return res;
730          }
731
732          int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
733          {
734            double val;
735            DataArrayDouble *a;
736            DataArrayDoubleTuple *aa;
737            std::vector<double> bb;
738            int sw;
739            int spaceDim=self->getSpaceDimension();
740            const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
741            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
742            return self->getCellContainingPoint(pos,eps);
743          }
744
745          PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
746          {
747            double val;
748            DataArrayDouble *a;
749            DataArrayDoubleTuple *aa;
750            std::vector<double> bb;
751            int sw;
752            int spaceDim=self->getSpaceDimension();
753            const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
754            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
755            std::vector<int> elts,eltsIndex;
756            self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
757            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
758            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
759            d0->alloc(elts.size(),1);
760            d1->alloc(eltsIndex.size(),1);
761            std::copy(elts.begin(),elts.end(),d0->getPointer());
762            std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
763            PyObject *ret=PyTuple_New(2);
764            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
765            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
766            return ret;
767          }
768
769          PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
770          {
771            std::vector<int> elts,eltsIndex;
772            int spaceDim=self->getSpaceDimension();
773            void *da=0;
774            int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
775            if (!SWIG_IsOK(res1))
776              {
777                int size;
778                INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
779                int nbOfPoints=size/spaceDim;
780                if(size%spaceDim!=0)
781                  {
782                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
783                  }
784                self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
785              }
786            else
787              {
788                DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
789                if(!da2)
790                  throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
791                da2->checkAllocated();
792                int size=da2->getNumberOfTuples();
793                int nbOfCompo=da2->getNumberOfComponents();
794                if(nbOfCompo!=spaceDim)
795                  {
796                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
797                  }
798                self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
799              }
800            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
801            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
802            d0->alloc(elts.size(),1);
803            d1->alloc(eltsIndex.size(),1);
804            std::copy(elts.begin(),elts.end(),d0->getPointer());
805            std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
806            PyObject *ret=PyTuple_New(2);
807            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
808            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
809            return ret;
810          }
811
812          PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
813          {
814            double val;
815            DataArrayDouble *a;
816            DataArrayDoubleTuple *aa;
817            std::vector<double> bb;
818            int sw;
819            int spaceDim=self->getSpaceDimension();
820            const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
821            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
822            std::vector<int> elts;
823            self->getCellsContainingPoint(pos,eps,elts);
824            DataArrayInt *ret=DataArrayInt::New();
825            ret->alloc((int)elts.size(),1);
826            std::copy(elts.begin(),elts.end(),ret->getPointer());
827            return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
828          }
829          
830          void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
831          {
832            void *da=0;
833            int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
834            if (!SWIG_IsOK(res1))
835              {
836                int size;
837                INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
838                self->renumberCells(tmp,check);
839              }
840            else
841              {
842                DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
843                if(!da2)
844                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
845                da2->checkAllocated();
846                self->renumberCells(da2->getConstPointer(),check);
847              }
848          }
849
850          PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
851          {
852            DataArrayInt *cellCor, *nodeCor;
853            self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
854            PyObject *res = PyList_New(2);
855            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
856            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
857            return res;
858          }
859
860          PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
861          {
862            DataArrayInt *cellCor=0,*nodeCor=0;
863            self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
864            PyObject *res = PyList_New(2);
865            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
866            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
867            return res;
868          }
869          
870          DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
871          {
872            DataArrayInt *cellCor=0;
873            self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
874            return cellCor;
875          }
876
877          DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
878          {
879            void *da=0;
880            int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
881            if (!SWIG_IsOK(res1))
882              {
883                int size;
884                INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
885                return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
886              }
887            else
888              {
889                DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
890                if(!da2)
891                  throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
892                da2->checkAllocated();
893                return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
894              }
895          }
896          PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
897          {
898            std::vector<int> conn;
899            self->getNodeIdsOfCell(cellId,conn);
900            return convertIntArrToPyList2(conn);
901          }
902
903          PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
904          {
905            std::vector<double> coo;
906            self->getCoordinatesOfNode(nodeId,coo);
907            return convertDblArrToPyList2(coo);
908          }
909
910          void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
911          {
912            double val;
913            DataArrayDouble *a;
914            DataArrayDoubleTuple *aa;
915            std::vector<double> bb;
916            int sw;
917            int spaceDim=self->getSpaceDimension();
918            const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
919            const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
920            self->scale(pointPtr,factor);
921          }
922
923          PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
924          {
925            int spaceDim=self->getSpaceDimension();
926            INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
927            self->getBoundingBox(tmp);
928            PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
929            return ret;
930          }
931
932          PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
933          {
934            std::string ret1;
935            bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
936            PyObject *ret=PyTuple_New(2);
937            PyObject *ret0Py=ret0?Py_True:Py_False;
938            Py_XINCREF(ret0Py);
939            PyTuple_SetItem(ret,0,ret0Py);
940            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
941            return ret;
942          }
943
944          PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
945          {
946            int szArr,sw,iTypppArr;
947            std::vector<int> stdvecTyyppArr;
948            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
949            MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
950            if(sw==3)//DataArrayInt
951              { 
952                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
953                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
954                std::string name=argpt->getName();
955                if(!name.empty())
956                  ret->setName(name.c_str());
957              }
958            return convertMesh(ret, SWIG_POINTER_OWN | 0 );
959          }
960         
961          PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
962          {
963            int szArr,sw,iTypppArr;
964            std::vector<int> stdvecTyyppArr;
965            DataArrayInt *arr=0;
966            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
967            MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
968            if(sw==3)//DataArrayInt
969              { 
970                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
971                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
972                std::string name=argpt->getName();
973                if(!name.empty())
974                  ret->setName(name.c_str());
975              }
976            //
977            PyObject *res = PyList_New(2);
978            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
979            PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
980            PyList_SetItem(res,0,obj0);
981            PyList_SetItem(res,1,obj1);
982            return res;
983          }
984
985          PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
986          {
987            int a,b,c;
988            DataArrayInt *arr=0;
989            MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
990            PyObject *res = PyTuple_New(2);
991            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
992            PyObject *obj1=0;
993            if(arr)
994              obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
995            else
996              obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
997            PyTuple_SetItem(res,0,obj0);
998            PyTuple_SetItem(res,1,obj1);
999            return res;
1000          }
1001
1002         PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
1003         {
1004           std::vector<int> vals=self->getDistributionOfTypes();
1005           if(vals.size()%3!=0)
1006             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1007           PyObject *ret=PyList_New((int)vals.size()/3);
1008           for(int j=0;j<(int)vals.size()/3;j++)
1009              {
1010                PyObject *ret1=PyList_New(3);
1011                PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1012                PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1013                PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1014                PyList_SetItem(ret,j,ret1);
1015              }
1016           return ret;
1017         }
1018
1019         DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1020         {
1021           std::vector<int> code;
1022           std::vector<const DataArrayInt *> idsPerType;
1023           convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1024           convertPyToNewIntArr4(li,1,3,code);
1025           return self->checkTypeConsistencyAndContig(code,idsPerType);
1026         }
1027
1028         PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1029         {
1030           std::vector<int> code;
1031           std::vector<DataArrayInt *> idsInPflPerType;
1032           std::vector<DataArrayInt *> idsPerType;
1033           self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1034           PyObject *ret=PyTuple_New(3);
1035           //
1036           if(code.size()%3!=0)
1037             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1038           PyObject *ret0=PyList_New((int)code.size()/3);
1039           for(int j=0;j<(int)code.size()/3;j++)
1040              {
1041                PyObject *ret00=PyList_New(3);
1042                PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1043                PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1044                PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1045                PyList_SetItem(ret0,j,ret00);
1046              }
1047           PyTuple_SetItem(ret,0,ret0);
1048           //
1049           PyObject *ret1=PyList_New(idsInPflPerType.size());
1050           for(std::size_t j=0;j<idsInPflPerType.size();j++)
1051             PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1052           PyTuple_SetItem(ret,1,ret1);
1053           int n=idsPerType.size();
1054           PyObject *ret2=PyList_New(n);
1055           for(int i=0;i<n;i++)
1056             PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1057           PyTuple_SetItem(ret,2,ret2);
1058           return ret;
1059         }
1060
1061         void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1062         {
1063           double val;
1064           DataArrayDouble *a;
1065           DataArrayDoubleTuple *aa;
1066           std::vector<double> bb;
1067           int sw;
1068           int spaceDim=self->getSpaceDimension();
1069           const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1070           const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1071           self->translate(vectorPtr);
1072         }
1073
1074          void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1075          {
1076            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1077            double val;
1078            DataArrayDouble *a;
1079            DataArrayDoubleTuple *aa;
1080            std::vector<double> bb;
1081            int sw;
1082            int spaceDim=self->getSpaceDimension();
1083            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1084            self->rotate(centerPtr,0,alpha);
1085          }
1086
1087          void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1088          {
1089            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1090            double val,val2;
1091            DataArrayDouble *a,*a2;
1092            DataArrayDoubleTuple *aa,*aa2;
1093            std::vector<double> bb,bb2;
1094            int sw;
1095            int spaceDim=self->getSpaceDimension();
1096            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1097            const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
1098            self->rotate(centerPtr,vectorPtr,alpha);
1099          }
1100
1101          PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1102          {
1103            std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1104            std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1105            PyObject *res=PyList_New(result.size());
1106            for(int i=0;iL!=result.end(); i++, iL++)
1107              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1108            return res;
1109          }
1110          
1111          static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1112          {
1113             std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1114             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1115             return MEDCouplingMesh::MergeMeshes(tmp);
1116          }
1117        }
1118   };
1119 }
1120
1121 //== MEDCouplingMesh End
1122
1123 %include "NormalizedUnstructuredMesh.hxx"
1124 %include "MEDCouplingNatureOfField.hxx"
1125 %include "MEDCouplingTimeDiscretization.hxx"
1126 %include "MEDCouplingGaussLocalization.hxx"
1127 %include "MEDCouplingFieldDiscretization.hxx"
1128
1129 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
1130 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
1131 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
1132
1133 //== MEDCouplingPointSet
1134
1135 namespace ParaMEDMEM
1136 {
1137   class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1138     {
1139     public:
1140       void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1141       DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1142       bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1143       void zipCoords() throw(INTERP_KERNEL::Exception);
1144       double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1145       void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1146       void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1147       void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1148       virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1149       virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1150       virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1151       static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1152       static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1153       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1154       virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1155       virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1156       virtual DataArrayInt *findBoundaryNodes() const;
1157       virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1158       virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1159       virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1160       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1161       virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1162       %extend 
1163          {
1164            std::string __str__() const throw(INTERP_KERNEL::Exception)
1165            {
1166              return self->simpleRepr();
1167            }
1168            
1169            PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1170            {
1171              int newNbOfNodes;
1172              DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1173              PyObject *res = PyList_New(2);
1174              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1175              PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1176              return res;
1177            }
1178            
1179            PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1180            {
1181              DataArrayInt *comm, *commIndex;
1182              self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1183              PyObject *res = PyList_New(2);
1184              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1185              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1186              return res;
1187            }
1188            
1189            PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1190            {
1191              DataArrayDouble *ret1=self->getCoords();
1192              if (ret1)
1193                 ret1->incrRef();
1194              return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1195            }
1196            
1197            PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1198            {
1199              int szArr,sw,iTypppArr;
1200              std::vector<int> stdvecTyyppArr;
1201              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1202              MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1203              if(sw==3)//DataArrayInt
1204                { 
1205                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1206                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1207                  std::string name=argpt->getName();
1208                  if(!name.empty())
1209                    ret->setName(name.c_str());
1210                }
1211              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1212            }
1213            
1214            PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1215            {
1216              int szArr,sw,iTypppArr;
1217              std::vector<int> stdvecTyyppArr;
1218              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1219              MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1220              if(sw==3)//DataArrayInt
1221                { 
1222                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1223                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1224                  std::string name=argpt->getName();
1225                  if(!name.empty())
1226                    ret->setName(name.c_str());
1227                }
1228              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1229            }
1230
1231            virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1232            {
1233              int szArr,sw,iTypppArr;
1234              std::vector<int> stdvecTyyppArr;
1235              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1236              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1237              if(sw==3)//DataArrayInt
1238                { 
1239                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1240                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1241                  std::string name=argpt->getName();
1242                  if(!name.empty())
1243                    ret->setName(name.c_str());
1244                }
1245              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1246            }
1247
1248            virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1249            {
1250              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1251              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1252            }
1253
1254            PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1255            {
1256              int szArr,sw,iTypppArr;
1257              std::vector<int> stdvecTyyppArr;
1258              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1259              MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1260              if(sw==3)//DataArrayInt
1261                { 
1262                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1263                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1264                  std::string name=argpt->getName();
1265                  if(!name.empty())
1266                    ret->setName(name.c_str());
1267                }
1268              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1269            }
1270
1271            void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1272            {
1273              int szArr,sw,iTypppArr;
1274              std::vector<int> stdvecTyyppArr;
1275              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1276              self->renumberNodes(tmp,newNbOfNodes);
1277            }
1278
1279            void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1280            {
1281              int szArr,sw,iTypppArr;
1282              std::vector<int> stdvecTyyppArr;
1283              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1284              self->renumberNodes2(tmp,newNbOfNodes);
1285            }
1286
1287            PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1288              {
1289                int spaceDim=self->getSpaceDimension();
1290                double val,val2;
1291                DataArrayDouble *a,*a2;
1292                DataArrayDoubleTuple *aa,*aa2;
1293                std::vector<double> bb,bb2;
1294                int sw;
1295                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1296                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1297                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1298                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1299                std::vector<int> nodes;
1300                self->findNodesOnLine(p,v,eps,nodes);
1301                DataArrayInt *ret=DataArrayInt::New();
1302                ret->alloc((int)nodes.size(),1);
1303                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1304                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1305              }
1306            PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1307              {
1308                int spaceDim=self->getSpaceDimension();
1309                double val,val2;
1310                DataArrayDouble *a,*a2;
1311                DataArrayDoubleTuple *aa,*aa2;
1312                std::vector<double> bb,bb2;
1313                int sw;
1314                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1315                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1316                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1317                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1318                std::vector<int> nodes;
1319                self->findNodesOnPlane(p,v,eps,nodes);
1320                DataArrayInt *ret=DataArrayInt::New();
1321                ret->alloc((int)nodes.size(),1);
1322                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1323                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1324              }
1325            
1326            PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1327            {
1328              double val;
1329              DataArrayDouble *a;
1330              DataArrayDoubleTuple *aa;
1331              std::vector<double> bb;
1332              int sw;
1333              int spaceDim=self->getSpaceDimension();
1334              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1335              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1336              DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1337              return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1338            }
1339
1340            PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1341            {
1342              DataArrayInt *c=0,*cI=0;
1343              //
1344              double val;
1345              DataArrayDouble *a;
1346              DataArrayDoubleTuple *aa;
1347              std::vector<double> bb;
1348              int sw;
1349              int spaceDim=self->getSpaceDimension();
1350              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1351              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1352              self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1353              PyObject *ret=PyTuple_New(2);
1354              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1355              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1356              return ret;
1357            }
1358
1359            PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1360            {
1361              DataArrayInt *c=0,*cI=0;
1362              int spaceDim=self->getSpaceDimension();
1363              double val;
1364              DataArrayDouble *a;
1365              DataArrayDoubleTuple *aa;
1366              std::vector<double> bb;
1367              int sw;
1368              int nbOfTuples=-1;
1369              const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1370              self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1371              //
1372              PyObject *ret=PyTuple_New(2);
1373              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1374              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1375              return ret;
1376            }
1377
1378            PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1379            {
1380              double val;
1381              DataArrayDouble *a;
1382              DataArrayDoubleTuple *aa;
1383              std::vector<double> bb;
1384              int sw;
1385              int spaceDim=self->getSpaceDimension();
1386              const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1387              const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1388              //
1389              DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1390              return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1391            }
1392
1393            void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1394            {
1395              int sw;
1396              int singleVal;
1397              std::vector<int> multiVal;
1398              std::pair<int, std::pair<int,int> > slic;
1399              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1400              convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1401              switch(sw)
1402                {
1403                case 1:
1404                  return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1405                case 2:
1406                  return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1407                case 4:
1408                  return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1409                default:
1410                  throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1411                }
1412            }
1413
1414            virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1415            {
1416              MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1417              MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1418              self->getReverseNodalConnectivity(d0,d1);
1419              PyObject *ret=PyTuple_New(2);
1420              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1421              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1422              return ret;
1423            }
1424
1425            virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1426            {
1427              DataArrayInt *v0=0,*v1=0;
1428              self->findCommonCells(compType,startCellId,v0,v1);
1429              PyObject *res = PyList_New(2);
1430              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1431              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1432              return res;
1433            }
1434
1435       
1436            virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1437            {
1438              void *da=0;
1439              int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1440              if (!SWIG_IsOK(res1))
1441                {
1442                  int size;
1443                  INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1444                  self->renumberNodesInConn(tmp);
1445                }
1446              else
1447                {
1448                  DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1449                  if(!da2)
1450                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1451                  da2->checkAllocated();
1452                  self->renumberNodesInConn(da2->getConstPointer());
1453                }
1454            }
1455
1456            virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1457            {
1458              int ret1=-1;
1459              DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1460              PyObject *ret=PyTuple_New(2);
1461              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1462              PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1463              return ret;
1464            }
1465
1466            virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1467            {
1468              DataArrayInt *ret=0;
1469              //
1470              int szArr,sw,iTypppArr;
1471              std::vector<int> stdvecTyyppArr;
1472              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1473              self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1474              return ret;
1475            }
1476
1477            virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1478            {
1479              bool ret1;
1480              int ret2;
1481              DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1482              PyObject *res = PyList_New(3);
1483              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1484              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1485              PyList_SetItem(res,2,SWIG_From_int(ret2));
1486              return res;
1487            }
1488            
1489            virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1490            {
1491              bool ret1;
1492              int ret2;
1493              DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1494              PyObject *res = PyList_New(3);
1495              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1496              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1497              PyList_SetItem(res,2,SWIG_From_int(ret2));
1498              return res;
1499            }
1500            
1501            DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1502            {
1503              void *da=0;
1504              int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
1505              if (!SWIG_IsOK(res1))
1506                {
1507                  int size;
1508                  INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1509                  return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1510                }
1511              else
1512                {
1513                  DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1514                  if(!da2)
1515                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1516                  da2->checkAllocated();
1517                  return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1518                }
1519            }
1520
1521            MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1522            {
1523              int sw;
1524              int singleVal;
1525              std::vector<int> multiVal;
1526              std::pair<int, std::pair<int,int> > slic;
1527              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1528              int nbc=self->getNumberOfCells();
1529              convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1530              switch(sw)
1531                {
1532                case 1:
1533                  {
1534                    if(singleVal>=nbc)
1535                      {
1536                        std::ostringstream oss;
1537                        oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1538                        throw INTERP_KERNEL::Exception(oss.str().c_str());
1539                      }
1540                    if(singleVal>=0)
1541                      return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1542                    else
1543                      {
1544                        if(nbc+singleVal>0)
1545                          {
1546                            int tmp=nbc+singleVal;
1547                            return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1548                          }
1549                        else
1550                          {
1551                            std::ostringstream oss;
1552                            oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1553                            throw INTERP_KERNEL::Exception(oss.str().c_str());
1554                          }
1555                      }
1556                  }
1557                case 2:
1558                  {
1559                    return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1560                  }
1561                case 3:
1562                  {
1563                    return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1564                  }
1565                case 4:
1566                  {
1567                    if(!daIntTyypp)
1568                      throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1569                    daIntTyypp->checkAllocated();
1570                    return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1571                  }
1572                default:
1573                  throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1574                }
1575            }
1576            
1577            static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1578            {
1579              int sz;
1580              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1581              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1582              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1583              for(int i=0;i<sz;i++)
1584                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1585            }
1586            
1587            static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1588            {
1589              int sz;
1590              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1591              int sw,nbNodes=0;
1592              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1593              std::vector<double> val3;
1594              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1595                                                             "Rotate2DAlg",2,true,nbNodes);
1596              if(sw!=2 && sw!=3)
1597                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1598              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1599            }
1600            
1601            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1602            {
1603              int sz,sz2;
1604              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1605              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1606              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1607              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1608              for(int i=0;i<sz;i++)
1609                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1610            }
1611            
1612            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1613            {
1614              int sz,sz2;
1615              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1616              int sw,nbNodes=0;
1617              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1618              std::vector<double> val3;
1619              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1620                                                             "Rotate3DAlg",3,true,nbNodes);
1621              if(sw!=2 && sw!=3)
1622                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1623              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1624              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1625            }
1626          }
1627     };
1628
1629   //== MEDCouplingPointSet End
1630
1631   class MEDCouplingUMeshCell
1632   {
1633   public:
1634     INTERP_KERNEL::NormalizedCellType getType() const;
1635     %extend
1636       {
1637         std::string __str__() const throw(INTERP_KERNEL::Exception)
1638         {
1639           return self->repr();
1640         }
1641
1642         PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1643         {
1644           int ret2;
1645           const int *r=self->getAllConn(ret2);
1646           PyObject *ret=PyTuple_New(ret2);
1647           for(int i=0;i<ret2;i++)
1648             PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1649           return ret;
1650         }
1651       }
1652   };
1653
1654   class MEDCouplingUMeshCellIterator
1655   {
1656   public:
1657     %extend
1658       {
1659         PyObject *next()
1660         {
1661           MEDCouplingUMeshCell *ret=self->nextt();
1662           if(ret)
1663             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1664           else
1665             {
1666               PyErr_SetString(PyExc_StopIteration,"No more data.");
1667               return 0;
1668             }
1669         }
1670       }
1671   };
1672
1673   class MEDCouplingUMeshCellByTypeIterator
1674   {
1675   public:
1676     ~MEDCouplingUMeshCellByTypeIterator();
1677     %extend
1678       {
1679         PyObject *next()
1680         {
1681           MEDCouplingUMeshCellEntry *ret=self->nextt();
1682           if(ret)
1683             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1684           else
1685             {
1686               PyErr_SetString(PyExc_StopIteration,"No more data.");
1687               return 0;
1688             }
1689         }
1690       }
1691   };
1692
1693   class MEDCouplingUMeshCellByTypeEntry
1694   {
1695   public:
1696     ~MEDCouplingUMeshCellByTypeEntry();
1697     %extend
1698       {
1699         MEDCouplingUMeshCellByTypeIterator *__iter__()
1700         {
1701           return self->iterator();
1702         }
1703       }
1704   };
1705
1706   class MEDCouplingUMeshCellEntry
1707   {
1708   public:
1709     INTERP_KERNEL::NormalizedCellType getType() const;
1710     int getNumberOfElems() const;
1711     %extend
1712       {
1713         MEDCouplingUMeshCellIterator *__iter__()
1714         {
1715           return self->iterator();
1716         }
1717       }
1718   };
1719   
1720   //== MEDCouplingUMesh
1721
1722   class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1723   {
1724   public:
1725     static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1726     static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1727     MEDCouplingUMesh *clone(bool recDeepCpy) const;
1728     void checkCoherency() const throw(INTERP_KERNEL::Exception);
1729     void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1730     void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1731     void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1732     MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1733     void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1734     INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1735     void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1736     int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1737     int getMeshLength() const throw(INTERP_KERNEL::Exception);
1738     void computeTypes() throw(INTERP_KERNEL::Exception);
1739     std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1740     MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1741     //tools
1742     void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1743     std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1744     DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1745     MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1746     bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1747     bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1748     DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1749     DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1750     DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1751     DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1752     DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1753     MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1754     MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1755     MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1756     void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1757     bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1758     MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1759     bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1760     void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1761     void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1762     void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1763     DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1764     void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1765     bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1766     MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1767     MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1768     MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1769     MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1770     DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1771     std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1772     DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1773     DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1774     ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1775     DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1776     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1777     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1778     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1779     static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1780     static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1781     %extend {
1782       MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1783       {
1784         return MEDCouplingUMesh::New();
1785       }
1786       
1787       MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1788       {
1789         return MEDCouplingUMesh::New(meshName,meshDim);
1790       }
1791       
1792       std::string __str__() const throw(INTERP_KERNEL::Exception)
1793       {
1794         return self->simpleRepr();
1795       }
1796       
1797       std::string __repr__() const throw(INTERP_KERNEL::Exception)
1798       {
1799         std::ostringstream oss;
1800         self->reprQuickOverview(oss);
1801         return oss.str();
1802       }
1803       
1804       MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1805       {
1806         return self->cellIterator();
1807       }
1808       
1809       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1810       {
1811         int sw;
1812         int singleVal;
1813         std::vector<int> multiVal;
1814         std::pair<int, std::pair<int,int> > slic;
1815         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1816         int nbc=self->getNumberOfCells();
1817         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1818         switch(sw)
1819           {
1820           case 1:
1821             {
1822               if(singleVal>=nbc)
1823                 {
1824                   std::ostringstream oss;
1825                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1826                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1827                 }
1828               if(singleVal>=0)
1829                 {
1830                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1831                   break;
1832                 }
1833               else
1834                 {
1835                   if(nbc+singleVal>0)
1836                     {
1837                       int tmp=nbc+singleVal;
1838                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1839                       break;
1840                     }
1841                   else
1842                     {
1843                       std::ostringstream oss;
1844                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1845                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1846                     }
1847                 }
1848             }
1849           case 2:
1850             {
1851               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1852               break;
1853             }
1854           case 4:
1855             {
1856               if(!daIntTyypp)
1857                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1858               daIntTyypp->checkAllocated();
1859               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1860               break;
1861             }
1862           default:
1863             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1864           }
1865       }
1866
1867       void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1868       {
1869         int sw;
1870         int singleVal;
1871         std::vector<int> multiVal;
1872         std::pair<int, std::pair<int,int> > slic;
1873         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1874         int nbc=self->getNumberOfCells();
1875         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1876         switch(sw)
1877           {
1878           case 1:
1879             {
1880               if(singleVal>=nbc)
1881                 {
1882                   std::ostringstream oss;
1883                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1884                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1885                 }
1886               if(singleVal>=0)
1887                 {
1888                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1889                   break;
1890                 }
1891               else
1892                 {
1893                   if(nbc+singleVal>0)
1894                     {
1895                       int tmp=nbc+singleVal;
1896                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1897                       break;
1898                     }
1899                   else
1900                     {
1901                       std::ostringstream oss;
1902                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1903                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1904                     }
1905                 }
1906             }
1907           case 2:
1908             {
1909               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1910               break;
1911             }
1912           case 3:
1913             {
1914               self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1915               break;
1916             }
1917           case 4:
1918             {
1919               if(!daIntTyypp)
1920                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1921               daIntTyypp->checkAllocated();
1922               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1923               break;
1924             }
1925           default:
1926             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1927           }
1928       }
1929
1930       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1931       {
1932         int szArr,sw,iTypppArr;
1933         std::vector<int> stdvecTyyppArr;
1934         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1935         if(size>szArr)
1936           {
1937             std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1938             throw INTERP_KERNEL::Exception(oss.str().c_str());
1939           }
1940         self->insertNextCell(type,size,tmp);
1941       }
1942
1943       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1944       {
1945         int szArr,sw,iTypppArr;
1946         std::vector<int> stdvecTyyppArr;
1947         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1948         self->insertNextCell(type,szArr,tmp);
1949       }
1950       
1951       DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1952       {
1953         DataArrayInt *ret=self->getNodalConnectivity();
1954         if(ret)
1955           ret->incrRef();
1956         return ret;
1957       }
1958       DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1959       {
1960         DataArrayInt *ret=self->getNodalConnectivityIndex();
1961         if(ret)
1962           ret->incrRef();
1963         return ret;
1964       }
1965       PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1966       {
1967         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1968         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1969         PyObject *res = PyList_New(result.size());
1970         for (int i=0;iL!=result.end(); i++, iL++)
1971           PyList_SetItem(res,i,PyInt_FromLong(*iL));
1972         return res;
1973       }
1974       
1975       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1976       {
1977         int szArr,sw,iTypppArr;
1978         std::vector<int> stdvecTyyppArr;
1979         const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1980         int nbOfDepthPeelingPerformed=0;
1981         DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1982         PyObject *res=PyTuple_New(2);
1983         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1984         PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1985         return res;
1986       }
1987
1988       static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1989       {
1990         DataArrayInt *v0=0,*v1=0;
1991         MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1992         PyObject *res = PyList_New(2);
1993         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1994         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1995         return res;
1996       }
1997       
1998       PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1999       {
2000         double val;
2001         DataArrayDouble *a;
2002         DataArrayDoubleTuple *aa;
2003         std::vector<double> bb;
2004         int sw;
2005         int nbOfCompo=self->getSpaceDimension();
2006         const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2007         //
2008         int cellId=-1;
2009         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2010         PyObject *ret=PyTuple_New(2);
2011         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2012         PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2013         return ret;
2014       }
2015
2016       PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2017       {
2018         DataArrayInt *ret1=0;
2019         DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2020         PyObject *ret=PyTuple_New(2);
2021         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2022         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2023         return ret;
2024       }
2025       
2026       PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2027       {
2028         std::vector<int> cells;
2029         self->checkButterflyCells(cells,eps);
2030         DataArrayInt *ret=DataArrayInt::New();
2031         ret->alloc((int)cells.size(),1);
2032         std::copy(cells.begin(),cells.end(),ret->getPointer());
2033         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2034       }
2035
2036       PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2037       {
2038         std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2039         int sz=ms.size();
2040         PyObject *ret = PyList_New(sz);
2041         for(int i=0;i<sz;i++)
2042           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2043         return ret;
2044       }
2045
2046       PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2047       {
2048         std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2049         int sz=retCpp.size();
2050         PyObject *ret=PyList_New(sz);
2051         for(int i=0;i<sz;i++)
2052           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2053         return ret;
2054       }
2055
2056       PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2057       {
2058         int size;
2059         INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2060         MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2061         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2062       }
2063
2064       bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2065       {
2066         int sz;
2067         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2068         bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2069         return ret;
2070       }
2071
2072       DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2073       {
2074         int sz;
2075         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2076         DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2077         return ret;
2078       }
2079
2080       PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2081       {
2082         DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2083         self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2084         PyObject *ret=PyTuple_New(3);
2085         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2086         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2087         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2088         return ret;
2089       }
2090
2091       PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2092       {
2093         DataArrayInt *tmp0=0,*tmp1=0;
2094         self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2095         PyObject *ret=PyTuple_New(2);
2096         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2097         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2098         return ret;
2099       }
2100
2101       void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2102       {
2103         int sw;
2104         int singleVal;
2105         std::vector<int> multiVal;
2106         std::pair<int, std::pair<int,int> > slic;
2107         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2108         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2109         switch(sw)
2110           {
2111           case 1:
2112             return self->duplicateNodes(&singleVal,&singleVal+1);
2113           case 2:
2114             return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2115           case 4:
2116             return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2117           default:
2118             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2119           }
2120       }
2121
2122       void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2123       {
2124         int sw;
2125         int singleVal;
2126         std::vector<int> multiVal;
2127         std::pair<int, std::pair<int,int> > slic;
2128         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2129         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2130         switch(sw)
2131           {
2132           case 1:
2133             return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2134           case 2:
2135             return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2136           case 4:
2137             return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2138           default:
2139             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2140           }
2141       }
2142
2143       PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2144       {
2145         int sz;
2146         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2147         DataArrayInt *tmp0,*tmp1=0;
2148         tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2149         PyObject *ret=PyTuple_New(2);
2150         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2151         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2152         return ret;
2153       }
2154
2155       PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2156       {
2157         DataArrayInt *ret0=0,*ret1=0;
2158         self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2159         PyObject *ret=PyTuple_New(2);
2160         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2161         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162         return ret;
2163       }
2164
2165       static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2166       {
2167         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2168         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2169         DataArrayInt *ret1=0,*ret2=0;
2170         MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2171         PyObject *ret=PyTuple_New(3);
2172         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2173         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2174         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2175         return ret;
2176       }
2177
2178       static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2179       {
2180         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2181         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2182         MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2183         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2184       }
2185
2186       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2187       {
2188         int sz;
2189         std::vector<const MEDCouplingUMesh *> meshes;
2190         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2191         std::vector<DataArrayInt *> corr;
2192         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2193         sz=corr.size();
2194         PyObject *ret1=PyList_New(sz);
2195         for(int i=0;i<sz;i++)
2196           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2197         PyObject *ret=PyList_New(2);
2198         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2199         PyList_SetItem(ret,1,ret1);
2200         return ret;
2201       }
2202
2203       static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2204       {
2205         std::vector<MEDCouplingUMesh *> meshes;
2206         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2207         MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2208       }
2209
2210       static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2211       {
2212         std::vector<MEDCouplingUMesh *> meshes;
2213         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2214         MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2215       }
2216
2217       static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2218       {
2219         int sw;
2220         int singleVal;
2221         std::vector<int> multiVal;
2222         std::pair<int, std::pair<int,int> > slic;
2223         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2224         if(!arrIndx)
2225           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2226         convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2227         switch(sw)
2228           {
2229           case 1:
2230             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2231           case 2:
2232             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2233           case 4:
2234             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2235           default:
2236             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2237           }
2238       }
2239       
2240       static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2241       {
2242         DataArrayInt *arrOut=0,*arrIndexOut=0;
2243         int sw;
2244         int singleVal;
2245         std::vector<int> multiVal;
2246         std::pair<int, std::pair<int,int> > slic;
2247         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2248         if(!arrIndxIn)
2249           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2250         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2251         switch(sw)
2252           {
2253           case 1:
2254             {
2255               MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2256               break;
2257             }
2258           case 2:
2259             {
2260               MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2261               break;
2262             }
2263           case 4:
2264             {
2265               MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2266               break;
2267             }
2268           default:
2269             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2270           }
2271         PyObject *ret=PyTuple_New(2);
2272         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2273         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2274         return ret;
2275       }
2276
2277       static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2278       {
2279         DataArrayInt *arrOut=0,*arrIndexOut=0;
2280         MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2281         PyObject *ret=PyTuple_New(2);
2282         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2283         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2284         return ret;
2285       }
2286
2287       static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2288       {
2289         if(!PySlice_Check(slic))
2290           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2291         Py_ssize_t strt=2,stp=2,step=2;
2292         PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2293         if(!arrIndxIn)
2294           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2295         arrIndxIn->checkAllocated();
2296         if(arrIndxIn->getNumberOfComponents()!=1)
2297           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2298         if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2299           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2300         DataArrayInt *arrOut=0,*arrIndexOut=0;
2301         MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2302         PyObject *ret=PyTuple_New(2);
2303         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2304         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2305         return ret;
2306       }
2307
2308       static PyObject *SetPartOfIndexedArrays(PyObject *li,
2309                                               const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2310                                               const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2311       {
2312         DataArrayInt *arrOut=0,*arrIndexOut=0;
2313         int sw;
2314         int singleVal;
2315         std::vector<int> multiVal;
2316         std::pair<int, std::pair<int,int> > slic;
2317         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2318         if(!arrIndxIn)
2319           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2320         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2321         switch(sw)
2322           {
2323           case 1:
2324             {
2325               MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2326               break;
2327             }
2328           case 2:
2329             {
2330               MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2331               break;
2332             }
2333           case 4:
2334             {
2335               MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2336               break;
2337             }
2338           default:
2339             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2340           }
2341         PyObject *ret=PyTuple_New(2);
2342         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2344         return ret;
2345       }
2346
2347       static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2348                                                 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2349       {
2350         int sw;
2351         int singleVal;
2352         std::vector<int> multiVal;
2353         std::pair<int, std::pair<int,int> > slic;
2354         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2355         if(!arrIndxIn)
2356           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2357         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2358         switch(sw)
2359           {
2360           case 1:
2361             {
2362               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2363               break;
2364             }
2365           case 2:
2366             {
2367               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2368               break;
2369             }
2370           case 4:
2371             {
2372               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2373               break;
2374             }
2375           default:
2376             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2377           }
2378       }
2379
2380       PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2381       {
2382         double val;
2383         DataArrayDouble *a;
2384         DataArrayDoubleTuple *aa;
2385         std::vector<double> bb;
2386         int sw;
2387         int spaceDim=self->getSpaceDimension();
2388         const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2389         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2390         //
2391         std::vector<int> cells;
2392         self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2393         DataArrayInt *ret=DataArrayInt::New();
2394         ret->alloc((int)cells.size(),1);
2395         std::copy(cells.begin(),cells.end(),ret->getPointer());
2396         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2397       }
2398
2399       void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2400       {
2401         double val;
2402         DataArrayDouble *a;
2403         DataArrayDoubleTuple *aa;
2404         std::vector<double> bb;
2405         int sw;
2406         int spaceDim=self->getSpaceDimension();
2407         const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2408         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2409         self->orientCorrectly2DCells(v,polyOnly);
2410       }
2411       
2412       PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2413       {
2414         std::vector<int> cells;
2415         self->arePolyhedronsNotCorrectlyOriented(cells);
2416         DataArrayInt *ret=DataArrayInt::New();
2417         ret->alloc((int)cells.size(),1);
2418         std::copy(cells.begin(),cells.end(),ret->getPointer());
2419         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2420       }
2421
2422       PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2423       {
2424         double vec[3];
2425         double pos[3];
2426         self->getFastAveragePlaneOfThis(vec,pos);
2427         double vals[6];
2428         std::copy(vec,vec+3,vals);
2429         std::copy(pos,pos+3,vals+3);
2430         return convertDblArrToPyListOfTuple(vals,3,2);
2431       }
2432       
2433       static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2434       {
2435         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2436         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2437         return MEDCouplingUMesh::MergeUMeshes(tmp);
2438       }
2439
2440       PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2441       {
2442         DataArrayInt *ret1;
2443         bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2444         PyObject *ret=PyTuple_New(2);
2445         PyObject *ret0Py=ret0?Py_True:Py_False;
2446         Py_XINCREF(ret0Py);
2447         PyTuple_SetItem(ret,0,ret0Py);
2448         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2449         return ret;
2450       }
2451
2452       PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2453       {
2454         DataArrayInt *ret1;
2455         bool ret0=self->areCellsIncludedIn2(other,ret1);
2456         PyObject *ret=PyTuple_New(2);
2457         PyObject *ret0Py=ret0?Py_True:Py_False;
2458         Py_XINCREF(ret0Py);
2459         PyTuple_SetItem(ret,0,ret0Py);
2460         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2461         return ret;
2462       }
2463
2464       PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2465       {
2466         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2467         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2468         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2469         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2470         MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2471         PyObject *ret=PyTuple_New(5);
2472         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2473         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2474         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2475         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2476         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2477         return ret;
2478       }
2479
2480       PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2481       {
2482         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2483         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2484         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2485         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2486         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2487         PyObject *ret=PyTuple_New(5);
2488         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2489         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2490         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2491         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2492         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2493         return ret;
2494       }
2495
2496       PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2497       {
2498         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2499         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2500         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2501         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2502         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2503         PyObject *ret=PyTuple_New(5);
2504         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2505         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2506         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2507         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2508         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2509         return ret;
2510       }
2511       
2512       PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2513       {
2514         DataArrayInt *neighbors=0,*neighborsIdx=0;
2515         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2516         PyObject *ret=PyTuple_New(2);
2517         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2518         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2519         return ret;
2520       }
2521
2522       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2523       {
2524         DataArrayInt *neighbors=0,*neighborsIdx=0;
2525         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2526         PyObject *ret=PyTuple_New(2);
2527         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2528         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2529         return ret;
2530       }
2531
2532       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2533       {
2534         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2535         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2536         DataArrayInt *d2,*d3,*d4,*dd5;
2537         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2538         PyObject *ret=PyTuple_New(7);
2539         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2540         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2541         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2542         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2543         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2544         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2545         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2546         return ret;
2547       }
2548
2549       DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2550       {
2551         if(!da)
2552           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2553         da->checkAllocated();
2554         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2555       }
2556
2557       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2558       {
2559         if(!da)
2560           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2561         da->checkAllocated();
2562         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2563       }
2564
2565       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2566       {
2567         if(!da)
2568           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2569         da->checkAllocated();
2570         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2571       }
2572
2573       PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2574       {
2575         if(!da)
2576           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2577         da->checkAllocated();
2578         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2579         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2580         PyObject *res = PyList_New(result.size());
2581         for (int i=0;iL!=result.end(); i++, iL++)
2582           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2583         return res;
2584       }
2585
2586       DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2587       {
2588         if(!da)
2589           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2590         da->checkAllocated();
2591         DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2592         ret->setName(da->getName().c_str());
2593         return ret;
2594       }
2595
2596       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2597       {
2598         DataArrayInt *cellNb1=0,*cellNb2=0;
2599         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2600         PyObject *ret=PyTuple_New(3);
2601         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2602         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2603         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2604         return ret;
2605       }
2606
2607       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2608       {
2609         int spaceDim=self->getSpaceDimension();
2610         if(spaceDim!=3)
2611           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2612         double val,val2;
2613         DataArrayDouble *a,*a2;
2614         DataArrayDoubleTuple *aa,*aa2;
2615         std::vector<double> bb,bb2;
2616         int sw;
2617         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2618         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2619         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2620         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2621         //
2622         DataArrayInt *cellIds=0;
2623         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2624         PyObject *ret=PyTuple_New(2);
2625         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2626         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2627         return ret;
2628       }
2629
2630       PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2631       {
2632         int spaceDim=self->getSpaceDimension();
2633         if(spaceDim!=3)
2634           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2635         double val,val2;
2636         DataArrayDouble *a,*a2;
2637         DataArrayDoubleTuple *aa,*aa2;
2638         std::vector<double> bb,bb2;
2639         int sw;
2640         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2641         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2642         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2643         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2644         //
2645         DataArrayInt *cellIds=0;
2646         MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2647         PyObject *ret=PyTuple_New(2);
2648         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2649         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2650         return ret;
2651       }
2652
2653       DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2654       {
2655         int spaceDim=self->getSpaceDimension();
2656         if(spaceDim!=3)
2657           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2658         double val,val2;
2659         DataArrayDouble *a,*a2;
2660         DataArrayDoubleTuple *aa,*aa2;
2661         std::vector<double> bb,bb2;
2662         int sw;
2663         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2664         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2665         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2666         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2667         return self->getCellIdsCrossingPlane(orig,vect,eps);
2668       }
2669
2670       void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2671       {
2672         int sw;
2673         int pos1;
2674         std::vector<int> pos2;
2675         DataArrayInt *pos3=0;
2676         DataArrayIntTuple *pos4=0;
2677         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2678         switch(sw)
2679           {
2680           case 1:
2681             {
2682               self->convertToPolyTypes(&pos1,&pos1+1);
2683               return;
2684             }
2685           case 2:
2686             {
2687               if(pos2.empty())
2688                 return;
2689               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2690               return ;
2691             }
2692           case 3:
2693             {
2694               self->convertToPolyTypes(pos3->begin(),pos3->end());
2695               return ;
2696             }
2697           default:
2698             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2699           }
2700       }
2701     }
2702     void convertAllToPoly();
2703     void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2704     bool unPolyze() throw(INTERP_KERNEL::Exception);
2705     void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2706     MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2707     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2708   };
2709
2710   //== MEDCouplingUMesh End
2711
2712   //== MEDCouplingExtrudedMesh
2713
2714   class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2715   {
2716   public:
2717     static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2718     MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2719     %extend {
2720       MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2721       {
2722         return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2723       }
2724       
2725       std::string __str__() const throw(INTERP_KERNEL::Exception)
2726       {
2727         return self->simpleRepr();
2728       }
2729
2730       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2731       {
2732         std::ostringstream oss;
2733         self->reprQuickOverview(oss);
2734         return oss.str();
2735       }
2736       
2737       PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2738       {
2739         MEDCouplingUMesh *ret=self->getMesh2D();
2740         if(ret)
2741           ret->incrRef();
2742         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2743       }
2744       PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2745       {
2746         MEDCouplingUMesh *ret=self->getMesh1D();
2747         if(ret)
2748           ret->incrRef();
2749         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2750       }
2751       PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2752       {
2753         DataArrayInt *ret=self->getMesh3DIds();
2754         if(ret)
2755           ret->incrRef();
2756         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2757       } 
2758     }
2759   };
2760
2761   //== MEDCouplingExtrudedMesh End
2762
2763   class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2764   {
2765   public:
2766     static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2767     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2768     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2769     int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2770     virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2771     virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2772     %extend
2773     {
2774       virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2775       {
2776         int szArr,sw,iTypppArr;
2777         std::vector<int> stdvecTyyppArr;
2778         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2779         self->insertNextCell(tmp,tmp+szArr);
2780       }
2781
2782       virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2783       {
2784         DataArrayInt *ret=self->getNodalConnectivity();
2785         if(ret) ret->incrRef();
2786         return ret;
2787       }
2788       
2789       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2790       {
2791         std::vector< const MEDCoupling1GTUMesh *> parts;
2792         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2793         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2794       }
2795     }
2796   };
2797
2798   //== MEDCoupling1SGTUMesh
2799
2800   class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2801   {
2802   public:
2803     static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2804     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2805     void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2806     int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2807     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2808     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2809     %extend
2810     {
2811       MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2812       {
2813         return MEDCoupling1SGTUMesh::New(name,type);
2814       }
2815
2816       std::string __str__() const throw(INTERP_KERNEL::Exception)
2817       {
2818         return self->simpleRepr();
2819       }
2820       
2821       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2822       {
2823         std::ostringstream oss;
2824         self->reprQuickOverview(oss);
2825         return oss.str();
2826       }
2827
2828       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2829       {
2830         std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2831         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2832         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2833       }
2834       
2835       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2836       {
2837         std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2838         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2839         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2840       }
2841     }
2842   };
2843   
2844   //== MEDCoupling1SGTUMesh End
2845
2846   //== MEDCoupling1DGTUMesh
2847
2848   class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2849   {
2850   public:
2851     static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2852     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2853     void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2854     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2855     bool isPacked() const throw(INTERP_KERNEL::Exception);
2856     %extend
2857     {
2858       MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2859       {
2860         return MEDCoupling1DGTUMesh::New(name,type);
2861       }
2862
2863       std::string __str__() const throw(INTERP_KERNEL::Exception)
2864       {
2865         return self->simpleRepr();
2866       }
2867       
2868       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2869       {
2870         std::ostringstream oss;
2871         self->reprQuickOverview(oss);
2872         return oss.str();
2873       }
2874
2875       DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2876       {
2877         DataArrayInt *ret=self->getNodalConnectivityIndex();
2878         if(ret) ret->incrRef();
2879         return ret;
2880       }
2881
2882       PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2883       {
2884         DataArrayInt *ret1=0,*ret2=0;
2885         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2886         PyObject *ret0Py=ret0?Py_True:Py_False;
2887         Py_XINCREF(ret0Py);
2888         PyObject *ret=PyTuple_New(3);
2889         PyTuple_SetItem(ret,0,ret0Py);
2890         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2891         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2892         return ret;
2893       }
2894       
2895       PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2896       {
2897         bool ret1;
2898         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2899         PyObject *ret=PyTuple_New(2);
2900         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2901         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2902         PyTuple_SetItem(ret,1,ret1Py);
2903         return ret;
2904       }
2905
2906       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2907       {
2908         std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2909         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2910         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2911       }
2912       
2913       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2914       {
2915         std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2916         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2917         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2918       }
2919       
2920       static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2921       {
2922         std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2923         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2924         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2925       }
2926     }
2927   };
2928
2929   //== MEDCoupling1DGTUMeshEnd
2930
2931   class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2932   {
2933   public:
2934     int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2935     int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2936     virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2937     std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2938     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2939     %extend
2940     {
2941       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2942       {
2943         int tmpp1=-1,tmpp2=-1;
2944         std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2945         std::vector< std::pair<int,int> > inp;
2946         if(tmpp2==2)
2947           {
2948             inp.resize(tmpp1);
2949             for(int i=0;i<tmpp1;i++)
2950               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2951           }
2952         else if(tmpp2==1)
2953           {
2954             if(tmpp1%2!=0)
2955               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2956             inp.resize(tmpp1/2);
2957             for(int i=0;i<tmpp1/2;i++)
2958               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2959           }
2960         else
2961           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2962         return self->buildStructuredSubPart(inp);
2963       }
2964
2965       static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2966       {
2967         int tmpp1=-1,tmpp2=-1;
2968         std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
2969         std::vector< std::pair<int,int> > inp;
2970         if(tmpp2==2)
2971           {
2972             inp.resize(tmpp1);
2973             for(int i=0;i<tmpp1;i++)
2974               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2975           }
2976         else if(tmpp2==1)
2977           {
2978             if(tmpp1%2!=0)
2979               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
2980             inp.resize(tmpp1/2);
2981             for(int i=0;i<tmpp1/2;i++)
2982               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2983           }
2984         else
2985           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
2986         //
2987         int szArr,sw,iTypppArr;
2988         std::vector<int> stdvecTyyppArr;
2989         const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2990         std::vector<int> tmp5(tmp4,tmp4+szArr);
2991         //
2992         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2993       }
2994
2995       static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
2996       {
2997         int szArr,sw,iTypppArr;
2998         std::vector<int> stdvecTyyppArr;
2999         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3000         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3001       }
3002
3003       static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3004       {
3005         int szArr,sw,iTypppArr;
3006         std::vector<int> stdvecTyyppArr;
3007         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3008         int szArr2,sw2,iTypppArr2;
3009         std::vector<int> stdvecTyyppArr2;
3010         const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3011         std::vector<int> tmp3(tmp2,tmp2+szArr2);
3012         std::vector< std::pair<int,int> > partCompactFormat;
3013         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3014         PyObject *ret=PyTuple_New(2);
3015         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3016         PyTuple_SetItem(ret,0,ret0Py);
3017         PyObject *ret1Py=PyList_New(partCompactFormat.size());
3018         for(std::size_t i=0;i<partCompactFormat.size();i++)
3019           {
3020             PyObject *tmp4=PyTuple_New(2);
3021             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3022             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3023             PyList_SetItem(ret1Py,i,tmp4);
3024           }
3025         PyTuple_SetItem(ret,1,ret1Py);
3026         return ret;
3027       }
3028     }
3029   };
3030
3031   //== MEDCouplingCMesh
3032   
3033   class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3034   {
3035   public:
3036     static MEDCouplingCMesh *New();
3037     static MEDCouplingCMesh *New(const char *meshName);
3038     MEDCouplingCMesh *clone(bool recDeepCpy) const;
3039     void setCoords(const DataArrayDouble *coordsX,
3040                    const DataArrayDouble *coordsY=0,
3041                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3042     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3043     %extend {
3044       MEDCouplingCMesh()
3045       {
3046         return MEDCouplingCMesh::New();
3047       }
3048       MEDCouplingCMesh(const char *meshName)
3049       {
3050         return MEDCouplingCMesh::New(meshName);
3051       }
3052       std::string __str__() const throw(INTERP_KERNEL::Exception)
3053       {
3054         return self->simpleRepr();
3055       }
3056       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3057       {
3058         std::ostringstream oss;
3059         self->reprQuickOverview(oss);
3060         return oss.str();
3061       }
3062       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3063       {
3064         DataArrayDouble *ret=self->getCoordsAt(i);
3065         if(ret)
3066           ret->incrRef();
3067         return ret;
3068       }
3069     }
3070   };
3071
3072   //== MEDCouplingCMesh End
3073
3074   //== MEDCouplingCurveLinearMesh
3075
3076   class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3077   {
3078   public:
3079     static MEDCouplingCurveLinearMesh *New();
3080     static MEDCouplingCurveLinearMesh *New(const char *meshName);
3081     MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3082     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3083     %extend {
3084       MEDCouplingCurveLinearMesh()
3085       {
3086         return MEDCouplingCurveLinearMesh::New();
3087       }
3088       MEDCouplingCurveLinearMesh(const char *meshName)
3089       {
3090         return MEDCouplingCurveLinearMesh::New(meshName);
3091       }
3092       std::string __str__() const throw(INTERP_KERNEL::Exception) 
3093       {
3094         return self->simpleRepr();
3095       }
3096       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3097       {
3098         std::ostringstream oss;
3099         self->reprQuickOverview(oss);
3100         return oss.str();
3101       }
3102       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3103       {
3104         DataArrayDouble *ret=self->getCoords();
3105         if(ret)
3106           ret->incrRef();
3107         return ret;
3108       }
3109       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3110       {
3111         int szArr,sw,iTypppArr;
3112         std::vector<int> stdvecTyyppArr;
3113         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3114         self->setNodeGridStructure(tmp,tmp+szArr);
3115       }
3116     }
3117   };
3118
3119   //== MEDCouplingCurveLinearMesh End
3120 }
3121
3122 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
3123 {
3124   MEDCouplingFieldDiscretization *clonePart(PyObject *li)
3125   {
3126     int sz=0,sw=-1,val1=-1;
3127     std::vector<int> val2;
3128     const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
3129     return self->clonePart(inp,inp+sz);
3130   }
3131
3132   PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
3133   {
3134     DataArrayInt *ret1=0;
3135     int bb,ee,ss;
3136     MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
3137     PyObject *res=PyTuple_New(2);
3138     PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3139     if(ret1)
3140       PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3141     else
3142       {
3143         PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3144         PyTuple_SetItem(res,1,res1);
3145       }
3146     return res;
3147   }
3148   
3149   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3150   {
3151     std::vector<int> vVal; int iVal=-1;
3152     int sz=-1,sw=0;
3153     const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
3154     if(sw==0)
3155       throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
3156     DataArrayInt *ret0=0,*ret1=0;
3157     self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
3158     PyObject *pyRet=PyTuple_New(2);
3159     PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3160     PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3161     return pyRet;
3162   }
3163 }
3164
3165 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
3166 {
3167   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3168   { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3169 }
3170
3171 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
3172 {
3173   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3174   { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3175 }
3176
3177 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
3178 {
3179   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3180   { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3181 }
3182
3183 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
3184 {
3185   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3186   { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3187 }
3188
3189 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
3190 {
3191   PyObject *getArrayOfDiscIds() const
3192   {
3193     DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
3194     if(ret)
3195       ret->incrRef();
3196     return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3197   }
3198
3199   PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
3200   {
3201     std::vector<int> ret1;
3202     std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
3203     std::size_t sz=ret0.size();
3204     PyObject *pyRet=PyTuple_New(2);
3205     PyObject *pyRet0=PyList_New((int)sz);
3206     PyObject *pyRet1=PyList_New((int)sz);
3207     for(std::size_t i=0;i<sz;i++)
3208       {
3209         PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3210         PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
3211       }
3212     PyTuple_SetItem(pyRet,0,pyRet0);
3213     PyTuple_SetItem(pyRet,1,pyRet1);
3214     return pyRet;
3215   }
3216 }
3217
3218 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
3219 {
3220   PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
3221   {
3222     int ret1;
3223     DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
3224     PyObject *ret=PyTuple_New(2);
3225     PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3226     PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3227     return ret;
3228   }
3229 }
3230
3231 namespace ParaMEDMEM
3232 {
3233   class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3234   {
3235   public:
3236     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3237     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3238     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3239     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3240     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3241     void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3242     void setName(const char *name) throw(INTERP_KERNEL::Exception);
3243     std::string getDescription() const throw(INTERP_KERNEL::Exception);
3244     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3245     std::string getName() const throw(INTERP_KERNEL::Exception);
3246     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3247     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3248     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3249     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3250     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3251     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3252     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3253     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3254                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3255     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3256     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3257     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3258     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3259     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3260     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3261     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3262     %extend {
3263       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3264       {
3265         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3266         if(ret1)
3267           ret1->incrRef();
3268         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3269       }
3270
3271       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3272       {
3273         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3274         if(ret)
3275           ret->incrRef();
3276         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3277       }
3278
3279       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3280       {
3281         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3282         return convertIntArrToPyList3(ret);
3283       }
3284
3285       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3286       {
3287         std::string ret1;
3288         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3289         PyObject *ret=PyTuple_New(2);
3290         PyObject *ret0Py=ret0?Py_True:Py_False;
3291         Py_XINCREF(ret0Py);
3292         PyTuple_SetItem(ret,0,ret0Py);
3293         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3294         return ret;
3295       }
3296
3297       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3298       {
3299         DataArrayInt *ret1=0;
3300         MEDCouplingMesh *ret0=0;
3301         void *da=0;
3302         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3303         if (!SWIG_IsOK(res1))
3304           {
3305             int size;
3306             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3307             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3308           }
3309         else
3310           {
3311             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3312             if(!da2)
3313               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3314             da2->checkAllocated();
3315             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3316           }
3317         PyObject *res = PyList_New(2);
3318         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3319         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3320         return res;
3321       }
3322
3323       PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3324       {
3325         DataArrayInt *ret1=0;
3326         int bb,ee,ss;
3327         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3328         PyObject *res=PyTuple_New(2);
3329         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3330         if(ret1)
3331           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3332         else
3333           {
3334             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3335             PyTuple_SetItem(res,1,res1);
3336           }
3337         return res;
3338       }
3339
3340       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
3341       {
3342         int sw;
3343         int pos1;
3344         std::vector<int> pos2;
3345         DataArrayInt *pos3=0;
3346         DataArrayIntTuple *pos4=0;
3347         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
3348         switch(sw)
3349           {
3350           case 1:
3351             {
3352               return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
3353             }
3354           case 2:
3355             {
3356               return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
3357             }
3358           case 3:
3359             {
3360               return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
3361             }
3362           default:
3363             throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
3364           }
3365       }
3366
3367       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3368                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3369       {
3370         void *da=0;
3371         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3372         if (!SWIG_IsOK(res1))
3373           {
3374             int size;
3375             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3376             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3377           }
3378         else
3379           {
3380             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3381             if(!da2)
3382               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3383             da2->checkAllocated();
3384             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3385           }
3386       }
3387
3388       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3389       {
3390         std::vector<int> tmp;
3391         self->getCellIdsHavingGaussLocalization(locId,tmp);
3392         DataArrayInt *ret=DataArrayInt::New();
3393         ret->alloc((int)tmp.size(),1);
3394         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3395         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3396       }
3397     }
3398   };
3399   
3400   class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3401   {
3402   public:
3403     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3404     static MEDCouplingFieldTemplate *New(TypeOfField type);
3405     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3406     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3407     %extend
3408        {
3409          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3410          {
3411            return MEDCouplingFieldTemplate::New(f);
3412          }
3413          
3414          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3415          {
3416            return MEDCouplingFieldTemplate::New(type);
3417          }
3418          
3419          std::string __str__() const throw(INTERP_KERNEL::Exception)
3420          {
3421            return self->simpleRepr();
3422          }
3423          
3424          std::string __repr__() const throw(INTERP_KERNEL::Exception)
3425          {
3426            std::ostringstream oss;
3427            self->reprQuickOverview(oss);
3428            return oss.str();
3429          }
3430        }
3431   };
3432   
3433   class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3434   {
3435   public:
3436     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3437     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3438     void setTimeUnit(const char *unit);
3439     const char *getTimeUnit() const;
3440     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3441     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3442     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3443     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3444     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3445     void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
3446     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3447     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3448     MEDCouplingFieldDouble *deepCpy() const;
3449     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3450     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3451     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3452     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3453     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3454     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3455     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3456     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3457     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3458     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3459     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3460     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3461     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3462     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3463     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3464     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3465     void setIteration(int it) throw(INTERP_KERNEL::Exception);
3466     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3467     void setOrder(int order) throw(INTERP_KERNEL::Exception);
3468     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3469     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3470     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3471     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3472     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3473     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3474     bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3475     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3476     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3477     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3478     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3479     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3480     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3481     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3482     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3483     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3484     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3485     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3486     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3487     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3488     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3489     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3490     void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3491     void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3492     void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3493     void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3494     void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3495     void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3496     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3497     void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3498     void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3499     void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3500     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3501     double getMaxValue() const throw(INTERP_KERNEL::Exception);
3502     double getMinValue() const throw(INTERP_KERNEL::Exception);
3503     double getAverageValue() const throw(INTERP_KERNEL::Exception);
3504     double norm2() const throw(INTERP_KERNEL::Exception);
3505     double normMax() const throw(INTERP_KERNEL::Exception);
3506     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3507     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3508     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3509     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3510     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3511     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3512     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3513     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3514     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3515     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3516     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3517     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3518     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3519     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3520     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3521     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3522     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3523     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3524     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3525     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3526     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3527     MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3528     %extend {
3529       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3530       {
3531         return MEDCouplingFieldDouble::New(type,td);
3532       }
3533
3534       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3535       {
3536         return MEDCouplingFieldDouble::New(ft,td);
3537       }
3538
3539       std::string __str__() const throw(INTERP_KERNEL::Exception)
3540       {
3541         return self->simpleRepr();
3542       }
3543
3544       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3545       {
3546         std::ostringstream oss;
3547         self->reprQuickOverview(oss);
3548         return oss.str();
3549       }
3550
3551       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3552       {
3553         DataArrayDouble *ret=self->getArray();
3554         if(ret)
3555           ret->incrRef();
3556         return ret;
3557       }
3558
3559       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3560       {
3561         std::vector<DataArrayDouble *> arrs=self->getArrays();
3562         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3563           if(*it)
3564             (*it)->incrRef();
3565         int sz=arrs.size();
3566         PyObject *ret=PyTuple_New(sz);
3567         for(int i=0;i<sz;i++)
3568           {
3569             if(arrs[i])
3570               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3571             else
3572               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3573           }
3574         return ret;
3575       }
3576
3577       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3578       {
3579         std::vector<const DataArrayDouble *> tmp;
3580         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3581         int sz=tmp.size();
3582         std::vector<DataArrayDouble *> arrs(sz);
3583         for(int i=0;i<sz;i++)
3584           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3585         self->setArrays(arrs);
3586       }
3587
3588       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3589       {
3590         DataArrayDouble *ret=self->getEndArray();
3591         if(ret)
3592           ret->incrRef();
3593         return ret;
3594       }
3595
3596       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3597       {
3598         double val;
3599         DataArrayDouble *a;
3600         DataArrayDoubleTuple *aa;
3601         std::vector<double> bb;
3602         int sw;
3603         const MEDCouplingMesh *mesh=self->getMesh();
3604         if(!mesh)
3605           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3606         int spaceDim=mesh->getSpaceDimension();
3607         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3608         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3609         //
3610         int sz=self->getNumberOfComponents();
3611         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3612         self->getValueOn(spaceLoc,res);
3613         return convertDblArrToPyList(res,sz);
3614       }
3615
3616        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3617        {
3618          int sz=self->getNumberOfComponents();
3619          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3620          self->getValueOnPos(i,j,k,res);
3621          return convertDblArrToPyList(res,sz);
3622        }
3623
3624       DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3625       {
3626         void *da=0;
3627         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
3628         if (!SWIG_IsOK(res1))
3629           {
3630             int size;
3631             INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3632             const MEDCouplingMesh *mesh=self->getMesh();
3633             if(!mesh)
3634               throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3635             int spaceDim=mesh->getSpaceDimension();
3636             int nbOfPoints=size/spaceDim;
3637             if(size%spaceDim!=0)
3638               {
3639                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3640               }
3641             return self->getValueOnMulti(tmp,nbOfPoints);
3642           }
3643         else
3644           {
3645             DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3646             if(!da2)
3647               throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3648             da2->checkAllocated();
3649             int size=da2->getNumberOfTuples();
3650             int nbOfCompo=da2->getNumberOfComponents();
3651             const MEDCouplingMesh *mesh=self->getMesh();
3652             if(!mesh)
3653               throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3654             if(nbOfCompo!=mesh->getSpaceDimension())
3655               {
3656                 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3657               }
3658             return self->getValueOnMulti(da2->getConstPointer(),size);
3659           }
3660       }
3661
3662       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3663       {
3664         double val;
3665         DataArrayDouble *a;
3666         DataArrayDoubleTuple *aa;
3667         std::vector<double> bb;
3668         int sw;
3669         const MEDCouplingMesh *mesh=self->getMesh();
3670         if(!mesh)
3671           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3672         int spaceDim=mesh->getSpaceDimension();
3673         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3674         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3675         //
3676         //
3677         int sz=self->getNumberOfComponents();
3678         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3679         self->getValueOn(spaceLoc,time,res);
3680         return convertDblArrToPyList(res,sz);
3681       }
3682
3683       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3684       {
3685         if(self->getArray()!=0)
3686           ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3687         else
3688           {
3689             MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3690             ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3691             self->setArray(arr);
3692           }
3693       }
3694       
3695       PyObject *getTime() throw(INTERP_KERNEL::Exception)
3696       {
3697         int tmp1,tmp2;
3698         double tmp0=self->getTime(tmp1,tmp2);
3699         PyObject *res = PyList_New(3);
3700         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3701         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3702         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3703         return res;
3704       }
3705
3706       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3707       {
3708         int tmp1,tmp2;
3709         double tmp0=self->getStartTime(tmp1,tmp2);
3710         PyObject *res = PyList_New(3);
3711         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3712         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3713         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3714         return res;
3715       }
3716
3717       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3718       {
3719         int tmp1,tmp2;
3720         double tmp0=self->getEndTime(tmp1,tmp2);
3721         PyObject *res = PyList_New(3);
3722         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3723         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3724         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3725         return res;
3726       }
3727       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3728       {
3729         int sz=self->getNumberOfComponents();
3730         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3731         self->accumulate(tmp);
3732         return convertDblArrToPyList(tmp,sz);
3733       }
3734       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3735       {
3736         int sz=self->getNumberOfComponents();
3737         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3738         self->integral(isWAbs,tmp);
3739         return convertDblArrToPyList(tmp,sz);
3740       }
3741       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3742       {
3743         int sz=self->getNumberOfComponents();
3744         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3745         self->getWeightedAverageValue(tmp,isWAbs);
3746         return convertDblArrToPyList(tmp,sz);
3747       }
3748       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3749       {
3750         int sz=self->getNumberOfComponents();
3751         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3752         self->normL1(tmp);
3753         return convertDblArrToPyList(tmp,sz);
3754       }
3755       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3756       {
3757         int sz=self->getNumberOfComponents();
3758         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3759         self->normL2(tmp);
3760         return convertDblArrToPyList(tmp,sz);
3761       }
3762       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3763       {
3764         void *da=0;
3765         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3766         if (!SWIG_IsOK(res1))
3767           {
3768             int size;
3769             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3770             self->renumberCells(tmp,check);
3771           }
3772         else
3773           {
3774             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3775             if(!da2)
3776               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3777             da2->checkAllocated();
3778             self->renumberCells(da2->getConstPointer(),check);
3779           }
3780       }
3781       void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3782       {
3783         void *da=0;
3784         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3785         if (!SWIG_IsOK(res1))
3786           {
3787             int size;
3788             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3789             self->renumberNodes(tmp,eps);
3790           }
3791         else
3792           {
3793             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3794             if(!da2)
3795               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3796             da2->checkAllocated();
3797             self->renumberNodes(da2->getConstPointer(),eps);
3798           }
3799       }
3800
3801       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3802       {
3803         int sw;
3804         int singleVal;
3805         std::vector<int> multiVal;
3806         std::pair<int, std::pair<int,int> > slic;
3807         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3808         const MEDCouplingMesh *mesh=self->getMesh();
3809         if(!mesh)
3810           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3811         int nbc=mesh->getNumberOfCells();
3812         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3813         switch(sw)
3814           {
3815           case 1:
3816             {
3817               if(singleVal>=nbc)
3818                 {
3819                   std::ostringstream oss;
3820                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3821                   throw INTERP_KERNEL::Exception(oss.str().c_str());
3822                 }
3823               if(singleVal>=0)
3824                 return self->buildSubPart(&singleVal,&singleVal+1);
3825               else
3826                 {
3827                   if(nbc+singleVal>0)
3828                     {
3829                       int tmp=nbc+singleVal;
3830                       return self->buildSubPart(&tmp,&tmp+1);
3831                     }
3832                   else
3833                     {
3834                       std::ostringstream oss;
3835                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3836                       throw INTERP_KERNEL::Exception(oss.str().c_str());
3837                     }
3838                 }
3839             }
3840           case 2:
3841             {
3842               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3843             }
3844           case 3:
3845             {
3846               return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3847             }
3848           case 4:
3849             {
3850               if(!daIntTyypp)
3851                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3852               daIntTyypp->checkAllocated();
3853               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3854             }
3855           default:
3856             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3857           }
3858       }
3859
3860       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3861       {
3862         const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call  Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
3863         if(PyTuple_Check(li))
3864           {
3865             Py_ssize_t sz=PyTuple_Size(li);
3866             if(sz!=2)
3867               throw INTERP_KERNEL::Exception(msg);
3868             PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3869             int sw;
3870             int singleVal;
3871             std::vector<int> multiVal;
3872             std::pair<int, std::pair<int,int> > slic;
3873             ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3874             if(!self->getArray())
3875               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3876             try
3877               { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3878             catch(INTERP_KERNEL::Exception& e)
3879               { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3880             MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3881             DataArrayDouble *ret0Arr=ret0->getArray();
3882             if(!ret0Arr)
3883               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3884             switch(sw)
3885               {
3886               case 1:
3887                 {
3888                   std::vector<int> v2(1,singleVal);
3889                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3890                   ret0->setArray(aarr);
3891                   return ret0.retn();
3892                 }
3893               case 2:
3894                 {
3895                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3896                   ret0->setArray(aarr);
3897                   return ret0.retn();
3898                 }
3899               case 3:
3900                 {
3901                   int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3902                   std::vector<int> v2(nbOfComp);
3903                   for(int i=0;i<nbOfComp;i++)
3904                     v2[i]=slic.first+i*slic.second.second;
3905                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3906                   ret0->setArray(aarr);
3907                   return ret0.retn();
3908                 }
3909               default:
3910                 throw INTERP_KERNEL::Exception(msg);
3911               }
3912             
3913           }
3914         else
3915           return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3916       }
3917
3918       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3919       {
3920         DataArrayInt *tmp;
3921         double r1=self->getMaxValue2(tmp);
3922         PyObject *ret=PyTuple_New(2);
3923         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3924         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3925         return ret;
3926       }
3927       
3928       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3929       {
3930         DataArrayInt *tmp;
3931         double r1=self->getMinValue2(tmp);
3932         PyObject *ret=PyTuple_New(2);
3933         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3934         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3935         return ret;
3936       }
3937       
3938       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3939       {
3940         std::vector<int> tmp;
3941         convertPyToNewIntArr3(li,tmp);
3942         return self->keepSelectedComponents(tmp);
3943       }
3944
3945       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3946       {
3947         std::vector<int> tmp;
3948         convertPyToNewIntArr3(li,tmp);
3949         self->setSelectedComponents(f,tmp);
3950       }
3951
3952       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3953       {
3954         double val,val2;
3955         DataArrayDouble *a,*a2;
3956         DataArrayDoubleTuple *aa,*aa2;
3957         std::vector<double> bb,bb2;
3958         int sw;
3959         int spaceDim=3;
3960         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3961         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3962         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3963         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3964         //
3965         return self->extractSlice3D(orig,vect,eps);
3966       }
3967
3968       MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3969       {
3970         return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3971       }
3972
3973       MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3974       {
3975         return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3976       }
3977
3978       MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3979       {
3980         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__sub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
3981         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3982         void *argp;
3983         //
3984         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3985           {
3986             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3987             if(other)
3988               return (*self)-(*other);
3989             else
3990               throw INTERP_KERNEL::Exception(msg);
3991           }
3992         //
3993         double val;
3994         DataArrayDouble *a;
3995         DataArrayDoubleTuple *aa;
3996         std::vector<double> bb;
3997         int sw;
3998         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3999         switch(sw)
4000           {
4001           case 1:
4002             {
4003               if(!self->getArray())
4004                 throw INTERP_KERNEL::Exception(msg2);
4005               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4006               ret->applyLin(1.,-val);
4007               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4008               ret2->setArray(ret);
4009               return ret2.retn();
4010             }
4011           case 2:
4012             {
4013               if(!self->getArray())
4014                 throw INTERP_KERNEL::Exception(msg2);
4015               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4016               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4017               ret2->setArray(ret);
4018               return ret2.retn();
4019             }
4020           case 3:
4021             {
4022               if(!self->getArray())
4023                 throw INTERP_KERNEL::Exception(msg2);
4024               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4025               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4026               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4027               ret2->setArray(ret);
4028               return ret2.retn();
4029             }
4030           case 4:
4031             {
4032               if(!self->getArray())
4033                 throw INTERP_KERNEL::Exception(msg2);
4034               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4035               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4036               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4037               ret2->setArray(ret);
4038               return ret2.retn();
4039             }
4040           default:
4041             { throw INTERP_KERNEL::Exception(msg); }
4042           }
4043       }
4044
4045       MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4046       {
4047         return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4048       }
4049
4050       MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4051       {
4052         return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4053       }
4054
4055       MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4056       {
4057         return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4058       }
4059
4060       MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4061       {
4062         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__div__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4063         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4064         void *argp;
4065         //
4066         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4067           {
4068             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4069             if(other)
4070               return (*self)/(*other);
4071             else
4072               throw INTERP_KERNEL::Exception(msg);
4073           }
4074         //
4075         double val;
4076         DataArrayDouble *a;
4077         DataArrayDoubleTuple *aa;
4078         std::vector<double> bb;
4079         int sw;
4080         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4081         switch(sw)
4082           {
4083           case 1:
4084             {
4085               if(val==0.)
4086                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4087               if(!self->getArray())
4088                 throw INTERP_KERNEL::Exception(msg2);
4089               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4090               ret->applyLin(1./val,0);
4091               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4092               ret2->setArray(ret);
4093               return ret2.retn();
4094             }
4095           case 2:
4096             {
4097               if(!self->getArray())
4098                 throw INTERP_KERNEL::Exception(msg2);
4099               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4100               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4101               ret2->setArray(ret);
4102               return ret2.retn();
4103             }
4104           case 3:
4105             {
4106               if(!self->getArray())
4107                 throw INTERP_KERNEL::Exception(msg2);
4108               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4109               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4110               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4111               ret2->setArray(ret);
4112               return ret2.retn();
4113             }
4114           case 4:
4115             {
4116               if(!self->getArray())
4117                 throw INTERP_KERNEL::Exception(msg2);
4118               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4119               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4120               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4121               ret2->setArray(ret);
4122               return ret2.retn();
4123             }
4124           default:
4125             { throw INTERP_KERNEL::Exception(msg); }
4126           }
4127       }
4128
4129       MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4130       {
4131         return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4132       }
4133
4134       MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4135       {
4136         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__pow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4137         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4138         void *argp;
4139         //
4140         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4141           {
4142             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4143             if(other)
4144               return (*self)^(*other);
4145             else
4146               throw INTERP_KERNEL::Exception(msg);
4147           }
4148         //
4149         double val;
4150         DataArrayDouble *a;
4151         DataArrayDoubleTuple *aa;
4152         std::vector<double> bb;
4153         int sw;
4154         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4155         switch(sw)
4156           {
4157           case 1:
4158             {
4159               if(!self->getArray())
4160                 throw INTERP_KERNEL::Exception(msg2);
4161               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4162               ret->applyPow(val);
4163               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4164               ret2->setArray(ret);
4165               return ret2.retn();
4166             }
4167           case 2:
4168             {
4169               if(!self->getArray())
4170                 throw INTERP_KERNEL::Exception(msg2);
4171               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4172               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4173               ret2->setArray(ret);
4174               return ret2.retn();
4175             }
4176           case 3:
4177             {
4178               if(!self->getArray())
4179                 throw INTERP_KERNEL::Exception(msg2);
4180               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4181               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4182               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4183               ret2->setArray(ret);
4184               return ret2.retn();
4185             }
4186           case 4:
4187             {
4188               if(!self->getArray())
4189                 throw INTERP_KERNEL::Exception(msg2);
4190               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4191               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4192               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4193               ret2->setArray(ret);
4194               return ret2.retn();
4195             }
4196           default:
4197             { throw INTERP_KERNEL::Exception(msg); }
4198           }
4199       }
4200
4201       MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4202       {
4203         return self->negate();
4204       }
4205
4206       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4207       {
4208         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__iadd__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4209         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4210         void *argp;
4211         //
4212         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4213           {
4214             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4215             if(other)
4216               {
4217                 *self+=*other;
4218                 Py_XINCREF(trueSelf);
4219                 return trueSelf;
4220               }
4221             else
4222               throw INTERP_KERNEL::Exception(msg);
4223           }
4224         //
4225         double val;
4226         DataArrayDouble *a;
4227         DataArrayDoubleTuple *aa;
4228         std::vector<double> bb;
4229         int sw;
4230         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4231         switch(sw)
4232           {
4233           case 1:
4234             {
4235               if(!self->getArray())
4236                 throw INTERP_KERNEL::Exception(msg2);
4237               self->getArray()->applyLin(1.,val);
4238               Py_XINCREF(trueSelf);
4239               return trueSelf;
4240             }
4241           case 2:
4242             {
4243               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4244               ret2->setArray(a);
4245               *self+=*ret2;
4246               Py_XINCREF(trueSelf);
4247               return trueSelf;
4248             }
4249           case 3:
4250             {
4251               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4252               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4253               ret2->setArray(aaa);
4254               *self+=*ret2;
4255               Py_XINCREF(trueSelf);
4256               return trueSelf;
4257             }
4258           case 4:
4259             {
4260               if(!self->getArray())
4261                 throw INTERP_KERNEL::Exception(msg2);
4262               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4263               self->getArray()->addEqual(aaa);
4264               Py_XINCREF(trueSelf);
4265               return trueSelf;
4266             }
4267           default:
4268             { throw INTERP_KERNEL::Exception(msg); }
4269           }
4270       }
4271
4272       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4273       {
4274         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__isub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4275         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4276         void *argp;
4277         //
4278         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4279           {
4280             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4281             if(other)
4282               {
4283                 *self-=*other;
4284                 Py_XINCREF(trueSelf);
4285                 return trueSelf;
4286               }
4287             else
4288               throw INTERP_KERNEL::Exception(msg);
4289           }
4290         //
4291         double val;
4292         DataArrayDouble *a;
4293         DataArrayDoubleTuple *aa;
4294         std::vector<double> bb;
4295         int sw;
4296         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4297         switch(sw)
4298           {
4299           case 1:
4300             {
4301               if(!self->getArray())
4302                 throw INTERP_KERNEL::Exception(msg2);
4303               self->getArray()->applyLin(1.,-val);
4304               Py_XINCREF(trueSelf);
4305               return trueSelf;
4306             }
4307           case 2:
4308             {
4309               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4310               ret2->setArray(a);
4311               *self-=*ret2;
4312               Py_XINCREF(trueSelf);
4313               return trueSelf;
4314             }
4315           case 3:
4316             {
4317               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4318               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4319               ret2->setArray(aaa);
4320               *self-=*ret2;
4321               Py_XINCREF(trueSelf);
4322               return trueSelf;
4323             }
4324           case 4:
4325             {
4326               if(!self->getArray())
4327                 throw INTERP_KERNEL::Exception(msg2);
4328               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4329               self->getArray()->substractEqual(aaa);
4330               Py_XINCREF(trueSelf);
4331               return trueSelf;
4332             }
4333           default:
4334             { throw INTERP_KERNEL::Exception(msg); }
4335           }
4336       }
4337
4338       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4339       {
4340         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__imul__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4341         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4342         void *argp;
4343         //
4344         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4345           {
4346             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4347             if(other)
4348               {
4349                 *self*=*other;
4350                 Py_XINCREF(trueSelf);
4351                 return trueSelf;
4352               }
4353             else
4354               throw INTERP_KERNEL::Exception(msg);
4355           }
4356         //
4357         double val;
4358         DataArrayDouble *a;
4359         DataArrayDoubleTuple *aa;
4360         std::vector<double> bb;
4361         int sw;
4362         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4363         switch(sw)
4364           {
4365           case 1:
4366             {
4367               if(!self->getArray())
4368                 throw INTERP_KERNEL::Exception(msg2);
4369               self->getArray()->applyLin(val,0);
4370               Py_XINCREF(trueSelf);
4371               return trueSelf;
4372             }
4373           case 2:
4374             {
4375               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4376               ret2->setArray(a);
4377               *self*=*ret2;
4378               Py_XINCREF(trueSelf);
4379               return trueSelf;
4380             }
4381           case 3:
4382             {
4383               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4384               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4385               ret2->setArray(aaa);
4386               *self*=*ret2;
4387               Py_XINCREF(trueSelf);
4388               return trueSelf;
4389             }
4390           case 4:
4391             {
4392               if(!self->getArray())
4393                 throw INTERP_KERNEL::Exception(msg2);
4394               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4395               self->getArray()->multiplyEqual(aaa);
4396               Py_XINCREF(trueSelf);
4397               return trueSelf;
4398             }
4399           default:
4400             { throw INTERP_KERNEL::Exception(msg); }
4401           }
4402       }
4403
4404       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4405       {
4406         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__idiv__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4407         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4408         void *argp;
4409         //
4410         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4411           {
4412             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4413             if(other)
4414               {
4415                 *self/=*other;
4416                 Py_XINCREF(trueSelf);
4417                 return trueSelf;
4418               }
4419             else
4420               throw INTERP_KERNEL::Exception(msg);
4421           }
4422         //
4423         double val;
4424         DataArrayDouble *a;
4425         DataArrayDoubleTuple *aa;
4426         std::vector<double> bb;
4427         int sw;
4428         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4429         switch(sw)
4430           {
4431           case 1:
4432             {
4433               if(val==0.)
4434                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4435               if(!self->getArray())
4436                 throw INTERP_KERNEL::Exception(msg2);
4437               self->getArray()->applyLin(1./val,0);
4438               Py_XINCREF(trueSelf);
4439               return trueSelf;
4440             }
4441           case 2:
4442             {
4443               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4444               ret2->setArray(a);
4445               *self/=*ret2;
4446               Py_XINCREF(trueSelf);
4447               return trueSelf;
4448             }
4449           case 3:
4450             {
4451               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4452               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4453               ret2->setArray(aaa);
4454               *self/=*ret2;
4455               Py_XINCREF(trueSelf);
4456               return trueSelf;
4457             }
4458           case 4:
4459             {
4460               if(!self->getArray())
4461                 throw INTERP_KERNEL::Exception(msg2);
4462               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4463               self->getArray()->divideEqual(aaa);
4464               Py_XINCREF(trueSelf);
4465               return trueSelf;
4466             }
4467           default:
4468             { throw INTERP_KERNEL::Exception(msg); }
4469           }
4470       }
4471
4472       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4473       {
4474         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__ipow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4475         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4476         void *argp;
4477         //
4478         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4479           {
4480             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4481             if(other)
4482               {
4483                 *self^=*other;
4484                 Py_XINCREF(trueSelf);
4485                 return trueSelf;
4486               }
4487             else
4488               throw INTERP_KERNEL::Exception(msg);
4489           }
4490         //
4491         double val;
4492         DataArrayDouble *a;
4493         DataArrayDoubleTuple *aa;
4494         std::vector<double> bb;
4495         int sw;
4496         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4497         switch(sw)
4498           {
4499           case 1:
4500             {
4501               if(!self->getArray())
4502                 throw INTERP_KERNEL::Exception(msg2);
4503               self->getArray()->applyPow(val);
4504               Py_XINCREF(trueSelf);
4505               return trueSelf;
4506             }
4507           case 2:
4508             {
4509               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4510               ret2->setArray(a);
4511               *self^=*ret2;
4512               Py_XINCREF(trueSelf);
4513               return trueSelf;
4514             }
4515           case 3:
4516             {
4517               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4518               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4519               ret2->setArray(aaa);
4520               *self^=*ret2;
4521               Py_XINCREF(trueSelf);
4522               return trueSelf;
4523             }
4524           case 4:
4525             {
4526               if(!self->getArray())
4527                 throw INTERP_KERNEL::Exception(msg2);
4528               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4529               self->getArray()->powEqual(aaa);
4530               Py_XINCREF(trueSelf);
4531               return trueSelf;
4532             }
4533           default:
4534             { throw INTERP_KERNEL::Exception(msg); }
4535           }
4536       }
4537
4538       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4539       {
4540         std::vector<const MEDCouplingFieldDouble *> tmp;
4541         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4542         return MEDCouplingFieldDouble::MergeFields(tmp);
4543       }
4544
4545       static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4546       {
4547         std::vector<const MEDCouplingFieldDouble *> tmp;
4548         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4549         MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4550       }
4551     }
4552   };
4553
4554   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4555   {
4556   public:
4557     int getNumberOfFields() const;
4558     MEDCouplingMultiFields *deepCpy() const;
4559     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4560     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4561     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4562     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4563     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4564     %extend
4565        {
4566          std::string __str__() const throw(INTERP_KERNEL::Exception)
4567          {
4568            return self->simpleRepr();
4569          }
4570          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4571          {
4572            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4573            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4574            int sz=tmp.size();
4575            std::vector<MEDCouplingFieldDouble *> fs(sz);
4576            for(int i=0;i<sz;i++)
4577              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4578            return MEDCouplingMultiFields::New(fs);
4579          }
4580          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4581          {
4582            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4583            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4584            int sz=tmp.size();
4585            std::vector<MEDCouplingFieldDouble *> fs(sz);
4586            for(int i=0;i<sz;i++)
4587              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4588            return MEDCouplingMultiFields::New(fs);
4589          }
4590          PyObject *getFields() const
4591          {
4592            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4593            int sz=fields.size();
4594            PyObject *res = PyList_New(sz);
4595            for(int i=0;i<sz;i++)
4596              {
4597                if(fields[i])
4598                  {
4599                    fields[i]->incrRef();
4600                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4601                  }
4602                else
4603                  {
4604                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4605                  }
4606              }
4607            return res;
4608          }
4609          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4610          {
4611            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4612            if(ret)
4613              {
4614                ret->incrRef();
4615                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4616              }
4617            else
4618              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4619          }
4620          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4621          {
4622            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4623            int sz=ms.size();
4624            PyObject *res = PyList_New(sz);
4625            for(int i=0;i<sz;i++)
4626              {
4627                if(ms[i])
4628                  {
4629                    ms[i]->incrRef();
4630                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4631                  }
4632                else
4633                  {
4634                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4635                  }
4636              }
4637            return res;
4638          }
4639          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4640          {
4641            std::vector<int> refs;
4642            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4643            int sz=ms.size();
4644            PyObject *res = PyList_New(sz);
4645            for(int i=0;i<sz;i++)
4646              {
4647                if(ms[i])
4648                  {
4649                    ms[i]->incrRef();
4650                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4651                  }
4652                else
4653                  {
4654                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4655                  }
4656              }
4657            //
4658            PyObject *ret=PyTuple_New(2);
4659            PyTuple_SetItem(ret,0,res);
4660            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4661            return ret;
4662          }
4663          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4664          {
4665            std::vector<DataArrayDouble *> ms=self->getArrays();
4666            int sz=ms.size();
4667            PyObject *res = PyList_New(sz);
4668            for(int i=0;i<sz;i++)
4669              {
4670                if(ms[i])
4671                  {
4672                    ms[i]->incrRef();
4673                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4674                  }
4675                else
4676                  {
4677                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4678                  }
4679              }
4680            return res;
4681          }
4682          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4683          {
4684            std::vector< std::vector<int> > refs;
4685            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4686            int sz=ms.size();
4687            PyObject *res = PyList_New(sz);
4688            PyObject *res2 = PyList_New(sz);
4689            for(int i=0;i<sz;i++)
4690              {
4691                if(ms[i])
4692                  {
4693                    ms[i]->incrRef();
4694                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4695                  }
4696                else
4697                  {
4698                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4699                  }
4700                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4701              }
4702            //
4703            PyObject *ret=PyTuple_New(2);
4704            PyTuple_SetItem(ret,0,res);
4705            PyTuple_SetItem(ret,1,res2);
4706            return ret;
4707          }
4708        }
4709   };
4710   
4711   class MEDCouplingDefinitionTime
4712   {
4713   public:
4714     MEDCouplingDefinitionTime();
4715     void assign(const MEDCouplingDefinitionTime& other);
4716     bool isEqual(const MEDCouplingDefinitionTime& other) const;
4717     double getTimeResolution() const;
4718     std::vector<double> getHotSpotsTime() const;
4719     %extend
4720       {
4721         std::string __str__() const throw(INTERP_KERNEL::Exception)
4722           {
4723             std::ostringstream oss;
4724             self->appendRepr(oss);
4725             return oss.str();
4726           }
4727
4728         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4729         {
4730           int meshId,arrId,arrIdInField,fieldId;
4731           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4732           PyObject *res=PyList_New(4);
4733           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4734           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4735           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4736           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4737           return res;
4738         }
4739
4740         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4741         {
4742           int meshId,arrId,arrIdInField,fieldId;
4743           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4744           PyObject *res=PyList_New(4);
4745           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4746           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4747           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4748           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4749           return res;
4750         }
4751       }
4752   };
4753
4754   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4755   {
4756   public:
4757     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4758     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4759     
4760     %extend
4761       {
4762         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4763           {
4764             std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4765             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4766             int sz=tmp.size();
4767             std::vector<MEDCouplingFieldDouble *> fs(sz);
4768             for(int i=0;i<sz;i++)
4769               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4770             return MEDCouplingFieldOverTime::New(fs);
4771           }
4772         std::string __str__() const throw(INTERP_KERNEL::Exception)
4773           {
4774             return self->simpleRepr();
4775           }
4776         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4777         {
4778           std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4779           convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4780            int sz=tmp.size();
4781            std::vector<MEDCouplingFieldDouble *> fs(sz);
4782            for(int i=0;i<sz;i++)
4783              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4784            return MEDCouplingFieldOverTime::New(fs);
4785          }
4786       }
4787   };
4788 }
4789
4790 %pythoncode %{
4791 import os
4792 __filename=os.environ.get('PYTHONSTARTUP')
4793 if __filename and os.path.isfile(__filename):
4794   execfile(__filename)
4795   pass
4796 %}