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