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