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