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