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