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