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