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