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