]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDCoupling_Swig/MEDCouplingCommon.i
Salome HOME
933b2f829247461eeacddc64de1d5e69b1d5a595
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2007-2012  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 "MEDCouplingField.hxx"
34 #include "MEDCouplingFieldDouble.hxx"
35 #include "MEDCouplingFieldTemplate.hxx"
36 #include "MEDCouplingGaussLocalization.hxx"
37 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
38 #include "MEDCouplingMultiFields.hxx"
39 #include "MEDCouplingFieldOverTime.hxx"
40 #include "MEDCouplingDefinitionTime.hxx"
41 #include "MEDCouplingFieldDiscretization.hxx"
42 #include "MEDCouplingTypemaps.i"
43
44 #include "InterpKernelAutoPtr.hxx"
45
46 using namespace ParaMEDMEM;
47 using namespace INTERP_KERNEL;
48 %}
49
50 %template(ivec) std::vector<int>;
51 %template(dvec) std::vector<double>;
52 %template(svec) std::vector<std::string>;
53
54 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
55 {
56   $result=convertMesh($1,$owner);
57 }
58
59 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
60 {
61   $result=convertMesh($1,$owner);
62 }
63
64 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
65 {
66   $result=convertMesh($1,$owner);
67 }
68
69 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
70 {
71   $result=convertFieldDiscretization($1,$owner);
72 }
73
74 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
75 {
76   $result=convertMultiFields($1,$owner);
77 }
78
79 #ifdef WITH_NUMPY2
80 %init %{ import_array(); %}
81 #endif
82
83 %feature("autodoc", "1");
84 %feature("docstring");
85
86 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
87 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
88 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
89 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
90 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
91 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
92 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
93 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
94 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
95 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
96 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
97 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
98 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
99 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
100 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
101 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
102 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
103 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
104 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
105 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
106 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
107 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
108 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
109 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
110 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
111 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
112 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
113 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
114 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
115 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
116 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
117 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
118 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
119 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
120 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
121 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
122 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
123 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
124 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
125 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
126 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
127 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
128 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
129 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator+;
130 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator-;
131 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator*;
132 %newobject ParaMEDMEM::MEDCouplingFieldDouble::operator/;
133 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
134 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
135 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
136 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
137 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
138 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
139 %newobject ParaMEDMEM::DataArrayInt::New;
140 %newobject ParaMEDMEM::DataArrayInt::__iter__;
141 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
142 %newobject ParaMEDMEM::DataArrayInt::deepCpy;
143 %newobject ParaMEDMEM::DataArrayInt::performCpy;
144 %newobject ParaMEDMEM::DataArrayInt::substr;
145 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
146 %newobject ParaMEDMEM::DataArrayInt::keepSelectedComponents;
147 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId;
148 %newobject ParaMEDMEM::DataArrayInt::selectByTupleIdSafe;
149 %newobject ParaMEDMEM::DataArrayInt::selectByTupleId2;
150 %newobject ParaMEDMEM::DataArrayInt::selectByTupleRanges;
151 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
152 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
153 %newobject ParaMEDMEM::DataArrayInt::renumber;
154 %newobject ParaMEDMEM::DataArrayInt::renumberR;
155 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
156 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
157 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
158 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
159 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
160 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
161 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
162 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
163 %newobject ParaMEDMEM::DataArrayInt::negate;
164 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
165 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
166 %newobject ParaMEDMEM::DataArrayInt::Meld;
167 %newobject ParaMEDMEM::DataArrayInt::Add;
168 %newobject ParaMEDMEM::DataArrayInt::Substract;
169 %newobject ParaMEDMEM::DataArrayInt::Multiply;
170 %newobject ParaMEDMEM::DataArrayInt::Divide;
171 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
172 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
173 %newobject ParaMEDMEM::DataArrayInt::Range;
174 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
175 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
176 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
177 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
178 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
179 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
180 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
181 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
182 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
183 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
184 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
185 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
186 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
187 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
188 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
189 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
190 %newobject ParaMEDMEM::DataArrayInt::__neg__;
191 %newobject ParaMEDMEM::DataArrayInt::__add__;
192 %newobject ParaMEDMEM::DataArrayInt::__radd__;
193 %newobject ParaMEDMEM::DataArrayInt::__sub__;
194 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
195 %newobject ParaMEDMEM::DataArrayInt::__mul__;
196 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
197 %newobject ParaMEDMEM::DataArrayInt::__div__;
198 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
199 %newobject ParaMEDMEM::DataArrayInt::__mod__;
200 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
201 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
202 %newobject ParaMEDMEM::DataArrayDouble::New;
203 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
204 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
205 %newobject ParaMEDMEM::DataArrayDouble::deepCpy;
206 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
207 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
208 %newobject ParaMEDMEM::DataArrayDouble::Meld;
209 %newobject ParaMEDMEM::DataArrayDouble::Dot;
210 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
211 %newobject ParaMEDMEM::DataArrayDouble::Add;
212 %newobject ParaMEDMEM::DataArrayDouble::Substract;
213 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
214 %newobject ParaMEDMEM::DataArrayDouble::Divide;
215 %newobject ParaMEDMEM::DataArrayDouble::substr;
216 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
217 %newobject ParaMEDMEM::DataArrayDouble::keepSelectedComponents;
218 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
219 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId;
220 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe;
221 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleId2;
222 %newobject ParaMEDMEM::DataArrayDouble::selectByTupleRanges;
223 %newobject ParaMEDMEM::DataArrayDouble::negate;
224 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
225 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
226 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
227 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
228 %newobject ParaMEDMEM::DataArrayDouble::determinant;
229 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
230 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
231 %newobject ParaMEDMEM::DataArrayDouble::inverse;
232 %newobject ParaMEDMEM::DataArrayDouble::trace;
233 %newobject ParaMEDMEM::DataArrayDouble::deviator;
234 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
235 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
236 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
237 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
238 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
239 %newobject ParaMEDMEM::DataArrayDouble::renumber;
240 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
241 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
242 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
243 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
244 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
245 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
246 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
247 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
248 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
249 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
250 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
251 %newobject ParaMEDMEM::DataArrayDouble::__add__;
252 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
253 %newobject ParaMEDMEM::DataArrayDouble::__sub__;
254 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
255 %newobject ParaMEDMEM::DataArrayDouble::__mul__;
256 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
257 %newobject ParaMEDMEM::DataArrayDouble::__div__;
258 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
259 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
260 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
261 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
262 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
263 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
264 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
265 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
266 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
267 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
268 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
269 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
270 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
271 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
272 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
273 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
274 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
275 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
276 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
277 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
278 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
279 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
280 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
281 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
282 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
283 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
284 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
285 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
286 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
287 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
288 %newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
289 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
290 %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
291 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
292 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
293 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
294 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
295 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
296 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
297 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
298 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
299 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
300 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
301 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
302 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
303 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
304 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
305 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
306 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
307 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
308 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
309 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
310 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
311 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
312 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
313 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
314 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
315 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
316 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
317 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
318 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
319 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
320 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
321 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes;
322 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
323 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
324 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
325 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
326 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
327 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
328 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
329 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
330 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
331 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
332 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
333 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
334 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
335 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
336 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
337 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
338 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
339
340 %feature("unref") DataArrayDouble "$this->decrRef();"
341 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
342 %feature("unref") MEDCouplingMesh "$this->decrRef();"
343 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
344 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
345 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
346 %feature("unref") DataArrayInt "$this->decrRef();"
347 %feature("unref") MEDCouplingField "$this->decrRef();"
348 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
349 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
350 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
351 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
352 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
353 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
354 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
355 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
356 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
357
358 %rename(assign) *::operator=;
359 %ignore ParaMEDMEM::MEDCouplingVersionMajMinRel;
360 %ignore ParaMEDMEM::RefCountObject::decrRef;
361 %ignore ParaMEDMEM::MemArray::operator=;
362 %ignore ParaMEDMEM::MemArray::operator[];
363 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
364 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
365 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
366 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
367 %ignore ParaMEDMEM::DataArrayIntIterator::nextt;
368 %ignore ParaMEDMEM::DataArrayIntTuple::repr;
369 %ignore ParaMEDMEM::DataArrayIntTuple::intValue;
370 %ignore ParaMEDMEM::DataArrayDoubleIterator::nextt;
371 %ignore ParaMEDMEM::DataArrayDoubleTuple::repr;
372 %ignore ParaMEDMEM::DataArrayDoubleTuple::doubleValue;
373 %ignore ParaMEDMEM::DataArrayDouble::writeVTK;
374 %ignore ParaMEDMEM::DataArrayInt::writeVTK;
375 %ignore ParaMEDMEM::DataArrayDouble::SetArrayIn;
376 %ignore ParaMEDMEM::DataArrayInt::SetArrayIn;
377
378 %nodefaultctor;
379
380 %rename (InterpKernelException) INTERP_KERNEL::Exception;
381
382 namespace INTERP_KERNEL
383 {
384   class Exception
385   {
386   public:
387     Exception(const char* what);
388     ~Exception() throw ();
389     const char *what() const throw ();
390     %extend
391     {
392       std::string __str__() const
393         {
394           return std::string(self->what());
395         }
396     }
397   };
398 }
399
400 %include "MEDCouplingTimeLabel.hxx"
401
402 namespace ParaMEDMEM
403 {
404   typedef enum
405     {
406       C_DEALLOC = 2,
407       CPP_DEALLOC = 3
408     } DeallocType;
409
410   typedef enum
411     {
412       ON_CELLS = 0,
413       ON_NODES = 1,
414       ON_GAUSS_PT = 2,
415       ON_GAUSS_NE = 3,
416       ON_NODES_KR = 4
417     } TypeOfField;
418
419   typedef enum
420     {
421       NO_TIME = 4,
422       ONE_TIME = 5,
423       LINEAR_TIME = 6,
424       CONST_ON_TIME_INTERVAL = 7
425     } TypeOfTimeDiscretization;
426
427   const char *MEDCouplingVersionStr();
428   int MEDCouplingVersion();
429   PyObject *MEDCouplingVersionMajMinRel()
430   {
431     int tmp0=0,tmp1=0,tmp2=0;
432     MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
433     PyObject *res = PyList_New(3);
434     PyList_SetItem(res,0,SWIG_From_int(tmp0));
435     PyList_SetItem(res,1,SWIG_From_int(tmp1));
436     PyList_SetItem(res,2,SWIG_From_int(tmp2));
437     return res;
438   }
439
440   class MEDCOUPLING_EXPORT RefCountObject
441   {
442   protected:
443     RefCountObject();
444     RefCountObject(const RefCountObject& other);
445     ~RefCountObject();
446   public:
447     bool decrRef() const;
448     void incrRef() const;
449     virtual std::size_t getHeapMemorySize() const;
450   };
451 }
452
453 namespace ParaMEDMEM
454 {
455   typedef enum
456     {
457       UNSTRUCTURED = 5,
458       UNSTRUCTURED_DESC = 6,
459       CARTESIAN = 7,
460       EXTRUDED = 8,
461       CURVE_LINEAR = 9
462     } MEDCouplingMeshType;
463
464   class DataArrayInt;
465   class DataArrayDouble;
466   class MEDCouplingUMesh;
467   class MEDCouplingFieldDouble;
468
469   %extend RefCountObject
470   {
471     std::string getHiddenCppPointer() const
472     {
473       std::ostringstream oss; oss << "C++ Pointer address is : " << self;
474       return oss.str();
475     }
476   }
477
478   class MEDCouplingMesh : public RefCountObject, public TimeLabel
479   {
480   public:
481     void setName(const char *name);
482     const char *getName() const;
483     void setDescription(const char *descr);
484     const char *getDescription() const;
485     void setTime(double val, int iteration, int order);
486     void setTimeUnit(const char *unit);
487     const char *getTimeUnit() const;
488     virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
489     bool isStructured() const throw(INTERP_KERNEL::Exception);
490     virtual MEDCouplingMesh *deepCpy() const;
491     virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
492     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
493     virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
494     virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
495     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
496     virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
497     virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
498     virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
499     virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
500     virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
501     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
502     virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
503     virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
504     virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
505     virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
506     virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
507     virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
508     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
509     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
510     void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
511     // tools
512     virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
513     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
514     virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
515     virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
516     virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
517     virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
518     virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
519     virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
520     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
521     virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
522     static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
523     static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
524     static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
525     %extend
526        {
527          std::string __str__() const throw(INTERP_KERNEL::Exception)
528          {
529            return self->simpleRepr();
530          }
531
532          PyObject *getTime() throw(INTERP_KERNEL::Exception)
533          {
534            int tmp1,tmp2;
535            double tmp0=self->getTime(tmp1,tmp2);
536            PyObject *res = PyList_New(3);
537            PyList_SetItem(res,0,SWIG_From_double(tmp0));
538            PyList_SetItem(res,1,SWIG_From_int(tmp1));
539            PyList_SetItem(res,2,SWIG_From_int(tmp2));
540            return res;
541          }
542
543          int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
544          {
545            double val;
546            DataArrayDouble *a;
547            DataArrayDoubleTuple *aa;
548            std::vector<double> bb;
549            int sw;
550            int spaceDim=self->getSpaceDimension();
551            const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
552            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
553            return self->getCellContainingPoint(pos,eps);
554          }
555
556          PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
557          {
558            double val;
559            DataArrayDouble *a;
560            DataArrayDoubleTuple *aa;
561            std::vector<double> bb;
562            int sw;
563            int spaceDim=self->getSpaceDimension();
564            const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
565            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
566            std::vector<int> elts,eltsIndex;
567            self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
568            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
569            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
570            d0->alloc(elts.size(),1);
571            d1->alloc(eltsIndex.size(),1);
572            std::copy(elts.begin(),elts.end(),d0->getPointer());
573            std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
574            PyObject *ret=PyTuple_New(2);
575            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
576            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
577            d0->incrRef();
578            d1->incrRef();
579            return ret;
580          }
581
582          PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
583          {
584            std::vector<int> elts,eltsIndex;
585            int spaceDim=self->getSpaceDimension();
586            void *da=0;
587            int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
588            if (!SWIG_IsOK(res1))
589              {
590                int size;
591                INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(p,&size);
592                int nbOfPoints=size/spaceDim;
593                if(size%spaceDim!=0)
594                  {
595                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
596                  }
597                self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
598              }
599            else
600              {
601                DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
602                if(!da2)
603                  throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
604                da2->checkAllocated();
605                int size=da2->getNumberOfTuples();
606                int nbOfCompo=da2->getNumberOfComponents();
607                if(nbOfCompo!=spaceDim)
608                  {
609                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
610                  }
611                self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
612              }
613            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
614            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
615            d0->alloc(elts.size(),1);
616            d1->alloc(eltsIndex.size(),1);
617            std::copy(elts.begin(),elts.end(),d0->getPointer());
618            std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
619            PyObject *ret=PyTuple_New(2);
620            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
621            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
622            d0->incrRef();
623            d1->incrRef();
624            return ret;
625          }
626
627          PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
628          {
629            double val;
630            DataArrayDouble *a;
631            DataArrayDoubleTuple *aa;
632            std::vector<double> bb;
633            int sw;
634            int spaceDim=self->getSpaceDimension();
635            const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
636            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
637            std::vector<int> elts;
638            self->getCellsContainingPoint(pos,eps,elts);
639            DataArrayInt *ret=DataArrayInt::New();
640            ret->alloc((int)elts.size(),1);
641            std::copy(elts.begin(),elts.end(),ret->getPointer());
642            return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
643          }
644          
645          void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
646          {
647            void *da=0;
648            int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
649            if (!SWIG_IsOK(res1))
650              {
651                int size;
652                INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
653                self->renumberCells(tmp,check);
654              }
655            else
656              {
657                DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
658                if(!da2)
659                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
660                da2->checkAllocated();
661                self->renumberCells(da2->getConstPointer(),check);
662              }
663          }
664
665          PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
666          {
667            DataArrayInt *cellCor, *nodeCor;
668            self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
669            PyObject *res = PyList_New(2);
670            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
671            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
672            return res;
673          }
674          DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
675          {
676            void *da=0;
677            int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
678            if (!SWIG_IsOK(res1))
679              {
680                int size;
681                INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
682                return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
683              }
684            else
685              {
686                DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
687                if(!da2)
688                  throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
689                da2->checkAllocated();
690                return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
691              }
692          }
693          PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
694          {
695            std::vector<int> conn;
696            self->getNodeIdsOfCell(cellId,conn);
697            return convertIntArrToPyList2(conn);
698          }
699
700          PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
701          {
702            std::vector<double> coo;
703            self->getCoordinatesOfNode(nodeId,coo);
704            return convertDblArrToPyList2(coo);
705          }
706
707          void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
708          {
709            double val;
710            DataArrayDouble *a;
711            DataArrayDoubleTuple *aa;
712            std::vector<double> bb;
713            int sw;
714            int spaceDim=self->getSpaceDimension();
715            const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
716            const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
717            self->scale(pointPtr,factor);
718          }
719
720          PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
721          {
722            int spaceDim=self->getSpaceDimension();
723            INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
724            self->getBoundingBox(tmp);
725            PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
726            return ret;
727          }
728
729          PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
730          {
731            std::string ret1;
732            bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
733            PyObject *ret=PyTuple_New(2);
734            PyObject *ret0Py=ret0?Py_True:Py_False;
735            Py_XINCREF(ret0Py);
736            PyTuple_SetItem(ret,0,ret0Py);
737            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
738            return ret;
739          }
740
741          PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
742          {
743            int szArr,sw,iTypppArr;
744            std::vector<int> stdvecTyyppArr;
745            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
746            MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
747            if(sw==3)//DataArrayInt
748              { 
749                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
750                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
751                std::string name=argpt->getName();
752                if(!name.empty())
753                  ret->setName(name.c_str());
754              }
755            return convertMesh(ret, SWIG_POINTER_OWN | 0 );
756          }
757         
758          PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
759          {
760            int szArr,sw,iTypppArr;
761            std::vector<int> stdvecTyyppArr;
762            DataArrayInt *arr=0;
763            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
764            MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
765            if(sw==3)//DataArrayInt
766              { 
767                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
768                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
769                std::string name=argpt->getName();
770                if(!name.empty())
771                  ret->setName(name.c_str());
772              }
773            //
774            PyObject *res = PyList_New(2);
775            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
776            PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
777            PyList_SetItem(res,0,obj0);
778            PyList_SetItem(res,1,obj1);
779            return res;
780          }
781
782         PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
783         {
784           std::vector<int> vals=self->getDistributionOfTypes();
785           PyObject *ret=PyList_New((int)vals.size()/3);
786           for(int j=0;j<(int)vals.size()/3;j++)
787              {
788                PyObject *ret1=PyList_New(3);
789                PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
790                PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
791                PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
792                PyList_SetItem(ret,j,ret1);
793              }
794           return ret;
795         }
796
797         DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
798         {
799           std::vector<int> code;
800           std::vector<const DataArrayInt *> idsPerType;
801           convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
802           convertPyToNewIntArr4(li,1,3,code);
803           return self->checkTypeConsistencyAndContig(code,idsPerType);
804         }
805
806         PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
807         {
808           std::vector<int> code;
809           std::vector<DataArrayInt *> idsInPflPerType;
810           std::vector<DataArrayInt *> idsPerType;
811           self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
812           PyObject *ret=PyTuple_New(3);
813           PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
814           PyObject *ret1=PyList_New(idsInPflPerType.size());
815           for(std::size_t j=0;j<idsInPflPerType.size();j++)
816             PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
817           PyTuple_SetItem(ret,1,ret1);
818           int n=idsPerType.size();
819           PyObject *ret2=PyList_New(n);
820           for(int i=0;i<n;i++)
821             PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
822           PyTuple_SetItem(ret,2,ret2);
823           return ret;
824         }
825
826         void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
827         {
828           double val;
829           DataArrayDouble *a;
830           DataArrayDoubleTuple *aa;
831           std::vector<double> bb;
832           int sw;
833           int spaceDim=self->getSpaceDimension();
834           const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
835           const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
836           self->translate(vectorPtr);
837         }
838
839          void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
840          {
841            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
842            double val;
843            DataArrayDouble *a;
844            DataArrayDoubleTuple *aa;
845            std::vector<double> bb;
846            int sw;
847            int spaceDim=self->getSpaceDimension();
848            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
849            self->rotate(centerPtr,0,alpha);
850          }
851
852          void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
853          {
854            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
855            double val;
856            DataArrayDouble *a;
857            DataArrayDoubleTuple *aa;
858            std::vector<double> bb;
859            int sw;
860            int spaceDim=self->getSpaceDimension();
861            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
862            const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,false);
863            self->rotate(centerPtr,vectorPtr,alpha);
864          }
865
866          PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
867          {
868            std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
869            std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
870            PyObject *res=PyList_New(result.size());
871            for(int i=0;iL!=result.end(); i++, iL++)
872              PyList_SetItem(res,i,PyInt_FromLong(*iL));
873            return res;
874          }
875          
876          static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
877          {
878             std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
879             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
880             return MEDCouplingMesh::MergeMeshes(tmp);
881          }
882        }
883   };
884 }
885
886 %extend ParaMEDMEM::DataArray
887 {
888   PyObject *getInfoOnComponents() const throw(INTERP_KERNEL::Exception)
889   {
890     const std::vector<std::string>& comps=self->getInfoOnComponents();
891     PyObject *ret=PyList_New((int)comps.size());
892     for(int i=0;i<(int)comps.size();i++)
893       PyList_SetItem(ret,i,PyString_FromString(comps[i].c_str()));
894     return ret;
895   }
896
897   void copyPartOfStringInfoFrom(const DataArray& other, PyObject *li) throw(INTERP_KERNEL::Exception)
898   {
899     std::vector<int> tmp;
900     convertPyToNewIntArr3(li,tmp);
901     self->copyPartOfStringInfoFrom(other,tmp);
902   }
903
904   void copyPartOfStringInfoFrom2(PyObject *li, const DataArray& other) throw(INTERP_KERNEL::Exception)
905   {
906     std::vector<int> tmp;
907     convertPyToNewIntArr3(li,tmp);
908     self->copyPartOfStringInfoFrom2(tmp,other);
909   }
910 }
911
912 %extend ParaMEDMEM::DataArrayInt
913 {
914   void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
915   {
916     int szArr,sw,iTypppArr;
917     std::vector<int> stdvecTyyppArr;
918     const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
919     self->pushBackValsSilent(tmp,tmp+szArr);
920   }
921
922   PyObject *partitionByDifferentValues() const throw(INTERP_KERNEL::Exception)
923   {
924     std::vector<int> ret1;
925     std::vector<DataArrayInt *> ret0=self->partitionByDifferentValues(ret1);
926     std::size_t sz=ret0.size();
927     PyObject *pyRet=PyTuple_New(2);
928     PyObject *pyRet0=PyList_New((int)sz);
929     PyObject *pyRet1=PyList_New((int)sz);
930     for(std::size_t i=0;i<sz;i++)
931       {
932         PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
933         PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
934       }
935     PyTuple_SetItem(pyRet,0,pyRet0);
936     PyTuple_SetItem(pyRet,1,pyRet1);
937     return pyRet;
938   }
939 }
940
941 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
942 {
943   MEDCouplingFieldDiscretization *clonePart(PyObject *li)
944   {
945     int sz=0,sw=-1,val1=-1;
946     std::vector<int> val2;
947     const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
948     return self->clonePart(inp,inp+sz);
949   }
950 }
951
952 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
953 {
954   PyObject *getArrayOfDiscIds() const
955   {
956     DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
957     if(ret)
958       ret->incrRef();
959     return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
960   }
961 }
962
963 %ignore ParaMEDMEM::DataArray::getInfoOnComponents;
964 %ignore ParaMEDMEM::DataArrayInt::partitionByDifferentValues;
965 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
966 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
967
968 %include "MEDCouplingMemArray.hxx"
969 %include "NormalizedUnstructuredMesh.hxx"
970 %include "MEDCouplingNatureOfField.hxx"
971 %include "MEDCouplingTimeDiscretization.hxx"
972 %include "MEDCouplingGaussLocalization.hxx"
973 %include "MEDCouplingFieldDiscretization.hxx"
974
975 namespace ParaMEDMEM
976 {
977   class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
978     {
979     public:
980       void updateTime() const;
981       void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
982       DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
983       bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
984       void zipCoords() throw(INTERP_KERNEL::Exception);
985       double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
986       void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
987       void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
988       void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
989       virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
990       virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
991       static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
992       static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
993       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
994       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
995       //! size of returned tinyInfo must be always the same.
996       void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
997       void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const throw(INTERP_KERNEL::Exception);
998       void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const throw(INTERP_KERNEL::Exception);
999       void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
1000                            const std::vector<std::string>& littleStrings) throw(INTERP_KERNEL::Exception);
1001       virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1002       virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1003       virtual DataArrayInt *findBoundaryNodes() const;
1004       %extend 
1005          {
1006            std::string __str__() const throw(INTERP_KERNEL::Exception)
1007            {
1008              return self->simpleRepr();
1009            }
1010            
1011            PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1012            {
1013              int newNbOfNodes;
1014              DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1015              PyObject *res = PyList_New(2);
1016              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1017              PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1018              return res;
1019            }
1020            
1021            PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1022            {
1023              DataArrayInt *comm, *commIndex;
1024              self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1025              PyObject *res = PyList_New(2);
1026              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1027              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1028              return res;
1029            }
1030            
1031            PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1032            {
1033              DataArrayDouble *ret1=self->getCoords();
1034              ret1->incrRef();
1035              return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1036            }
1037            
1038            PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1039            {
1040              int szArr,sw,iTypppArr;
1041              std::vector<int> stdvecTyyppArr;
1042              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1043              MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1044              if(sw==3)//DataArrayInt
1045                { 
1046                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1047                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1048                  std::string name=argpt->getName();
1049                  if(!name.empty())
1050                    ret->setName(name.c_str());
1051                }
1052              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1053            }
1054            
1055            PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1056            {
1057              int szArr,sw,iTypppArr;
1058              std::vector<int> stdvecTyyppArr;
1059              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1060              MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1061              if(sw==3)//DataArrayInt
1062                { 
1063                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1064                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1065                  std::string name=argpt->getName();
1066                  if(!name.empty())
1067                    ret->setName(name.c_str());
1068                }
1069              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1070            }
1071
1072            PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1073            {
1074              int szArr,sw,iTypppArr;
1075              std::vector<int> stdvecTyyppArr;
1076              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1077              MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1078              if(sw==3)//DataArrayInt
1079                { 
1080                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1081                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1082                  std::string name=argpt->getName();
1083                  if(!name.empty())
1084                    ret->setName(name.c_str());
1085                }
1086              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1087            }
1088
1089            void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1090            {
1091              int szArr,sw,iTypppArr;
1092              std::vector<int> stdvecTyyppArr;
1093              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1094              self->renumberNodes(tmp,newNbOfNodes);
1095            }
1096
1097            void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1098            {
1099              int szArr,sw,iTypppArr;
1100              std::vector<int> stdvecTyyppArr;
1101              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1102              self->renumberNodes2(tmp,newNbOfNodes);
1103            }
1104
1105            PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1106              {
1107                int spaceDim=self->getSpaceDimension();
1108                double val,val2;
1109                DataArrayDouble *a,*a2;
1110                DataArrayDoubleTuple *aa,*aa2;
1111                std::vector<double> bb,bb2;
1112                int sw;
1113                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1114                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1115                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1116                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1117                std::vector<int> nodes;
1118                self->findNodesOnLine(p,v,eps,nodes);
1119                DataArrayInt *ret=DataArrayInt::New();
1120                ret->alloc((int)nodes.size(),1);
1121                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1122                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1123              }
1124            PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1125              {
1126                int spaceDim=self->getSpaceDimension();
1127                double val,val2;
1128                DataArrayDouble *a,*a2;
1129                DataArrayDoubleTuple *aa,*aa2;
1130                std::vector<double> bb,bb2;
1131                int sw;
1132                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1133                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1134                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1135                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1136                std::vector<int> nodes;
1137                self->findNodesOnPlane(p,v,eps,nodes);
1138                DataArrayInt *ret=DataArrayInt::New();
1139                ret->alloc((int)nodes.size(),1);
1140                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1141                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1142              }
1143            
1144            PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1145            {
1146              double val;
1147              DataArrayDouble *a;
1148              DataArrayDoubleTuple *aa;
1149              std::vector<double> bb;
1150              int sw;
1151              int spaceDim=self->getSpaceDimension();
1152              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1153              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1154              DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1155              return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1156            }
1157
1158            PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfNodes, double eps) const throw(INTERP_KERNEL::Exception)
1159            {
1160              DataArrayInt *c=0,*cI=0;
1161              //
1162              double val;
1163              DataArrayDouble *a;
1164              DataArrayDoubleTuple *aa;
1165              std::vector<double> bb;
1166              int sw;
1167              int spaceDim=self->getSpaceDimension();
1168              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1169              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfNodes,spaceDim,true);
1170              self->getNodeIdsNearPoints(pos,nbOfNodes,eps,c,cI);
1171              PyObject *ret=PyTuple_New(2);
1172              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1173              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1174              return ret;
1175            }
1176
1177            PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1178            {
1179              DataArrayInt *c=0,*cI=0;
1180              int spaceDim=self->getSpaceDimension();
1181              double val;
1182              DataArrayDouble *a;
1183              DataArrayDoubleTuple *aa;
1184              std::vector<double> bb;
1185              int sw;
1186              int nbOfTuples=-1;
1187              const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1188              self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1189              //
1190              PyObject *ret=PyTuple_New(2);
1191              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1192              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1193              return ret;
1194            }
1195
1196            PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1197            {
1198              double val;
1199              DataArrayDouble *a;
1200              DataArrayDoubleTuple *aa;
1201              std::vector<double> bb;
1202              int sw;
1203              int spaceDim=self->getSpaceDimension();
1204              const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1205              const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1206              //
1207              DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1208              return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1209            }
1210
1211            void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1212            {
1213              int sw;
1214              int singleVal;
1215              std::vector<int> multiVal;
1216              std::pair<int, std::pair<int,int> > slic;
1217              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1218              convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1219              switch(sw)
1220                {
1221                case 1:
1222                  return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1223                case 2:
1224                  return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1225                case 4:
1226                  return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1227                default:
1228                  throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1229                }
1230            }
1231
1232            static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1233            {
1234              int sz;
1235              INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1236              INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1237              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1238              for(int i=0;i<sz;i++)
1239                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1240            }
1241            
1242            static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1243            {
1244              int sz,sz2;
1245              INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1246              int sw,nbNodes=0;
1247              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1248              std::vector<double> val3;
1249              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1250                                                             "Rotate2DAlg",2,true,nbNodes);
1251              if(sw!=2 && sw!=3)
1252                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1253              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1254            }
1255            
1256            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1257            {
1258              int sz,sz2;
1259              INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1260              INTERP_KERNEL::AutoPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1261              INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1262              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1263              for(int i=0;i<sz;i++)
1264                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1265            }
1266            
1267            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1268            {
1269              int sz,sz2;
1270              INTERP_KERNEL::AutoPtr<double> c=convertPyToNewDblArr2(center,&sz);
1271              int sw,nbNodes=0;
1272              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1273              std::vector<double> val3;
1274              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1275                                                             "Rotate3DAlg",3,true,nbNodes);
1276              if(sw!=2 && sw!=3)
1277                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1278              INTERP_KERNEL::AutoPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1279              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1280            }
1281          }
1282     };
1283
1284   class MEDCouplingUMeshCell
1285   {
1286   public:
1287     INTERP_KERNEL::NormalizedCellType getType() const;
1288     %extend
1289       {
1290         std::string __str__() const
1291         {
1292           return self->repr();
1293         }
1294
1295         PyObject *getAllConn() const
1296         {
1297           int ret2;
1298           const int *r=self->getAllConn(ret2);
1299           PyObject *ret=PyTuple_New(ret2);
1300           for(int i=0;i<ret2;i++)
1301             PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1302           return ret;
1303         }
1304       }
1305   };
1306
1307   class MEDCouplingUMeshCellIterator
1308   {
1309   public:
1310     %extend
1311       {
1312         PyObject *next()
1313         {
1314           MEDCouplingUMeshCell *ret=self->nextt();
1315           if(ret)
1316             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1317           else
1318             {
1319               PyErr_SetString(PyExc_StopIteration,"No more data.");
1320               return 0;
1321             }
1322         }
1323       }
1324   };
1325
1326   class MEDCouplingUMeshCellByTypeIterator
1327   {
1328   public:
1329     ~MEDCouplingUMeshCellByTypeIterator();
1330     %extend
1331       {
1332         PyObject *next()
1333         {
1334           MEDCouplingUMeshCellEntry *ret=self->nextt();
1335           if(ret)
1336             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1337           else
1338             {
1339               PyErr_SetString(PyExc_StopIteration,"No more data.");
1340               return 0;
1341             }
1342         }
1343       }
1344   };
1345
1346   class MEDCouplingUMeshCellByTypeEntry
1347   {
1348   public:
1349     ~MEDCouplingUMeshCellByTypeEntry();
1350     %extend
1351       {
1352         MEDCouplingUMeshCellByTypeIterator *__iter__()
1353         {
1354           return self->iterator();
1355         }
1356       }
1357   };
1358
1359   class MEDCouplingUMeshCellEntry
1360   {
1361   public:
1362     INTERP_KERNEL::NormalizedCellType getType() const;
1363     int getNumberOfElems() const;
1364     %extend
1365       {
1366         MEDCouplingUMeshCellIterator *__iter__()
1367         {
1368           return self->iterator();
1369         }
1370       }
1371   };
1372   
1373   class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1374   {
1375   public:
1376     static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1377     static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1378     MEDCouplingUMesh *clone(bool recDeepCpy) const;
1379     void updateTime() const;
1380     void checkCoherency() const throw(INTERP_KERNEL::Exception);
1381     void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1382     void allocateCells(int nbOfCells) throw(INTERP_KERNEL::Exception);
1383     void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1384     MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1385     void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1386     INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1387     void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1388     int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1389     int getMeshLength() const throw(INTERP_KERNEL::Exception);
1390     void computeTypes() throw(INTERP_KERNEL::Exception);
1391     std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1392     MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1393     //tools
1394     void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1395     std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1396     DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1397     MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1398     bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1399     bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1400     DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1401     DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1402     DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1403     DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1404     DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1405     MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1406     MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1407     MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1408     void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1409     bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1410     MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1411     bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1412     void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1413     void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1414     void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1415     DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1416     void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1417     bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1418     MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1419     MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1420     MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1421     MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1422     DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1423     std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1424     DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1425     DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1426     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1427     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1428     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1429     static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1430     static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1431     %extend {
1432       MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1433       {
1434         return MEDCouplingUMesh::New();
1435       }
1436       
1437       MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1438       {
1439         return MEDCouplingUMesh::New(meshName,meshDim);
1440       }
1441       
1442       std::string __str__() const throw(INTERP_KERNEL::Exception)
1443       {
1444         return self->simpleRepr();
1445       }
1446       
1447       MEDCouplingUMeshCellIterator *__iter__()
1448       {
1449         return self->cellIterator();
1450       }
1451
1452       MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1453       {
1454         int sw;
1455         int singleVal;
1456         std::vector<int> multiVal;
1457         std::pair<int, std::pair<int,int> > slic;
1458         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1459         int nbc=self->getNumberOfCells();
1460         convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1461         switch(sw)
1462           {
1463           case 1:
1464             {
1465               if(singleVal>=nbc)
1466                 {
1467                   std::ostringstream oss;
1468                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1469                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1470                 }
1471               if(singleVal>=0)
1472                 return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1473               else
1474                 {
1475                   if(nbc+singleVal>0)
1476                     {
1477                       int tmp=nbc+singleVal;
1478                       return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1479                     }
1480                   else
1481                     {
1482                       std::ostringstream oss;
1483                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1484                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1485                     }
1486                 }
1487             }
1488           case 2:
1489             {
1490               return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1491             }
1492           case 3:
1493             {
1494               return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1495             }
1496           case 4:
1497             {
1498               if(!daIntTyypp)
1499                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1500               daIntTyypp->checkAllocated();
1501               return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1502             }
1503           default:
1504             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1505           }
1506       }
1507       
1508       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1509       {
1510         int sw;
1511         int singleVal;
1512         std::vector<int> multiVal;
1513         std::pair<int, std::pair<int,int> > slic;
1514         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1515         int nbc=self->getNumberOfCells();
1516         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1517         switch(sw)
1518           {
1519           case 1:
1520             {
1521               if(singleVal>=nbc)
1522                 {
1523                   std::ostringstream oss;
1524                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1525                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1526                 }
1527               if(singleVal>=0)
1528                 {
1529                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1530                   break;
1531                 }
1532               else
1533                 {
1534                   if(nbc+singleVal>0)
1535                     {
1536                       int tmp=nbc+singleVal;
1537                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1538                       break;
1539                     }
1540                   else
1541                     {
1542                       std::ostringstream oss;
1543                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1544                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1545                     }
1546                 }
1547             }
1548           case 2:
1549             {
1550               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1551               break;
1552             }
1553           case 4:
1554             {
1555               if(!daIntTyypp)
1556                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1557               daIntTyypp->checkAllocated();
1558               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1559               break;
1560             }
1561           default:
1562             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1563           }
1564       }
1565
1566       void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1567       {
1568         int sw;
1569         int singleVal;
1570         std::vector<int> multiVal;
1571         std::pair<int, std::pair<int,int> > slic;
1572         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1573         int nbc=self->getNumberOfCells();
1574         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1575         switch(sw)
1576           {
1577           case 1:
1578             {
1579               if(singleVal>=nbc)
1580                 {
1581                   std::ostringstream oss;
1582                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1583                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1584                 }
1585               if(singleVal>=0)
1586                 {
1587                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1588                   break;
1589                 }
1590               else
1591                 {
1592                   if(nbc+singleVal>0)
1593                     {
1594                       int tmp=nbc+singleVal;
1595                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1596                       break;
1597                     }
1598                   else
1599                     {
1600                       std::ostringstream oss;
1601                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1602                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1603                     }
1604                 }
1605             }
1606           case 2:
1607             {
1608               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1609               break;
1610             }
1611           case 3:
1612             {
1613               self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1614               break;
1615             }
1616           case 4:
1617             {
1618               if(!daIntTyypp)
1619                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1620               daIntTyypp->checkAllocated();
1621               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1622               break;
1623             }
1624           default:
1625             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1626           }
1627       }
1628
1629       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1630       {
1631         int szArr,sw,iTypppArr;
1632         std::vector<int> stdvecTyyppArr;
1633         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1634         if(size>szArr)
1635           {
1636             std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1637             throw INTERP_KERNEL::Exception(oss.str().c_str());
1638           }
1639         self->insertNextCell(type,size,tmp);
1640       }
1641
1642       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1643       {
1644         int szArr,sw,iTypppArr;
1645         std::vector<int> stdvecTyyppArr;
1646         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1647         self->insertNextCell(type,szArr,tmp);
1648       }
1649       
1650       DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1651       {
1652         DataArrayInt *ret=self->getNodalConnectivity();
1653         if(ret)
1654           ret->incrRef();
1655         return ret;
1656       }
1657       DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1658       {
1659         DataArrayInt *ret=self->getNodalConnectivityIndex();
1660         if(ret)
1661           ret->incrRef();
1662         return ret;
1663       }
1664       PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1665       {
1666         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1667         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1668         PyObject *res = PyList_New(result.size());
1669         for (int i=0;iL!=result.end(); i++, iL++)
1670           PyList_SetItem(res,i,PyInt_FromLong(*iL));
1671         return res;
1672       }
1673       
1674       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1675       {
1676         int szArr,sw,iTypppArr;
1677         std::vector<int> stdvecTyyppArr;
1678         const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1679         int nbOfDepthPeelingPerformed=0;
1680         DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1681         PyObject *res=PyTuple_New(2);
1682         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1683         PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1684         return res;
1685       }
1686
1687       PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1688       {
1689         DataArrayInt *v0=0,*v1=0;
1690         self->findCommonCells(compType,startCellId,v0,v1);
1691         PyObject *res = PyList_New(2);
1692         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1693         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1694         return res;
1695       }
1696
1697       static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1698       {
1699         DataArrayInt *v0=0,*v1=0;
1700         MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1701         PyObject *res = PyList_New(2);
1702         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1703         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1704         return res;
1705       }
1706       
1707       PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1708       {
1709         double val;
1710         DataArrayDouble *a;
1711         DataArrayDoubleTuple *aa;
1712         std::vector<double> bb;
1713         int sw;
1714         int nbOfCompo=self->getSpaceDimension();
1715         const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1716         //
1717         int cellId=-1,nodeId=-1;
1718         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId,nodeId);
1719         PyObject *ret=PyTuple_New(3);
1720         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1721         PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1722         PyTuple_SetItem(ret,2,PyInt_FromLong(nodeId));
1723         return ret;
1724       }
1725
1726       PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1727       {
1728         bool ret1;
1729         int ret2;
1730         DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1731         PyObject *res = PyList_New(3);
1732         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1733         PyList_SetItem(res,1,SWIG_From_bool(ret1));
1734         PyList_SetItem(res,2,SWIG_From_int(ret2));
1735         return res;
1736       }
1737       PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1738       {
1739         bool ret1;
1740         int ret2;
1741         DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1742         PyObject *res = PyList_New(3);
1743         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1744         PyList_SetItem(res,1,SWIG_From_bool(ret1));
1745         PyList_SetItem(res,2,SWIG_From_int(ret2));
1746         return res;
1747       }
1748       PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1749       {
1750         std::vector<int> cells;
1751         self->checkButterflyCells(cells,eps);
1752         DataArrayInt *ret=DataArrayInt::New();
1753         ret->alloc((int)cells.size(),1);
1754         std::copy(cells.begin(),cells.end(),ret->getPointer());
1755         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1756       }
1757
1758       PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1759       {
1760         std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1761         int sz=ms.size();
1762         PyObject *ret = PyList_New(sz);
1763         for(int i=0;i<sz;i++)
1764           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1765         return ret;
1766       }
1767
1768       PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1769       {
1770         std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1771         int sz=retCpp.size();
1772         PyObject *ret=PyList_New(sz);
1773         for(int i=0;i<sz;i++)
1774           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1775         return ret;
1776       }
1777
1778       PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1779       {
1780         int size;
1781         INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1782         MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1783         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1784       }
1785
1786       bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1787       {
1788         int sz;
1789         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1790         bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1791         return ret;
1792       }
1793
1794       DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1795       {
1796         int sz;
1797         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1798         DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1799         return ret;
1800       }
1801
1802       PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1803       {
1804         DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1805         self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1806         PyObject *ret=PyTuple_New(3);
1807         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1808         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1809         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1810         return ret;
1811       }
1812
1813       PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1814       {
1815         DataArrayInt *tmp0=0,*tmp1=0;
1816         self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1817         PyObject *ret=PyTuple_New(2);
1818         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1819         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1820         return ret;
1821       }
1822
1823       void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1824       {
1825         int sw;
1826         int singleVal;
1827         std::vector<int> multiVal;
1828         std::pair<int, std::pair<int,int> > slic;
1829         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1830         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1831         switch(sw)
1832           {
1833           case 1:
1834             return self->duplicateNodes(&singleVal,&singleVal+1);
1835           case 2:
1836             return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1837           case 4:
1838             return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1839           default:
1840             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1841           }
1842       }
1843
1844       void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1845       {
1846         int sw;
1847         int singleVal;
1848         std::vector<int> multiVal;
1849         std::pair<int, std::pair<int,int> > slic;
1850         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1851         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1852         switch(sw)
1853           {
1854           case 1:
1855             return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1856           case 2:
1857             return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1858           case 4:
1859             return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1860           default:
1861             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1862           }
1863       }
1864
1865       void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1866       {
1867         void *da=0;
1868         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1869         if (!SWIG_IsOK(res1))
1870           {
1871             int size;
1872             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1873             self->renumberNodesInConn(tmp);
1874           }
1875         else
1876           {
1877             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1878             if(!da2)
1879               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1880             da2->checkAllocated();
1881             self->renumberNodesInConn(da2->getConstPointer());
1882           }
1883       }
1884
1885       PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1886       {
1887         int sz;
1888         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1889         DataArrayInt *tmp0,*tmp1=0;
1890         tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1891         PyObject *ret=PyTuple_New(2);
1892         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1893         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1894         return ret;
1895       }
1896
1897       static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1898       {
1899         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1900         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1901         DataArrayInt *ret1=0,*ret2=0;
1902         MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1903         PyObject *ret=PyTuple_New(3);
1904         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1905         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1906         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1907         return ret;
1908       }
1909
1910       static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1911       {
1912         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1913         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1914         MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1915         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1916       }
1917
1918       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1919       {
1920         int sz;
1921         std::vector<const MEDCouplingUMesh *> meshes;
1922         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1923         std::vector<DataArrayInt *> corr;
1924         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1925         sz=corr.size();
1926         PyObject *ret1=PyList_New(sz);
1927         for(int i=0;i<sz;i++)
1928           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1929         PyObject *ret=PyList_New(2);
1930         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1931         PyList_SetItem(ret,1,ret1);
1932         return ret;
1933       }
1934
1935       static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1936       {
1937         std::vector<MEDCouplingUMesh *> meshes;
1938         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1939         MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
1940       }
1941
1942       static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
1943       {
1944         std::vector<MEDCouplingUMesh *> meshes;
1945         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1946         MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
1947       }
1948
1949       static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
1950       {
1951         int sw;
1952         int singleVal;
1953         std::vector<int> multiVal;
1954         std::pair<int, std::pair<int,int> > slic;
1955         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1956         if(!arrIndx)
1957           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
1958         convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1959         switch(sw)
1960           {
1961           case 1:
1962             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
1963           case 2:
1964             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
1965           case 4:
1966             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
1967           default:
1968             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1969           }
1970       }
1971       
1972       static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
1973       {
1974         DataArrayInt *arrOut=0,*arrIndexOut=0;
1975         int sw;
1976         int singleVal;
1977         std::vector<int> multiVal;
1978         std::pair<int, std::pair<int,int> > slic;
1979         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1980         if(!arrIndxIn)
1981           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
1982         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
1983         switch(sw)
1984           {
1985           case 1:
1986             {
1987               MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
1988               break;
1989             }
1990           case 2:
1991             {
1992               MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1993               break;
1994             }
1995           case 4:
1996             {
1997               MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
1998               break;
1999             }
2000           default:
2001             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2002           }
2003         PyObject *ret=PyTuple_New(2);
2004         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2005         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2006         return ret;
2007       }
2008
2009       static PyObject *SetPartOfIndexedArrays(PyObject *li,
2010                                               const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2011                                               const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2012       {
2013         DataArrayInt *arrOut=0,*arrIndexOut=0;
2014         int sw;
2015         int singleVal;
2016         std::vector<int> multiVal;
2017         std::pair<int, std::pair<int,int> > slic;
2018         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2019         if(!arrIndxIn)
2020           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2021         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2022         switch(sw)
2023           {
2024           case 1:
2025             {
2026               MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2027               break;
2028             }
2029           case 2:
2030             {
2031               MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2032               break;
2033             }
2034           case 4:
2035             {
2036               MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2037               break;
2038             }
2039           default:
2040             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2041           }
2042         PyObject *ret=PyTuple_New(2);
2043         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2044         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2045         return ret;
2046       }
2047
2048       static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2049                                                 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2050       {
2051         int sw;
2052         int singleVal;
2053         std::vector<int> multiVal;
2054         std::pair<int, std::pair<int,int> > slic;
2055         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2056         if(!arrIndxIn)
2057           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2058         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2059         switch(sw)
2060           {
2061           case 1:
2062             {
2063               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2064               break;
2065             }
2066           case 2:
2067             {
2068               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2069               break;
2070             }
2071           case 4:
2072             {
2073               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2074               break;
2075             }
2076           default:
2077             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2078           }
2079       }
2080
2081       PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2082       {
2083         double val;
2084         DataArrayDouble *a;
2085         DataArrayDoubleTuple *aa;
2086         std::vector<double> bb;
2087         int sw;
2088         int spaceDim=self->getSpaceDimension();
2089         const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2090         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2091         //
2092         std::vector<int> cells;
2093         self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2094         DataArrayInt *ret=DataArrayInt::New();
2095         ret->alloc((int)cells.size(),1);
2096         std::copy(cells.begin(),cells.end(),ret->getPointer());
2097         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2098       }
2099
2100       void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2101       {
2102         double val;
2103         DataArrayDouble *a;
2104         DataArrayDoubleTuple *aa;
2105         std::vector<double> bb;
2106         int sw;
2107         int spaceDim=self->getSpaceDimension();
2108         const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2109         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2110         self->orientCorrectly2DCells(v,polyOnly);
2111       }
2112       
2113       PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2114       {
2115         std::vector<int> cells;
2116         self->arePolyhedronsNotCorrectlyOriented(cells);
2117         DataArrayInt *ret=DataArrayInt::New();
2118         ret->alloc((int)cells.size(),1);
2119         std::copy(cells.begin(),cells.end(),ret->getPointer());
2120         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2121       }
2122
2123       PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2124       {
2125         double vec[3];
2126         double pos[3];
2127         self->getFastAveragePlaneOfThis(vec,pos);
2128         double vals[6];
2129         std::copy(vec,vec+3,vals);
2130         std::copy(pos,pos+3,vals+3);
2131         return convertDblArrToPyListOfTuple(vals,3,2);
2132       }
2133       
2134       static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2135       {
2136         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2137         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2138         return MEDCouplingUMesh::MergeUMeshes(tmp);
2139       }
2140
2141       PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2142       {
2143         DataArrayInt *ret1;
2144         bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2145         PyObject *ret=PyTuple_New(2);
2146         PyObject *ret0Py=ret0?Py_True:Py_False;
2147         Py_XINCREF(ret0Py);
2148         PyTuple_SetItem(ret,0,ret0Py);
2149         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2150         return ret;
2151       }
2152
2153       PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2154       {
2155         DataArrayInt *ret1;
2156         bool ret0=self->areCellsIncludedIn2(other,ret1);
2157         PyObject *ret=PyTuple_New(2);
2158         PyObject *ret0Py=ret0?Py_True:Py_False;
2159         Py_XINCREF(ret0Py);
2160         PyTuple_SetItem(ret,0,ret0Py);
2161         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2162         return ret;
2163       }
2164
2165       PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2166       {
2167         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2168         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2169         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2170         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2171         MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2172         PyObject *ret=PyTuple_New(5);
2173         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2174         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2175         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2176         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2177         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2178         return ret;
2179       }
2180
2181       PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2182       {
2183         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2184         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2185         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2186         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2187         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2188         PyObject *ret=PyTuple_New(5);
2189         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2190         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2191         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2193         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2194         return ret;
2195       }
2196
2197       PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2198       {
2199         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2200         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2201         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2202         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2203         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2204         PyObject *ret=PyTuple_New(5);
2205         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2206         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2207         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2208         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2209         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2210         return ret;
2211       }
2212       
2213       PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2214       {
2215         DataArrayInt *neighbors=0,*neighborsIdx=0;
2216         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2217         PyObject *ret=PyTuple_New(2);
2218         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2219         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2220         return ret;
2221       }
2222
2223       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2224       {
2225         DataArrayInt *neighbors=0,*neighborsIdx=0;
2226         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2227         PyObject *ret=PyTuple_New(2);
2228         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2229         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2230         return ret;
2231       } 
2232
2233       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2234       {
2235         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2236         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2237         DataArrayInt *d2,*d3,*d4,*dd5;
2238         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2239         PyObject *ret=PyTuple_New(7);
2240         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2241         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2242         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr((DataArrayInt *)d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2243         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2244         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2245         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2246         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2247         d0->incrRef();
2248         d1->incrRef();
2249         return ret;
2250       }
2251
2252       PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2253       {
2254         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2255         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2256         self->getReverseNodalConnectivity(d0,d1);
2257         PyObject *ret=PyTuple_New(2);
2258         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2259         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2260         d0->incrRef();
2261         d1->incrRef();
2262         return ret;
2263       }
2264
2265       DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2266       {
2267         if(!da)
2268           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2269         da->checkAllocated();
2270         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2271       }
2272
2273       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2274       {
2275         if(!da)
2276           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2277         da->checkAllocated();
2278         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2279       }
2280
2281       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2282       {
2283         if(!da)
2284           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2285         da->checkAllocated();
2286         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2287       }
2288
2289       PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2290       {
2291         if(!da)
2292           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2293         da->checkAllocated();
2294         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2295         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2296         PyObject *res = PyList_New(result.size());
2297         for (int i=0;iL!=result.end(); i++, iL++)
2298           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2299         return res;
2300       }
2301
2302       DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2303       {
2304         if(!da)
2305           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2306         da->checkAllocated();
2307         DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2308         ret->setName(da->getName().c_str());
2309         return ret;
2310       }
2311
2312       DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
2313       {
2314         void *da=0;
2315         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2316         if (!SWIG_IsOK(res1))
2317           {
2318             int size;
2319             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2320             return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
2321           }
2322         else
2323           {
2324             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2325             if(!da2)
2326               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2327             da2->checkAllocated();
2328             return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
2329           }
2330       }
2331
2332       PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
2333       {
2334         int ret1=-1;
2335         DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
2336         PyObject *ret=PyTuple_New(2);
2337         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2338         PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2339         return ret;
2340       }
2341
2342       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2343       {
2344         DataArrayInt *cellNb1=0,*cellNb2=0;
2345         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2346         PyObject *ret=PyTuple_New(3);
2347         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2348         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2349         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2350         return ret;
2351       }
2352
2353       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2354       {
2355         int spaceDim=self->getSpaceDimension();
2356         if(spaceDim!=3)
2357           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2358         double val,val2;
2359         DataArrayDouble *a,*a2;
2360         DataArrayDoubleTuple *aa,*aa2;
2361         std::vector<double> bb,bb2;
2362         int sw;
2363         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2364         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2365         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2366         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2367         //
2368         DataArrayInt *cellIds=0;
2369         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2370         PyObject *ret=PyTuple_New(2);
2371         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2372         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2373         return ret;
2374       }
2375
2376       PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2377       {
2378         int spaceDim=self->getSpaceDimension();
2379         if(spaceDim!=3)
2380           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2381         double val,val2;
2382         DataArrayDouble *a,*a2;
2383         DataArrayDoubleTuple *aa,*aa2;
2384         std::vector<double> bb,bb2;
2385         int sw;
2386         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2387         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2388         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2389         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2390         //
2391         DataArrayInt *cellIds=0;
2392         MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2393         PyObject *ret=PyTuple_New(2);
2394         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2395         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2396         return ret;
2397       }
2398
2399       DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2400       {
2401         int spaceDim=self->getSpaceDimension();
2402         if(spaceDim!=3)
2403           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2404         double val,val2;
2405         DataArrayDouble *a,*a2;
2406         DataArrayDoubleTuple *aa,*aa2;
2407         std::vector<double> bb,bb2;
2408         int sw;
2409         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2410         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2411         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2412         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2413         return self->getCellIdsCrossingPlane(orig,vect,eps);
2414       }
2415
2416       void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2417       {
2418         int sw;
2419         int pos1;
2420         std::vector<int> pos2;
2421         DataArrayInt *pos3=0;
2422         DataArrayIntTuple *pos4=0;
2423         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2424         switch(sw)
2425           {
2426           case 1:
2427             {
2428               self->convertToPolyTypes(&pos1,&pos1+1);
2429               return;
2430             }
2431           case 2:
2432             {
2433               if(pos2.empty())
2434                 return;
2435               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2436               return ;
2437             }
2438           case 3:
2439             {
2440               self->convertToPolyTypes(pos3->begin(),pos3->end());
2441               return ;
2442             }
2443           default:
2444             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2445           }
2446       }
2447     }
2448     void convertAllToPoly();
2449     void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2450     bool unPolyze() throw(INTERP_KERNEL::Exception);
2451     void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2452     MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2453     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2454   };
2455
2456   class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2457   {
2458   public:
2459     static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2460     MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2461     void updateTime() const throw(INTERP_KERNEL::Exception);
2462     %extend {
2463       MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2464       {
2465         return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2466       }
2467       
2468       std::string __str__() const throw(INTERP_KERNEL::Exception)
2469       {
2470         return self->simpleRepr();
2471       }
2472       PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2473       {
2474         MEDCouplingUMesh *ret=self->getMesh2D();
2475         ret->incrRef();
2476         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2477       }
2478       PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2479       {
2480         MEDCouplingUMesh *ret=self->getMesh1D();
2481         ret->incrRef();
2482         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2483       }
2484       PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2485       {
2486         DataArrayInt *ret=self->getMesh3DIds();
2487         ret->incrRef();
2488         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2489       } 
2490     }
2491   };
2492
2493   class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2494   {
2495   public:
2496     void updateTime() const throw(INTERP_KERNEL::Exception);
2497     int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2498     int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2499   };
2500
2501   class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2502   {
2503   public:
2504     static MEDCouplingCMesh *New();
2505     static MEDCouplingCMesh *New(const char *meshName);
2506     MEDCouplingCMesh *clone(bool recDeepCpy) const;
2507     void setCoords(const DataArrayDouble *coordsX,
2508                    const DataArrayDouble *coordsY=0,
2509                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2510     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2511     %extend {
2512       MEDCouplingCMesh()
2513       {
2514         return MEDCouplingCMesh::New();
2515       }
2516       MEDCouplingCMesh(const char *meshName)
2517       {
2518         return MEDCouplingCMesh::New(meshName);
2519       }
2520       std::string __str__() const throw(INTERP_KERNEL::Exception)
2521       {
2522         return self->simpleRepr();
2523       }
2524       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2525       {
2526         DataArrayDouble *ret=self->getCoordsAt(i);
2527         if(ret)
2528           ret->incrRef();
2529         return ret;
2530       }
2531     }
2532   };
2533
2534   class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2535   {
2536   public:
2537     static MEDCouplingCurveLinearMesh *New();
2538     static MEDCouplingCurveLinearMesh *New(const char *meshName);
2539     MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2540     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2541     std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2542     %extend {
2543       MEDCouplingCurveLinearMesh()
2544       {
2545         return MEDCouplingCurveLinearMesh::New();
2546       }
2547       MEDCouplingCurveLinearMesh(const char *meshName)
2548       {
2549         return MEDCouplingCurveLinearMesh::New(meshName);
2550       }
2551       std::string __str__() const throw(INTERP_KERNEL::Exception) 
2552       {
2553         return self->simpleRepr();
2554       }
2555       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2556       {
2557         DataArrayDouble *ret=self->getCoords();
2558         if(ret)
2559           ret->incrRef();
2560         return ret;
2561       }
2562       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2563       {
2564         int szArr,sw,iTypppArr;
2565         std::vector<int> stdvecTyyppArr;
2566         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2567         self->setNodeGridStructure(tmp,tmp+szArr);
2568       }
2569     }
2570   };
2571   
2572 }
2573 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
2574 {
2575   PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
2576   {
2577     int ret1;
2578     DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
2579     PyObject *ret=PyTuple_New(2);
2580     PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2581     PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
2582     return ret;
2583   }
2584 }
2585
2586 %extend ParaMEDMEM::DataArrayDoubleIterator
2587 {
2588   PyObject *next()
2589   {
2590     DataArrayDoubleTuple *ret=self->nextt();
2591     if(ret)
2592       return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
2593     else
2594       {
2595         PyErr_SetString(PyExc_StopIteration,"No more data.");
2596         return 0;
2597       }
2598   }
2599 }
2600
2601 %extend ParaMEDMEM::DataArrayDoubleTuple
2602 {
2603   std::string __str__() const
2604   {
2605     return self->repr();
2606   }
2607
2608   double __float__() const throw(INTERP_KERNEL::Exception)
2609   {
2610     return self->doubleValue();
2611   }
2612
2613   DataArrayDouble *buildDADouble()
2614   {
2615     return self->buildDADouble(1,self->getNumberOfCompo());
2616   }
2617
2618   PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2619   {
2620     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2621     ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2622     Py_XINCREF(trueSelf);
2623     return trueSelf;
2624   }
2625   
2626   PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2627   {
2628     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2629     ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2630     Py_XINCREF(trueSelf);
2631     return trueSelf;
2632   }
2633   
2634   PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2635   {
2636     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2637     ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2638     Py_XINCREF(trueSelf);
2639     return trueSelf;
2640   }
2641
2642   PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2643   {
2644     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2645     ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2646     Py_XINCREF(trueSelf);
2647     return trueSelf;
2648   }
2649
2650   PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2651   {
2652     int sw;
2653     int singleVal;
2654     std::vector<int> multiVal;
2655     std::pair<int, std::pair<int,int> > slic;
2656     ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2657     const double *pt=self->getConstPointer();
2658     int nbc=self->getNumberOfCompo();
2659     convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2660     switch(sw)
2661       {
2662       case 1:
2663         {
2664           if(singleVal>=nbc)
2665             {
2666               std::ostringstream oss;
2667               oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2668               throw INTERP_KERNEL::Exception(oss.str().c_str());
2669             }
2670           if(singleVal>=0)
2671             return PyFloat_FromDouble(pt[singleVal]);
2672           else
2673             {
2674               if(nbc+singleVal>0)
2675                 return PyFloat_FromDouble(pt[nbc+singleVal]);
2676               else
2677                 {
2678                   std::ostringstream oss;
2679                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2680                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2681                 }
2682             }
2683         }
2684       case 2:
2685         {
2686           PyObject *t=PyTuple_New(multiVal.size());
2687           for(int j=0;j<(int)multiVal.size();j++)
2688             {
2689               int cid=multiVal[j];
2690               if(cid>=nbc)
2691                 {
2692                   std::ostringstream oss;
2693                   oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2694                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2695                 }
2696               PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2697             }
2698           return t;
2699         }
2700       case 3:
2701           {
2702             int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2703             PyObject *t=PyTuple_New(sz);
2704             for(int j=0;j<sz;j++)
2705               PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2706             return t;
2707           }
2708       default:
2709         throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2710       }
2711   }
2712
2713   DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2714   {
2715      const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2716      int sw1,sw2;
2717      double singleValV;
2718      std::vector<double> multiValV;
2719      ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2720      int nbc=self->getNumberOfCompo();
2721      convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2722      int singleVal;
2723      std::vector<int> multiVal;
2724      std::pair<int, std::pair<int,int> > slic;
2725      ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2726      double *pt=self->getPointer();
2727      convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2728      switch(sw2)
2729        {
2730        case 1:
2731          {
2732            if(singleVal>=nbc)
2733             {
2734               std::ostringstream oss;
2735               oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2736               throw INTERP_KERNEL::Exception(oss.str().c_str());
2737             }
2738            switch(sw1)
2739              {
2740              case 1:
2741                {
2742                  pt[singleVal]=singleValV;
2743                  return self;
2744                }
2745              case 2:
2746                {
2747                  if(multiValV.size()!=1)
2748                    {
2749                      std::ostringstream oss;
2750                      oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2751                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2752                    }
2753                  pt[singleVal]=multiValV[0];
2754                  return self;
2755                }
2756              case 3:
2757                {
2758                  pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2759                  return self;
2760                }
2761              default:
2762                throw INTERP_KERNEL::Exception(msg);
2763              }
2764          }
2765        case 2:
2766          {
2767            switch(sw1)
2768              {
2769              case 1:
2770                {
2771                  for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2772                    {
2773                      if(*it>=nbc)
2774                        {
2775                          std::ostringstream oss;
2776                          oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2777                          throw INTERP_KERNEL::Exception(oss.str().c_str());
2778                        }
2779                      pt[*it]=singleValV;
2780                    }
2781                  return self;
2782                }
2783              case 2:
2784                {
2785                  if(multiVal.size()!=multiValV.size())
2786                    {
2787                      std::ostringstream oss;
2788                      oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2789                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2790                    }
2791                  for(int i=0;i<(int)multiVal.size();i++)
2792                    {
2793                      int pos=multiVal[i];
2794                      if(pos>=nbc)
2795                        {
2796                          std::ostringstream oss;
2797                          oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2798                          throw INTERP_KERNEL::Exception(oss.str().c_str());
2799                        }
2800                      pt[multiVal[i]]=multiValV[i];
2801                    }
2802                  return self;
2803                }
2804              case 3:
2805                {
2806                  const double *ptV=daIntTyyppV->getConstPointer();
2807                  if(nbc>daIntTyyppV->getNumberOfCompo())
2808                    {
2809                      std::ostringstream oss;
2810                      oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2811                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2812                    }
2813                  std::copy(ptV,ptV+nbc,pt);
2814                  return self;
2815                }
2816              default:
2817                throw INTERP_KERNEL::Exception(msg);
2818              }
2819          }
2820        case 3:
2821          {
2822            int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2823            switch(sw1)
2824              {
2825              case 1:
2826                {
2827                  for(int j=0;j<sz;j++)
2828                    pt[slic.first+j*slic.second.second]=singleValV;
2829                  return self;
2830                }
2831              case 2:
2832                {
2833                  if(sz!=(int)multiValV.size())
2834                    {
2835                      std::ostringstream oss;
2836                      oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2837                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2838                    }
2839                  for(int j=0;j<sz;j++)
2840                    pt[slic.first+j*slic.second.second]=multiValV[j];
2841                  return self;
2842                }
2843              case 3:
2844                {
2845                  const double *ptV=daIntTyyppV->getConstPointer();
2846                  if(sz>daIntTyyppV->getNumberOfCompo())
2847                    {
2848                      std::ostringstream oss;
2849                      oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2850                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2851                    }
2852                  for(int j=0;j<sz;j++)
2853                    pt[slic.first+j*slic.second.second]=ptV[j];
2854                  return self;
2855                }
2856              default:
2857                throw INTERP_KERNEL::Exception(msg);
2858              }
2859          }
2860        default:
2861          throw INTERP_KERNEL::Exception(msg);
2862        }
2863    }
2864 }
2865
2866 %extend ParaMEDMEM::DataArrayDouble
2867  {
2868    DataArrayDouble() throw(INTERP_KERNEL::Exception)
2869    {
2870      return DataArrayDouble::New();
2871    }
2872
2873    static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2874    {
2875      const char *msg="ParaMEDMEM::DataArrayDouble::New : Available API are : \n-DataArrayDouble.New()\n--DataArrayDouble.New([1.,3.,4.])\n-DataArrayDouble.New([1.,3.,4.],3)\n-DataArrayDouble.New([1.,3.,4.,5.],2,2)\n-DataArrayDouble.New(5)\n-DataArrayDouble.New(5,2) !";
2876      if(PyList_Check(elt0) || PyTuple_Check(elt0))
2877        {
2878          if(nbOfTuples)
2879            {
2880              if(PyInt_Check(nbOfTuples))
2881                {
2882                  int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
2883                  if(nbOfTuples1<0)
2884                    throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2885                  if(elt2)
2886                    {
2887                      if(PyInt_Check(elt2))
2888                        {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
2889                          int nbOfCompo=PyInt_AS_LONG(elt2);
2890                          if(nbOfCompo<0)
2891                            throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2892                          MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2893                          std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
2894                          ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2895                          ret->incrRef();
2896                          return ret;
2897                        }
2898                      else
2899                        throw INTERP_KERNEL::Exception(msg);
2900                    }
2901                  else
2902                    {//DataArrayDouble.New([1.,3.,4.],3)
2903                      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2904                      int tmpp1=-1;
2905                      std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
2906                      ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2907                      ret->incrRef();
2908                      return ret;
2909                    }
2910                }
2911              else
2912                throw INTERP_KERNEL::Exception(msg);
2913            }
2914          else
2915            {// DataArrayDouble.New([1.,3.,4.])
2916              MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2917              int tmpp1=-1,tmpp2=-1;
2918              std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
2919              ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
2920              ret->incrRef();
2921              return ret;
2922            }
2923        }
2924      else if(PyInt_Check(elt0))
2925        {
2926          int nbOfTuples1=PyInt_AS_LONG(elt0);
2927          if(nbOfTuples1<0)
2928            throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2929          if(nbOfTuples)
2930            {
2931              if(!elt2)
2932                {
2933                  if(PyInt_Check(nbOfTuples))
2934                    {//DataArrayDouble.New(5,2)
2935                      int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
2936                      if(nbOfCompo<0)
2937                        throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2938                      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2939                      ret->alloc(nbOfTuples1,nbOfCompo);
2940                      ret->incrRef();
2941                      return ret;
2942                    }
2943                  else
2944                    throw INTERP_KERNEL::Exception(msg);
2945                }
2946              else
2947                throw INTERP_KERNEL::Exception(msg);
2948            }
2949          else
2950            {//DataArrayDouble.New(5)
2951              MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2952              ret->alloc(nbOfTuples1,1);
2953              ret->incrRef();
2954              return ret;
2955            }
2956        }
2957      else
2958        throw INTERP_KERNEL::Exception(msg);
2959    }
2960    
2961    DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2962    {
2963      return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
2964    }
2965
2966    void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
2967    {
2968      double val;
2969      std::vector<double> bb;
2970      int sw,nbTuples=-1;
2971      const char msg[]="Python wrap of DataArrayDouble::pushBackValsSilent : ";
2972      const double *tmp=convertObjToPossibleCpp5_SingleCompo(li,sw,val,bb,msg,true,nbTuples);
2973      self->pushBackValsSilent(tmp,tmp+nbTuples);
2974    }
2975
2976    std::string __str__() const
2977    {
2978      return self->repr();
2979    }
2980
2981    double __float__() const throw(INTERP_KERNEL::Exception)
2982    {
2983      return self->doubleValue();
2984    }
2985
2986    int __len__() const throw(INTERP_KERNEL::Exception)
2987    {
2988      if(self->isAllocated())
2989        {
2990          return self->getNumberOfTuples();
2991        }
2992      else
2993        {
2994          throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
2995        }
2996    }
2997
2998    DataArrayDoubleIterator *__iter__()
2999    {
3000      return self->iterator();
3001    }
3002    
3003    void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3004    {
3005      const char *msg="ParaMEDMEM::DataArrayDouble::setValues : Available API are : \n-DataArrayDouble.setValues([1.,3.,4.])\n-DataArrayDouble.setValues([1.,3.,4.],3)\n-DataArrayDouble.setValues([1.,3.,4.,5.],2,2)\n-DataArrayDouble.setValues([(1.,1.7),(3.,3.7),(4.,4.7)])\n !";
3006      if(PyList_Check(li) || PyTuple_Check(li))
3007        {
3008          if(nbOfTuples)
3009            {
3010              if(PyInt_Check(nbOfTuples))
3011                {
3012                  int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
3013                  if(nbOfTuples1<0)
3014                    throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
3015                  if(nbOfComp)
3016                    {
3017                      if(PyInt_Check(nbOfComp))
3018                        {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
3019                          int nbOfCompo=PyInt_AS_LONG(nbOfComp);
3020                          if(nbOfCompo<0)
3021                            throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
3022                          std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
3023                          self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3024                        }
3025                      else
3026                        throw INTERP_KERNEL::Exception(msg);
3027                    }
3028                  else
3029                    {//DataArrayDouble.setValues([1.,3.,4.],3)
3030                      int tmpp1=-1;
3031                      std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,tmpp1);
3032                      self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3033                    }
3034                }
3035              else
3036                throw INTERP_KERNEL::Exception(msg);
3037            }
3038          else
3039            {// DataArrayDouble.setValues([1.,3.,4.])
3040              int tmpp1=-1,tmpp2=-1;
3041              std::vector<double> tmp=fillArrayWithPyListDbl2(li,tmpp1,tmpp2);
3042              self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
3043            }
3044        }
3045      else
3046        throw INTERP_KERNEL::Exception(msg);
3047    }
3048
3049    PyObject *getValues() throw(INTERP_KERNEL::Exception)
3050    {
3051      const double *vals=self->getPointer();
3052      return convertDblArrToPyList(vals,self->getNbOfElems());
3053    }
3054
3055    PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
3056    {
3057      std::string ret1;
3058      bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
3059      PyObject *ret=PyTuple_New(2);
3060      PyObject *ret0Py=ret0?Py_True:Py_False;
3061      Py_XINCREF(ret0Py);
3062      PyTuple_SetItem(ret,0,ret0Py);
3063      PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3064      return ret;
3065    }
3066
3067    PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
3068    {
3069      const double *vals=self->getPointer();
3070      int nbOfComp=self->getNumberOfComponents();
3071      int nbOfTuples=self->getNumberOfTuples();
3072      return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
3073    }
3074
3075    DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
3076    {
3077      void *da=0;
3078      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3079      if (!SWIG_IsOK(res1))
3080        {
3081          int size;
3082          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3083          if(size!=self->getNumberOfTuples())
3084            {
3085              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3086            }
3087          return self->renumber(tmp);
3088        }
3089      else
3090        {
3091          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3092          if(!da2)
3093            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3094          da2->checkAllocated();
3095          int size=self->getNumberOfTuples();
3096          if(size!=self->getNumberOfTuples())
3097            {
3098              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3099            }
3100          return self->renumber(da2->getConstPointer());
3101        }
3102    }
3103
3104    DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
3105    {
3106      void *da=0;
3107      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3108      if (!SWIG_IsOK(res1))
3109        {
3110          int size;
3111          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3112          if(size!=self->getNumberOfTuples())
3113            {
3114              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3115            }
3116          return self->renumberR(tmp);
3117        }
3118      else
3119        {
3120          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3121          if(!da2)
3122            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3123          da2->checkAllocated();
3124          int size=self->getNumberOfTuples();
3125          if(size!=self->getNumberOfTuples())
3126            {
3127              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3128            }
3129          return self->renumberR(da2->getConstPointer());
3130        }
3131    }
3132
3133    DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
3134    {
3135      void *da=0;
3136      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3137      if (!SWIG_IsOK(res1))
3138        {
3139          int size;
3140          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3141          if(size!=self->getNumberOfTuples())
3142            {
3143              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3144            }
3145          return self->renumberAndReduce(tmp,newNbOfTuple);
3146        }
3147      else
3148        {
3149          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3150          if(!da2)
3151            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3152          da2->checkAllocated();
3153          int size=self->getNumberOfTuples();
3154          if(size!=self->getNumberOfTuples())
3155            {
3156              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3157            }
3158          return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
3159        }
3160    }
3161
3162    void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
3163    {
3164      void *da=0;
3165      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3166      if (!SWIG_IsOK(res1))
3167        {
3168          int size;
3169          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3170          if(size!=self->getNumberOfTuples())
3171            {
3172              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3173            }
3174          self->renumberInPlace(tmp);
3175        }
3176      else
3177        {
3178          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3179          if(!da2)
3180            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3181          da2->checkAllocated();
3182          int size=self->getNumberOfTuples();
3183          if(size!=self->getNumberOfTuples())
3184            {
3185              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3186            }
3187          self->renumberInPlace(da2->getConstPointer());
3188        }
3189    }
3190
3191    void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
3192    {
3193      void *da=0;
3194      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3195      if (!SWIG_IsOK(res1))
3196        {
3197          int size;
3198          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3199          if(size!=self->getNumberOfTuples())
3200            {
3201              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3202            }
3203          self->renumberInPlaceR(tmp);
3204        }
3205      else
3206        {
3207          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3208          if(!da2)
3209            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3210          da2->checkAllocated();
3211          int size=self->getNumberOfTuples();
3212          if(size!=self->getNumberOfTuples())
3213            {
3214              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3215            }
3216          self->renumberInPlaceR(da2->getConstPointer());
3217        }
3218    }
3219
3220    DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
3221    {
3222      void *da=0;
3223      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3224      if (!SWIG_IsOK(res1))
3225        {
3226          int size;
3227          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3228          return self->selectByTupleId(tmp,tmp+size);
3229        }
3230      else
3231        {
3232          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3233          if(!da2)
3234            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3235          da2->checkAllocated();
3236          return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3237        }
3238    }
3239
3240    DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
3241    {
3242      void *da=0;
3243      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3244      if (!SWIG_IsOK(res1))
3245        {
3246          int size;
3247          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3248          return self->selectByTupleIdSafe(tmp,tmp+size);
3249        }
3250      else
3251        {
3252          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3253          if(!da2)
3254            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3255          da2->checkAllocated();
3256          return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3257        }
3258    }
3259
3260    PyObject *minimalDistanceTo(const DataArrayDouble *other) const throw(INTERP_KERNEL::Exception)
3261    {
3262      int thisTupleId,otherTupleId;
3263      double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
3264      PyObject *ret=PyTuple_New(3);
3265      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
3266      PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
3267      PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
3268      return ret;
3269    }
3270
3271    PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3272    {
3273      int tmp;
3274      double r1=self->getMaxValue(tmp);
3275      PyObject *ret=PyTuple_New(2);
3276      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3277      PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3278      return ret;
3279    }
3280
3281    PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3282    {
3283      DataArrayInt *tmp;
3284      double r1=self->getMaxValue2(tmp);
3285      PyObject *ret=PyTuple_New(2);
3286      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3287      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3288      return ret;
3289    }
3290
3291    PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3292    {
3293      int tmp;
3294      double r1=self->getMinValue(tmp);
3295      PyObject *ret=PyTuple_New(2);
3296      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3297      PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3298      return ret;
3299    }
3300
3301    PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3302    {
3303      DataArrayInt *tmp;
3304      double r1=self->getMinValue2(tmp);
3305      PyObject *ret=PyTuple_New(2);
3306      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3307      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3308      return ret;
3309    }
3310
3311    PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
3312    {
3313      int nbOfCompo=self->getNumberOfComponents();
3314      INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
3315      self->getMinMaxPerComponent(tmp);
3316      PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
3317      return ret;
3318    }
3319
3320    PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3321    {
3322      int sz=self->getNumberOfComponents();
3323      INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3324      self->accumulate(tmp);
3325      return convertDblArrToPyList(tmp,sz);
3326    }
3327    
3328    DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3329    {
3330      std::vector<int> tmp;
3331      convertPyToNewIntArr3(li,tmp);
3332      return self->keepSelectedComponents(tmp);
3333    }
3334
3335    PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
3336    {
3337      DataArrayInt *comm, *commIndex;
3338      self->findCommonTuples(prec,limitNodeId,comm,commIndex);
3339      PyObject *res = PyList_New(2);
3340      PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3341      PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3342      return res;
3343    }
3344
3345    PyObject *distanceToTuple(PyObject *tuple) const throw(INTERP_KERNEL::Exception)
3346    {
3347      double val;
3348      DataArrayDouble *a;
3349      DataArrayDoubleTuple *aa;
3350      std::vector<double> bb;
3351      int sw;
3352      int tupleId=-1,nbTuples=-1,nbOfCompo=self->getNumberOfComponents();
3353      const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
3354      //
3355      int cellId=-1,nodeId=-1;
3356      double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
3357      PyObject *ret=PyTuple_New(2);
3358      PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
3359      PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
3360      return ret;
3361    }
3362
3363    void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3364    {
3365      std::vector<int> tmp;
3366      convertPyToNewIntArr3(li,tmp);
3367      self->setSelectedComponents(a,tmp);
3368    }
3369    
3370    PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3371    {
3372      int sz=self->getNumberOfComponents();
3373      INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3374      self->getTuple(tupleId,tmp);
3375      return convertDblArrToPyList(tmp,sz);
3376    }
3377
3378    static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3379    {
3380      std::vector<const DataArrayDouble *> tmp;
3381      convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3382      return DataArrayDouble::Aggregate(tmp);
3383    }
3384
3385    static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3386    {
3387      std::vector<const DataArrayDouble *> tmp;
3388      convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3389      return DataArrayDouble::Meld(tmp);
3390    }
3391
3392    DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
3393    {
3394      std::vector<std::pair<int,int> > ranges;
3395      convertPyToVectorPairInt(li,ranges);
3396      return self->selectByTupleRanges(ranges);
3397    }
3398
3399    PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
3400    {
3401      double val;
3402      DataArrayDouble *a;
3403      DataArrayDoubleTuple *aa;
3404      std::vector<double> bb;
3405      int sw;
3406      int nbComp=self->getNumberOfComponents(),nbTuples=-1;
3407      const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
3408      const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
3409      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
3410      DataArrayInt *c=0,*cI=0;
3411      self->computeTupleIdsNearTuples(inpu,eps,c,cI);
3412      PyObject *ret=PyTuple_New(2);
3413      PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3414      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3415      return ret;
3416    }
3417
3418    PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3419    {
3420      const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
3421      self->checkAllocated();
3422      int nbOfTuples=self->getNumberOfTuples();
3423      int nbOfComponents=self->getNumberOfComponents();
3424      int it1,ic1;
3425      std::vector<int> vt1,vc1;
3426      std::pair<int, std::pair<int,int> > pt1,pc1;
3427      DataArrayInt *dt1=0,*dc1=0;
3428      int sw;
3429      convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3430      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
3431      switch(sw)
3432        {
3433        case 1:
3434          if(nbOfComponents==1)
3435            return PyFloat_FromDouble(self->getIJSafe(it1,0));
3436          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3437        case 2:
3438          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3439        case 3:
3440          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3441        case 4:
3442          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3443        case 5:
3444          return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
3445        case 6:
3446          {
3447            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3448            std::vector<int> v2(1,ic1);
3449            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3450          }
3451        case 7:
3452          {
3453            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3454            std::vector<int> v2(1,ic1);
3455            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3456          }
3457        case 8:
3458          {
3459            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3460            std::vector<int> v2(1,ic1);
3461            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3462          }
3463        case 9:
3464          {
3465            ret=self->selectByTupleIdSafe(&it1,&it1+1);
3466            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3467          }
3468        case 10:
3469          {
3470            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3471            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3472          }
3473        case 11:
3474          {
3475            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3476            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3477          }
3478        case 12:
3479          {
3480            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3481            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3482          }
3483        case 13:
3484          {
3485            ret=self->selectByTupleIdSafe(&it1,&it1+1);
3486            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3487            std::vector<int> v2(nbOfComp);
3488            for(int i=0;i<nbOfComp;i++)
3489              v2[i]=pc1.first+i*pc1.second.second;
3490            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3491          }
3492        case 14:
3493          {
3494            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3495            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3496            std::vector<int> v2(nbOfComp);
3497            for(int i=0;i<nbOfComp;i++)
3498              v2[i]=pc1.first+i*pc1.second.second;
3499            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3500          }
3501        case 15:
3502          {
3503            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3504            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3505            std::vector<int> v2(nbOfComp);
3506            for(int i=0;i<nbOfComp;i++)
3507              v2[i]=pc1.first+i*pc1.second.second;
3508            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3509          }
3510        case 16:
3511          {
3512            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3513            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3514            std::vector<int> v2(nbOfComp);
3515            for(int i=0;i<nbOfComp;i++)
3516              v2[i]=pc1.first+i*pc1.second.second;
3517            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3518          }
3519        default:
3520          throw INTERP_KERNEL::Exception(msg);
3521        }
3522    }
3523
3524    DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3525    {
3526      self->checkAllocated();
3527      const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
3528      int nbOfTuples=self->getNumberOfTuples();
3529      int nbOfComponents=self->getNumberOfComponents();
3530      int sw1,sw2;
3531      double i1;
3532      std::vector<double> v1;
3533      DataArrayDouble *d1=0;
3534      convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
3535      int it1,ic1;
3536      std::vector<int> vt1,vc1;
3537      std::pair<int, std::pair<int,int> > pt1,pc1;
3538      DataArrayInt *dt1=0,*dc1=0;
3539      convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3540      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
3541      switch(sw2)
3542        {
3543        case 1:
3544          {
3545            switch(sw1)
3546              {
3547              case 1:
3548                self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3549                return self;
3550              case 2:
3551                tmp=DataArrayDouble::New();
3552                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3553                self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3554                return self;
3555              case 3:
3556                self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3557                return self;
3558              default:
3559                throw INTERP_KERNEL::Exception(msg);
3560              }
3561            break;
3562          }
3563        case 2:
3564          {
3565            switch(sw1)
3566              {
3567              case 1:
3568                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3569                return self;
3570              case 2:
3571                tmp=DataArrayDouble::New();
3572                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3573                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3574                return self;
3575              case 3:
3576                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3577                return self;
3578              default:
3579                throw INTERP_KERNEL::Exception(msg);
3580              }
3581            break;
3582          }
3583        case 3:
3584          {
3585            switch(sw1)
3586              {
3587              case 1:
3588                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3589                return self;
3590              case 2:
3591                tmp=DataArrayDouble::New();
3592                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3593                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3594                return self;
3595              case 3:
3596                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3597                return self;
3598              default:
3599                throw INTERP_KERNEL::Exception(msg);
3600              }
3601            break;
3602          }
3603        case 4:
3604          {
3605            switch(sw1)
3606              {
3607              case 1:
3608                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3609                return self;
3610              case 2:
3611                tmp=DataArrayDouble::New();
3612                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3613                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3614                return self;
3615              case 3:
3616                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3617                return self;
3618              default:
3619                throw INTERP_KERNEL::Exception(msg);
3620              }
3621            break;
3622          }
3623        case 5:
3624          {
3625            switch(sw1)
3626              {
3627              case 1:
3628                self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3629                return self;
3630              case 2:
3631                tmp=DataArrayDouble::New();
3632                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3633                self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3634                return self;
3635              case 3:
3636                self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3637                return self;
3638              default:
3639                throw INTERP_KERNEL::Exception(msg);
3640              }
3641            break;
3642          }
3643        case 6:
3644          {
3645            switch(sw1)
3646              {
3647              case 1:
3648                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3649                return self;
3650              case 2:
3651                tmp=DataArrayDouble::New();
3652                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3653                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3654                return self;
3655              case 3:
3656                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3657                return self;
3658              default:
3659                throw INTERP_KERNEL::Exception(msg);
3660              }
3661            break;
3662          }
3663        case 7:
3664          {
3665            switch(sw1)
3666              {
3667              case 1:
3668                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3669                return self;
3670              case 2:
3671                tmp=DataArrayDouble::New();
3672                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3673                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3674                return self;
3675              case 3:
3676                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3677                return self;
3678              default:
3679                throw INTERP_KERNEL::Exception(msg);
3680              }
3681            break;
3682          }
3683        case 8:
3684          {
3685            switch(sw1)
3686              {
3687              case 1:
3688                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3689                return self;
3690              case 2:
3691                tmp=DataArrayDouble::New();
3692                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3693                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3694                return self;
3695              case 3:
3696                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3697                return self;
3698              default:
3699                throw INTERP_KERNEL::Exception(msg);
3700              }
3701            break;
3702          }
3703        case 9:
3704          {
3705            switch(sw1)
3706              {
3707              case 1:
3708                self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3709                return self;
3710              case 2:
3711                tmp=DataArrayDouble::New();
3712                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3713                self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3714                return self;
3715              case 3:
3716                self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3717                return self;
3718              default:
3719                throw INTERP_KERNEL::Exception(msg);
3720              }
3721            break;
3722          }
3723        case 10:
3724          {
3725            switch(sw1)
3726              {
3727              case 1:
3728                self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3729                return self;
3730              case 2:
3731                tmp=DataArrayDouble::New();
3732                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3733                self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3734                return self;
3735              case 3:
3736                self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3737                return self;
3738              default:
3739                throw INTERP_KERNEL::Exception(msg);
3740              }
3741            break;
3742          }
3743        case 11:
3744          {
3745            switch(sw1)
3746              {
3747              case 1:
3748                self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3749                return self;
3750              case 2:
3751                tmp=DataArrayDouble::New();
3752                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3753                self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
3754                return self;
3755              case 3:
3756                self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
3757                return self;
3758              default:
3759                throw INTERP_KERNEL::Exception(msg);
3760              }
3761            break;
3762          }
3763        case 12:
3764          {
3765            switch(sw1)
3766              {
3767              case 1:
3768                self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3769                return self;
3770              case 2:
3771                tmp=DataArrayDouble::New();
3772                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3773                self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3774                return self;
3775              case 3:
3776                self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3777                return self;
3778              default:
3779                throw INTERP_KERNEL::Exception(msg);
3780              }
3781            break;
3782          }
3783        case 13:
3784          {
3785            switch(sw1)
3786              {
3787              case 1:
3788                self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3789                return self;
3790              case 2:
3791                tmp=DataArrayDouble::New();
3792                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3793                self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3794                return self;
3795              case 3:
3796                self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3797                return self;
3798              default:
3799                throw INTERP_KERNEL::Exception(msg);
3800              }
3801            break;
3802          }
3803        case 14:
3804          {
3805            switch(sw1)
3806              {
3807              case 1:
3808                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3809                return self;
3810              case 2:
3811                tmp=DataArrayDouble::New();
3812                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3813                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3814                return self;
3815              case 3:
3816                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3817                return self;
3818              default:
3819                throw INTERP_KERNEL::Exception(msg);
3820              }
3821            break;
3822          }
3823        case 15:
3824          {
3825            switch(sw1)
3826              {
3827              case 1:
3828                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3829                return self;
3830              case 2:
3831                  tmp=DataArrayDouble::New();
3832                  tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3833                  self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3834                  return self;
3835              case 3:
3836                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3837                return self;
3838              default:
3839                throw INTERP_KERNEL::Exception(msg);
3840              }
3841            break;
3842          }
3843        case 16:
3844          {
3845            switch(sw1)
3846              {
3847              case 1:
3848                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3849                return self;
3850              case 2:
3851                tmp=DataArrayDouble::New();
3852                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3853                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3854                return self;
3855              case 3:
3856                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3857                return self;
3858              default:
3859                throw INTERP_KERNEL::Exception(msg);
3860              }
3861            break;
3862          }
3863        default:
3864          throw INTERP_KERNEL::Exception(msg);
3865        }
3866      return self;
3867    }
3868
3869    DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3870    {
3871      return self->negate();
3872    }
3873
3874    DataArrayDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3875    {
3876      const char msg[]="Unexpected situation in __add__ !";
3877      double val;
3878      DataArrayDouble *a;
3879      DataArrayDoubleTuple *aa;
3880      std::vector<double> bb;
3881      int sw;
3882      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3883      switch(sw)
3884        {
3885        case 1:
3886          {
3887            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3888            ret->applyLin(1.,val);
3889            ret->incrRef();
3890            return ret;
3891          }
3892        case 2:
3893          {
3894            return DataArrayDouble::Add(self,a);
3895          }
3896        case 3:
3897          {
3898            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3899            return DataArrayDouble::Add(self,aaa);
3900          }
3901        case 4:
3902          {
3903            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3904            return DataArrayDouble::Add(self,aaa);
3905          }
3906        default:
3907          throw INTERP_KERNEL::Exception(msg);
3908        }
3909    }
3910
3911    DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3912    {
3913      const char msg[]="Unexpected situation in __radd__ !";
3914      double val;
3915      DataArrayDouble *a;
3916      DataArrayDoubleTuple *aa;
3917      std::vector<double> bb;
3918      int sw;
3919      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3920      switch(sw)
3921        {
3922        case 1:
3923          {
3924            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3925            ret->applyLin(1.,val);
3926            ret->incrRef();
3927            return ret;
3928          }
3929        case 3:
3930          {
3931            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3932            return DataArrayDouble::Add(self,aaa);
3933          }
3934        case 4:
3935          {
3936            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3937            return DataArrayDouble::Add(self,aaa);
3938          }
3939        default:
3940          throw INTERP_KERNEL::Exception(msg);
3941        }
3942    }
3943    
3944    PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3945    {
3946      const char msg[]="Unexpected situation in __iadd__ !";
3947      double val;
3948      DataArrayDouble *a;
3949      DataArrayDoubleTuple *aa;
3950      std::vector<double> bb;
3951      int sw;
3952      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3953      switch(sw)
3954        {
3955        case 1:
3956          {
3957            self->applyLin(1.,val);
3958            Py_XINCREF(trueSelf);
3959            return trueSelf;
3960          }
3961        case 2:
3962          {
3963            self->addEqual(a);
3964            Py_XINCREF(trueSelf);
3965            return trueSelf;
3966          }
3967        case 3:
3968          {
3969            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3970            self->addEqual(aaa);
3971            Py_XINCREF(trueSelf);
3972            return trueSelf;
3973          }
3974        case 4:
3975          {
3976            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3977            self->addEqual(aaa);
3978            Py_XINCREF(trueSelf);
3979            return trueSelf;
3980          }
3981        default:
3982          throw INTERP_KERNEL::Exception(msg);
3983        }
3984    }
3985
3986    DataArrayDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3987    {
3988      const char msg[]="Unexpected situation in __sub__ !";
3989      double val;
3990      DataArrayDouble *a;
3991      DataArrayDoubleTuple *aa;
3992      std::vector<double> bb;
3993      int sw;
3994      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3995      switch(sw)
3996        {
3997        case 1:
3998          {
3999            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4000            ret->applyLin(1.,-val);
4001            ret->incrRef();
4002            return ret;
4003          }
4004        case 2:
4005          {
4006            return DataArrayDouble::Substract(self,a);
4007          }
4008        case 3:
4009          {
4010            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4011            return DataArrayDouble::Substract(self,aaa);
4012          }
4013        case 4:
4014          {
4015            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4016            return DataArrayDouble::Substract(self,aaa);
4017          }
4018        default:
4019          throw INTERP_KERNEL::Exception(msg);
4020        }
4021    }
4022
4023    DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4024    {
4025      const char msg[]="Unexpected situation in __rsub__ !";
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            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4037            ret->applyLin(-1.,val);
4038            ret->incrRef();
4039            return ret;
4040          }
4041        case 3:
4042          {
4043            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4044            return DataArrayDouble::Substract(aaa,self);
4045          }
4046        case 4:
4047          {
4048            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4049            return DataArrayDouble::Substract(aaa,self);
4050          }
4051        default:
4052          throw INTERP_KERNEL::Exception(msg);
4053        }
4054    }
4055
4056    PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4057    {
4058      const char msg[]="Unexpected situation in __isub__ !";
4059      double val;
4060      DataArrayDouble *a;
4061      DataArrayDoubleTuple *aa;
4062      std::vector<double> bb;
4063      int sw;
4064      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4065      switch(sw)
4066        {
4067        case 1:
4068          {
4069            self->applyLin(1,-val);
4070            Py_XINCREF(trueSelf);
4071            return trueSelf;
4072          }
4073        case 2:
4074          {
4075            self->substractEqual(a);
4076            Py_XINCREF(trueSelf);
4077            return trueSelf;
4078          }
4079        case 3:
4080          {
4081            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4082            self->substractEqual(aaa);
4083            Py_XINCREF(trueSelf);
4084            return trueSelf;
4085          }
4086        case 4:
4087          {
4088            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4089            self->substractEqual(aaa);
4090            Py_XINCREF(trueSelf);
4091            return trueSelf;
4092          }
4093        default:
4094          throw INTERP_KERNEL::Exception(msg);
4095        }
4096    }
4097
4098    DataArrayDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4099    {
4100      const char msg[]="Unexpected situation in __mul__ !";
4101      double val;
4102      DataArrayDouble *a;
4103      DataArrayDoubleTuple *aa;
4104      std::vector<double> bb;
4105      int sw;
4106      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4107      switch(sw)
4108        {
4109        case 1:
4110          {
4111            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4112            ret->applyLin(val,0.);
4113            ret->incrRef();
4114            return ret;
4115          }
4116        case 2:
4117          {
4118            return DataArrayDouble::Multiply(self,a);
4119          }
4120        case 3:
4121          {
4122            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4123            return DataArrayDouble::Multiply(self,aaa);
4124          }
4125        case 4:
4126          {
4127            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4128            return DataArrayDouble::Multiply(self,aaa);
4129          }
4130        default:
4131          throw INTERP_KERNEL::Exception(msg);
4132        }
4133    }
4134
4135    DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4136    {
4137      const char msg[]="Unexpected situation in __rmul__ !";
4138      double val;
4139      DataArrayDouble *a;
4140      DataArrayDoubleTuple *aa;
4141      std::vector<double> bb;
4142      int sw;
4143      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4144      switch(sw)
4145        {
4146        case 1:
4147          {
4148            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4149            ret->applyLin(val,0.);
4150            ret->incrRef();
4151            return ret;
4152          }
4153        case 3:
4154          {
4155            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4156            return DataArrayDouble::Multiply(self,aaa);
4157          }
4158        case 4:
4159          {
4160            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4161            return DataArrayDouble::Multiply(self,aaa);
4162          }
4163        default:
4164          throw INTERP_KERNEL::Exception(msg);
4165        }
4166    }
4167
4168    PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4169    {
4170      const char msg[]="Unexpected situation in __imul__ !";
4171      double val;
4172      DataArrayDouble *a;
4173      DataArrayDoubleTuple *aa;
4174      std::vector<double> bb;
4175      int sw;
4176      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4177      switch(sw)
4178        {
4179        case 1:
4180          {
4181            self->applyLin(val,0.);
4182            Py_XINCREF(trueSelf);
4183            return trueSelf;
4184          }
4185        case 2:
4186          {
4187            self->multiplyEqual(a);
4188            Py_XINCREF(trueSelf);
4189            return trueSelf;
4190          }
4191        case 3:
4192          {
4193            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4194            self->multiplyEqual(aaa);
4195            Py_XINCREF(trueSelf);
4196            return trueSelf;
4197          }
4198        case 4:
4199          {
4200            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4201            self->multiplyEqual(aaa);
4202            Py_XINCREF(trueSelf);
4203            return trueSelf;
4204          }
4205        default:
4206          throw INTERP_KERNEL::Exception(msg);
4207        }
4208    }
4209
4210    DataArrayDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4211    {
4212      const char msg[]="Unexpected situation in __div__ !";
4213      double val;
4214      DataArrayDouble *a;
4215      DataArrayDoubleTuple *aa;
4216      std::vector<double> bb;
4217      int sw;
4218      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4219      switch(sw)
4220        {
4221        case 1:
4222          {
4223            if(val==0.)
4224              throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4225            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4226            ret->applyLin(1/val,0.);
4227            ret->incrRef();
4228            return ret;
4229          }
4230        case 2:
4231          {
4232            return DataArrayDouble::Divide(self,a);
4233          }
4234        case 3:
4235          {
4236            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4237            return DataArrayDouble::Divide(self,aaa);
4238          }
4239        case 4:
4240          {
4241            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4242            return DataArrayDouble::Divide(self,aaa);
4243          }
4244        default:
4245          throw INTERP_KERNEL::Exception(msg);
4246        }
4247    }
4248
4249    DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4250    {
4251      const char msg[]="Unexpected situation in __rdiv__ !";
4252      double val;
4253      DataArrayDouble *a;
4254      DataArrayDoubleTuple *aa;
4255      std::vector<double> bb;
4256      int sw;
4257      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4258      switch(sw)
4259        {
4260        case 1:
4261          {
4262            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4263            ret->applyInv(val);
4264            ret->incrRef();
4265            return ret;
4266          }
4267        case 3:
4268          {
4269            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4270            return DataArrayDouble::Divide(aaa,self);
4271          }
4272        case 4:
4273          {
4274            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4275            return DataArrayDouble::Divide(aaa,self);
4276          }
4277        default:
4278          throw INTERP_KERNEL::Exception(msg);
4279        }
4280    }
4281
4282    PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4283    {
4284      const char msg[]="Unexpected situation in __idiv__ !";
4285      double val;
4286      DataArrayDouble *a;
4287      DataArrayDoubleTuple *aa;
4288      std::vector<double> bb;
4289      int sw;
4290      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4291      switch(sw)
4292        {
4293        case 1:
4294          {
4295            if(val==0.)
4296              throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4297            self->applyLin(1./val,0.);
4298            Py_XINCREF(trueSelf);
4299            return trueSelf;
4300          }
4301        case 2:
4302          {
4303            self->divideEqual(a);
4304            Py_XINCREF(trueSelf);
4305            return trueSelf;
4306          }
4307        case 3:
4308          {
4309            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4310            self->divideEqual(aaa);
4311            Py_XINCREF(trueSelf);
4312            return trueSelf;
4313          }
4314        case 4:
4315          {
4316            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4317            self->divideEqual(aaa);
4318            Py_XINCREF(trueSelf);
4319            return trueSelf;
4320          }
4321        default:
4322          throw INTERP_KERNEL::Exception(msg);
4323        }
4324    }
4325    
4326    PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
4327    {
4328      DataArrayInt *c=0,*cI=0;
4329      //
4330      self->computeTupleIdsNearTuples(other,eps,c,cI);
4331      PyObject *ret=PyTuple_New(2);
4332      PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4333      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4334      return ret;
4335    }
4336  };
4337
4338 %extend ParaMEDMEM::DataArrayIntTuple
4339 {
4340   std::string __str__() const
4341   {
4342     return self->repr();
4343   }
4344
4345   int __int__() const throw(INTERP_KERNEL::Exception)
4346   {
4347     return self->intValue();
4348   }
4349
4350   DataArrayInt *buildDAInt()
4351   {
4352     return self->buildDAInt(1,self->getNumberOfCompo());
4353   }
4354
4355   PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4356   {
4357     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4358     ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4359     Py_XINCREF(trueSelf);
4360     return trueSelf;
4361   }
4362   
4363   PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4364   {
4365     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4366     ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4367     Py_XINCREF(trueSelf);
4368     return trueSelf;
4369   }
4370   
4371   PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4372   {
4373     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4374     ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4375     Py_XINCREF(trueSelf);
4376     return trueSelf;
4377   }
4378
4379   PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4380   {
4381     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4382     ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4383     Py_XINCREF(trueSelf);
4384     return trueSelf;
4385   }
4386
4387   PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4388   {
4389     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4390     ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4391     Py_XINCREF(trueSelf);
4392     return trueSelf;
4393   }
4394   
4395   PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4396   {
4397     int sw;
4398     int singleVal;
4399     std::vector<int> multiVal;
4400     std::pair<int, std::pair<int,int> > slic;
4401     ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4402     const int *pt=self->getConstPointer();
4403     int nbc=self->getNumberOfCompo();
4404     convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4405     switch(sw)
4406       {
4407       case 1:
4408         {
4409           if(singleVal>=nbc)
4410             {
4411               std::ostringstream oss;
4412               oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4413               throw INTERP_KERNEL::Exception(oss.str().c_str());
4414             }
4415           if(singleVal>=0)
4416             return PyInt_FromLong(pt[singleVal]);
4417           else
4418             {
4419               if(nbc+singleVal>0)
4420                 return PyInt_FromLong(pt[nbc+singleVal]);
4421               else
4422                 {
4423                   std::ostringstream oss;
4424                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4425                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4426                 }
4427             }
4428         }
4429       case 2:
4430         {
4431           PyObject *t=PyTuple_New(multiVal.size());
4432           for(int j=0;j<(int)multiVal.size();j++)
4433             {
4434               int cid=multiVal[j];
4435               if(cid>=nbc)
4436                 {
4437                   std::ostringstream oss;
4438                   oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4439                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4440                 }
4441               PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4442             }
4443           return t;
4444         }
4445       case 3:
4446           {
4447             int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4448             PyObject *t=PyTuple_New(sz);
4449             for(int j=0;j<sz;j++)
4450               PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4451             return t;
4452           }
4453       default:
4454         throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4455       }
4456   }
4457
4458   DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4459   {
4460      const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4461      int sw1,sw2;
4462      int singleValV;
4463      std::vector<int> multiValV;
4464      std::pair<int, std::pair<int,int> > slicV;
4465      ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4466      int nbc=self->getNumberOfCompo();
4467      convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4468      int singleVal;
4469      std::vector<int> multiVal;
4470      std::pair<int, std::pair<int,int> > slic;
4471      ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4472      int *pt=self->getPointer();
4473      convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4474      switch(sw2)
4475        {
4476        case 1:
4477          {
4478            if(singleVal>=nbc)
4479             {
4480               std::ostringstream oss;
4481               oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4482               throw INTERP_KERNEL::Exception(oss.str().c_str());
4483             }
4484            switch(sw1)
4485              {
4486              case 1:
4487                {
4488                  pt[singleVal]=singleValV;
4489                  return self;
4490                }
4491              case 2:
4492                {
4493                  if(multiValV.size()!=1)
4494                    {
4495                      std::ostringstream oss;
4496                      oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4497                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4498                    }
4499                  pt[singleVal]=multiValV[0];
4500                  return self;
4501                }
4502              case 4:
4503                {
4504                  pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4505                  return self;
4506                }
4507              default:
4508                throw INTERP_KERNEL::Exception(msg);
4509              }
4510          }
4511        case 2:
4512          {
4513            switch(sw1)
4514              {
4515              case 1:
4516                {
4517                  for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4518                    {
4519                      if(*it>=nbc)
4520                        {
4521                          std::ostringstream oss;
4522                          oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4523                          throw INTERP_KERNEL::Exception(oss.str().c_str());
4524                        }
4525                      pt[*it]=singleValV;
4526                    }
4527                  return self;
4528                }
4529              case 2:
4530                {
4531                  if(multiVal.size()!=multiValV.size())
4532                    {
4533                      std::ostringstream oss;
4534                      oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4535                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4536                    }
4537                  for(int i=0;i<(int)multiVal.size();i++)
4538                    {
4539                      int pos=multiVal[i];
4540                      if(pos>=nbc)
4541                        {
4542                          std::ostringstream oss;
4543                          oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4544                          throw INTERP_KERNEL::Exception(oss.str().c_str());
4545                        }
4546                      pt[multiVal[i]]=multiValV[i];
4547                    }
4548                  return self;
4549                }
4550              case 4:
4551                {
4552                  const int *ptV=daIntTyyppV->getConstPointer();
4553                  if(nbc>daIntTyyppV->getNumberOfCompo())
4554                    {
4555                      std::ostringstream oss;
4556                      oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4557                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4558                    }
4559                  std::copy(ptV,ptV+nbc,pt);
4560                  return self;
4561                }
4562              default:
4563                throw INTERP_KERNEL::Exception(msg);
4564              }
4565          }
4566        case 3:
4567          {
4568            int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4569            switch(sw1)
4570              {
4571              case 1:
4572                {
4573                  for(int j=0;j<sz;j++)
4574                    pt[slic.first+j*slic.second.second]=singleValV;
4575                  return self;
4576                }
4577              case 2:
4578                {
4579                  if(sz!=(int)multiValV.size())
4580                    {
4581                      std::ostringstream oss;
4582                      oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4583                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4584                    }
4585                  for(int j=0;j<sz;j++)
4586                    pt[slic.first+j*slic.second.second]=multiValV[j];
4587                  return self;
4588                }
4589              case 4:
4590                {
4591                  const int *ptV=daIntTyyppV->getConstPointer();
4592                  if(sz>daIntTyyppV->getNumberOfCompo())
4593                    {
4594                      std::ostringstream oss;
4595                      oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4596                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4597                    }
4598                  for(int j=0;j<sz;j++)
4599                    pt[slic.first+j*slic.second.second]=ptV[j];
4600                  return self;
4601                }
4602              default:
4603                throw INTERP_KERNEL::Exception(msg);
4604              }
4605          }
4606        default:
4607          throw INTERP_KERNEL::Exception(msg);
4608        }
4609    }
4610 }
4611
4612 %extend ParaMEDMEM::DataArrayIntIterator
4613 {
4614   PyObject *next()
4615   {
4616     DataArrayIntTuple *ret=self->nextt();
4617     if(ret)
4618       return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4619     else
4620       {
4621         PyErr_SetString(PyExc_StopIteration,"No more data.");
4622         return 0;
4623       }
4624   }
4625 }
4626
4627 %extend ParaMEDMEM::DataArrayInt
4628  {
4629    DataArrayInt() throw(INTERP_KERNEL::Exception)
4630    {
4631      return DataArrayInt::New();
4632    }
4633
4634    static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4635    {
4636      const char *msg="ParaMEDMEM::DataArrayInt::New : Available API are : \n-DataArrayInt.New()\n--DataArrayInt.New([1,3,4])\n-DataArrayInt.New([1,3,4],3)\n-DataArrayInt.New([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n-DataArrayInt.New(5,2) !";
4637      if(PyList_Check(elt0) || PyTuple_Check(elt0))
4638        {
4639          if(nbOfTuples)
4640            {
4641              if(PyInt_Check(nbOfTuples))
4642                {
4643                  int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4644                  if(nbOfTuples1<0)
4645                    throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4646                  if(nbOfComp)
4647                    {
4648                      if(PyInt_Check(nbOfComp))
4649                        {//DataArrayInt.New([1,3,4,5],2,2)
4650                          int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4651                          if(nbOfCompo<0)
4652                            throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4653                          MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4654                          std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
4655                          ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4656                          ret->incrRef();
4657                          return ret;
4658                        }
4659                      else
4660                        throw INTERP_KERNEL::Exception(msg);
4661                    }
4662                  else
4663                    {//DataArrayInt.New([1,3,4],3)
4664                      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4665                      int tmpp1=-1;
4666                      std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
4667                      ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4668                      ret->incrRef();
4669                      return ret;
4670                    }
4671                }
4672              else
4673                throw INTERP_KERNEL::Exception(msg);
4674            }
4675          else
4676            {// DataArrayInt.New([1,3,4])
4677              MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4678              int tmpp1=-1,tmpp2=-1;
4679              std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
4680              ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
4681              ret->incrRef();
4682              return ret;
4683            }
4684        }
4685      else if(PyInt_Check(elt0))
4686        {
4687          int nbOfTuples1=PyInt_AS_LONG(elt0);
4688          if(nbOfTuples1<0)
4689            throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4690          if(nbOfTuples)
4691            {
4692              if(!nbOfComp)
4693                {
4694                  if(PyInt_Check(nbOfTuples))
4695                    {//DataArrayInt.New(5,2)
4696                      int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
4697                      if(nbOfCompo<0)
4698                        throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4699                      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4700                      ret->alloc(nbOfTuples1,nbOfCompo);
4701                      ret->incrRef();
4702                      return ret;
4703                    }
4704                  else
4705                    throw INTERP_KERNEL::Exception(msg);
4706                }
4707              else
4708                throw INTERP_KERNEL::Exception(msg);
4709            }
4710          else
4711            {//DataArrayInt.New(5)
4712              MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4713              ret->alloc(nbOfTuples1,1);
4714              ret->incrRef();
4715              return ret;
4716            }
4717        }
4718      else
4719        throw INTERP_KERNEL::Exception(msg);
4720    }
4721
4722    DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4723    {
4724      return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
4725    }
4726
4727    std::string __str__() const
4728    {
4729      return self->repr();
4730    }
4731
4732    int __len__() const throw(INTERP_KERNEL::Exception)
4733    {
4734      if(self->isAllocated())
4735        {
4736          return self->getNumberOfTuples();
4737        }
4738      else
4739        {
4740          throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
4741        }
4742    }
4743
4744    int __int__() const throw(INTERP_KERNEL::Exception)
4745    {
4746      return self->intValue();
4747    }
4748
4749    DataArrayIntIterator *__iter__()
4750    {
4751      return self->iterator();
4752    }
4753    
4754    PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4755    {
4756      int sz=self->getNumberOfComponents();
4757      INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
4758      self->accumulate(tmp);
4759      return convertIntArrToPyList(tmp,sz);
4760    }
4761    
4762    static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
4763    {
4764      int newNbOfTuples=-1;
4765      int szArr,szArrI,sw,iTypppArr,iTypppArrI;
4766      std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
4767      const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
4768      const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
4769      DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
4770      PyObject *ret=PyTuple_New(2);
4771      PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
4772      PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
4773      return ret;
4774    }
4775
4776    void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4777    {
4778      const char *msg="ParaMEDMEM::DataArrayInt::setValues : Available API are : \n-DataArrayInt.setValues([1,3,4])\n-DataArrayInt.setValues([1,3,4],3)\n-DataArrayInt.setValues([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n !";
4779      if(PyList_Check(li) || PyTuple_Check(li))
4780        {
4781          if(nbOfTuples)
4782            {
4783              if(PyInt_Check(nbOfTuples))
4784                {
4785                  int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
4786                  if(nbOfTuples<0)
4787                    throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
4788                  if(nbOfComp)
4789                    {
4790                      if(PyInt_Check(nbOfComp))
4791                        {//DataArrayInt.setValues([1,3,4,5],2,2)
4792                          int nbOfCompo=PyInt_AS_LONG(nbOfComp);
4793                          if(nbOfCompo<0)
4794                            throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
4795                          std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
4796                          self->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4797                        }
4798                      else
4799                        throw INTERP_KERNEL::Exception(msg);
4800                    }
4801                  else
4802                    {//DataArrayInt.setValues([1,3,4],3)
4803                      int tmpp1=-1;
4804                      std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,tmpp1);
4805                      self->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4806                    }
4807                }
4808              else
4809                throw INTERP_KERNEL::Exception(msg);
4810            }
4811          else
4812            {// DataArrayInt.setValues([1,3,4])
4813              int tmpp1=-1,tmpp2=-1;
4814              std::vector<int> tmp=fillArrayWithPyListInt2(li,tmpp1,tmpp2);
4815              self->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),self->getPointer());
4816            }
4817        }
4818      else
4819        throw INTERP_KERNEL::Exception(msg);
4820    }
4821
4822    PyObject *getValues() throw(INTERP_KERNEL::Exception)
4823    {
4824      const int *vals=self->getPointer();
4825      return convertIntArrToPyList(vals,self->getNbOfElems());
4826    }
4827
4828    PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
4829    {
4830      std::string ret1;
4831      bool ret0=self->isEqualIfNotWhy(other,ret1);
4832      PyObject *ret=PyTuple_New(2);
4833      PyObject *ret0Py=ret0?Py_True:Py_False;
4834      Py_XINCREF(ret0Py);
4835      PyTuple_SetItem(ret,0,ret0Py);
4836      PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4837      return ret;
4838    }
4839
4840    PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
4841    {
4842      const int *vals=self->getPointer();
4843      int nbOfComp=self->getNumberOfComponents();
4844      int nbOfTuples=self->getNumberOfTuples();
4845      return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4846    }
4847
4848    static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
4849    {
4850      std::vector<const DataArrayInt *> groups;
4851      std::vector< std::vector<int> > fidsOfGroups;
4852      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
4853      ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
4854      PyObject *ret = PyList_New(2);
4855      PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4856      int sz=fidsOfGroups.size();
4857      PyObject *ret1 = PyList_New(sz);
4858      for(int i=0;i<sz;i++)
4859        PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
4860      PyList_SetItem(ret,1,ret1);
4861      return ret;
4862    }
4863
4864    void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
4865    {
4866      void *da=0;
4867      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4868      if (!SWIG_IsOK(res1))
4869        {
4870          int size;
4871          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4872          self->transformWithIndArr(tmp,tmp+size);
4873        }
4874      else
4875        {
4876          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4877          self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4878        }
4879    }
4880
4881    DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4882    {
4883      int sw;
4884      int singleVal;
4885      std::vector<int> multiVal;
4886      std::pair<int, std::pair<int,int> > slic;
4887      ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4888      convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4889      switch(sw)
4890        {
4891        case 1:
4892          return self->getIdsEqualList(&singleVal,&singleVal+1);
4893        case 2:
4894          return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4895        case 4:
4896          return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
4897        default:
4898          throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4899        }
4900    }
4901
4902    DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4903    {
4904      int sw;
4905      int singleVal;
4906      std::vector<int> multiVal;
4907      std::pair<int, std::pair<int,int> > slic;
4908      ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4909      convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4910      switch(sw)
4911        {
4912        case 1:
4913          return self->getIdsNotEqualList(&singleVal,&singleVal+1);
4914        case 2:
4915          return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4916        case 4:
4917          return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
4918        default:
4919          throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4920        }
4921    }
4922
4923    PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
4924    {
4925      DataArrayInt *ret0=0,*ret1=0,*ret2=0;
4926      void *da=0;
4927      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4928      if (!SWIG_IsOK(res1))
4929        {
4930          int size;
4931          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4932          self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
4933        }
4934      else
4935        {
4936          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4937          if(!da2)
4938            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4939          da2->checkAllocated();
4940          int size=self->getNumberOfTuples();
4941          self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
4942        }
4943      PyObject *ret = PyList_New(3);
4944      PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4945      PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4946      PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4947      return ret;
4948    }
4949
4950    DataArrayInt *transformWithIndArrR(PyObject *li) const
4951    {
4952      void *da=0;
4953      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4954      if (!SWIG_IsOK(res1))
4955        {
4956          int size;
4957          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4958          return self->transformWithIndArrR(tmp,tmp+size);
4959        }
4960      else
4961        {
4962          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4963          return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4964        }
4965    }
4966
4967    void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4968    {
4969      void *da=0;
4970      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4971      if (!SWIG_IsOK(res1))
4972        {
4973          int size;
4974          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4975          if(size!=self->getNumberOfTuples())
4976            {
4977              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4978            }
4979          self->renumberInPlace(tmp);
4980        }
4981      else
4982        {
4983          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4984          if(!da2)
4985            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4986          da2->checkAllocated();
4987          int size=self->getNumberOfTuples();
4988          if(size!=self->getNumberOfTuples())
4989            {
4990              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4991            }
4992          self->renumberInPlace(da2->getConstPointer());
4993        }
4994    }
4995
4996    void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4997    {
4998      void *da=0;
4999      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
5000      if (!SWIG_IsOK(res1))
5001        {
5002          int size;
5003          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5004          if(size!=self->getNumberOfTuples())
5005            {
5006              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5007            }
5008          self->renumberInPlaceR(tmp);
5009        }
5010      else
5011        {
5012          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5013          if(!da2)
5014            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5015          da2->checkAllocated();
5016          int size=self->getNumberOfTuples();
5017          if(size!=self->getNumberOfTuples())
5018            {
5019              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5020            }
5021          self->renumberInPlaceR(da2->getConstPointer());
5022        }
5023    }
5024
5025    DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
5026    {
5027      void *da=0;
5028      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
5029      if (!SWIG_IsOK(res1))
5030        {
5031          int size;
5032          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5033          if(size!=self->getNumberOfTuples())
5034            {
5035              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5036            }
5037          return self->renumberAndReduce(tmp,newNbOfTuple);
5038        }
5039      else
5040        {
5041          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5042          if(!da2)
5043            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5044          da2->checkAllocated();
5045          int size=self->getNumberOfTuples();
5046          if(size!=self->getNumberOfTuples())
5047            {
5048              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5049            }
5050          return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
5051        }
5052    }
5053
5054    DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
5055    {
5056      void *da=0;
5057      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
5058      if (!SWIG_IsOK(res1))
5059        {
5060          int size;
5061          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5062          if(size!=self->getNumberOfTuples())
5063            {
5064              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5065            }
5066          return self->renumber(tmp);
5067        }
5068      else
5069        {
5070          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5071          if(!da2)
5072            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5073          da2->checkAllocated();
5074          int size=self->getNumberOfTuples();
5075          if(size!=self->getNumberOfTuples())
5076            {
5077              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5078            }
5079          return self->renumber(da2->getConstPointer());
5080        }
5081    }
5082
5083    DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
5084    {
5085      void *da=0;
5086      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
5087      if (!SWIG_IsOK(res1))
5088        {
5089          int size;
5090          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5091          if(size!=self->getNumberOfTuples())
5092            {
5093              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5094            }
5095          return self->renumberR(tmp);
5096        }
5097      else
5098        {
5099          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5100          if(!da2)
5101            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5102          da2->checkAllocated();
5103          int size=self->getNumberOfTuples();
5104          if(size!=self->getNumberOfTuples())
5105            {
5106              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
5107            }
5108          return self->renumberR(da2->getConstPointer());
5109        }
5110    }
5111
5112    DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
5113    {
5114      void *da=0;
5115      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
5116      if (!SWIG_IsOK(res1))
5117        {
5118          int size;
5119          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5120          return self->selectByTupleId(tmp,tmp+size);
5121        }
5122      else
5123        {
5124          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5125          if(!da2)
5126           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5127          da2->checkAllocated();
5128          return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5129        }
5130    }
5131
5132    DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
5133    {
5134      void *da=0;
5135      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
5136      if (!SWIG_IsOK(res1))
5137        {
5138          int size;
5139          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
5140          return self->selectByTupleIdSafe(tmp,tmp+size);
5141        }
5142      else
5143        {
5144          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
5145          if(!da2)
5146           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
5147          da2->checkAllocated();
5148          return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
5149        }
5150    }
5151
5152    DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
5153    {
5154      std::vector<int> tmp;
5155      convertPyToNewIntArr3(li,tmp);
5156      return self->keepSelectedComponents(tmp);
5157    }
5158
5159    void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
5160    {
5161      std::vector<int> tmp;
5162      convertPyToNewIntArr3(li,tmp);
5163      self->setSelectedComponents(a,tmp);
5164    }
5165
5166    PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
5167    {
5168      int sz=self->getNumberOfComponents();
5169      INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
5170      self->getTuple(tupleId,tmp);
5171      return convertIntArrToPyList(tmp,sz);
5172    }
5173
5174    PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
5175    {
5176      DataArrayInt *arr=0;
5177      DataArrayInt *arrI=0;
5178      self->changeSurjectiveFormat(targetNb,arr,arrI);
5179      PyObject *res = PyList_New(2);
5180      PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5181      PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
5182      return res;
5183    }
5184
5185    DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
5186    {
5187      std::vector<std::pair<int,int> > ranges;
5188      convertPyToVectorPairInt(li,ranges);
5189      return self->selectByTupleRanges(ranges);
5190    }
5191
5192    static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
5193    {
5194      std::vector<const DataArrayInt *> tmp;
5195      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5196      return DataArrayInt::Meld(tmp);
5197    }
5198
5199    static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
5200    {
5201      std::vector<const DataArrayInt *> tmp;
5202      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5203      return DataArrayInt::Aggregate(tmp);
5204    }
5205
5206    static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
5207    {
5208      std::vector<const DataArrayInt *> tmp;
5209      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5210      return DataArrayInt::BuildUnion(tmp);
5211    }
5212
5213    static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
5214    {
5215      std::vector<const DataArrayInt *> tmp;
5216      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
5217      return DataArrayInt::BuildIntersection(tmp);
5218    }
5219
5220    PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
5221    {
5222      int tmp;
5223      int r1=self->getMaxValue(tmp);
5224      PyObject *ret=PyTuple_New(2);
5225      PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5226      PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5227      return ret;
5228    }
5229
5230    PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
5231    {
5232      int tmp;
5233      int r1=self->getMinValue(tmp);
5234      PyObject *ret=PyTuple_New(2);
5235      PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
5236      PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
5237      return ret;
5238    }
5239
5240    int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5241    {
5242      int nbOfCompo=self->getNumberOfComponents();
5243      switch(nbOfCompo)
5244        {
5245          case 1:
5246          {
5247            if(PyInt_Check(obj))
5248              {
5249                int val=(int)PyInt_AS_LONG(obj);
5250                return self->locateValue(val);
5251              }
5252            else
5253              throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
5254          }
5255        default:
5256          {
5257            std::vector<int> arr;
5258            convertPyToNewIntArr3(obj,arr);
5259            return self->locateTuple(arr);
5260          }
5261        }
5262    }
5263
5264    bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5265    {
5266      int nbOfCompo=self->getNumberOfComponents();
5267      switch(nbOfCompo)
5268        {
5269        case 0:
5270          return false;
5271        case 1:
5272          {
5273            if(PyInt_Check(obj))
5274              {
5275                int val=(int)PyInt_AS_LONG(obj);
5276                return self->presenceOfValue(val);
5277              }
5278            else
5279              throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5280          }
5281        default:
5282          {
5283            std::vector<int> arr;
5284            convertPyToNewIntArr3(obj,arr);
5285            return self->presenceOfTuple(arr);
5286          }
5287        }
5288    }
5289
5290    PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5291    {
5292      const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
5293      self->checkAllocated();
5294      int nbOfTuples=self->getNumberOfTuples();
5295      int nbOfComponents=self->getNumberOfComponents();
5296      int it1,ic1;
5297      std::vector<int> vt1,vc1;
5298      std::pair<int, std::pair<int,int> > pt1,pc1;
5299      DataArrayInt *dt1=0,*dc1=0;
5300      int sw;
5301      convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5302      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
5303      switch(sw)
5304        {
5305        case 1:
5306          {
5307            if(nbOfComponents==1)
5308              return PyInt_FromLong(self->getIJSafe(it1,0));
5309            return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5310          }
5311        case 2:
5312          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5313        case 3:
5314          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5315        case 4:
5316          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5317        case 5:
5318          return PyInt_FromLong(self->getIJSafe(it1,ic1));
5319        case 6:
5320          {
5321            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5322            std::vector<int> v2(1,ic1);
5323            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5324          }
5325        case 7:
5326          {
5327            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5328            std::vector<int> v2(1,ic1);
5329            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5330          }
5331        case 8:
5332          {
5333            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5334            std::vector<int> v2(1,ic1);
5335            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5336          }
5337        case 9:
5338          {
5339            ret=self->selectByTupleIdSafe(&it1,&it1+1);
5340            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5341          }
5342        case 10:
5343          {
5344            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5345            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5346          }
5347        case 11:
5348          {
5349            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5350            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5351          }
5352        case 12:
5353          {
5354            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5355            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5356          }
5357        case 13:
5358          {
5359            ret=self->selectByTupleIdSafe(&it1,&it1+1);
5360            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5361            std::vector<int> v2(nbOfComp);
5362            for(int i=0;i<nbOfComp;i++)
5363              v2[i]=pc1.first+i*pc1.second.second;
5364            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5365          }
5366        case 14:
5367          {
5368            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5369            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5370            std::vector<int> v2(nbOfComp);
5371            for(int i=0;i<nbOfComp;i++)
5372              v2[i]=pc1.first+i*pc1.second.second;
5373            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5374          }
5375        case 15:
5376          {
5377            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5378            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5379            std::vector<int> v2(nbOfComp);
5380            for(int i=0;i<nbOfComp;i++)
5381              v2[i]=pc1.first+i*pc1.second.second;
5382            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5383          }
5384        case 16:
5385          {
5386            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5387            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5388            std::vector<int> v2(nbOfComp);
5389            for(int i=0;i<nbOfComp;i++)
5390              v2[i]=pc1.first+i*pc1.second.second;
5391            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5392          }
5393        default:
5394          throw INTERP_KERNEL::Exception(msg);
5395        }
5396    }
5397
5398    DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5399    {
5400      self->checkAllocated();
5401      const char msg[]="Unexpected situation in __setitem__ !";
5402      int nbOfTuples=self->getNumberOfTuples();
5403      int nbOfComponents=self->getNumberOfComponents();
5404      int sw1,sw2;
5405      int i1;
5406      std::vector<int> v1;
5407      DataArrayInt *d1=0;
5408      DataArrayIntTuple *dd1=0;
5409      convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5410      int it1,ic1;
5411      std::vector<int> vt1,vc1;
5412      std::pair<int, std::pair<int,int> > pt1,pc1;
5413      DataArrayInt *dt1=0,*dc1=0;
5414      convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5415      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5416      switch(sw2)
5417        {
5418        case 1:
5419          {
5420            switch(sw1)
5421              {
5422              case 1:
5423                self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5424                return self;
5425              case 2:
5426                tmp=DataArrayInt::New();
5427                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5428                self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
5429                return self;
5430              case 3:
5431                self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
5432                return self;
5433              case 4:
5434                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5435                self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
5436                return self;
5437              default:
5438                throw INTERP_KERNEL::Exception(msg);
5439              }
5440            break;
5441          }
5442        case 2:
5443          {
5444            switch(sw1)
5445              {
5446              case 1:
5447                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5448                return self;
5449              case 2:
5450                tmp=DataArrayInt::New();
5451                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5452                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
5453                return self;
5454              case 3:
5455                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5456                return self;
5457              case 4:
5458                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5459                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5460                return self;
5461              default:
5462                throw INTERP_KERNEL::Exception(msg);
5463              }
5464            break;
5465          }
5466        case 3:
5467          {
5468            switch(sw1)
5469              {
5470              case 1:
5471                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5472                return self;
5473              case 2:
5474                tmp=DataArrayInt::New();
5475                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5476                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
5477                return self;
5478              case 3:
5479                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5480                return self;
5481              case 4:
5482                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5483                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5484                return self;
5485              default:
5486                throw INTERP_KERNEL::Exception(msg);
5487              }
5488            break;
5489          }
5490        case 4:
5491          {
5492            switch(sw1)
5493              {
5494              case 1:
5495                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5496                return self;
5497              case 2:
5498                tmp=DataArrayInt::New();
5499                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5500                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
5501                return self;
5502              case 3:
5503                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5504                return self;
5505              case 4:
5506                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5507                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5508                return self;
5509              default:
5510                throw INTERP_KERNEL::Exception(msg);
5511              }
5512            break;
5513          }
5514        case 5:
5515          {
5516            switch(sw1)
5517              {
5518              case 1:
5519                self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5520                return self;
5521              case 2:
5522                tmp=DataArrayInt::New();
5523                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5524                self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
5525                return self;
5526              case 3:
5527                self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
5528                return self;
5529              case 4:
5530                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5531                self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
5532                return self;
5533              default:
5534                throw INTERP_KERNEL::Exception(msg);
5535              }
5536            break;
5537          }
5538        case 6:
5539          {
5540            switch(sw1)
5541              {
5542              case 1:
5543                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5544                return self;
5545              case 2:
5546                tmp=DataArrayInt::New();
5547                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5548                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
5549                return self;
5550              case 3:
5551                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5552                return self;
5553              case 4:
5554                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5555                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5556                return self;
5557              default:
5558                throw INTERP_KERNEL::Exception(msg);
5559              }
5560            break;
5561          }
5562        case 7:
5563          {
5564            switch(sw1)
5565              {
5566              case 1:
5567                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5568                return self;
5569              case 2:
5570                tmp=DataArrayInt::New();
5571                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5572                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
5573                return self;
5574              case 3:
5575                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5576                return self;
5577              case 4:
5578                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5579                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5580                return self;
5581              default:
5582                throw INTERP_KERNEL::Exception(msg);
5583              }
5584            break;
5585          }
5586        case 8:
5587          {
5588            switch(sw1)
5589              {
5590              case 1:
5591                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5592                return self;
5593              case 2:
5594                tmp=DataArrayInt::New();
5595                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5596                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
5597                return self;
5598              case 3:
5599                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5600                return self;
5601              case 4:
5602                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5603                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5604                return self;
5605              default:
5606                throw INTERP_KERNEL::Exception(msg);
5607              }
5608            break;
5609          }
5610        case 9:
5611          {
5612            switch(sw1)
5613              {
5614              case 1:
5615                self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5616                return self;
5617              case 2:
5618                tmp=DataArrayInt::New();
5619                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5620                self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
5621                return self;
5622              case 3:
5623                self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5624                return self;
5625              case 4:
5626                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5627                self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5628                return self;
5629              default:
5630                throw INTERP_KERNEL::Exception(msg);
5631              }
5632            break;
5633          }
5634        case 10:
5635          {
5636            switch(sw1)
5637              {
5638              case 1:
5639                self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5640                return self;
5641              case 2:
5642                tmp=DataArrayInt::New();
5643                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5644                self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
5645                return self;
5646              case 3:
5647                self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5648                return self;
5649              case 4:
5650                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5651                self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5652                return self;
5653              default:
5654                throw INTERP_KERNEL::Exception(msg);
5655              }
5656            break;
5657          }
5658        case 11:
5659          {
5660            switch(sw1)
5661              {
5662              case 1:
5663                self->setPartOfValuesSimple4(i1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5664                return self;
5665              case 2:
5666                tmp=DataArrayInt::New();
5667                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5668                self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size(),false);
5669                return self;
5670              case 3:
5671                self->setPartOfValues4(d1,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5672                return self;
5673              case 4:
5674                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5675                self->setPartOfValues4(tmp,pt1.first,pt1.second.first,pt1.second.second,&vc1[0],&vc1[0]+vc1.size());
5676                return self;
5677              default:
5678                throw INTERP_KERNEL::Exception(msg);
5679              }
5680            break;
5681          }
5682        case 12:
5683          {
5684            switch(sw1)
5685              {
5686              case 1:
5687                self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5688                return self;
5689              case 2:
5690                tmp=DataArrayInt::New();
5691                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5692                self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
5693                return self;
5694              case 3:
5695                self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5696                return self;
5697              case 4:
5698                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5699                self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5700                return self;
5701              default:
5702                throw INTERP_KERNEL::Exception(msg);
5703              }
5704            break;
5705          }
5706        case 13:
5707          {
5708            switch(sw1)
5709              {
5710              case 1:
5711                self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5712                return self;
5713              case 2:
5714                tmp=DataArrayInt::New();
5715                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5716                self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
5717                return self;
5718              case 3:
5719                self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5720                return self;
5721              case 4:
5722                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5723                self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5724                return self;
5725              default:
5726                throw INTERP_KERNEL::Exception(msg);
5727              }
5728            break;
5729          }
5730        case 14:
5731          {
5732            switch(sw1)
5733              {
5734              case 1:
5735                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5736                return self;
5737              case 2:
5738                tmp=DataArrayInt::New();
5739                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5740                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
5741                return self;
5742              case 3:
5743                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5744                return self;
5745              case 4:
5746                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5747                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5748                return self;
5749              default:
5750                throw INTERP_KERNEL::Exception(msg);
5751              }
5752            break;
5753          }
5754        case 15:
5755          {
5756            switch(sw1)
5757              {
5758              case 1:
5759                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5760                return self;
5761              case 2:
5762                  tmp=DataArrayInt::New();
5763                  tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5764                  self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
5765                  return self;
5766              case 3:
5767                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5768                return self;
5769              case 4:
5770                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5771                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5772                return self;
5773              default:
5774                throw INTERP_KERNEL::Exception(msg);
5775              }
5776            break;
5777          }
5778        case 16:
5779          {
5780            switch(sw1)
5781              {
5782              case 1:
5783                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5784                return self;
5785              case 2:
5786                tmp=DataArrayInt::New();
5787                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5788                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
5789                return self;
5790              case 3:
5791                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5792                return self;
5793              case 4:
5794                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5795                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5796                return self;
5797              default:
5798                throw INTERP_KERNEL::Exception(msg);
5799              }
5800            break;
5801          }
5802        default:
5803          throw INTERP_KERNEL::Exception(msg);
5804        }
5805      return self;
5806    }
5807
5808    DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
5809    {
5810      return self->negate();
5811    }
5812  
5813    DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5814    {
5815      const char msg[]="Unexpected situation in __add__ !";
5816      int val;
5817      DataArrayInt *a;
5818      std::vector<int> aa;
5819      DataArrayIntTuple *aaa;
5820      int sw;
5821      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5822      switch(sw)
5823        {
5824        case 1:
5825          {
5826            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5827            ret->applyLin(1,val);
5828            ret->incrRef();
5829            return ret;
5830          }
5831        case 2:
5832          {
5833            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5834            return DataArrayInt::Add(self,aaa);
5835          }
5836        case 3:
5837          {
5838            return DataArrayInt::Add(self,a);
5839          }
5840        case 4:
5841          {
5842            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5843            return DataArrayInt::Add(self,aaaa);
5844          }
5845        default:
5846          throw INTERP_KERNEL::Exception(msg);
5847        }
5848    }
5849
5850    DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5851    {
5852      const char msg[]="Unexpected situation in __radd__ !";
5853      int val;
5854      DataArrayInt *a;
5855      std::vector<int> aa;
5856      DataArrayIntTuple *aaa;
5857      int sw;
5858      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5859      switch(sw)
5860        {
5861        case 1:
5862          {
5863            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5864            ret->applyLin(1,val);
5865            ret->incrRef();
5866            return ret;
5867          }
5868        case 2:
5869          {
5870            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5871            return DataArrayInt::Add(self,aaa);
5872          }
5873        case 4:
5874          {
5875            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5876            return DataArrayInt::Add(self,aaaa);
5877          }
5878        default:
5879          throw INTERP_KERNEL::Exception(msg);
5880        }
5881    }
5882
5883    PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5884    {
5885      const char msg[]="Unexpected situation in __iadd__ !";
5886      int val;
5887      DataArrayInt *a;
5888      std::vector<int> aa;
5889      DataArrayIntTuple *aaa;
5890      int sw;
5891      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5892      switch(sw)
5893        {
5894        case 1:
5895          {
5896            self->applyLin(1,val);
5897            Py_XINCREF(trueSelf);
5898            return trueSelf;
5899          }
5900        case 2:
5901          {
5902            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5903            self->addEqual(bb);
5904            Py_XINCREF(trueSelf);
5905            return trueSelf;
5906          }
5907        case 3:
5908          {
5909            self->addEqual(a);
5910            Py_XINCREF(trueSelf);
5911            return trueSelf;
5912          }
5913        case 4:
5914          {
5915            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5916            self->addEqual(aaaa);
5917            Py_XINCREF(trueSelf);
5918            return trueSelf;
5919          }
5920        default:
5921          throw INTERP_KERNEL::Exception(msg);
5922        }
5923    }
5924
5925    DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5926    {
5927      const char msg[]="Unexpected situation in __sub__ !";
5928      int val;
5929      DataArrayInt *a;
5930      std::vector<int> aa;
5931      DataArrayIntTuple *aaa;
5932      int sw;
5933      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5934      switch(sw)
5935        {
5936        case 1:
5937          {
5938            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5939            ret->applyLin(1,-val);
5940            ret->incrRef();
5941            return ret;
5942          }
5943        case 2:
5944          {
5945            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5946            return DataArrayInt::Substract(self,aaa);
5947          }
5948        case 3:
5949          {
5950            return DataArrayInt::Substract(self,a);
5951          }
5952        case 4:
5953          {
5954            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5955            return DataArrayInt::Substract(self,aaaa);
5956          }
5957        default:
5958          throw INTERP_KERNEL::Exception(msg);
5959        }
5960    }
5961
5962    DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5963    {
5964      const char msg[]="Unexpected situation in __rsub__ !";
5965      int val;
5966      DataArrayInt *a;
5967      std::vector<int> aa;
5968      DataArrayIntTuple *aaa;
5969      int sw;
5970      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5971      switch(sw)
5972        {
5973        case 1:
5974          {
5975            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5976            ret->applyLin(-1,val);
5977            ret->incrRef();
5978            return ret;
5979          }
5980        case 2:
5981          {
5982            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5983            return DataArrayInt::Substract(aaa,self);
5984          }
5985        case 4:
5986          {
5987            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5988            return DataArrayInt::Substract(aaaa,self);
5989          }
5990        default:
5991          throw INTERP_KERNEL::Exception(msg);
5992        }
5993    }
5994
5995    PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5996    {
5997      const char msg[]="Unexpected situation in __isub__ !";
5998      int val;
5999      DataArrayInt *a;
6000      std::vector<int> aa;
6001      DataArrayIntTuple *aaa;
6002      int sw;
6003      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6004      switch(sw)
6005        {
6006        case 1:
6007          {
6008            self->applyLin(1,-val);
6009            Py_XINCREF(trueSelf);
6010            return trueSelf;
6011          }
6012        case 2:
6013          {
6014            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6015            self->substractEqual(bb);
6016            Py_XINCREF(trueSelf);
6017            return trueSelf;
6018          }
6019        case 3:
6020          {
6021            self->substractEqual(a);
6022            Py_XINCREF(trueSelf);
6023            return trueSelf;
6024          }
6025        case 4:
6026          {
6027            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6028            self->substractEqual(aaaa);
6029            Py_XINCREF(trueSelf);
6030            return trueSelf;
6031          }
6032        default:
6033          throw INTERP_KERNEL::Exception(msg);
6034        }
6035    }
6036
6037    DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6038    {
6039      const char msg[]="Unexpected situation in __mul__ !";
6040      int val;
6041      DataArrayInt *a;
6042      std::vector<int> aa;
6043      DataArrayIntTuple *aaa;
6044      int sw;
6045      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6046      switch(sw)
6047        {
6048        case 1:
6049          {
6050            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6051            ret->applyLin(val,0);
6052            ret->incrRef();
6053            return ret;
6054          }
6055        case 2:
6056          {
6057            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6058            return DataArrayInt::Multiply(self,aaa);
6059          }
6060        case 3:
6061          {
6062            return DataArrayInt::Multiply(self,a);
6063          }
6064        case 4:
6065          {
6066            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6067            return DataArrayInt::Multiply(self,aaaa);
6068          }
6069        default:
6070          throw INTERP_KERNEL::Exception(msg);
6071        }
6072    }
6073
6074    DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6075    {
6076      const char msg[]="Unexpected situation in __rmul__ !";
6077      int val;
6078      DataArrayInt *a;
6079      std::vector<int> aa;
6080      DataArrayIntTuple *aaa;
6081      int sw;
6082      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6083      switch(sw)
6084        {
6085        case 1:
6086          {
6087            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6088            ret->applyLin(val,0);
6089            ret->incrRef();
6090            return ret;
6091          }
6092        case 2:
6093          {
6094            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6095            return DataArrayInt::Multiply(self,aaa);
6096          }
6097        case 4:
6098          {
6099            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6100            return DataArrayInt::Multiply(self,aaaa);
6101          }
6102        default:
6103          throw INTERP_KERNEL::Exception(msg);
6104        }
6105    }
6106
6107    PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6108    {
6109      const char msg[]="Unexpected situation in __imul__ !";
6110      int val;
6111      DataArrayInt *a;
6112      std::vector<int> aa;
6113      DataArrayIntTuple *aaa;
6114      int sw;
6115      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6116      switch(sw)
6117        {
6118        case 1:
6119          {
6120            self->applyLin(val,0);
6121            Py_XINCREF(trueSelf);
6122            return trueSelf;
6123          }
6124        case 2:
6125          {
6126            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6127            self->multiplyEqual(bb);
6128            Py_XINCREF(trueSelf);
6129            return trueSelf;
6130          }
6131        case 3:
6132          {
6133            self->multiplyEqual(a);
6134            Py_XINCREF(trueSelf);
6135            return trueSelf;
6136          }
6137        case 4:
6138          {
6139            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6140            self->multiplyEqual(aaaa);
6141            Py_XINCREF(trueSelf);
6142            return trueSelf;
6143          }
6144        default:
6145          throw INTERP_KERNEL::Exception(msg);
6146        }
6147    }
6148
6149    DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6150    {
6151      const char msg[]="Unexpected situation in __div__ !";
6152      int val;
6153      DataArrayInt *a;
6154      std::vector<int> aa;
6155      DataArrayIntTuple *aaa;
6156      int sw;
6157      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6158      switch(sw)
6159        {
6160        case 1:
6161          {
6162            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6163            ret->applyDivideBy(val);
6164            ret->incrRef();
6165            return ret;
6166          }
6167        case 2:
6168          {
6169            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6170            return DataArrayInt::Divide(self,aaa);
6171          }
6172        case 3:
6173          {
6174            return DataArrayInt::Divide(self,a);
6175          }
6176        case 4:
6177          {
6178            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6179            return DataArrayInt::Divide(self,aaaa);
6180          }
6181        default:
6182          throw INTERP_KERNEL::Exception(msg);
6183        }
6184    }
6185
6186    DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6187    {
6188      const char msg[]="Unexpected situation in __rdiv__ !";
6189      int val;
6190      DataArrayInt *a;
6191      std::vector<int> aa;
6192      DataArrayIntTuple *aaa;
6193      int sw;
6194      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6195      switch(sw)
6196        {
6197        case 1:
6198          {
6199            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6200            ret->applyInv(val);
6201            ret->incrRef();
6202            return ret;
6203          }
6204        case 2:
6205          {
6206            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6207            return DataArrayInt::Divide(aaa,self);
6208          }
6209        case 4:
6210          {
6211            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6212            return DataArrayInt::Divide(aaaa,self);
6213          }
6214        default:
6215          throw INTERP_KERNEL::Exception(msg);
6216        }
6217    }
6218
6219    PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6220    {
6221      const char msg[]="Unexpected situation in __idiv__ !";
6222      int val;
6223      DataArrayInt *a;
6224      std::vector<int> aa;
6225      DataArrayIntTuple *aaa;
6226      int sw;
6227      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6228      switch(sw)
6229        {
6230        case 1:
6231          {
6232            self->applyDivideBy(val);
6233            Py_XINCREF(trueSelf);
6234            return trueSelf;
6235          }
6236        case 2:
6237          {
6238            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6239            self->divideEqual(bb);
6240            Py_XINCREF(trueSelf);
6241            return trueSelf;
6242          }
6243        case 3:
6244          {
6245            self->divideEqual(a);
6246            Py_XINCREF(trueSelf);
6247            return trueSelf;
6248          }
6249        case 4:
6250          {
6251            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6252            self->divideEqual(aaaa);
6253            Py_XINCREF(trueSelf);
6254            return trueSelf;
6255          }
6256        default:
6257          throw INTERP_KERNEL::Exception(msg);
6258        }
6259    }
6260
6261    DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6262    {
6263      const char msg[]="Unexpected situation in __mod__ !";
6264      int val;
6265      DataArrayInt *a;
6266      std::vector<int> aa;
6267      DataArrayIntTuple *aaa;
6268      int sw;
6269      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6270      switch(sw)
6271        {
6272        case 1:
6273          {
6274            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6275            ret->applyModulus(val);
6276            ret->incrRef();
6277            return ret;
6278          }
6279        case 2:
6280          {
6281            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6282            return DataArrayInt::Modulus(self,aaa);
6283          }
6284        case 3:
6285          {
6286            return DataArrayInt::Modulus(self,a);
6287          }
6288        case 4:
6289          {
6290            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6291            return DataArrayInt::Modulus(self,aaaa);
6292          }
6293        default:
6294          throw INTERP_KERNEL::Exception(msg);
6295        }
6296    }
6297
6298    DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6299    {
6300      const char msg[]="Unexpected situation in __rmod__ !";
6301      int val;
6302      DataArrayInt *a;
6303      std::vector<int> aa;
6304      DataArrayIntTuple *aaa;
6305      int sw;
6306      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6307      switch(sw)
6308        {
6309        case 1:
6310          {
6311            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6312            ret->applyRModulus(val);
6313            ret->incrRef();
6314            return ret;
6315          }
6316        case 2:
6317          {
6318            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6319            return DataArrayInt::Modulus(aaa,self);
6320          }
6321        case 3:
6322          {
6323            return DataArrayInt::Modulus(a,self);
6324          }
6325        case 4:
6326          {
6327            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6328            return DataArrayInt::Modulus(aaaa,self);
6329          }
6330        default:
6331          throw INTERP_KERNEL::Exception(msg);
6332        }
6333    }
6334
6335    PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6336    {
6337      const char msg[]="Unexpected situation in __imod__ !";
6338      int val;
6339      DataArrayInt *a;
6340      std::vector<int> aa;
6341      DataArrayIntTuple *aaa;
6342      int sw;
6343      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6344      switch(sw)
6345        {
6346        case 1:
6347          {
6348            self->applyModulus(val);
6349            Py_XINCREF(trueSelf);
6350            return trueSelf;
6351          }
6352        case 3:
6353          {
6354            self->modulusEqual(a);
6355            Py_XINCREF(trueSelf);
6356            return trueSelf;
6357          }
6358        case 4:
6359          {
6360            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6361            self->modulusEqual(aaaa);
6362            Py_XINCREF(trueSelf);
6363            return trueSelf;
6364          }
6365        default:
6366          throw INTERP_KERNEL::Exception(msg);
6367        }
6368    }
6369  };
6370
6371 namespace ParaMEDMEM
6372 {
6373   class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
6374   {
6375   public:
6376     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
6377     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
6378     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6379     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6380     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
6381     void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
6382     void setName(const char *name) throw(INTERP_KERNEL::Exception);
6383     const char *getDescription() const throw(INTERP_KERNEL::Exception);
6384     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
6385     const char *getName() const throw(INTERP_KERNEL::Exception);
6386     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
6387     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
6388     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
6389     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
6390     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
6391     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
6392     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
6393     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
6394                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
6395     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
6396     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
6397     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
6398     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
6399     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
6400     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
6401     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
6402     %extend {
6403       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
6404       {
6405         MEDCouplingMesh *ret1=(MEDCouplingMesh *)self->getMesh();
6406         if(ret1)
6407           ret1->incrRef();
6408         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
6409       }
6410
6411       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
6412       {
6413         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
6414         if(ret)
6415           ret->incrRef();
6416         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
6417       }
6418
6419       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
6420       {
6421         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
6422         return convertIntArrToPyList3(ret);
6423       }
6424
6425       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
6426       {
6427         std::string ret1;
6428         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
6429         PyObject *ret=PyTuple_New(2);
6430         PyObject *ret0Py=ret0?Py_True:Py_False;
6431         Py_XINCREF(ret0Py);
6432         PyTuple_SetItem(ret,0,ret0Py);
6433         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6434         return ret;
6435       }
6436
6437       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
6438       {
6439         DataArrayInt *ret1=0;
6440         MEDCouplingMesh *ret0=0;
6441         void *da=0;
6442         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
6443         if (!SWIG_IsOK(res1))
6444           {
6445             int size;
6446             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6447             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
6448           }
6449         else
6450           {
6451             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6452             if(!da2)
6453               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6454             da2->checkAllocated();
6455             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
6456           }
6457         PyObject *res = PyList_New(2);
6458         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
6459         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
6460         return res;
6461       }
6462
6463       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
6464       {
6465         int sw;
6466         int pos1;
6467         std::vector<int> pos2;
6468         DataArrayInt *pos3=0;
6469         DataArrayIntTuple *pos4=0;
6470         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
6471         switch(sw)
6472           {
6473           case 1:
6474             {
6475               return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
6476             }
6477           case 2:
6478             {
6479               return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
6480             }
6481           case 3:
6482             {
6483               return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
6484             }
6485           default:
6486             throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
6487           }
6488       }
6489
6490       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
6491                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
6492       {
6493         void *da=0;
6494         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
6495         if (!SWIG_IsOK(res1))
6496           {
6497             int size;
6498             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6499             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
6500           }
6501         else
6502           {
6503             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6504             if(!da2)
6505               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6506             da2->checkAllocated();
6507             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
6508           }
6509       }
6510
6511       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
6512       {
6513         std::vector<int> tmp;
6514         self->getCellIdsHavingGaussLocalization(locId,tmp);
6515         DataArrayInt *ret=DataArrayInt::New();
6516         ret->alloc((int)tmp.size(),1);
6517         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
6518         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6519       }
6520     }
6521   };
6522
6523   class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
6524   {
6525   public:
6526     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
6527     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
6528     void setTimeUnit(const char *unit);
6529     const char *getTimeUnit() const;
6530     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
6531     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6532     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6533     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
6534     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
6535     void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
6536     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
6537     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
6538     MEDCouplingFieldDouble *deepCpy() const;
6539     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
6540     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
6541     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
6542     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
6543     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
6544     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6545     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6546     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6547     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6548     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6549     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
6550     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
6551     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
6552     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
6553     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
6554     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
6555     void setIteration(int it) throw(INTERP_KERNEL::Exception);
6556     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
6557     void setOrder(int order) throw(INTERP_KERNEL::Exception);
6558     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
6559     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
6560     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
6561     void updateTime() const throw(INTERP_KERNEL::Exception);
6562     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6563     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6564     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6565     bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6566     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6567     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6568     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
6569     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
6570     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
6571     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
6572     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
6573     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
6574     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
6575     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
6576     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
6577     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
6578     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
6579     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
6580     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
6581     void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6582     void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6583     void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6584     void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6585     void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6586     void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6587     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
6588     void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
6589     void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
6590     void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
6591     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
6592     double getMaxValue() const throw(INTERP_KERNEL::Exception);
6593     double getMinValue() const throw(INTERP_KERNEL::Exception);
6594     double getAverageValue() const throw(INTERP_KERNEL::Exception);
6595     double norm2() const throw(INTERP_KERNEL::Exception);
6596     double normMax() const throw(INTERP_KERNEL::Exception);
6597     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
6598     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
6599     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
6600     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
6601     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
6602     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
6603     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6604     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6605     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6606     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6607     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6608     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6609     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6610     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6611     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6612     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6613     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6614     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6615     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6616     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6617     MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6618     MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6619     MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6620     MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6621     %extend {
6622       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
6623       {
6624         return MEDCouplingFieldDouble::New(type,td);
6625       }
6626
6627       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
6628       {
6629         return MEDCouplingFieldDouble::New(ft,td);
6630       }
6631
6632       std::string __str__() const throw(INTERP_KERNEL::Exception)
6633       {
6634         return self->simpleRepr();
6635       }
6636
6637       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
6638       {
6639         DataArrayDouble *ret=self->getArray();
6640         if(ret)
6641           ret->incrRef();
6642         return ret;
6643       }
6644
6645       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
6646       {
6647         std::vector<DataArrayDouble *> arrs=self->getArrays();
6648         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
6649           if(*it)
6650             (*it)->incrRef();
6651         int sz=arrs.size();
6652         PyObject *ret=PyTuple_New(sz);
6653         for(int i=0;i<sz;i++)
6654           {
6655             if(arrs[i])
6656               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6657             else
6658               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
6659           }
6660         return ret;
6661       }
6662
6663       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
6664       {
6665         std::vector<const DataArrayDouble *> tmp;
6666         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
6667         int sz=tmp.size();
6668         std::vector<DataArrayDouble *> arrs(sz);
6669         for(int i=0;i<sz;i++)
6670           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
6671         self->setArrays(arrs);
6672       }
6673
6674       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
6675       {
6676         DataArrayDouble *ret=self->getEndArray();
6677         if(ret)
6678           ret->incrRef();
6679         return ret;
6680       }
6681
6682       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
6683       {
6684         double val;
6685         DataArrayDouble *a;
6686         DataArrayDoubleTuple *aa;
6687         std::vector<double> bb;
6688         int sw;
6689         const MEDCouplingMesh *mesh=self->getMesh();
6690         if(!mesh)
6691           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6692         int spaceDim=mesh->getSpaceDimension();
6693         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6694         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6695         //
6696         int sz=self->getNumberOfComponents();
6697         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6698         self->getValueOn(spaceLoc,res);
6699         return convertDblArrToPyList(res,sz);
6700       }
6701
6702        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
6703        {
6704          int sz=self->getNumberOfComponents();
6705          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6706          self->getValueOnPos(i,j,k,res);
6707          return convertDblArrToPyList(res,sz);
6708        }
6709
6710       DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
6711       {
6712         void *da=0;
6713         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
6714         if (!SWIG_IsOK(res1))
6715           {
6716             int size;
6717             INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
6718             const MEDCouplingMesh *mesh=self->getMesh();
6719             if(!mesh)
6720               throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6721             int spaceDim=mesh->getSpaceDimension();
6722             int nbOfPoints=size/spaceDim;
6723             if(size%spaceDim!=0)
6724               {
6725                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
6726               }
6727             return self->getValueOnMulti(tmp,nbOfPoints);
6728           }
6729         else
6730           {
6731             DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
6732             if(!da2)
6733               throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
6734             da2->checkAllocated();
6735             int size=da2->getNumberOfTuples();
6736             int nbOfCompo=da2->getNumberOfComponents();
6737             const MEDCouplingMesh *mesh=self->getMesh();
6738             if(!mesh)
6739               throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6740             if(nbOfCompo!=mesh->getSpaceDimension())
6741               {
6742                 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
6743               }
6744             return self->getValueOnMulti(da2->getConstPointer(),size);
6745           }
6746       }
6747
6748       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
6749       {
6750         double val;
6751         DataArrayDouble *a;
6752         DataArrayDoubleTuple *aa;
6753         std::vector<double> bb;
6754         int sw;
6755         const MEDCouplingMesh *mesh=self->getMesh();
6756         if(!mesh)
6757           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6758         int spaceDim=mesh->getSpaceDimension();
6759         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6760         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6761         //
6762         //
6763         int sz=self->getNumberOfComponents();
6764         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6765         self->getValueOn(spaceLoc,time,res);
6766         return convertDblArrToPyList(res,sz);
6767       }
6768
6769       void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
6770       {
6771         if(self->getArray()!=0)
6772           {
6773             int sz;
6774             double *tmp=convertPyToNewDblArr2(li,&sz);
6775             int nbTuples=self->getArray()->getNumberOfTuples();
6776             int nbOfCompo=self->getArray()->getNumberOfComponents();
6777             self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
6778           }
6779         else
6780           throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
6781       }
6782       
6783       PyObject *getTime() throw(INTERP_KERNEL::Exception)
6784       {
6785         int tmp1,tmp2;
6786         double tmp0=self->getTime(tmp1,tmp2);
6787         PyObject *res = PyList_New(3);
6788         PyList_SetItem(res,0,SWIG_From_double(tmp0));
6789         PyList_SetItem(res,1,SWIG_From_int(tmp1));
6790         PyList_SetItem(res,2,SWIG_From_int(tmp2));
6791         return res;
6792       }
6793
6794       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
6795       {
6796         int tmp1,tmp2;
6797         double tmp0=self->getStartTime(tmp1,tmp2);
6798         PyObject *res = PyList_New(3);
6799         PyList_SetItem(res,0,SWIG_From_double(tmp0));
6800         PyList_SetItem(res,1,SWIG_From_int(tmp1));
6801         PyList_SetItem(res,2,SWIG_From_int(tmp2));
6802         return res;
6803       }
6804
6805       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
6806       {
6807         int tmp1,tmp2;
6808         double tmp0=self->getEndTime(tmp1,tmp2);
6809         PyObject *res = PyList_New(3);
6810         PyList_SetItem(res,0,SWIG_From_double(tmp0));
6811         PyList_SetItem(res,1,SWIG_From_int(tmp1));
6812         PyList_SetItem(res,2,SWIG_From_int(tmp2));
6813         return res;
6814       }
6815       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
6816       {
6817         int sz=self->getNumberOfComponents();
6818         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6819         self->accumulate(tmp);
6820         return convertDblArrToPyList(tmp,sz);
6821       }
6822       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
6823       {
6824         int sz=self->getNumberOfComponents();
6825         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6826         self->integral(isWAbs,tmp);
6827         return convertDblArrToPyList(tmp,sz);
6828       }
6829       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
6830       {
6831         int sz=self->getNumberOfComponents();
6832         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6833         self->getWeightedAverageValue(tmp,isWAbs);
6834         return convertDblArrToPyList(tmp,sz);
6835       }
6836       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
6837       {
6838         int sz=self->getNumberOfComponents();
6839         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6840         self->normL1(tmp);
6841         return convertDblArrToPyList(tmp,sz);
6842       }
6843       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
6844       {
6845         int sz=self->getNumberOfComponents();
6846         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6847         self->normL2(tmp);
6848         return convertDblArrToPyList(tmp,sz);
6849       }
6850       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
6851       {
6852         void *da=0;
6853         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
6854         if (!SWIG_IsOK(res1))
6855           {
6856             int size;
6857             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6858             self->renumberCells(tmp,check);
6859           }
6860         else
6861           {
6862             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6863             if(!da2)
6864               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6865             da2->checkAllocated();
6866             self->renumberCells(da2->getConstPointer(),check);
6867           }
6868       }
6869       void renumberNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
6870       {
6871         void *da=0;
6872         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
6873         if (!SWIG_IsOK(res1))
6874           {
6875             int size;
6876             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6877             self->renumberNodes(tmp);
6878           }
6879         else
6880           {
6881             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6882             if(!da2)
6883               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6884             da2->checkAllocated();
6885             self->renumberNodes(da2->getConstPointer());
6886           }
6887       }
6888
6889       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
6890       {
6891         int sw;
6892         int singleVal;
6893         std::vector<int> multiVal;
6894         std::pair<int, std::pair<int,int> > slic;
6895         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
6896         const MEDCouplingMesh *mesh=self->getMesh();
6897         if(!mesh)
6898           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
6899         int nbc=mesh->getNumberOfCells();
6900         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
6901         switch(sw)
6902           {
6903           case 1:
6904             {
6905               if(singleVal>=nbc)
6906                 {
6907                   std::ostringstream oss;
6908                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6909                   throw INTERP_KERNEL::Exception(oss.str().c_str());
6910                 }
6911               if(singleVal>=0)
6912                 return self->buildSubPart(&singleVal,&singleVal+1);
6913               else
6914                 {
6915                   if(nbc+singleVal>0)
6916                     {
6917                       int tmp=nbc+singleVal;
6918                       return self->buildSubPart(&tmp,&tmp+1);
6919                     }
6920                   else
6921                     {
6922                       std::ostringstream oss;
6923                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6924                       throw INTERP_KERNEL::Exception(oss.str().c_str());
6925                     }
6926                 }
6927             }
6928           case 2:
6929             {
6930               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
6931             }
6932           case 3:
6933             {
6934               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rg=DataArrayInt::Range(slic.first,slic.second.first,slic.second.second);
6935               return self->buildSubPart(rg->begin(),rg->end());
6936             }
6937           case 4:
6938             {
6939               if(!daIntTyypp)
6940                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
6941               daIntTyypp->checkAllocated();
6942               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
6943             }
6944           default:
6945             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
6946           }
6947       }
6948
6949       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
6950       {
6951         return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
6952       }
6953
6954       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
6955       {
6956         DataArrayInt *tmp;
6957         double r1=self->getMaxValue2(tmp);
6958         PyObject *ret=PyTuple_New(2);
6959         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6960         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6961         return ret;
6962       }
6963       
6964       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
6965       {
6966         DataArrayInt *tmp;
6967         double r1=self->getMinValue2(tmp);
6968         PyObject *ret=PyTuple_New(2);
6969         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6970         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6971         return ret;
6972       }
6973       
6974       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
6975       {
6976         std::vector<int> tmp;
6977         convertPyToNewIntArr3(li,tmp);
6978         return self->keepSelectedComponents(tmp);
6979       }
6980
6981       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
6982       {
6983         std::vector<int> tmp;
6984         convertPyToNewIntArr3(li,tmp);
6985         self->setSelectedComponents(f,tmp);
6986       }
6987
6988       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
6989       {
6990         double val,val2;
6991         DataArrayDouble *a,*a2;
6992         DataArrayDoubleTuple *aa,*aa2;
6993         std::vector<double> bb,bb2;
6994         int sw;
6995         int spaceDim=3;
6996         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
6997         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
6998         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
6999         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
7000         //
7001         return self->extractSlice3D(orig,vect,eps);
7002       }
7003
7004       PyObject *___iadd___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
7005       {
7006         *self+=other;
7007         Py_XINCREF(trueSelf);
7008         return trueSelf;
7009       }
7010       
7011       PyObject *___isub___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
7012       {
7013         *self-=other;
7014         Py_XINCREF(trueSelf);
7015         return trueSelf;
7016       }
7017
7018       PyObject *___imul___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
7019       {
7020         *self*=other;
7021         Py_XINCREF(trueSelf);
7022         return trueSelf;
7023       }
7024
7025       PyObject *___idiv___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
7026       {
7027         *self/=other;
7028         Py_XINCREF(trueSelf);
7029         return trueSelf;
7030       }
7031
7032       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7033       {
7034         std::vector<const MEDCouplingFieldDouble *> tmp;
7035         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7036         return MEDCouplingFieldDouble::MergeFields(tmp);
7037       }
7038
7039       static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
7040       {
7041         std::vector<const MEDCouplingFieldDouble *> tmp;
7042         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7043         MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
7044       }
7045     }
7046   };
7047
7048   class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
7049   {
7050   public:
7051     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
7052     static MEDCouplingFieldTemplate *New(TypeOfField type);
7053     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
7054     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
7055     void updateTime() const;
7056     %extend
7057        {
7058          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
7059          {
7060            return MEDCouplingFieldTemplate::New(f);
7061          }
7062          
7063          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
7064          {
7065            return MEDCouplingFieldTemplate::New(type);
7066          }
7067          
7068          std::string __str__() const throw(INTERP_KERNEL::Exception)
7069            {
7070              return self->simpleRepr();
7071            }
7072        }
7073   };
7074
7075   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
7076   {
7077   public:
7078     int getNumberOfFields() const;
7079     MEDCouplingMultiFields *deepCpy() const;
7080     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
7081     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
7082     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7083     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
7084     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
7085     void updateTime() const throw(INTERP_KERNEL::Exception);
7086     %extend
7087        {
7088          std::string __str__() const throw(INTERP_KERNEL::Exception)
7089          {
7090            return self->simpleRepr();
7091          }
7092          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7093          {
7094            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7095            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7096            int sz=tmp.size();
7097            std::vector<MEDCouplingFieldDouble *> fs(sz);
7098            for(int i=0;i<sz;i++)
7099              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7100            return MEDCouplingMultiFields::New(fs);
7101          }
7102          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
7103          {
7104            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7105            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7106            int sz=tmp.size();
7107            std::vector<MEDCouplingFieldDouble *> fs(sz);
7108            for(int i=0;i<sz;i++)
7109              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7110            return MEDCouplingMultiFields::New(fs);
7111          }
7112          PyObject *getFields() const
7113          {
7114            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
7115            int sz=fields.size();
7116            PyObject *res = PyList_New(sz);
7117            for(int i=0;i<sz;i++)
7118              {
7119                if(fields[i])
7120                  {
7121                    fields[i]->incrRef();
7122                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
7123                  }
7124                else
7125                  {
7126                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
7127                  }
7128              }
7129            return res;
7130          }
7131          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
7132          {
7133            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
7134            if(ret)
7135              {
7136                ret->incrRef();
7137                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
7138              }
7139            else
7140              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
7141          }
7142          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
7143          {
7144            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
7145            int sz=ms.size();
7146            PyObject *res = PyList_New(sz);
7147            for(int i=0;i<sz;i++)
7148              {
7149                if(ms[i])
7150                  {
7151                    ms[i]->incrRef();
7152                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7153                  }
7154                else
7155                  {
7156                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7157                  }
7158              }
7159            return res;
7160          }
7161          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
7162          {
7163            std::vector<int> refs;
7164            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
7165            int sz=ms.size();
7166            PyObject *res = PyList_New(sz);
7167            for(int i=0;i<sz;i++)
7168              {
7169                if(ms[i])
7170                  {
7171                    ms[i]->incrRef();
7172                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
7173                  }
7174                else
7175                  {
7176                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
7177                  }
7178              }
7179            //
7180            PyObject *ret=PyTuple_New(2);
7181            PyTuple_SetItem(ret,0,res);
7182            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
7183            return ret;
7184          }
7185          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
7186          {
7187            std::vector<DataArrayDouble *> ms=self->getArrays();
7188            int sz=ms.size();
7189            PyObject *res = PyList_New(sz);
7190            for(int i=0;i<sz;i++)
7191              {
7192                if(ms[i])
7193                  {
7194                    ms[i]->incrRef();
7195                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7196                  }
7197                else
7198                  {
7199                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7200                  }
7201              }
7202            return res;
7203          }
7204          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
7205          {
7206            std::vector< std::vector<int> > refs;
7207            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
7208            int sz=ms.size();
7209            PyObject *res = PyList_New(sz);
7210            PyObject *res2 = PyList_New(sz);
7211            for(int i=0;i<sz;i++)
7212              {
7213                if(ms[i])
7214                  {
7215                    ms[i]->incrRef();
7216                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
7217                  }
7218                else
7219                  {
7220                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
7221                  }
7222                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
7223              }
7224            //
7225            PyObject *ret=PyTuple_New(2);
7226            PyTuple_SetItem(ret,0,res);
7227            PyTuple_SetItem(ret,1,res2);
7228            return ret;
7229          }
7230        }
7231   };
7232   
7233   class MEDCouplingDefinitionTime
7234   {
7235   public:
7236     MEDCouplingDefinitionTime();
7237     void assign(const MEDCouplingDefinitionTime& other);
7238     bool isEqual(const MEDCouplingDefinitionTime& other) const;
7239     double getTimeResolution() const;
7240     std::vector<double> getHotSpotsTime() const;
7241     %extend
7242       {
7243         std::string __str__() const
7244           {
7245             std::ostringstream oss;
7246             self->appendRepr(oss);
7247             return oss.str();
7248           }
7249
7250         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
7251         {
7252           int meshId,arrId,arrIdInField,fieldId;
7253           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
7254           PyObject *res=PyList_New(4);
7255           PyList_SetItem(res,0,PyInt_FromLong(meshId));
7256           PyList_SetItem(res,1,PyInt_FromLong(arrId));
7257           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7258           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7259           return res;
7260         }
7261
7262         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
7263         {
7264           int meshId,arrId,arrIdInField,fieldId;
7265           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
7266           PyObject *res=PyList_New(4);
7267           PyList_SetItem(res,0,PyInt_FromLong(meshId));
7268           PyList_SetItem(res,1,PyInt_FromLong(arrId));
7269           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7270           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7271           return res;
7272         }
7273       }
7274   };
7275
7276   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
7277   {
7278   public:
7279     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
7280     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
7281     
7282     %extend
7283       {
7284         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
7285           {
7286             std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7287             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7288             int sz=tmp.size();
7289             std::vector<MEDCouplingFieldDouble *> fs(sz);
7290             for(int i=0;i<sz;i++)
7291               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7292             return MEDCouplingFieldOverTime::New(fs);
7293           }
7294         std::string __str__() const throw(INTERP_KERNEL::Exception)
7295           {
7296             return self->simpleRepr();
7297           }
7298         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7299         {
7300           std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7301           convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7302            int sz=tmp.size();
7303            std::vector<MEDCouplingFieldDouble *> fs(sz);
7304            for(int i=0;i<sz;i++)
7305              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7306            return MEDCouplingFieldOverTime::New(fs);
7307          }
7308       }
7309   };
7310 }
7311
7312 %pythoncode %{
7313 import os
7314 __filename=os.environ.get('PYTHONSTARTUP')
7315 if __filename and os.path.isfile(__filename):
7316   execfile(__filename)
7317   pass
7318 %}