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