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