Salome HOME
Merge from V6_main (04/10/2012)
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 %module MEDCoupling
21
22 #define MEDCOUPLING_EXPORT
23
24 %include std_vector.i
25 %include std_string.i
26
27 %{
28 #include "MEDCouplingMemArray.hxx"
29 #include "MEDCouplingUMesh.hxx"
30 #include "MEDCouplingExtrudedMesh.hxx"
31 #include "MEDCouplingCMesh.hxx"
32 #include "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 *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2449   {
2450     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2451     ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
2452     Py_XINCREF(trueSelf);
2453     return trueSelf;
2454   }
2455   
2456   PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2457   {
2458     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2459     ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
2460     Py_XINCREF(trueSelf);
2461     return trueSelf;
2462   }
2463   
2464   PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2465   {
2466     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2467     ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
2468     Py_XINCREF(trueSelf);
2469     return trueSelf;
2470   }
2471
2472   PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
2473   {
2474     MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
2475     ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
2476     Py_XINCREF(trueSelf);
2477     return trueSelf;
2478   }
2479
2480   PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
2481   {
2482     int sw;
2483     int singleVal;
2484     std::vector<int> multiVal;
2485     std::pair<int, std::pair<int,int> > slic;
2486     ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2487     const double *pt=self->getConstPointer();
2488     int nbc=self->getNumberOfCompo();
2489     convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2490     switch(sw)
2491       {
2492       case 1:
2493         {
2494           if(singleVal>=nbc)
2495             {
2496               std::ostringstream oss;
2497               oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2498               throw INTERP_KERNEL::Exception(oss.str().c_str());
2499             }
2500           if(singleVal>=0)
2501             return PyFloat_FromDouble(pt[singleVal]);
2502           else
2503             {
2504               if(nbc+singleVal>0)
2505                 return PyFloat_FromDouble(pt[nbc+singleVal]);
2506               else
2507                 {
2508                   std::ostringstream oss;
2509                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
2510                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2511                 }
2512             }
2513         }
2514       case 2:
2515         {
2516           PyObject *t=PyTuple_New(multiVal.size());
2517           for(int j=0;j<(int)multiVal.size();j++)
2518             {
2519               int cid=multiVal[j];
2520               if(cid>=nbc)
2521                 {
2522                   std::ostringstream oss;
2523                   oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
2524                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2525                 }
2526               PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[cid]));
2527             }
2528           return t;
2529         }
2530       case 3:
2531           {
2532             int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2533             PyObject *t=PyTuple_New(sz);
2534             for(int j=0;j<sz;j++)
2535               PyTuple_SetItem(t,j,PyFloat_FromDouble(pt[slic.first+j*slic.second.second]));
2536             return t;
2537           }
2538       default:
2539         throw INTERP_KERNEL::Exception("DataArrayDoubleTuple::__getitem__ : unrecognized type entered !");
2540       }
2541   }
2542
2543   DataArrayDoubleTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
2544   {
2545      const char msg[]="DataArrayDoubleTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
2546      int sw1,sw2;
2547      double singleValV;
2548      std::vector<double> multiValV;
2549      ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
2550      int nbc=self->getNumberOfCompo();
2551      convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
2552      int singleVal;
2553      std::vector<int> multiVal;
2554      std::pair<int, std::pair<int,int> > slic;
2555      ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2556      double *pt=self->getPointer();
2557      convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
2558      switch(sw2)
2559        {
2560        case 1:
2561          {
2562            if(singleVal>=nbc)
2563             {
2564               std::ostringstream oss;
2565               oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
2566               throw INTERP_KERNEL::Exception(oss.str().c_str());
2567             }
2568            switch(sw1)
2569              {
2570              case 1:
2571                {
2572                  pt[singleVal]=singleValV;
2573                  return self;
2574                }
2575              case 2:
2576                {
2577                  if(multiValV.size()!=1)
2578                    {
2579                      std::ostringstream oss;
2580                      oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
2581                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2582                    }
2583                  pt[singleVal]=multiValV[0];
2584                  return self;
2585                }
2586              case 3:
2587                {
2588                  pt[singleVal]=daIntTyyppV->getConstPointer()[0];
2589                  return self;
2590                }
2591              default:
2592                throw INTERP_KERNEL::Exception(msg);
2593              }
2594          }
2595        case 2:
2596          {
2597            switch(sw1)
2598              {
2599              case 1:
2600                {
2601                  for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
2602                    {
2603                      if(*it>=nbc)
2604                        {
2605                          std::ostringstream oss;
2606                          oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
2607                          throw INTERP_KERNEL::Exception(oss.str().c_str());
2608                        }
2609                      pt[*it]=singleValV;
2610                    }
2611                  return self;
2612                }
2613              case 2:
2614                {
2615                  if(multiVal.size()!=multiValV.size())
2616                    {
2617                      std::ostringstream oss;
2618                      oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
2619                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2620                    }
2621                  for(int i=0;i<(int)multiVal.size();i++)
2622                    {
2623                      int pos=multiVal[i];
2624                      if(pos>=nbc)
2625                        {
2626                          std::ostringstream oss;
2627                          oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
2628                          throw INTERP_KERNEL::Exception(oss.str().c_str());
2629                        }
2630                      pt[multiVal[i]]=multiValV[i];
2631                    }
2632                  return self;
2633                }
2634              case 3:
2635                {
2636                  const double *ptV=daIntTyyppV->getConstPointer();
2637                  if(nbc>daIntTyyppV->getNumberOfCompo())
2638                    {
2639                      std::ostringstream oss;
2640                      oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2641                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2642                    }
2643                  std::copy(ptV,ptV+nbc,pt);
2644                  return self;
2645                }
2646              default:
2647                throw INTERP_KERNEL::Exception(msg);
2648              }
2649          }
2650        case 3:
2651          {
2652            int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
2653            switch(sw1)
2654              {
2655              case 1:
2656                {
2657                  for(int j=0;j<sz;j++)
2658                    pt[slic.first+j*slic.second.second]=singleValV;
2659                  return self;
2660                }
2661              case 2:
2662                {
2663                  if(sz!=(int)multiValV.size())
2664                    {
2665                      std::ostringstream oss;
2666                      oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
2667                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2668                    }
2669                  for(int j=0;j<sz;j++)
2670                    pt[slic.first+j*slic.second.second]=multiValV[j];
2671                  return self;
2672                }
2673              case 3:
2674                {
2675                  const double *ptV=daIntTyyppV->getConstPointer();
2676                  if(sz>daIntTyyppV->getNumberOfCompo())
2677                    {
2678                      std::ostringstream oss;
2679                      oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
2680                      throw INTERP_KERNEL::Exception(oss.str().c_str());
2681                    }
2682                  for(int j=0;j<sz;j++)
2683                    pt[slic.first+j*slic.second.second]=ptV[j];
2684                  return self;
2685                }
2686              default:
2687                throw INTERP_KERNEL::Exception(msg);
2688              }
2689          }
2690        default:
2691          throw INTERP_KERNEL::Exception(msg);
2692        }
2693    }
2694 }
2695
2696 %extend ParaMEDMEM::DataArrayDouble
2697  {
2698    DataArrayDouble() throw(INTERP_KERNEL::Exception)
2699    {
2700      return DataArrayDouble::New();
2701    }
2702
2703    static DataArrayDouble *New(PyObject *elt0, PyObject *elt1=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2704    {
2705      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) !";
2706      if(PyList_Check(elt0) || PyTuple_Check(elt0))
2707        {
2708          if(elt1)
2709            {
2710              if(PyInt_Check(elt1))
2711                {
2712                  int nbOfTuples=PyInt_AS_LONG(elt1);
2713                  if(nbOfTuples<0)
2714                    throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2715                  if(elt2)
2716                    {
2717                      if(PyInt_Check(elt2))
2718                        {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
2719                          int nbOfCompo=PyInt_AS_LONG(elt2);
2720                          if(nbOfCompo<0)
2721                            throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2722                          MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2723                          double *tmp=new double[nbOfTuples*nbOfCompo];
2724                          try { fillArrayWithPyListDbl(elt0,tmp,nbOfTuples*nbOfCompo,0.,true); }
2725                          catch(INTERP_KERNEL::Exception& e) { delete [] tmp; throw e; }
2726                          ret->useArray(tmp,true,CPP_DEALLOC,nbOfTuples,nbOfCompo);
2727                          ret->incrRef();
2728                          return ret;
2729                        }
2730                      else
2731                        throw INTERP_KERNEL::Exception(msg);
2732                    }
2733                  else
2734                    {//DataArrayDouble.New([1.,3.,4.],3)
2735                      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2736                      double *tmp=new double[nbOfTuples];
2737                      try { fillArrayWithPyListDbl(elt0,tmp,nbOfTuples,0.,true); }
2738                      catch(INTERP_KERNEL::Exception& e) { delete [] tmp; throw e; }
2739                      ret->useArray(tmp,true,CPP_DEALLOC,nbOfTuples,1);
2740                      ret->incrRef();
2741                      return ret;
2742                    }
2743                }
2744              else
2745                throw INTERP_KERNEL::Exception(msg);
2746            }
2747          else
2748            {// DataArrayDouble.New([1.,3.,4.])
2749              int szz=-1;
2750              if(PyList_Check(elt0))
2751                szz=PyList_Size(elt0);
2752              else
2753                szz=PyTuple_Size(elt0);
2754              MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2755              double *tmp=new double[szz];
2756              try { fillArrayWithPyListDbl(elt0,tmp,szz,0.,true); }
2757              catch(INTERP_KERNEL::Exception& e) { delete [] tmp; throw e; }
2758              ret->useArray(tmp,true,CPP_DEALLOC,szz,1);
2759              ret->incrRef();
2760              return ret;
2761            }
2762        }
2763      else if(PyInt_Check(elt0))
2764        {
2765          int nbOfTuples=PyInt_AS_LONG(elt0);
2766          if(nbOfTuples<0)
2767            throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
2768          if(elt1)
2769            {
2770              if(!elt2)
2771                {
2772                  if(PyInt_Check(elt1))
2773                    {//DataArrayDouble.New(5,2)
2774                      int nbOfCompo=PyInt_AS_LONG(elt1);
2775                      if(nbOfCompo<0)
2776                        throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
2777                      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2778                      ret->alloc(nbOfTuples,nbOfCompo);
2779                      ret->incrRef();
2780                      return ret;
2781                    }
2782                  else
2783                    throw INTERP_KERNEL::Exception(msg);
2784                }
2785              else
2786                throw INTERP_KERNEL::Exception(msg);
2787            }
2788          else
2789            {//DataArrayDouble.New(5)
2790              MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
2791              ret->alloc(nbOfTuples,1);
2792              ret->incrRef();
2793              return ret;
2794            }
2795        }
2796      else
2797        throw INTERP_KERNEL::Exception(msg);
2798    }
2799    
2800    DataArrayDouble(PyObject *elt0, PyObject *elt1=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
2801    {
2802      return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,elt1,elt2);
2803    }
2804
2805    std::string __str__() const
2806    {
2807      return self->repr();
2808    }
2809
2810    double __float__() const throw(INTERP_KERNEL::Exception)
2811    {
2812      return self->doubleValue();
2813    }
2814
2815    int __len__() const throw(INTERP_KERNEL::Exception)
2816    {
2817      if(self->isAllocated())
2818        {
2819          return self->getNumberOfTuples();
2820        }
2821      else
2822        {
2823          throw INTERP_KERNEL::Exception("DataArrayDouble::__len__ : Instance is NOT allocated !");
2824        }
2825    }
2826
2827    DataArrayDoubleIterator *__iter__()
2828    {
2829      return self->iterator();
2830    }
2831
2832    void setValues(PyObject *li, int nbOfTuples, int nbOfElsPerTuple) throw(INTERP_KERNEL::Exception)
2833    {
2834      double *tmp=new double[nbOfTuples*nbOfElsPerTuple];
2835      try
2836        {
2837          fillArrayWithPyListDbl(li,tmp,nbOfTuples*nbOfElsPerTuple,0.,false);
2838        }
2839      catch(INTERP_KERNEL::Exception& e)
2840        {
2841          delete [] tmp;
2842          throw e;
2843        }
2844      self->useArray(tmp,true,CPP_DEALLOC,nbOfTuples,nbOfElsPerTuple);
2845    }
2846
2847    PyObject *getValues() throw(INTERP_KERNEL::Exception)
2848    {
2849      const double *vals=self->getPointer();
2850      return convertDblArrToPyList(vals,self->getNbOfElems());
2851    }
2852
2853    PyObject *isEqualIfNotWhy(const DataArrayDouble& other, double prec) const throw(INTERP_KERNEL::Exception)
2854    {
2855      std::string ret1;
2856      bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
2857      PyObject *ret=PyTuple_New(2);
2858      PyObject *ret0Py=ret0?Py_True:Py_False;
2859      Py_XINCREF(ret0Py);
2860      PyTuple_SetItem(ret,0,ret0Py);
2861      PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
2862      return ret;
2863    }
2864
2865    PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
2866    {
2867      const double *vals=self->getPointer();
2868      int nbOfComp=self->getNumberOfComponents();
2869      int nbOfTuples=self->getNumberOfTuples();
2870      return convertDblArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
2871    }
2872
2873    DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
2874    {
2875      void *da=0;
2876      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2877      if (!SWIG_IsOK(res1))
2878        {
2879          int size;
2880          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2881          if(size!=self->getNumberOfTuples())
2882            {
2883              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2884            }
2885          return self->renumber(tmp);
2886        }
2887      else
2888        {
2889          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2890          if(!da2)
2891            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2892          da2->checkAllocated();
2893          int size=self->getNumberOfTuples();
2894          if(size!=self->getNumberOfTuples())
2895            {
2896              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2897            }
2898          return self->renumber(da2->getConstPointer());
2899        }
2900    }
2901
2902    DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
2903    {
2904      void *da=0;
2905      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2906      if (!SWIG_IsOK(res1))
2907        {
2908          int size;
2909          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2910          if(size!=self->getNumberOfTuples())
2911            {
2912              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2913            }
2914          return self->renumberR(tmp);
2915        }
2916      else
2917        {
2918          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2919          if(!da2)
2920            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2921          da2->checkAllocated();
2922          int size=self->getNumberOfTuples();
2923          if(size!=self->getNumberOfTuples())
2924            {
2925              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2926            }
2927          return self->renumberR(da2->getConstPointer());
2928        }
2929    }
2930
2931    DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
2932    {
2933      void *da=0;
2934      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2935      if (!SWIG_IsOK(res1))
2936        {
2937          int size;
2938          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2939          if(size!=self->getNumberOfTuples())
2940            {
2941              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2942            }
2943          return self->renumberAndReduce(tmp,newNbOfTuple);
2944        }
2945      else
2946        {
2947          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2948          if(!da2)
2949            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2950          da2->checkAllocated();
2951          int size=self->getNumberOfTuples();
2952          if(size!=self->getNumberOfTuples())
2953            {
2954              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2955            }
2956          return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
2957        }
2958    }
2959
2960    void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
2961    {
2962      void *da=0;
2963      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2964      if (!SWIG_IsOK(res1))
2965        {
2966          int size;
2967          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2968          if(size!=self->getNumberOfTuples())
2969            {
2970              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2971            }
2972          self->renumberInPlace(tmp);
2973        }
2974      else
2975        {
2976          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
2977          if(!da2)
2978            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2979          da2->checkAllocated();
2980          int size=self->getNumberOfTuples();
2981          if(size!=self->getNumberOfTuples())
2982            {
2983              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
2984            }
2985          self->renumberInPlace(da2->getConstPointer());
2986        }
2987    }
2988
2989    void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
2990    {
2991      void *da=0;
2992      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
2993      if (!SWIG_IsOK(res1))
2994        {
2995          int size;
2996          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
2997          if(size!=self->getNumberOfTuples())
2998            {
2999              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3000            }
3001          self->renumberInPlaceR(tmp);
3002        }
3003      else
3004        {
3005          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3006          if(!da2)
3007            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3008          da2->checkAllocated();
3009          int size=self->getNumberOfTuples();
3010          if(size!=self->getNumberOfTuples())
3011            {
3012              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
3013            }
3014          self->renumberInPlaceR(da2->getConstPointer());
3015        }
3016    }
3017
3018    DataArrayDouble *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
3019    {
3020      void *da=0;
3021      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3022      if (!SWIG_IsOK(res1))
3023        {
3024          int size;
3025          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3026          return self->selectByTupleId(tmp,tmp+size);
3027        }
3028      else
3029        {
3030          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3031          if(!da2)
3032            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3033          da2->checkAllocated();
3034          return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3035        }
3036    }
3037
3038    DataArrayDouble *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
3039    {
3040      void *da=0;
3041      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3042      if (!SWIG_IsOK(res1))
3043        {
3044          int size;
3045          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3046          return self->selectByTupleIdSafe(tmp,tmp+size);
3047        }
3048      else
3049        {
3050          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3051          if(!da2)
3052            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3053          da2->checkAllocated();
3054          return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
3055        }
3056    }
3057
3058    PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
3059    {
3060      int tmp;
3061      double r1=self->getMaxValue(tmp);
3062      PyObject *ret=PyTuple_New(2);
3063      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3064      PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3065      return ret;
3066    }
3067
3068    PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3069    {
3070      DataArrayInt *tmp;
3071      double r1=self->getMaxValue2(tmp);
3072      PyObject *ret=PyTuple_New(2);
3073      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3074      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3075      return ret;
3076    }
3077
3078    PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
3079    {
3080      int tmp;
3081      double r1=self->getMinValue(tmp);
3082      PyObject *ret=PyTuple_New(2);
3083      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3084      PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
3085      return ret;
3086    }
3087
3088    PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3089    {
3090      DataArrayInt *tmp;
3091      double r1=self->getMinValue2(tmp);
3092      PyObject *ret=PyTuple_New(2);
3093      PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3094      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3095      return ret;
3096    }
3097
3098    PyObject *getMinMaxPerComponent() const throw(INTERP_KERNEL::Exception)
3099    {
3100      int nbOfCompo=self->getNumberOfComponents();
3101      INTERP_KERNEL::AutoPtr<double> tmp=new double[2*nbOfCompo];
3102      self->getMinMaxPerComponent(tmp);
3103      PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,nbOfCompo);
3104      return ret;
3105    }
3106
3107    PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3108    {
3109      int sz=self->getNumberOfComponents();
3110      INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3111      self->accumulate(tmp);
3112      return convertDblArrToPyList(tmp,sz);
3113    }
3114    
3115    DataArrayDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3116    {
3117      std::vector<int> tmp;
3118      convertPyToNewIntArr3(li,tmp);
3119      return self->keepSelectedComponents(tmp);
3120    }
3121
3122    PyObject *findCommonTuples(double prec, int limitNodeId=-1) const throw(INTERP_KERNEL::Exception)
3123    {
3124      DataArrayInt *comm, *commIndex;
3125      self->findCommonTuples(prec,limitNodeId,comm,commIndex);
3126      PyObject *res = PyList_New(2);
3127      PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3128      PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3129      return res;
3130    }
3131
3132    void setSelectedComponents(const DataArrayDouble *a, PyObject *li) throw(INTERP_KERNEL::Exception)
3133    {
3134      std::vector<int> tmp;
3135      convertPyToNewIntArr3(li,tmp);
3136      self->setSelectedComponents(a,tmp);
3137    }
3138    
3139    PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
3140    {
3141      int sz=self->getNumberOfComponents();
3142      INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3143      self->getTuple(tupleId,tmp);
3144      return convertDblArrToPyList(tmp,sz);
3145    }
3146
3147    static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
3148    {
3149      std::vector<const DataArrayDouble *> tmp;
3150      convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3151      return DataArrayDouble::Aggregate(tmp);
3152    }
3153
3154    static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
3155    {
3156      std::vector<const DataArrayDouble *> tmp;
3157      convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3158      return DataArrayDouble::Meld(tmp);
3159    }
3160
3161    DataArrayDouble *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
3162    {
3163      std::vector<std::pair<int,int> > ranges;
3164      convertPyToVectorPairInt(li,ranges);
3165      return self->selectByTupleRanges(ranges);
3166    }
3167
3168    PyObject *computeTupleIdsNearTuples(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
3169    {
3170      double val;
3171      DataArrayDouble *a;
3172      DataArrayDoubleTuple *aa;
3173      std::vector<double> bb;
3174      int sw;
3175      int nbComp=self->getNumberOfComponents(),nbTuples=-1;
3176      const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
3177      const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
3178      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
3179      std::vector<int> c,cI;
3180      self->computeTupleIdsNearTuples(inpu,eps,c,cI);
3181      DataArrayInt *ret0=DataArrayInt::New(),*ret1=DataArrayInt::New();
3182      ret0->alloc((int)c.size(),1); std::copy(c.begin(),c.end(),ret0->getPointer());
3183      ret1->alloc((int)cI.size(),1); std::copy(cI.begin(),cI.end(),ret1->getPointer());
3184      PyObject *ret=PyTuple_New(2);
3185      PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3186      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3187      return ret;
3188    }
3189
3190    PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3191    {
3192      const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
3193      self->checkAllocated();
3194      int nbOfTuples=self->getNumberOfTuples();
3195      int nbOfComponents=self->getNumberOfComponents();
3196      int it1,ic1;
3197      std::vector<int> vt1,vc1;
3198      std::pair<int, std::pair<int,int> > pt1,pc1;
3199      DataArrayInt *dt1=0,*dc1=0;
3200      int sw;
3201      convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3202      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
3203      switch(sw)
3204        {
3205        case 1:
3206          if(nbOfComponents==1)
3207            return PyFloat_FromDouble(self->getIJSafe(it1,0));
3208          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3209        case 2:
3210          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3211        case 3:
3212          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3213        case 4:
3214          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3215        case 5:
3216          return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
3217        case 6:
3218          {
3219            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3220            std::vector<int> v2(1,ic1);
3221            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3222          }
3223        case 7:
3224          {
3225            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3226            std::vector<int> v2(1,ic1);
3227            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3228          }
3229        case 8:
3230          {
3231            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3232            std::vector<int> v2(1,ic1);
3233            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3234          }
3235        case 9:
3236          {
3237            ret=self->selectByTupleIdSafe(&it1,&it1+1);
3238            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3239          }
3240        case 10:
3241          {
3242            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3243            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3244          }
3245        case 11:
3246          {
3247            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3248            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3249          }
3250        case 12:
3251          {
3252            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3253            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3254          }
3255        case 13:
3256          {
3257            ret=self->selectByTupleIdSafe(&it1,&it1+1);
3258            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3259            std::vector<int> v2(nbOfComp);
3260            for(int i=0;i<nbOfComp;i++)
3261              v2[i]=pc1.first+i*pc1.second.second;
3262            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3263          }
3264        case 14:
3265          {
3266            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
3267            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3268            std::vector<int> v2(nbOfComp);
3269            for(int i=0;i<nbOfComp;i++)
3270              v2[i]=pc1.first+i*pc1.second.second;
3271            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3272          }
3273        case 15:
3274          {
3275            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
3276            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3277            std::vector<int> v2(nbOfComp);
3278            for(int i=0;i<nbOfComp;i++)
3279              v2[i]=pc1.first+i*pc1.second.second;
3280            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3281          }
3282        case 16:
3283          {
3284            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
3285            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
3286            std::vector<int> v2(nbOfComp);
3287            for(int i=0;i<nbOfComp;i++)
3288              v2[i]=pc1.first+i*pc1.second.second;
3289            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
3290          }
3291        default:
3292          throw INTERP_KERNEL::Exception(msg);
3293        }
3294    }
3295
3296    DataArrayDouble *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
3297    {
3298      self->checkAllocated();
3299      const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
3300      int nbOfTuples=self->getNumberOfTuples();
3301      int nbOfComponents=self->getNumberOfComponents();
3302      int sw1,sw2;
3303      double i1;
3304      std::vector<double> v1;
3305      DataArrayDouble *d1=0;
3306      convertObjToPossibleCpp4(value,sw1,i1,v1,d1);
3307      int it1,ic1;
3308      std::vector<int> vt1,vc1;
3309      std::pair<int, std::pair<int,int> > pt1,pc1;
3310      DataArrayInt *dt1=0,*dc1=0;
3311      convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
3312      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
3313      switch(sw2)
3314        {
3315        case 1:
3316          {
3317            switch(sw1)
3318              {
3319              case 1:
3320                self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
3321                return self;
3322              case 2:
3323                tmp=DataArrayDouble::New();
3324                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3325                self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
3326                return self;
3327              case 3:
3328                self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
3329                return self;
3330              default:
3331                throw INTERP_KERNEL::Exception(msg);
3332              }
3333            break;
3334          }
3335        case 2:
3336          {
3337            switch(sw1)
3338              {
3339              case 1:
3340                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3341                return self;
3342              case 2:
3343                tmp=DataArrayDouble::New();
3344                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3345                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
3346                return self;
3347              case 3:
3348                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
3349                return self;
3350              default:
3351                throw INTERP_KERNEL::Exception(msg);
3352              }
3353            break;
3354          }
3355        case 3:
3356          {
3357            switch(sw1)
3358              {
3359              case 1:
3360                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3361                return self;
3362              case 2:
3363                tmp=DataArrayDouble::New();
3364                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3365                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
3366                return self;
3367              case 3:
3368                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
3369                return self;
3370              default:
3371                throw INTERP_KERNEL::Exception(msg);
3372              }
3373            break;
3374          }
3375        case 4:
3376          {
3377            switch(sw1)
3378              {
3379              case 1:
3380                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3381                return self;
3382              case 2:
3383                tmp=DataArrayDouble::New();
3384                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3385                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
3386                return self;
3387              case 3:
3388                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
3389                return self;
3390              default:
3391                throw INTERP_KERNEL::Exception(msg);
3392              }
3393            break;
3394          }
3395        case 5:
3396          {
3397            switch(sw1)
3398              {
3399              case 1:
3400                self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
3401                return self;
3402              case 2:
3403                tmp=DataArrayDouble::New();
3404                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3405                self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
3406                return self;
3407              case 3:
3408                self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
3409                return self;
3410              default:
3411                throw INTERP_KERNEL::Exception(msg);
3412              }
3413            break;
3414          }
3415        case 6:
3416          {
3417            switch(sw1)
3418              {
3419              case 1:
3420                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3421                return self;
3422              case 2:
3423                tmp=DataArrayDouble::New();
3424                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3425                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
3426                return self;
3427              case 3:
3428                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
3429                return self;
3430              default:
3431                throw INTERP_KERNEL::Exception(msg);
3432              }
3433            break;
3434          }
3435        case 7:
3436          {
3437            switch(sw1)
3438              {
3439              case 1:
3440                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3441                return self;
3442              case 2:
3443                tmp=DataArrayDouble::New();
3444                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3445                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
3446                return self;
3447              case 3:
3448                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
3449                return self;
3450              default:
3451                throw INTERP_KERNEL::Exception(msg);
3452              }
3453            break;
3454          }
3455        case 8:
3456          {
3457            switch(sw1)
3458              {
3459              case 1:
3460                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3461                return self;
3462              case 2:
3463                tmp=DataArrayDouble::New();
3464                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3465                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
3466                return self;
3467              case 3:
3468                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
3469                return self;
3470              default:
3471                throw INTERP_KERNEL::Exception(msg);
3472              }
3473            break;
3474          }
3475        case 9:
3476          {
3477            switch(sw1)
3478              {
3479              case 1:
3480                self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3481                return self;
3482              case 2:
3483                tmp=DataArrayDouble::New();
3484                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3485                self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
3486                return self;
3487              case 3:
3488                self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
3489                return self;
3490              default:
3491                throw INTERP_KERNEL::Exception(msg);
3492              }
3493            break;
3494          }
3495        case 10:
3496          {
3497            switch(sw1)
3498              {
3499              case 1:
3500                self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3501                return self;
3502              case 2:
3503                tmp=DataArrayDouble::New();
3504                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3505                self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3506                return self;
3507              case 3:
3508                self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
3509                return self;
3510              default:
3511                throw INTERP_KERNEL::Exception(msg);
3512              }
3513            break;
3514          }
3515        case 11:
3516          {
3517            int bb=pt1.first;
3518            int ee=pt1.second.first;
3519            int ss=pt1.second.second;
3520            if(ee<bb || ss<=0)
3521              throw INTERP_KERNEL::Exception("Invalid slice in tuple selection");
3522            int nbOfE=(ee-bb)/ss;
3523            std::vector<int> nv(nbOfE);
3524            for(int jj=0;jj<nbOfE;jj++)
3525              nv[jj]=bb+jj*ss;
3526            switch(sw1)
3527              {
3528              case 1:
3529                self->setPartOfValuesSimple2(i1,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
3530                return self;
3531              case 2:
3532                tmp=DataArrayDouble::New();
3533                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3534                self->setPartOfValues2(tmp,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size(),false);
3535                return self;
3536              case 3:
3537                self->setPartOfValues2(d1,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
3538                return self;
3539              default:
3540                throw INTERP_KERNEL::Exception(msg);
3541              }
3542            break;
3543          }
3544        case 12:
3545          {
3546            switch(sw1)
3547              {
3548              case 1:
3549                self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3550                return self;
3551              case 2:
3552                tmp=DataArrayDouble::New();
3553                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3554                self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
3555                return self;
3556              case 3:
3557                self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
3558                return self;
3559              default:
3560                throw INTERP_KERNEL::Exception(msg);
3561              }
3562            break;
3563          }
3564        case 13:
3565          {
3566            switch(sw1)
3567              {
3568              case 1:
3569                self->setPartOfValuesSimple1(i1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3570                return self;
3571              case 2:
3572                tmp=DataArrayDouble::New();
3573                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3574                self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
3575                return self;
3576              case 3:
3577                self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
3578                return self;
3579              default:
3580                throw INTERP_KERNEL::Exception(msg);
3581              }
3582            break;
3583          }
3584        case 14:
3585          {
3586            switch(sw1)
3587              {
3588              case 1:
3589                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3590                return self;
3591              case 2:
3592                tmp=DataArrayDouble::New();
3593                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3594                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
3595                return self;
3596              case 3:
3597                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
3598                return self;
3599              default:
3600                throw INTERP_KERNEL::Exception(msg);
3601              }
3602            break;
3603          }
3604        case 15:
3605          {
3606            switch(sw1)
3607              {
3608              case 1:
3609                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3610                return self;
3611              case 2:
3612                  tmp=DataArrayDouble::New();
3613                  tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
3614                  self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
3615                  return self;
3616              case 3:
3617                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
3618                return self;
3619              default:
3620                throw INTERP_KERNEL::Exception(msg);
3621              }
3622            break;
3623          }
3624        case 16:
3625          {
3626            switch(sw1)
3627              {
3628              case 1:
3629                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3630                return self;
3631              case 2:
3632                tmp=DataArrayDouble::New();
3633                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
3634                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
3635                return self;
3636              case 3:
3637                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
3638                return self;
3639              default:
3640                throw INTERP_KERNEL::Exception(msg);
3641              }
3642            break;
3643          }
3644        default:
3645          throw INTERP_KERNEL::Exception(msg);
3646        }
3647      return self;
3648    }
3649
3650    DataArrayDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3651    {
3652      return self->negate();
3653    }
3654
3655    DataArrayDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3656    {
3657      const char msg[]="Unexpected situation in __add__ !";
3658      double val;
3659      DataArrayDouble *a;
3660      DataArrayDoubleTuple *aa;
3661      std::vector<double> bb;
3662      int sw;
3663      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3664      switch(sw)
3665        {
3666        case 1:
3667          {
3668            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3669            ret->applyLin(1.,val);
3670            ret->incrRef();
3671            return ret;
3672          }
3673        case 2:
3674          {
3675            return DataArrayDouble::Add(self,a);
3676          }
3677        case 3:
3678          {
3679            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3680            return DataArrayDouble::Add(self,aaa);
3681          }
3682        case 4:
3683          {
3684            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3685            return DataArrayDouble::Add(self,aaa);
3686          }
3687        default:
3688          throw INTERP_KERNEL::Exception(msg);
3689        }
3690    }
3691
3692    DataArrayDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3693    {
3694      const char msg[]="Unexpected situation in __radd__ !";
3695      double val;
3696      DataArrayDouble *a;
3697      DataArrayDoubleTuple *aa;
3698      std::vector<double> bb;
3699      int sw;
3700      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3701      switch(sw)
3702        {
3703        case 1:
3704          {
3705            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3706            ret->applyLin(1.,val);
3707            ret->incrRef();
3708            return ret;
3709          }
3710        case 3:
3711          {
3712            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3713            return DataArrayDouble::Add(self,aaa);
3714          }
3715        case 4:
3716          {
3717            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3718            return DataArrayDouble::Add(self,aaa);
3719          }
3720        default:
3721          throw INTERP_KERNEL::Exception(msg);
3722        }
3723    }
3724    
3725    PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3726    {
3727      const char msg[]="Unexpected situation in __iadd__ !";
3728      double val;
3729      DataArrayDouble *a;
3730      DataArrayDoubleTuple *aa;
3731      std::vector<double> bb;
3732      int sw;
3733      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3734      switch(sw)
3735        {
3736        case 1:
3737          {
3738            self->applyLin(1.,val);
3739            Py_XINCREF(trueSelf);
3740            return trueSelf;
3741          }
3742        case 2:
3743          {
3744            self->addEqual(a);
3745            Py_XINCREF(trueSelf);
3746            return trueSelf;
3747          }
3748        case 3:
3749          {
3750            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3751            self->addEqual(aaa);
3752            Py_XINCREF(trueSelf);
3753            return trueSelf;
3754          }
3755        case 4:
3756          {
3757            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3758            self->addEqual(aaa);
3759            Py_XINCREF(trueSelf);
3760            return trueSelf;
3761          }
3762        default:
3763          throw INTERP_KERNEL::Exception(msg);
3764        }
3765    }
3766
3767    DataArrayDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3768    {
3769      const char msg[]="Unexpected situation in __sub__ !";
3770      double val;
3771      DataArrayDouble *a;
3772      DataArrayDoubleTuple *aa;
3773      std::vector<double> bb;
3774      int sw;
3775      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3776      switch(sw)
3777        {
3778        case 1:
3779          {
3780            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3781            ret->applyLin(1.,-val);
3782            ret->incrRef();
3783            return ret;
3784          }
3785        case 2:
3786          {
3787            return DataArrayDouble::Substract(self,a);
3788          }
3789        case 3:
3790          {
3791            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3792            return DataArrayDouble::Substract(self,aaa);
3793          }
3794        case 4:
3795          {
3796            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3797            return DataArrayDouble::Substract(self,aaa);
3798          }
3799        default:
3800          throw INTERP_KERNEL::Exception(msg);
3801        }
3802    }
3803
3804    DataArrayDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3805    {
3806      const char msg[]="Unexpected situation in __rsub__ !";
3807      double val;
3808      DataArrayDouble *a;
3809      DataArrayDoubleTuple *aa;
3810      std::vector<double> bb;
3811      int sw;
3812      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3813      switch(sw)
3814        {
3815        case 1:
3816          {
3817            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3818            ret->applyLin(-1.,val);
3819            ret->incrRef();
3820            return ret;
3821          }
3822        case 3:
3823          {
3824            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3825            return DataArrayDouble::Substract(aaa,self);
3826          }
3827        case 4:
3828          {
3829            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3830            return DataArrayDouble::Substract(aaa,self);
3831          }
3832        default:
3833          throw INTERP_KERNEL::Exception(msg);
3834        }
3835    }
3836
3837    PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3838    {
3839      const char msg[]="Unexpected situation in __isub__ !";
3840      double val;
3841      DataArrayDouble *a;
3842      DataArrayDoubleTuple *aa;
3843      std::vector<double> bb;
3844      int sw;
3845      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3846      switch(sw)
3847        {
3848        case 1:
3849          {
3850            self->applyLin(1,-val);
3851            Py_XINCREF(trueSelf);
3852            return trueSelf;
3853          }
3854        case 2:
3855          {
3856            self->substractEqual(a);
3857            Py_XINCREF(trueSelf);
3858            return trueSelf;
3859          }
3860        case 3:
3861          {
3862            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3863            self->substractEqual(aaa);
3864            Py_XINCREF(trueSelf);
3865            return trueSelf;
3866          }
3867        case 4:
3868          {
3869            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3870            self->substractEqual(aaa);
3871            Py_XINCREF(trueSelf);
3872            return trueSelf;
3873          }
3874        default:
3875          throw INTERP_KERNEL::Exception(msg);
3876        }
3877    }
3878
3879    DataArrayDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3880    {
3881      const char msg[]="Unexpected situation in __mul__ !";
3882      double val;
3883      DataArrayDouble *a;
3884      DataArrayDoubleTuple *aa;
3885      std::vector<double> bb;
3886      int sw;
3887      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3888      switch(sw)
3889        {
3890        case 1:
3891          {
3892            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3893            ret->applyLin(val,0.);
3894            ret->incrRef();
3895            return ret;
3896          }
3897        case 2:
3898          {
3899            return DataArrayDouble::Multiply(self,a);
3900          }
3901        case 3:
3902          {
3903            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3904            return DataArrayDouble::Multiply(self,aaa);
3905          }
3906        case 4:
3907          {
3908            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3909            return DataArrayDouble::Multiply(self,aaa);
3910          }
3911        default:
3912          throw INTERP_KERNEL::Exception(msg);
3913        }
3914    }
3915
3916    DataArrayDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3917    {
3918      const char msg[]="Unexpected situation in __rmul__ !";
3919      double val;
3920      DataArrayDouble *a;
3921      DataArrayDoubleTuple *aa;
3922      std::vector<double> bb;
3923      int sw;
3924      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3925      switch(sw)
3926        {
3927        case 1:
3928          {
3929            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
3930            ret->applyLin(val,0.);
3931            ret->incrRef();
3932            return ret;
3933          }
3934        case 3:
3935          {
3936            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3937            return DataArrayDouble::Multiply(self,aaa);
3938          }
3939        case 4:
3940          {
3941            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3942            return DataArrayDouble::Multiply(self,aaa);
3943          }
3944        default:
3945          throw INTERP_KERNEL::Exception(msg);
3946        }
3947    }
3948
3949    PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3950    {
3951      const char msg[]="Unexpected situation in __imul__ !";
3952      double val;
3953      DataArrayDouble *a;
3954      DataArrayDoubleTuple *aa;
3955      std::vector<double> bb;
3956      int sw;
3957      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3958      switch(sw)
3959        {
3960        case 1:
3961          {
3962            self->applyLin(val,0.);
3963            Py_XINCREF(trueSelf);
3964            return trueSelf;
3965          }
3966        case 2:
3967          {
3968            self->multiplyEqual(a);
3969            Py_XINCREF(trueSelf);
3970            return trueSelf;
3971          }
3972        case 3:
3973          {
3974            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3975            self->multiplyEqual(aaa);
3976            Py_XINCREF(trueSelf);
3977            return trueSelf;
3978          }
3979        case 4:
3980          {
3981            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3982            self->multiplyEqual(aaa);
3983            Py_XINCREF(trueSelf);
3984            return trueSelf;
3985          }
3986        default:
3987          throw INTERP_KERNEL::Exception(msg);
3988        }
3989    }
3990
3991    DataArrayDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3992    {
3993      const char msg[]="Unexpected situation in __div__ !";
3994      double val;
3995      DataArrayDouble *a;
3996      DataArrayDoubleTuple *aa;
3997      std::vector<double> bb;
3998      int sw;
3999      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4000      switch(sw)
4001        {
4002        case 1:
4003          {
4004            if(val==0.)
4005              throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4006            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4007            ret->applyLin(1/val,0.);
4008            ret->incrRef();
4009            return ret;
4010          }
4011        case 2:
4012          {
4013            return DataArrayDouble::Divide(self,a);
4014          }
4015        case 3:
4016          {
4017            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4018            return DataArrayDouble::Divide(self,aaa);
4019          }
4020        case 4:
4021          {
4022            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4023            return DataArrayDouble::Divide(self,aaa);
4024          }
4025        default:
4026          throw INTERP_KERNEL::Exception(msg);
4027        }
4028    }
4029
4030    DataArrayDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4031    {
4032      const char msg[]="Unexpected situation in __rdiv__ !";
4033      double val;
4034      DataArrayDouble *a;
4035      DataArrayDoubleTuple *aa;
4036      std::vector<double> bb;
4037      int sw;
4038      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4039      switch(sw)
4040        {
4041        case 1:
4042          {
4043            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
4044            ret->applyInv(val);
4045            ret->incrRef();
4046            return ret;
4047          }
4048        case 3:
4049          {
4050            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4051            return DataArrayDouble::Divide(aaa,self);
4052          }
4053        case 4:
4054          {
4055            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4056            return DataArrayDouble::Divide(aaa,self);
4057          }
4058        default:
4059          throw INTERP_KERNEL::Exception(msg);
4060        }
4061    }
4062
4063    PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4064    {
4065      const char msg[]="Unexpected situation in __idiv__ !";
4066      double val;
4067      DataArrayDouble *a;
4068      DataArrayDoubleTuple *aa;
4069      std::vector<double> bb;
4070      int sw;
4071      convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4072      switch(sw)
4073        {
4074        case 1:
4075          {
4076            if(val==0.)
4077              throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
4078            self->applyLin(1./val,0.);
4079            Py_XINCREF(trueSelf);
4080            return trueSelf;
4081          }
4082        case 2:
4083          {
4084            self->divideEqual(a);
4085            Py_XINCREF(trueSelf);
4086            return trueSelf;
4087          }
4088        case 3:
4089          {
4090            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4091            self->divideEqual(aaa);
4092            Py_XINCREF(trueSelf);
4093            return trueSelf;
4094          }
4095        case 4:
4096          {
4097            MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4098            self->divideEqual(aaa);
4099            Py_XINCREF(trueSelf);
4100            return trueSelf;
4101          }
4102        default:
4103          throw INTERP_KERNEL::Exception(msg);
4104        }
4105    }
4106    
4107    PyObject *computeTupleIdsNearTuples(const DataArrayDouble *other, double eps)
4108    {
4109      std::vector<int> c,cI;
4110      //
4111      self->computeTupleIdsNearTuples(other,eps,c,cI);
4112      PyObject *ret=PyTuple_New(2);
4113      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
4114      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
4115      d0->alloc(c.size(),1);
4116      d1->alloc(cI.size(),1);
4117      std::copy(c.begin(),c.end(),d0->getPointer());
4118      std::copy(cI.begin(),cI.end(),d1->getPointer());
4119      PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4120      PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4121      d0->incrRef();
4122      d1->incrRef();
4123      return ret;
4124    }
4125  };
4126
4127 %extend ParaMEDMEM::DataArrayIntTuple
4128 {
4129   std::string __str__() const
4130   {
4131     return self->repr();
4132   }
4133
4134   int __int__() const throw(INTERP_KERNEL::Exception)
4135   {
4136     return self->intValue();
4137   }
4138
4139   DataArrayInt *buildDAInt()
4140   {
4141     return self->buildDAInt(1,self->getNumberOfCompo());
4142   }
4143
4144   PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4145   {
4146     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4147     ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
4148     Py_XINCREF(trueSelf);
4149     return trueSelf;
4150   }
4151   
4152   PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4153   {
4154     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4155     ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
4156     Py_XINCREF(trueSelf);
4157     return trueSelf;
4158   }
4159   
4160   PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4161   {
4162     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4163     ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
4164     Py_XINCREF(trueSelf);
4165     return trueSelf;
4166   }
4167
4168   PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4169   {
4170     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4171     ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
4172     Py_XINCREF(trueSelf);
4173     return trueSelf;
4174   }
4175
4176   PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4177   {
4178     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
4179     ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
4180     Py_XINCREF(trueSelf);
4181     return trueSelf;
4182   }
4183   
4184   PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4185   {
4186     int sw;
4187     int singleVal;
4188     std::vector<int> multiVal;
4189     std::pair<int, std::pair<int,int> > slic;
4190     ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4191     const int *pt=self->getConstPointer();
4192     int nbc=self->getNumberOfCompo();
4193     convertObjToPossibleCpp2(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4194     switch(sw)
4195       {
4196       case 1:
4197         {
4198           if(singleVal>=nbc)
4199             {
4200               std::ostringstream oss;
4201               oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4202               throw INTERP_KERNEL::Exception(oss.str().c_str());
4203             }
4204           if(singleVal>=0)
4205             return PyInt_FromLong(pt[singleVal]);
4206           else
4207             {
4208               if(nbc+singleVal>0)
4209                 return PyInt_FromLong(pt[nbc+singleVal]);
4210               else
4211                 {
4212                   std::ostringstream oss;
4213                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
4214                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4215                 }
4216             }
4217         }
4218       case 2:
4219         {
4220           PyObject *t=PyTuple_New(multiVal.size());
4221           for(int j=0;j<(int)multiVal.size();j++)
4222             {
4223               int cid=multiVal[j];
4224               if(cid>=nbc)
4225                 {
4226                   std::ostringstream oss;
4227                   oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
4228                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4229                 }
4230               PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
4231             }
4232           return t;
4233         }
4234       case 3:
4235           {
4236             int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4237             PyObject *t=PyTuple_New(sz);
4238             for(int j=0;j<sz;j++)
4239               PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
4240             return t;
4241           }
4242       default:
4243         throw INTERP_KERNEL::Exception("DataArrayIntTuple::__getitem__ : unrecognized type entered !");
4244       }
4245   }
4246
4247   DataArrayIntTuple *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
4248   {
4249      const char msg[]="DataArrayIntTuple::__setitem__ : unrecognized type entered, int, slice, list<int>, tuple<int> !";
4250      int sw1,sw2;
4251      int singleValV;
4252      std::vector<int> multiValV;
4253      std::pair<int, std::pair<int,int> > slicV;
4254      ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
4255      int nbc=self->getNumberOfCompo();
4256      convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
4257      int singleVal;
4258      std::vector<int> multiVal;
4259      std::pair<int, std::pair<int,int> > slic;
4260      ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4261      int *pt=self->getPointer();
4262      convertObjToPossibleCpp2(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
4263      switch(sw2)
4264        {
4265        case 1:
4266          {
4267            if(singleVal>=nbc)
4268             {
4269               std::ostringstream oss;
4270               oss << "Requesting for setting id # " << singleVal << " having only " << nbc << " components !";
4271               throw INTERP_KERNEL::Exception(oss.str().c_str());
4272             }
4273            switch(sw1)
4274              {
4275              case 1:
4276                {
4277                  pt[singleVal]=singleValV;
4278                  return self;
4279                }
4280              case 2:
4281                {
4282                  if(multiValV.size()!=1)
4283                    {
4284                      std::ostringstream oss;
4285                      oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
4286                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4287                    }
4288                  pt[singleVal]=multiValV[0];
4289                  return self;
4290                }
4291              case 4:
4292                {
4293                  pt[singleVal]=daIntTyyppV->getConstPointer()[0];
4294                  return self;
4295                }
4296              default:
4297                throw INTERP_KERNEL::Exception(msg);
4298              }
4299          }
4300        case 2:
4301          {
4302            switch(sw1)
4303              {
4304              case 1:
4305                {
4306                  for(std::vector<int>::const_iterator it=multiVal.begin();it!=multiVal.end();it++)
4307                    {
4308                      if(*it>=nbc)
4309                        {
4310                          std::ostringstream oss;
4311                          oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
4312                          throw INTERP_KERNEL::Exception(oss.str().c_str());
4313                        }
4314                      pt[*it]=singleValV;
4315                    }
4316                  return self;
4317                }
4318              case 2:
4319                {
4320                  if(multiVal.size()!=multiValV.size())
4321                    {
4322                      std::ostringstream oss;
4323                      oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << multiVal.size() << " !";
4324                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4325                    }
4326                  for(int i=0;i<(int)multiVal.size();i++)
4327                    {
4328                      int pos=multiVal[i];
4329                      if(pos>=nbc)
4330                        {
4331                          std::ostringstream oss;
4332                          oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
4333                          throw INTERP_KERNEL::Exception(oss.str().c_str());
4334                        }
4335                      pt[multiVal[i]]=multiValV[i];
4336                    }
4337                  return self;
4338                }
4339              case 4:
4340                {
4341                  const int *ptV=daIntTyyppV->getConstPointer();
4342                  if(nbc>daIntTyyppV->getNumberOfCompo())
4343                    {
4344                      std::ostringstream oss;
4345                      oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4346                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4347                    }
4348                  std::copy(ptV,ptV+nbc,pt);
4349                  return self;
4350                }
4351              default:
4352                throw INTERP_KERNEL::Exception(msg);
4353              }
4354          }
4355        case 3:
4356          {
4357            int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,"");
4358            switch(sw1)
4359              {
4360              case 1:
4361                {
4362                  for(int j=0;j<sz;j++)
4363                    pt[slic.first+j*slic.second.second]=singleValV;
4364                  return self;
4365                }
4366              case 2:
4367                {
4368                  if(sz!=(int)multiValV.size())
4369                    {
4370                      std::ostringstream oss;
4371                      oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
4372                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4373                    }
4374                  for(int j=0;j<sz;j++)
4375                    pt[slic.first+j*slic.second.second]=multiValV[j];
4376                  return self;
4377                }
4378              case 4:
4379                {
4380                  const int *ptV=daIntTyyppV->getConstPointer();
4381                  if(sz>daIntTyyppV->getNumberOfCompo())
4382                    {
4383                      std::ostringstream oss;
4384                      oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
4385                      throw INTERP_KERNEL::Exception(oss.str().c_str());
4386                    }
4387                  for(int j=0;j<sz;j++)
4388                    pt[slic.first+j*slic.second.second]=ptV[j];
4389                  return self;
4390                }
4391              default:
4392                throw INTERP_KERNEL::Exception(msg);
4393              }
4394          }
4395        default:
4396          throw INTERP_KERNEL::Exception(msg);
4397        }
4398    }
4399 }
4400
4401 %extend ParaMEDMEM::DataArrayIntIterator
4402 {
4403   PyObject *next()
4404   {
4405     DataArrayIntTuple *ret=self->nextt();
4406     if(ret)
4407       return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
4408     else
4409       {
4410         PyErr_SetString(PyExc_StopIteration,"No more data.");
4411         return 0;
4412       }
4413   }
4414 }
4415
4416 %extend ParaMEDMEM::DataArrayInt
4417  {
4418    DataArrayInt() throw(INTERP_KERNEL::Exception)
4419    {
4420      return DataArrayInt::New();
4421    }
4422
4423    static DataArrayInt *New(PyObject *elt0, PyObject *elt1=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
4424    {
4425      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) !";
4426      if(PyList_Check(elt0) || PyTuple_Check(elt0))
4427        {
4428          if(elt1)
4429            {
4430              if(PyInt_Check(elt1))
4431                {
4432                  int nbOfTuples=PyInt_AS_LONG(elt1);
4433                  if(nbOfTuples<0)
4434                    throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4435                  if(elt2)
4436                    {
4437                      if(PyInt_Check(elt2))
4438                        {//DataArrayInt.New([1,3,4,5],2,2)
4439                          int nbOfCompo=PyInt_AS_LONG(elt2);
4440                          if(nbOfCompo<0)
4441                            throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4442                          MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4443                          int *tmp=new int[nbOfTuples*nbOfCompo];
4444                          try { fillArrayWithPyListInt(elt0,tmp,nbOfTuples*nbOfCompo,0,true); }
4445                          catch(INTERP_KERNEL::Exception& e) { delete [] tmp; throw e; }
4446                          ret->useArray(tmp,true,CPP_DEALLOC,nbOfTuples,nbOfCompo);
4447                          ret->incrRef();
4448                          return ret;
4449                        }
4450                      else
4451                        throw INTERP_KERNEL::Exception(msg);
4452                    }
4453                  else
4454                    {//DataArrayInt.New([1,3,4],3)
4455                      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4456                      int *tmp=new int[nbOfTuples];
4457                      try { fillArrayWithPyListInt(elt0,tmp,nbOfTuples,0,true); }
4458                      catch(INTERP_KERNEL::Exception& e) { delete [] tmp; throw e; }
4459                      ret->useArray(tmp,true,CPP_DEALLOC,nbOfTuples,1);
4460                      ret->incrRef();
4461                      return ret;
4462                    }
4463                }
4464              else
4465                throw INTERP_KERNEL::Exception(msg);
4466            }
4467          else
4468            {// DataArrayInt.New([1,3,4])
4469              int szz=-1;
4470              if(PyList_Check(elt0))
4471                szz=PyList_Size(elt0);
4472              else
4473                szz=PyTuple_Size(elt0);
4474              MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4475              int *tmp=new int[szz];
4476              try { fillArrayWithPyListInt(elt0,tmp,szz,0,true); }
4477              catch(INTERP_KERNEL::Exception& e) { delete [] tmp; throw e; }
4478              ret->useArray(tmp,true,CPP_DEALLOC,szz,1);
4479              ret->incrRef();
4480              return ret;
4481            }
4482        }
4483      else if(PyInt_Check(elt0))
4484        {
4485          int nbOfTuples=PyInt_AS_LONG(elt0);
4486          if(nbOfTuples<0)
4487            throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
4488          if(elt1)
4489            {
4490              if(!elt2)
4491                {
4492                  if(PyInt_Check(elt1))
4493                    {//DataArrayInt.New(5,2)
4494                      int nbOfCompo=PyInt_AS_LONG(elt1);
4495                      if(nbOfCompo<0)
4496                        throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
4497                      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4498                      ret->alloc(nbOfTuples,nbOfCompo);
4499                      ret->incrRef();
4500                      return ret;
4501                    }
4502                  else
4503                    throw INTERP_KERNEL::Exception(msg);
4504                }
4505              else
4506                throw INTERP_KERNEL::Exception(msg);
4507            }
4508          else
4509            {//DataArrayInt.New(5)
4510              MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
4511              ret->alloc(nbOfTuples,1);
4512              ret->incrRef();
4513              return ret;
4514            }
4515        }
4516      else
4517        throw INTERP_KERNEL::Exception(msg);
4518    }
4519
4520    DataArrayInt(PyObject *elt0, PyObject *elt1=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
4521    {
4522      return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,elt1,elt2);
4523    }
4524
4525    std::string __str__() const
4526    {
4527      return self->repr();
4528    }
4529
4530    int __len__() const throw(INTERP_KERNEL::Exception)
4531    {
4532      if(self->isAllocated())
4533        {
4534          return self->getNumberOfTuples();
4535        }
4536      else
4537        {
4538          throw INTERP_KERNEL::Exception("DataArrayInt::__len__ : Instance is NOT allocated !");
4539        }
4540    }
4541
4542    int __int__() const throw(INTERP_KERNEL::Exception)
4543    {
4544      return self->intValue();
4545    }
4546
4547    DataArrayIntIterator *__iter__()
4548    {
4549      return self->iterator();
4550    }
4551
4552    static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, const DataArrayInt *arr, const DataArrayInt *arrI) throw(INTERP_KERNEL::Exception)
4553    {
4554      int newNbOfTuples=-1;
4555      DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arr,arrI,newNbOfTuples);
4556      PyObject *ret=PyTuple_New(2);
4557      PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
4558      PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
4559      return ret;
4560    }
4561
4562    void setValues(PyObject *li, int nbOfTuples, int nbOfElsPerTuple) throw(INTERP_KERNEL::Exception)
4563    {
4564      int *tmp=new int[nbOfTuples*nbOfElsPerTuple];
4565      try
4566        {
4567          fillArrayWithPyListInt(li,tmp,nbOfTuples*nbOfElsPerTuple,0,false);
4568        }
4569      catch(INTERP_KERNEL::Exception& e)
4570        {
4571          delete [] tmp;
4572          throw e;
4573        }
4574      self->useArray(tmp,true,CPP_DEALLOC,nbOfTuples,nbOfElsPerTuple);
4575    }
4576
4577    PyObject *getValues() throw(INTERP_KERNEL::Exception)
4578    {
4579      const int *vals=self->getPointer();
4580      return convertIntArrToPyList(vals,self->getNbOfElems());
4581    }
4582
4583    PyObject *isEqualIfNotWhy(const DataArrayInt& other) const throw(INTERP_KERNEL::Exception)
4584    {
4585      std::string ret1;
4586      bool ret0=self->isEqualIfNotWhy(other,ret1);
4587      PyObject *ret=PyTuple_New(2);
4588      PyObject *ret0Py=ret0?Py_True:Py_False;
4589      Py_XINCREF(ret0Py);
4590      PyTuple_SetItem(ret,0,ret0Py);
4591      PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4592      return ret;
4593    }
4594
4595    PyObject *getValuesAsTuple() throw(INTERP_KERNEL::Exception)
4596    {
4597      const int *vals=self->getPointer();
4598      int nbOfComp=self->getNumberOfComponents();
4599      int nbOfTuples=self->getNumberOfTuples();
4600      return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
4601    }
4602
4603    static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception)
4604    {
4605      std::vector<const DataArrayInt *> groups;
4606      std::vector< std::vector<int> > fidsOfGroups;
4607      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
4608      ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
4609      PyObject *ret = PyList_New(2);
4610      PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4611      int sz=fidsOfGroups.size();
4612      PyObject *ret1 = PyList_New(sz);
4613      for(int i=0;i<sz;i++)
4614        PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
4615      PyList_SetItem(ret,1,ret1);
4616      return ret;
4617    }
4618
4619    void transformWithIndArr(PyObject *li)
4620    {
4621      void *da=0;
4622      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4623      if (!SWIG_IsOK(res1))
4624        {
4625          int size;
4626          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4627          self->transformWithIndArr(tmp,tmp+size);
4628        }
4629      else
4630        {
4631          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4632          self->transformWithIndArr(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4633        }
4634    }
4635
4636    DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4637    {
4638      int sw;
4639      int singleVal;
4640      std::vector<int> multiVal;
4641      std::pair<int, std::pair<int,int> > slic;
4642      ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4643      convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4644      switch(sw)
4645        {
4646        case 1:
4647          return self->getIdsEqualList(&singleVal,&singleVal+1);
4648        case 2:
4649          return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4650        case 4:
4651          return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
4652        default:
4653          throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4654        }
4655    }
4656
4657    DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
4658    {
4659      int sw;
4660      int singleVal;
4661      std::vector<int> multiVal;
4662      std::pair<int, std::pair<int,int> > slic;
4663      ParaMEDMEM::DataArrayInt *daIntTyypp=0;
4664      convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
4665      switch(sw)
4666        {
4667        case 1:
4668          return self->getIdsNotEqualList(&singleVal,&singleVal+1);
4669        case 2:
4670          return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
4671        case 4:
4672          return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
4673        default:
4674          throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
4675        }
4676    }
4677
4678    PyObject *splitByValueRange(PyObject *li) const throw(INTERP_KERNEL::Exception)
4679    {
4680      DataArrayInt *ret0=0,*ret1=0,*ret2=0;
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          self->splitByValueRange(tmp,(int *)tmp+size,ret0,ret1,ret2);
4688        }
4689      else
4690        {
4691          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4692          if(!da2)
4693            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4694          da2->checkAllocated();
4695          int size=self->getNumberOfTuples();
4696          self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
4697        }
4698      PyObject *ret = PyList_New(3);
4699      PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4700      PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4701      PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4702      return ret;
4703    }
4704
4705    DataArrayInt *transformWithIndArrR(PyObject *li) const
4706    {
4707      void *da=0;
4708      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4709      if (!SWIG_IsOK(res1))
4710        {
4711          int size;
4712          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4713          return self->transformWithIndArrR(tmp,tmp+size);
4714        }
4715      else
4716        {
4717          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4718          return self->transformWithIndArrR(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4719        }
4720    }
4721
4722    void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
4723    {
4724      void *da=0;
4725      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4726      if (!SWIG_IsOK(res1))
4727        {
4728          int size;
4729          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4730          if(size!=self->getNumberOfTuples())
4731            {
4732              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4733            }
4734          self->renumberInPlace(tmp);
4735        }
4736      else
4737        {
4738          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4739          if(!da2)
4740            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4741          da2->checkAllocated();
4742          int size=self->getNumberOfTuples();
4743          if(size!=self->getNumberOfTuples())
4744            {
4745              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4746            }
4747          self->renumberInPlace(da2->getConstPointer());
4748        }
4749    }
4750
4751    void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
4752    {
4753      void *da=0;
4754      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4755      if (!SWIG_IsOK(res1))
4756        {
4757          int size;
4758          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4759          if(size!=self->getNumberOfTuples())
4760            {
4761              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4762            }
4763          self->renumberInPlaceR(tmp);
4764        }
4765      else
4766        {
4767          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4768          if(!da2)
4769            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4770          da2->checkAllocated();
4771          int size=self->getNumberOfTuples();
4772          if(size!=self->getNumberOfTuples())
4773            {
4774              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4775            }
4776          self->renumberInPlaceR(da2->getConstPointer());
4777        }
4778    }
4779
4780    DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
4781    {
4782      void *da=0;
4783      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4784      if (!SWIG_IsOK(res1))
4785        {
4786          int size;
4787          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4788          if(size!=self->getNumberOfTuples())
4789            {
4790              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4791            }
4792          return self->renumberAndReduce(tmp,newNbOfTuple);
4793        }
4794      else
4795        {
4796          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4797          if(!da2)
4798            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4799          da2->checkAllocated();
4800          int size=self->getNumberOfTuples();
4801          if(size!=self->getNumberOfTuples())
4802            {
4803              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4804            }
4805          return self->renumberAndReduce(da2->getConstPointer(),newNbOfTuple);
4806        }
4807    }
4808
4809    DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
4810    {
4811      void *da=0;
4812      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4813      if (!SWIG_IsOK(res1))
4814        {
4815          int size;
4816          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4817          if(size!=self->getNumberOfTuples())
4818            {
4819              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4820            }
4821          return self->renumber(tmp);
4822        }
4823      else
4824        {
4825          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4826          if(!da2)
4827            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4828          da2->checkAllocated();
4829          int size=self->getNumberOfTuples();
4830          if(size!=self->getNumberOfTuples())
4831            {
4832              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4833            }
4834          return self->renumber(da2->getConstPointer());
4835        }
4836    }
4837
4838    DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
4839    {
4840      void *da=0;
4841      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4842      if (!SWIG_IsOK(res1))
4843        {
4844          int size;
4845          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4846          if(size!=self->getNumberOfTuples())
4847            {
4848              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4849            }
4850          return self->renumberR(tmp);
4851        }
4852      else
4853        {
4854          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4855          if(!da2)
4856            throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4857          da2->checkAllocated();
4858          int size=self->getNumberOfTuples();
4859          if(size!=self->getNumberOfTuples())
4860            {
4861              throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !");
4862            }
4863          return self->renumberR(da2->getConstPointer());
4864        }
4865    }
4866
4867    DataArrayInt *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
4868    {
4869      void *da=0;
4870      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4871      if (!SWIG_IsOK(res1))
4872        {
4873          int size;
4874          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4875          return self->selectByTupleId(tmp,tmp+size);
4876        }
4877      else
4878        {
4879          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4880          if(!da2)
4881           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4882          da2->checkAllocated();
4883          return self->selectByTupleId(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4884        }
4885    }
4886
4887    DataArrayInt *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
4888    {
4889      void *da=0;
4890      int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
4891      if (!SWIG_IsOK(res1))
4892        {
4893          int size;
4894          INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
4895          return self->selectByTupleIdSafe(tmp,tmp+size);
4896        }
4897      else
4898        {
4899          DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
4900          if(!da2)
4901           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
4902          da2->checkAllocated();
4903          return self->selectByTupleIdSafe(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
4904        }
4905    }
4906
4907    DataArrayInt *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4908    {
4909      std::vector<int> tmp;
4910      convertPyToNewIntArr3(li,tmp);
4911      return self->keepSelectedComponents(tmp);
4912    }
4913
4914    void setSelectedComponents(const DataArrayInt *a, PyObject *li) throw(INTERP_KERNEL::Exception)
4915    {
4916      std::vector<int> tmp;
4917      convertPyToNewIntArr3(li,tmp);
4918      self->setSelectedComponents(a,tmp);
4919    }
4920
4921    PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
4922    {
4923      int sz=self->getNumberOfComponents();
4924      INTERP_KERNEL::AutoPtr<int> tmp=new int[sz];
4925      self->getTuple(tupleId,tmp);
4926      return convertIntArrToPyList(tmp,sz);
4927    }
4928
4929    PyObject *changeSurjectiveFormat(int targetNb) const throw(INTERP_KERNEL::Exception)
4930    {
4931      DataArrayInt *arr=0;
4932      DataArrayInt *arrI=0;
4933      self->changeSurjectiveFormat(targetNb,arr,arrI);
4934      PyObject *res = PyList_New(2);
4935      PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
4936      PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
4937      return res;
4938    }
4939
4940    DataArrayInt *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
4941    {
4942      std::vector<std::pair<int,int> > ranges;
4943      convertPyToVectorPairInt(li,ranges);
4944      return self->selectByTupleRanges(ranges);
4945    }
4946
4947    static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
4948    {
4949      std::vector<const DataArrayInt *> tmp;
4950      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
4951      return DataArrayInt::Meld(tmp);
4952    }
4953
4954    static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
4955    {
4956      std::vector<const DataArrayInt *> tmp;
4957      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
4958      return DataArrayInt::Aggregate(tmp);
4959    }
4960
4961    static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
4962    {
4963      std::vector<const DataArrayInt *> tmp;
4964      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
4965      return DataArrayInt::BuildUnion(tmp);
4966    }
4967
4968    static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
4969    {
4970      std::vector<const DataArrayInt *> tmp;
4971      convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
4972      return DataArrayInt::BuildIntersection(tmp);
4973    }
4974
4975    PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception)
4976    {
4977      int tmp;
4978      int r1=self->getMaxValue(tmp);
4979      PyObject *ret=PyTuple_New(2);
4980      PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4981      PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4982      return ret;
4983    }
4984
4985    PyObject *getMinValue() const throw(INTERP_KERNEL::Exception)
4986    {
4987      int tmp;
4988      int r1=self->getMinValue(tmp);
4989      PyObject *ret=PyTuple_New(2);
4990      PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
4991      PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
4992      return ret;
4993    }
4994
4995    int index(PyObject *obj) const throw(INTERP_KERNEL::Exception)
4996    {
4997      int nbOfCompo=self->getNumberOfComponents();
4998      switch(nbOfCompo)
4999        {
5000          case 1:
5001          {
5002            if(PyInt_Check(obj))
5003              {
5004                int val=(int)PyInt_AS_LONG(obj);
5005                return self->locateValue(val);
5006              }
5007            else
5008              throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
5009          }
5010        default:
5011          {
5012            std::vector<int> arr;
5013            convertPyToNewIntArr3(obj,arr);
5014            return self->locateTuple(arr);
5015          }
5016        }
5017    }
5018
5019    bool __contains__(PyObject *obj) const throw(INTERP_KERNEL::Exception)
5020    {
5021      int nbOfCompo=self->getNumberOfComponents();
5022      switch(nbOfCompo)
5023        {
5024        case 0:
5025          return false;
5026        case 1:
5027          {
5028            if(PyInt_Check(obj))
5029              {
5030                int val=(int)PyInt_AS_LONG(obj);
5031                return self->presenceOfValue(val);
5032              }
5033            else
5034              throw INTERP_KERNEL::Exception("DataArrayInt::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
5035          }
5036        default:
5037          {
5038            std::vector<int> arr;
5039            convertPyToNewIntArr3(obj,arr);
5040            return self->presenceOfTuple(arr);
5041          }
5042        }
5043    }
5044
5045    PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5046    {
5047      const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
5048      self->checkAllocated();
5049      int nbOfTuples=self->getNumberOfTuples();
5050      int nbOfComponents=self->getNumberOfComponents();
5051      int it1,ic1;
5052      std::vector<int> vt1,vc1;
5053      std::pair<int, std::pair<int,int> > pt1,pc1;
5054      DataArrayInt *dt1=0,*dc1=0;
5055      int sw;
5056      convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5057      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
5058      switch(sw)
5059        {
5060        case 1:
5061          {
5062            if(nbOfComponents==1)
5063              return PyInt_FromLong(self->getIJSafe(it1,0));
5064            return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5065          }
5066        case 2:
5067          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5068        case 3:
5069          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5070        case 4:
5071          return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5072        case 5:
5073          return PyInt_FromLong(self->getIJSafe(it1,ic1));
5074        case 6:
5075          {
5076            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5077            std::vector<int> v2(1,ic1);
5078            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5079          }
5080        case 7:
5081          {
5082            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5083            std::vector<int> v2(1,ic1);
5084            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5085          }
5086        case 8:
5087          {
5088            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5089            std::vector<int> v2(1,ic1);
5090            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5091          }
5092        case 9:
5093          {
5094            ret=self->selectByTupleIdSafe(&it1,&it1+1);
5095            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5096          }
5097        case 10:
5098          {
5099            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5100            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5101          }
5102        case 11:
5103          {
5104            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5105            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5106          }
5107        case 12:
5108          {
5109            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5110            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5111          }
5112        case 13:
5113          {
5114            ret=self->selectByTupleIdSafe(&it1,&it1+1);
5115            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5116            std::vector<int> v2(nbOfComp);
5117            for(int i=0;i<nbOfComp;i++)
5118              v2[i]=pc1.first+i*pc1.second.second;
5119            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5120          }
5121        case 14:
5122          {
5123            ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
5124            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5125            std::vector<int> v2(nbOfComp);
5126            for(int i=0;i<nbOfComp;i++)
5127              v2[i]=pc1.first+i*pc1.second.second;
5128            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5129          }
5130        case 15:
5131          {
5132            ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
5133            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5134            std::vector<int> v2(nbOfComp);
5135            for(int i=0;i<nbOfComp;i++)
5136              v2[i]=pc1.first+i*pc1.second.second;
5137            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5138          }
5139        case 16:
5140          {
5141            ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
5142            int nbOfComp=(pc1.second.first-1-pc1.first)/pc1.second.second+1;
5143            std::vector<int> v2(nbOfComp);
5144            for(int i=0;i<nbOfComp;i++)
5145              v2[i]=pc1.first+i*pc1.second.second;
5146            return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
5147          }
5148        default:
5149          throw INTERP_KERNEL::Exception(msg);
5150        }
5151    }
5152
5153    DataArrayInt *__setitem__(PyObject *obj, PyObject *value) throw(INTERP_KERNEL::Exception)
5154    {
5155      self->checkAllocated();
5156      const char msg[]="Unexpected situation in __setitem__ !";
5157      int nbOfTuples=self->getNumberOfTuples();
5158      int nbOfComponents=self->getNumberOfComponents();
5159      int sw1,sw2;
5160      int i1;
5161      std::vector<int> v1;
5162      DataArrayInt *d1=0;
5163      DataArrayIntTuple *dd1=0;
5164      convertObjToPossibleCpp1(value,sw1,i1,v1,d1,dd1);
5165      int it1,ic1;
5166      std::vector<int> vt1,vc1;
5167      std::pair<int, std::pair<int,int> > pt1,pc1;
5168      DataArrayInt *dt1=0,*dc1=0;
5169      convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
5170      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
5171      switch(sw2)
5172        {
5173        case 1:
5174          {
5175            switch(sw1)
5176              {
5177              case 1:
5178                self->setPartOfValuesSimple1(i1,it1,it1+1,1,0,nbOfComponents,1);
5179                return self;
5180              case 2:
5181                tmp=DataArrayInt::New();
5182                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5183                self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1,false);
5184                return self;
5185              case 3:
5186                self->setPartOfValues1(d1,it1,it1+1,1,0,nbOfComponents,1);
5187                return self;
5188              case 4:
5189                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5190                self->setPartOfValues1(tmp,it1,it1+1,1,0,nbOfComponents,1);
5191                return self;
5192              default:
5193                throw INTERP_KERNEL::Exception(msg);
5194              }
5195            break;
5196          }
5197        case 2:
5198          {
5199            switch(sw1)
5200              {
5201              case 1:
5202                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5203                return self;
5204              case 2:
5205                tmp=DataArrayInt::New();
5206                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5207                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1,false);
5208                return self;
5209              case 3:
5210                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5211                return self;
5212              case 4:
5213                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5214                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),0,nbOfComponents,1);
5215                return self;
5216              default:
5217                throw INTERP_KERNEL::Exception(msg);
5218              }
5219            break;
5220          }
5221        case 3:
5222          {
5223            switch(sw1)
5224              {
5225              case 1:
5226                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5227                return self;
5228              case 2:
5229                tmp=DataArrayInt::New();
5230                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5231                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1,false);
5232                return self;
5233              case 3:
5234                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5235                return self;
5236              case 4:
5237                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5238                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,0,nbOfComponents,1);
5239                return self;
5240              default:
5241                throw INTERP_KERNEL::Exception(msg);
5242              }
5243            break;
5244          }
5245        case 4:
5246          {
5247            switch(sw1)
5248              {
5249              case 1:
5250                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5251                return self;
5252              case 2:
5253                tmp=DataArrayInt::New();
5254                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5255                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1,false);
5256                return self;
5257              case 3:
5258                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5259                return self;
5260              case 4:
5261                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5262                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),0,nbOfComponents,1);
5263                return self;
5264              default:
5265                throw INTERP_KERNEL::Exception(msg);
5266              }
5267            break;
5268          }
5269        case 5:
5270          {
5271            switch(sw1)
5272              {
5273              case 1:
5274                self->setPartOfValuesSimple1(i1,it1,it1+1,1,ic1,ic1+1,1);
5275                return self;
5276              case 2:
5277                tmp=DataArrayInt::New();
5278                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5279                self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1,false);
5280                return self;
5281              case 3:
5282                self->setPartOfValues1(d1,it1,it1+1,1,ic1,ic1+1,1);
5283                return self;
5284              case 4:
5285                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5286                self->setPartOfValues1(tmp,it1,it1+1,1,ic1,ic1+1,1);
5287                return self;
5288              default:
5289                throw INTERP_KERNEL::Exception(msg);
5290              }
5291            break;
5292          }
5293        case 6:
5294          {
5295            switch(sw1)
5296              {
5297              case 1:
5298                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5299                return self;
5300              case 2:
5301                tmp=DataArrayInt::New();
5302                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5303                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1,false);
5304                return self;
5305              case 3:
5306                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5307                return self;
5308              case 4:
5309                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5310                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),ic1,ic1+1,1);
5311                return self;
5312              default:
5313                throw INTERP_KERNEL::Exception(msg);
5314              }
5315            break;
5316          }
5317        case 7:
5318          {
5319            switch(sw1)
5320              {
5321              case 1:
5322                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5323                return self;
5324              case 2:
5325                tmp=DataArrayInt::New();
5326                tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5327                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1,false);
5328                return self;
5329              case 3:
5330                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5331                return self;
5332              case 4:
5333                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5334                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,ic1,ic1+1,1);
5335                return self;
5336              default:
5337                throw INTERP_KERNEL::Exception(msg);
5338              }
5339            break;
5340          }
5341        case 8:
5342          {
5343            switch(sw1)
5344              {
5345              case 1:
5346                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5347                return self;
5348              case 2:
5349                tmp=DataArrayInt::New();
5350                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5351                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1,false);
5352                return self;
5353              case 3:
5354                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5355                return self;
5356              case 4:
5357                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5358                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),ic1,ic1+1,1);
5359                return self;
5360              default:
5361                throw INTERP_KERNEL::Exception(msg);
5362              }
5363            break;
5364          }
5365        case 9:
5366          {
5367            switch(sw1)
5368              {
5369              case 1:
5370                self->setPartOfValuesSimple2(i1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5371                return self;
5372              case 2:
5373                tmp=DataArrayInt::New();
5374                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5375                self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size(),false);
5376                return self;
5377              case 3:
5378                self->setPartOfValues2(d1,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5379                return self;
5380              case 4:
5381                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5382                self->setPartOfValues2(tmp,&it1,&it1+1,&vc1[0],&vc1[0]+vc1.size());
5383                return self;
5384              default:
5385                throw INTERP_KERNEL::Exception(msg);
5386              }
5387            break;
5388          }
5389        case 10:
5390          {
5391            switch(sw1)
5392              {
5393              case 1:
5394                self->setPartOfValuesSimple2(i1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5395                return self;
5396              case 2:
5397                tmp=DataArrayInt::New();
5398                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5399                self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size(),false);
5400                return self;
5401              case 3:
5402                self->setPartOfValues2(d1,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5403                return self;
5404              case 4:
5405                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5406                self->setPartOfValues2(tmp,&vt1[0],&vt1[0]+vt1.size(),&vc1[0],&vc1[0]+vc1.size());
5407                return self;
5408              default:
5409                throw INTERP_KERNEL::Exception(msg);
5410              }
5411            break;
5412          }
5413        case 11:
5414          {
5415            int bb=pt1.first;
5416            int ee=pt1.second.first;
5417            int ss=pt1.second.second;
5418            if(ee<bb || ss<=0)
5419              throw INTERP_KERNEL::Exception("Invalid slice in tuple selection");
5420            int nbOfE=(ee-bb)/ss;
5421            std::vector<int> nv(nbOfE);
5422            for(int jj=0;jj<nbOfE;jj++)
5423              nv[jj]=bb+jj*ss;
5424            switch(sw1)
5425              {
5426              case 1:
5427                self->setPartOfValuesSimple2(i1,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
5428                return self;
5429              case 2:
5430                tmp=DataArrayInt::New();
5431                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5432                self->setPartOfValues2(tmp,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size(),false);
5433                return self;
5434              case 3:
5435                self->setPartOfValues2(d1,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
5436                return self;
5437              case 4:
5438                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5439                self->setPartOfValues2(tmp,&nv[0],&nv[0]+nv.size(),&vc1[0],&vc1[0]+vc1.size());
5440                return self;
5441              default:
5442                throw INTERP_KERNEL::Exception(msg);
5443              }
5444            break;
5445          }
5446        case 12:
5447          {
5448            switch(sw1)
5449              {
5450              case 1:
5451                self->setPartOfValuesSimple2(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5452                return self;
5453              case 2:
5454                tmp=DataArrayInt::New();
5455                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5456                self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size(),false);
5457                return self;
5458              case 3:
5459                self->setPartOfValues2(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5460                return self;
5461              case 4:
5462                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5463                self->setPartOfValues2(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),&vc1[0],&vc1[0]+vc1.size());
5464                return self;
5465              default:
5466                throw INTERP_KERNEL::Exception(msg);
5467              }
5468            break;
5469          }
5470        case 13:
5471          {
5472            switch(sw1)
5473              {
5474              case 1:
5475                self->setPartOfValuesSimple1(i1,it1,it1+1,1,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,v1.size(),1);
5480                self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second,false);
5481                return self;
5482              case 3:
5483                self->setPartOfValues1(d1,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5484                return self;
5485              case 4:
5486                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5487                self->setPartOfValues1(tmp,it1,it1+1,1,pc1.first,pc1.second.first,pc1.second.second);
5488                return self;
5489              default:
5490                throw INTERP_KERNEL::Exception(msg);
5491              }
5492            break;
5493          }
5494        case 14:
5495          {
5496            switch(sw1)
5497              {
5498              case 1:
5499                self->setPartOfValuesSimple3(i1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5500                return self;
5501              case 2:
5502                tmp=DataArrayInt::New();
5503                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5504                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second,false);
5505                return self;
5506              case 3:
5507                self->setPartOfValues3(d1,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5508                return self;
5509              case 4:
5510                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5511                self->setPartOfValues3(tmp,&vt1[0],&vt1[0]+vt1.size(),pc1.first,pc1.second.first,pc1.second.second);
5512                return self;
5513              default:
5514                throw INTERP_KERNEL::Exception(msg);
5515              }
5516            break;
5517          }
5518        case 15:
5519          {
5520            switch(sw1)
5521              {
5522              case 1:
5523                self->setPartOfValuesSimple1(i1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5524                return self;
5525              case 2:
5526                  tmp=DataArrayInt::New();
5527                  tmp->useArray(&v1[0],false,CPP_DEALLOC,v1.size(),1);
5528                  self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second,false);
5529                  return self;
5530              case 3:
5531                self->setPartOfValues1(d1,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5532                return self;
5533              case 4:
5534                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5535                self->setPartOfValues1(tmp,pt1.first,pt1.second.first,pt1.second.second,pc1.first,pc1.second.first,pc1.second.second);
5536                return self;
5537              default:
5538                throw INTERP_KERNEL::Exception(msg);
5539              }
5540            break;
5541          }
5542        case 16:
5543          {
5544            switch(sw1)
5545              {
5546              case 1:
5547                self->setPartOfValuesSimple3(i1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5548                return self;
5549              case 2:
5550                tmp=DataArrayInt::New();
5551                tmp->useArray(&v1[0],false,CPP_DEALLOC,1,v1.size());
5552                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second,false);
5553                return self;
5554              case 3:
5555                self->setPartOfValues3(d1,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5556                return self;
5557              case 4:
5558                tmp=dd1->buildDAInt(1,self->getNumberOfComponents());
5559                self->setPartOfValues3(tmp,dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems(),pc1.first,pc1.second.first,pc1.second.second);
5560                return self;
5561              default:
5562                throw INTERP_KERNEL::Exception(msg);
5563              }
5564            break;
5565          }
5566        default:
5567          throw INTERP_KERNEL::Exception(msg);
5568        }
5569      return self;
5570    }
5571
5572    DataArrayInt *__neg__() const throw(INTERP_KERNEL::Exception)
5573    {
5574      return self->negate();
5575    }
5576  
5577    DataArrayInt *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5578    {
5579      const char msg[]="Unexpected situation in __add__ !";
5580      int val;
5581      DataArrayInt *a;
5582      std::vector<int> aa;
5583      DataArrayIntTuple *aaa;
5584      int sw;
5585      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5586      switch(sw)
5587        {
5588        case 1:
5589          {
5590            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5591            ret->applyLin(1,val);
5592            ret->incrRef();
5593            return ret;
5594          }
5595        case 2:
5596          {
5597            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5598            return DataArrayInt::Add(self,aaa);
5599          }
5600        case 3:
5601          {
5602            return DataArrayInt::Add(self,a);
5603          }
5604        case 4:
5605          {
5606            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5607            return DataArrayInt::Add(self,aaaa);
5608          }
5609        default:
5610          throw INTERP_KERNEL::Exception(msg);
5611        }
5612    }
5613
5614    DataArrayInt *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5615    {
5616      const char msg[]="Unexpected situation in __radd__ !";
5617      int val;
5618      DataArrayInt *a;
5619      std::vector<int> aa;
5620      DataArrayIntTuple *aaa;
5621      int sw;
5622      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5623      switch(sw)
5624        {
5625        case 1:
5626          {
5627            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5628            ret->applyLin(1,val);
5629            ret->incrRef();
5630            return ret;
5631          }
5632        case 2:
5633          {
5634            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5635            return DataArrayInt::Add(self,aaa);
5636          }
5637        case 4:
5638          {
5639            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5640            return DataArrayInt::Add(self,aaaa);
5641          }
5642        default:
5643          throw INTERP_KERNEL::Exception(msg);
5644        }
5645    }
5646
5647    PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5648    {
5649      const char msg[]="Unexpected situation in __iadd__ !";
5650      int val;
5651      DataArrayInt *a;
5652      std::vector<int> aa;
5653      DataArrayIntTuple *aaa;
5654      int sw;
5655      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5656      switch(sw)
5657        {
5658        case 1:
5659          {
5660            self->applyLin(1,val);
5661            Py_XINCREF(trueSelf);
5662            return trueSelf;
5663          }
5664        case 2:
5665          {
5666            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5667            self->addEqual(bb);
5668            Py_XINCREF(trueSelf);
5669            return trueSelf;
5670          }
5671        case 3:
5672          {
5673            self->addEqual(a);
5674            Py_XINCREF(trueSelf);
5675            return trueSelf;
5676          }
5677        case 4:
5678          {
5679            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5680            self->addEqual(aaaa);
5681            Py_XINCREF(trueSelf);
5682            return trueSelf;
5683          }
5684        default:
5685          throw INTERP_KERNEL::Exception(msg);
5686        }
5687    }
5688
5689    DataArrayInt *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5690    {
5691      const char msg[]="Unexpected situation in __sub__ !";
5692      int val;
5693      DataArrayInt *a;
5694      std::vector<int> aa;
5695      DataArrayIntTuple *aaa;
5696      int sw;
5697      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5698      switch(sw)
5699        {
5700        case 1:
5701          {
5702            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5703            ret->applyLin(1,-val);
5704            ret->incrRef();
5705            return ret;
5706          }
5707        case 2:
5708          {
5709            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5710            return DataArrayInt::Substract(self,aaa);
5711          }
5712        case 3:
5713          {
5714            return DataArrayInt::Substract(self,a);
5715          }
5716        case 4:
5717          {
5718            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5719            return DataArrayInt::Substract(self,aaaa);
5720          }
5721        default:
5722          throw INTERP_KERNEL::Exception(msg);
5723        }
5724    }
5725
5726    DataArrayInt *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5727    {
5728      const char msg[]="Unexpected situation in __rsub__ !";
5729      int val;
5730      DataArrayInt *a;
5731      std::vector<int> aa;
5732      DataArrayIntTuple *aaa;
5733      int sw;
5734      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5735      switch(sw)
5736        {
5737        case 1:
5738          {
5739            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5740            ret->applyLin(-1,val);
5741            ret->incrRef();
5742            return ret;
5743          }
5744        case 2:
5745          {
5746            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5747            return DataArrayInt::Substract(aaa,self);
5748          }
5749        case 4:
5750          {
5751            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5752            return DataArrayInt::Substract(aaaa,self);
5753          }
5754        default:
5755          throw INTERP_KERNEL::Exception(msg);
5756        }
5757    }
5758
5759    PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5760    {
5761      const char msg[]="Unexpected situation in __isub__ !";
5762      int val;
5763      DataArrayInt *a;
5764      std::vector<int> aa;
5765      DataArrayIntTuple *aaa;
5766      int sw;
5767      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5768      switch(sw)
5769        {
5770        case 1:
5771          {
5772            self->applyLin(1,-val);
5773            Py_XINCREF(trueSelf);
5774            return trueSelf;
5775          }
5776        case 2:
5777          {
5778            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5779            self->substractEqual(bb);
5780            Py_XINCREF(trueSelf);
5781            return trueSelf;
5782          }
5783        case 3:
5784          {
5785            self->substractEqual(a);
5786            Py_XINCREF(trueSelf);
5787            return trueSelf;
5788          }
5789        case 4:
5790          {
5791            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5792            self->substractEqual(aaaa);
5793            Py_XINCREF(trueSelf);
5794            return trueSelf;
5795          }
5796        default:
5797          throw INTERP_KERNEL::Exception(msg);
5798        }
5799    }
5800
5801    DataArrayInt *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5802    {
5803      const char msg[]="Unexpected situation in __mul__ !";
5804      int val;
5805      DataArrayInt *a;
5806      std::vector<int> aa;
5807      DataArrayIntTuple *aaa;
5808      int sw;
5809      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5810      switch(sw)
5811        {
5812        case 1:
5813          {
5814            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5815            ret->applyLin(val,0);
5816            ret->incrRef();
5817            return ret;
5818          }
5819        case 2:
5820          {
5821            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5822            return DataArrayInt::Multiply(self,aaa);
5823          }
5824        case 3:
5825          {
5826            return DataArrayInt::Multiply(self,a);
5827          }
5828        case 4:
5829          {
5830            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5831            return DataArrayInt::Multiply(self,aaaa);
5832          }
5833        default:
5834          throw INTERP_KERNEL::Exception(msg);
5835        }
5836    }
5837
5838    DataArrayInt *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5839    {
5840      const char msg[]="Unexpected situation in __rmul__ !";
5841      int val;
5842      DataArrayInt *a;
5843      std::vector<int> aa;
5844      DataArrayIntTuple *aaa;
5845      int sw;
5846      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5847      switch(sw)
5848        {
5849        case 1:
5850          {
5851            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5852            ret->applyLin(val,0);
5853            ret->incrRef();
5854            return ret;
5855          }
5856        case 2:
5857          {
5858            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5859            return DataArrayInt::Multiply(self,aaa);
5860          }
5861        case 4:
5862          {
5863            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5864            return DataArrayInt::Multiply(self,aaaa);
5865          }
5866        default:
5867          throw INTERP_KERNEL::Exception(msg);
5868        }
5869    }
5870
5871    PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5872    {
5873      const char msg[]="Unexpected situation in __imul__ !";
5874      int val;
5875      DataArrayInt *a;
5876      std::vector<int> aa;
5877      DataArrayIntTuple *aaa;
5878      int sw;
5879      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5880      switch(sw)
5881        {
5882        case 1:
5883          {
5884            self->applyLin(val,0);
5885            Py_XINCREF(trueSelf);
5886            return trueSelf;
5887          }
5888        case 2:
5889          {
5890            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5891            self->multiplyEqual(bb);
5892            Py_XINCREF(trueSelf);
5893            return trueSelf;
5894          }
5895        case 3:
5896          {
5897            self->multiplyEqual(a);
5898            Py_XINCREF(trueSelf);
5899            return trueSelf;
5900          }
5901        case 4:
5902          {
5903            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5904            self->multiplyEqual(aaaa);
5905            Py_XINCREF(trueSelf);
5906            return trueSelf;
5907          }
5908        default:
5909          throw INTERP_KERNEL::Exception(msg);
5910        }
5911    }
5912
5913    DataArrayInt *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5914    {
5915      const char msg[]="Unexpected situation in __div__ !";
5916      int val;
5917      DataArrayInt *a;
5918      std::vector<int> aa;
5919      DataArrayIntTuple *aaa;
5920      int sw;
5921      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5922      switch(sw)
5923        {
5924        case 1:
5925          {
5926            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5927            ret->applyDivideBy(val);
5928            ret->incrRef();
5929            return ret;
5930          }
5931        case 2:
5932          {
5933            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5934            return DataArrayInt::Divide(self,aaa);
5935          }
5936        case 3:
5937          {
5938            return DataArrayInt::Divide(self,a);
5939          }
5940        case 4:
5941          {
5942            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5943            return DataArrayInt::Divide(self,aaaa);
5944          }
5945        default:
5946          throw INTERP_KERNEL::Exception(msg);
5947        }
5948    }
5949
5950    DataArrayInt *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
5951    {
5952      const char msg[]="Unexpected situation in __rdiv__ !";
5953      int val;
5954      DataArrayInt *a;
5955      std::vector<int> aa;
5956      DataArrayIntTuple *aaa;
5957      int sw;
5958      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5959      switch(sw)
5960        {
5961        case 1:
5962          {
5963            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
5964            ret->applyInv(val);
5965            ret->incrRef();
5966            return ret;
5967          }
5968        case 2:
5969          {
5970            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
5971            return DataArrayInt::Divide(aaa,self);
5972          }
5973        case 4:
5974          {
5975            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
5976            return DataArrayInt::Divide(aaaa,self);
5977          }
5978        default:
5979          throw INTERP_KERNEL::Exception(msg);
5980        }
5981    }
5982
5983    PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
5984    {
5985      const char msg[]="Unexpected situation in __idiv__ !";
5986      int val;
5987      DataArrayInt *a;
5988      std::vector<int> aa;
5989      DataArrayIntTuple *aaa;
5990      int sw;
5991      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
5992      switch(sw)
5993        {
5994        case 1:
5995          {
5996            self->applyDivideBy(val);
5997            Py_XINCREF(trueSelf);
5998            return trueSelf;
5999          }
6000        case 2:
6001          {
6002            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6003            self->divideEqual(bb);
6004            Py_XINCREF(trueSelf);
6005            return trueSelf;
6006          }
6007        case 3:
6008          {
6009            self->divideEqual(a);
6010            Py_XINCREF(trueSelf);
6011            return trueSelf;
6012          }
6013        case 4:
6014          {
6015            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6016            self->divideEqual(aaaa);
6017            Py_XINCREF(trueSelf);
6018            return trueSelf;
6019          }
6020        default:
6021          throw INTERP_KERNEL::Exception(msg);
6022        }
6023    }
6024
6025    DataArrayInt *__mod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6026    {
6027      const char msg[]="Unexpected situation in __mod__ !";
6028      int val;
6029      DataArrayInt *a;
6030      std::vector<int> aa;
6031      DataArrayIntTuple *aaa;
6032      int sw;
6033      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6034      switch(sw)
6035        {
6036        case 1:
6037          {
6038            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6039            ret->applyModulus(val);
6040            ret->incrRef();
6041            return ret;
6042          }
6043        case 2:
6044          {
6045            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6046            return DataArrayInt::Modulus(self,aaa);
6047          }
6048        case 3:
6049          {
6050            return DataArrayInt::Modulus(self,a);
6051          }
6052        case 4:
6053          {
6054            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6055            return DataArrayInt::Modulus(self,aaaa);
6056          }
6057        default:
6058          throw INTERP_KERNEL::Exception(msg);
6059        }
6060    }
6061
6062    DataArrayInt *__rmod__(PyObject *obj) throw(INTERP_KERNEL::Exception)
6063    {
6064      const char msg[]="Unexpected situation in __rmod__ !";
6065      int val;
6066      DataArrayInt *a;
6067      std::vector<int> aa;
6068      DataArrayIntTuple *aaa;
6069      int sw;
6070      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6071      switch(sw)
6072        {
6073        case 1:
6074          {
6075            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
6076            ret->applyRModulus(val);
6077            ret->incrRef();
6078            return ret;
6079          }
6080        case 2:
6081          {
6082            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaa=DataArrayInt::New(); aaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
6083            return DataArrayInt::Modulus(aaa,self);
6084          }
6085        case 3:
6086          {
6087            return DataArrayInt::Modulus(a,self);
6088          }
6089        case 4:
6090          {
6091            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6092            return DataArrayInt::Modulus(aaaa,self);
6093          }
6094        default:
6095          throw INTERP_KERNEL::Exception(msg);
6096        }
6097    }
6098
6099    PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
6100    {
6101      const char msg[]="Unexpected situation in __imod__ !";
6102      int val;
6103      DataArrayInt *a;
6104      std::vector<int> aa;
6105      DataArrayIntTuple *aaa;
6106      int sw;
6107      convertObjToPossibleCpp1(obj,sw,val,aa,a,aaa);
6108      switch(sw)
6109        {
6110        case 1:
6111          {
6112            self->applyModulus(val);
6113            Py_XINCREF(trueSelf);
6114            return trueSelf;
6115          }
6116        case 3:
6117          {
6118            self->modulusEqual(a);
6119            Py_XINCREF(trueSelf);
6120            return trueSelf;
6121          }
6122        case 4:
6123          {
6124            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
6125            self->modulusEqual(aaaa);
6126            Py_XINCREF(trueSelf);
6127            return trueSelf;
6128          }
6129        default:
6130          throw INTERP_KERNEL::Exception(msg);
6131        }
6132    }
6133  };
6134
6135 namespace ParaMEDMEM
6136 {
6137   class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
6138   {
6139   public:
6140     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
6141     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
6142     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6143     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
6144     void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
6145     void setName(const char *name) throw(INTERP_KERNEL::Exception);
6146     const char *getDescription() const throw(INTERP_KERNEL::Exception);
6147     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
6148     const char *getName() const throw(INTERP_KERNEL::Exception);
6149     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
6150     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
6151     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
6152     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
6153     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
6154     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
6155     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
6156     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
6157                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
6158     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
6159     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
6160     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
6161     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
6162     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
6163     %extend {
6164       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
6165       {
6166         MEDCouplingMesh *ret1=(MEDCouplingMesh *)self->getMesh();
6167         if(ret1)
6168           ret1->incrRef();
6169         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
6170       }
6171
6172       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
6173       {
6174         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
6175         if(ret)
6176           ret->incrRef();
6177         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
6178       }
6179
6180       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
6181       {
6182         std::string ret1;
6183         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
6184         PyObject *ret=PyTuple_New(2);
6185         PyObject *ret0Py=ret0?Py_True:Py_False;
6186         Py_XINCREF(ret0Py);
6187         PyTuple_SetItem(ret,0,ret0Py);
6188         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6189         return ret;
6190       }
6191
6192       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
6193       {
6194         DataArrayInt *ret1=0;
6195         MEDCouplingMesh *ret0=0;
6196         void *da=0;
6197         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
6198         if (!SWIG_IsOK(res1))
6199           {
6200             int size;
6201             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6202             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
6203           }
6204         else
6205           {
6206             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6207             if(!da2)
6208               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6209             da2->checkAllocated();
6210             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
6211           }
6212         PyObject *res = PyList_New(2);
6213         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
6214         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
6215         return res;
6216       }
6217
6218       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
6219       {
6220         int sw;
6221         int pos1;
6222         std::vector<int> pos2;
6223         DataArrayInt *pos3=0;
6224         DataArrayIntTuple *pos4=0;
6225         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
6226         switch(sw)
6227           {
6228           case 1:
6229             {
6230               return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
6231             }
6232           case 2:
6233             {
6234               return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
6235             }
6236           case 3:
6237             {
6238               return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
6239             }
6240           default:
6241             throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
6242           }
6243       }
6244
6245       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
6246                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
6247       {
6248         void *da=0;
6249         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
6250         if (!SWIG_IsOK(res1))
6251           {
6252             int size;
6253             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6254             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
6255           }
6256         else
6257           {
6258             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6259             if(!da2)
6260               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6261             da2->checkAllocated();
6262             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
6263           }
6264       }
6265
6266       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
6267       {
6268         std::vector<int> tmp;
6269         self->getCellIdsHavingGaussLocalization(locId,tmp);
6270         DataArrayInt *ret=DataArrayInt::New();
6271         ret->alloc((int)tmp.size(),1);
6272         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
6273         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
6274       }
6275     }
6276   };
6277
6278   class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
6279   {
6280   public:
6281     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=NO_TIME);
6282     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate *ft, TypeOfTimeDiscretization td=NO_TIME);
6283     void setTimeUnit(const char *unit);
6284     const char *getTimeUnit() const;
6285     void copyTinyStringsFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6286     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
6287     std::string simpleRepr() const;
6288     std::string advancedRepr() const;
6289     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
6290     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
6291     MEDCouplingFieldDouble *deepCpy() const;
6292     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
6293     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
6294     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
6295     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
6296     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6297     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
6298     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6299     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6300     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
6301     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
6302     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
6303     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
6304     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
6305     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
6306     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
6307     void setIteration(int it) throw(INTERP_KERNEL::Exception);
6308     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
6309     void setOrder(int order) throw(INTERP_KERNEL::Exception);
6310     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
6311     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
6312     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
6313     void updateTime() const throw(INTERP_KERNEL::Exception);
6314     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6315     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double prec) throw(INTERP_KERNEL::Exception);
6316     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6317     bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6318     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6319     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
6320     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
6321     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
6322     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
6323     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
6324     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
6325     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
6326     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
6327     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
6328     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
6329     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
6330     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
6331     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
6332     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
6333     void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6334     void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6335     void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6336     void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6337     void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
6338     void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
6339     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
6340     void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
6341     void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
6342     void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
6343     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
6344     double getMaxValue() const throw(INTERP_KERNEL::Exception);
6345     double getMinValue() const throw(INTERP_KERNEL::Exception);
6346     double getAverageValue() const throw(INTERP_KERNEL::Exception);
6347     double norm2() const throw(INTERP_KERNEL::Exception);
6348     double normMax() const throw(INTERP_KERNEL::Exception);
6349     double getWeightedAverageValue() const throw(INTERP_KERNEL::Exception);
6350     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
6351     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
6352     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
6353     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
6354     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6355     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6356     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6357     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6358     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6359     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6360     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6361     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6362     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6363     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6364     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6365     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6366     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
6367     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6368     MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6369     MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6370     MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6371     MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
6372     %extend {
6373       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=NO_TIME)
6374       {
6375         return MEDCouplingFieldDouble::New(type,td);
6376       }
6377
6378       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate *ft, TypeOfTimeDiscretization td=NO_TIME)
6379       {
6380         return MEDCouplingFieldDouble::New(ft,td);
6381       }
6382
6383       std::string __str__() const
6384       {
6385         return self->simpleRepr();
6386       }
6387
6388       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
6389       {
6390         DataArrayDouble *ret=self->getArray();
6391         if(ret)
6392           ret->incrRef();
6393         return ret;
6394       }
6395
6396       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
6397       {
6398         std::vector<DataArrayDouble *> arrs=self->getArrays();
6399         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
6400           if(*it)
6401             (*it)->incrRef();
6402         int sz=arrs.size();
6403         PyObject *ret=PyTuple_New(sz);
6404         for(int i=0;i<sz;i++)
6405           {
6406             if(arrs[i])
6407               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6408             else
6409               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
6410           }
6411         return ret;
6412       }
6413
6414       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
6415       {
6416         std::vector<const DataArrayDouble *> tmp;
6417         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
6418         int sz=tmp.size();
6419         std::vector<DataArrayDouble *> arrs(sz);
6420         for(int i=0;i<sz;i++)
6421           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
6422         self->setArrays(arrs);
6423       }
6424
6425       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
6426       {
6427         DataArrayDouble *ret=self->getEndArray();
6428         if(ret)
6429           ret->incrRef();
6430         return ret;
6431       }
6432
6433       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
6434       {
6435         double val;
6436         DataArrayDouble *a;
6437         DataArrayDoubleTuple *aa;
6438         std::vector<double> bb;
6439         int sw;
6440         const MEDCouplingMesh *mesh=self->getMesh();
6441         if(!mesh)
6442           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6443         int spaceDim=mesh->getSpaceDimension();
6444         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6445         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6446         //
6447         int sz=self->getNumberOfComponents();
6448         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6449         self->getValueOn(spaceLoc,res);
6450         return convertDblArrToPyList(res,sz);
6451       }
6452
6453        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
6454        {
6455          int sz=self->getNumberOfComponents();
6456          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6457          self->getValueOnPos(i,j,k,res);
6458          return convertDblArrToPyList(res,sz);
6459        }
6460
6461       DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
6462       {
6463         void *da=0;
6464         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
6465         if (!SWIG_IsOK(res1))
6466           {
6467             int size;
6468             INTERP_KERNEL::AutoPtr<double> tmp=convertPyToNewDblArr2(li,&size);
6469             const MEDCouplingMesh *mesh=self->getMesh();
6470             if(!mesh)
6471               throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6472             int spaceDim=mesh->getSpaceDimension();
6473             int nbOfPoints=size/spaceDim;
6474             if(size%spaceDim!=0)
6475               {
6476                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
6477               }
6478             return self->getValueOnMulti(tmp,nbOfPoints);
6479           }
6480         else
6481           {
6482             DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
6483             if(!da2)
6484               throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
6485             da2->checkAllocated();
6486             int size=da2->getNumberOfTuples();
6487             int nbOfCompo=da2->getNumberOfComponents();
6488             const MEDCouplingMesh *mesh=self->getMesh();
6489             if(!mesh)
6490               throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
6491             if(nbOfCompo!=mesh->getSpaceDimension())
6492               {
6493                 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
6494               }
6495             return self->getValueOnMulti(da2->getConstPointer(),size);
6496           }
6497       }
6498
6499       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
6500       {
6501         double val;
6502         DataArrayDouble *a;
6503         DataArrayDoubleTuple *aa;
6504         std::vector<double> bb;
6505         int sw;
6506         const MEDCouplingMesh *mesh=self->getMesh();
6507         if(!mesh)
6508           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
6509         int spaceDim=mesh->getSpaceDimension();
6510         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
6511         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
6512         //
6513         //
6514         int sz=self->getNumberOfComponents();
6515         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
6516         self->getValueOn(spaceLoc,time,res);
6517         return convertDblArrToPyList(res,sz);
6518       }
6519
6520       void setValues(PyObject *li) throw(INTERP_KERNEL::Exception)
6521       {
6522         if(self->getArray()!=0)
6523           {
6524             int sz;
6525             double *tmp=convertPyToNewDblArr2(li,&sz);
6526             int nbTuples=self->getArray()->getNumberOfTuples();
6527             int nbOfCompo=self->getArray()->getNumberOfComponents();
6528             self->getArray()->useArray(tmp,true,CPP_DEALLOC,nbTuples,nbOfCompo);
6529           }
6530         else
6531           throw INTERP_KERNEL::Exception("setValuesCpy : field must contain an array behind");
6532       }
6533       
6534       PyObject *getTime() throw(INTERP_KERNEL::Exception)
6535       {
6536         int tmp1,tmp2;
6537         double tmp0=self->getTime(tmp1,tmp2);
6538         PyObject *res = PyList_New(3);
6539         PyList_SetItem(res,0,SWIG_From_double(tmp0));
6540         PyList_SetItem(res,1,SWIG_From_int(tmp1));
6541         PyList_SetItem(res,2,SWIG_From_int(tmp2));
6542         return res;
6543       }
6544
6545       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
6546       {
6547         int tmp1,tmp2;
6548         double tmp0=self->getStartTime(tmp1,tmp2);
6549         PyObject *res = PyList_New(3);
6550         PyList_SetItem(res,0,SWIG_From_double(tmp0));
6551         PyList_SetItem(res,1,SWIG_From_int(tmp1));
6552         PyList_SetItem(res,2,SWIG_From_int(tmp2));
6553         return res;
6554       }
6555
6556       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
6557       {
6558         int tmp1,tmp2;
6559         double tmp0=self->getEndTime(tmp1,tmp2);
6560         PyObject *res = PyList_New(3);
6561         PyList_SetItem(res,0,SWIG_From_double(tmp0));
6562         PyList_SetItem(res,1,SWIG_From_int(tmp1));
6563         PyList_SetItem(res,2,SWIG_From_int(tmp2));
6564         return res;
6565       }
6566       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
6567       {
6568         int sz=self->getNumberOfComponents();
6569         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6570         self->accumulate(tmp);
6571         PyObject *ret=convertDblArrToPyList(tmp,sz);
6572         return ret;
6573       }
6574       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
6575       {
6576         int sz=self->getNumberOfComponents();
6577         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6578         self->integral(isWAbs,tmp);
6579         PyObject *ret=convertDblArrToPyList(tmp,sz);
6580         return ret;
6581       }
6582       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
6583       {
6584         int sz=self->getNumberOfComponents();
6585         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6586         self->normL1(tmp);
6587         PyObject *ret=convertDblArrToPyList(tmp,sz);
6588         return ret;
6589       }
6590       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
6591       {
6592         int sz=self->getNumberOfComponents();
6593         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
6594         self->normL2(tmp);
6595         PyObject *ret=convertDblArrToPyList(tmp,sz);
6596         return ret;
6597       }
6598       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
6599       {
6600         void *da=0;
6601         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
6602         if (!SWIG_IsOK(res1))
6603           {
6604             int size;
6605             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6606             self->renumberCells(tmp,check);
6607           }
6608         else
6609           {
6610             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6611             if(!da2)
6612               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6613             da2->checkAllocated();
6614             self->renumberCells(da2->getConstPointer(),check);
6615           }
6616       }
6617       void renumberNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
6618       {
6619         void *da=0;
6620         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
6621         if (!SWIG_IsOK(res1))
6622           {
6623             int size;
6624             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
6625             self->renumberNodes(tmp);
6626           }
6627         else
6628           {
6629             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
6630             if(!da2)
6631               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
6632             da2->checkAllocated();
6633             self->renumberNodes(da2->getConstPointer());
6634           }
6635       }
6636
6637       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
6638       {
6639         int sw;
6640         int singleVal;
6641         std::vector<int> multiVal;
6642         std::pair<int, std::pair<int,int> > slic;
6643         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
6644         const MEDCouplingMesh *mesh=self->getMesh();
6645         if(!mesh)
6646           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
6647         int nbc=mesh->getNumberOfCells();
6648         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
6649         switch(sw)
6650           {
6651           case 1:
6652             {
6653               if(singleVal>=nbc)
6654                 {
6655                   std::ostringstream oss;
6656                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6657                   throw INTERP_KERNEL::Exception(oss.str().c_str());
6658                 }
6659               if(singleVal>=0)
6660                 return self->buildSubPart(&singleVal,&singleVal+1);
6661               else
6662                 {
6663                   if(nbc+singleVal>0)
6664                     {
6665                       int tmp=nbc+singleVal;
6666                       return self->buildSubPart(&tmp,&tmp+1);
6667                     }
6668                   else
6669                     {
6670                       std::ostringstream oss;
6671                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
6672                       throw INTERP_KERNEL::Exception(oss.str().c_str());
6673                     }
6674                 }
6675             }
6676           case 2:
6677             {
6678               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
6679             }
6680           case 3:
6681             {
6682               MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rg=DataArrayInt::Range(slic.first,slic.second.first,slic.second.second);
6683               return self->buildSubPart(rg->begin(),rg->end());
6684             }
6685           case 4:
6686             {
6687               if(!daIntTyypp)
6688                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
6689               daIntTyypp->checkAllocated();
6690               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
6691             }
6692           default:
6693             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
6694           }
6695       }
6696
6697       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
6698       {
6699         return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
6700       }
6701
6702       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
6703       {
6704         DataArrayInt *tmp;
6705         double r1=self->getMaxValue2(tmp);
6706         PyObject *ret=PyTuple_New(2);
6707         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6708         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6709         return ret;
6710       }
6711       
6712       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
6713       {
6714         DataArrayInt *tmp;
6715         double r1=self->getMinValue2(tmp);
6716         PyObject *ret=PyTuple_New(2);
6717         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
6718         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
6719         return ret;
6720       }
6721       
6722       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
6723       {
6724         std::vector<int> tmp;
6725         convertPyToNewIntArr3(li,tmp);
6726         return self->keepSelectedComponents(tmp);
6727       }
6728
6729       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
6730       {
6731         std::vector<int> tmp;
6732         convertPyToNewIntArr3(li,tmp);
6733         self->setSelectedComponents(f,tmp);
6734       }
6735
6736       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
6737       {
6738         double val,val2;
6739         DataArrayDouble *a,*a2;
6740         DataArrayDoubleTuple *aa,*aa2;
6741         std::vector<double> bb,bb2;
6742         int sw;
6743         int spaceDim=3;
6744         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
6745         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
6746         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
6747         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
6748         //
6749         return self->extractSlice3D(orig,vect,eps);
6750       }
6751
6752       PyObject *___iadd___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6753       {
6754         *self+=other;
6755         Py_XINCREF(trueSelf);
6756         return trueSelf;
6757       }
6758       
6759       PyObject *___isub___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6760       {
6761         *self-=other;
6762         Py_XINCREF(trueSelf);
6763         return trueSelf;
6764       }
6765
6766       PyObject *___imul___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6767       {
6768         *self*=other;
6769         Py_XINCREF(trueSelf);
6770         return trueSelf;
6771       }
6772
6773       PyObject *___idiv___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
6774       {
6775         *self/=other;
6776         Py_XINCREF(trueSelf);
6777         return trueSelf;
6778       }
6779
6780       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
6781       {
6782         std::vector<const MEDCouplingFieldDouble *> tmp;
6783         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
6784         return MEDCouplingFieldDouble::MergeFields(tmp);
6785       }
6786
6787       static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
6788       {
6789         std::vector<const MEDCouplingFieldDouble *> tmp;
6790         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
6791         MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
6792       }
6793     }
6794   };
6795
6796   class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
6797   {
6798   public:
6799     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
6800     static MEDCouplingFieldTemplate *New(TypeOfField type);
6801     std::string simpleRepr() const;
6802     std::string advancedRepr() const;
6803     void updateTime() const;
6804     %extend
6805        {
6806          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception)
6807          {
6808            return MEDCouplingFieldTemplate::New(f);
6809          }
6810          
6811          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
6812          {
6813            return MEDCouplingFieldTemplate::New(type);
6814          }
6815          
6816          std::string __str__() const
6817            {
6818              return self->simpleRepr();
6819            }
6820        }
6821   };
6822
6823   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
6824   {
6825   public:
6826     int getNumberOfFields() const;
6827     MEDCouplingMultiFields *deepCpy() const;
6828     virtual std::string simpleRepr() const;
6829     virtual std::string advancedRepr() const;
6830     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
6831     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
6832     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
6833     void updateTime() const throw(INTERP_KERNEL::Exception);
6834     %extend
6835        {
6836          std::string __str__() const
6837          {
6838            return self->simpleRepr();
6839          }
6840          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
6841          {
6842            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
6843            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
6844            int sz=tmp.size();
6845            std::vector<MEDCouplingFieldDouble *> fs(sz);
6846            for(int i=0;i<sz;i++)
6847              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
6848            return MEDCouplingMultiFields::New(fs);
6849          }
6850          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
6851          {
6852            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
6853            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
6854            int sz=tmp.size();
6855            std::vector<MEDCouplingFieldDouble *> fs(sz);
6856            for(int i=0;i<sz;i++)
6857              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
6858            return MEDCouplingMultiFields::New(fs);
6859          }
6860          PyObject *getFields() const
6861          {
6862            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
6863            int sz=fields.size();
6864            PyObject *res = PyList_New(sz);
6865            for(int i=0;i<sz;i++)
6866              {
6867                if(fields[i])
6868                  {
6869                    fields[i]->incrRef();
6870                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
6871                  }
6872                else
6873                  {
6874                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
6875                  }
6876              }
6877            return res;
6878          }
6879          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
6880          {
6881            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
6882            if(ret)
6883              {
6884                ret->incrRef();
6885                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
6886              }
6887            else
6888              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
6889          }
6890          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
6891          {
6892            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
6893            int sz=ms.size();
6894            PyObject *res = PyList_New(sz);
6895            for(int i=0;i<sz;i++)
6896              {
6897                if(ms[i])
6898                  {
6899                    ms[i]->incrRef();
6900                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
6901                  }
6902                else
6903                  {
6904                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
6905                  }
6906              }
6907            return res;
6908          }
6909          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
6910          {
6911            std::vector<int> refs;
6912            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
6913            int sz=ms.size();
6914            PyObject *res = PyList_New(sz);
6915            for(int i=0;i<sz;i++)
6916              {
6917                if(ms[i])
6918                  {
6919                    ms[i]->incrRef();
6920                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
6921                  }
6922                else
6923                  {
6924                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
6925                  }
6926              }
6927            //
6928            PyObject *ret=PyTuple_New(2);
6929            PyTuple_SetItem(ret,0,res);
6930            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
6931            return ret;
6932          }
6933          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
6934          {
6935            std::vector<DataArrayDouble *> ms=self->getArrays();
6936            int sz=ms.size();
6937            PyObject *res = PyList_New(sz);
6938            for(int i=0;i<sz;i++)
6939              {
6940                if(ms[i])
6941                  {
6942                    ms[i]->incrRef();
6943                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6944                  }
6945                else
6946                  {
6947                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
6948                  }
6949              }
6950            return res;
6951          }
6952          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
6953          {
6954            std::vector< std::vector<int> > refs;
6955            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
6956            int sz=ms.size();
6957            PyObject *res = PyList_New(sz);
6958            PyObject *res2 = PyList_New(sz);
6959            for(int i=0;i<sz;i++)
6960              {
6961                if(ms[i])
6962                  {
6963                    ms[i]->incrRef();
6964                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6965                  }
6966                else
6967                  {
6968                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
6969                  }
6970                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
6971              }
6972            //
6973            PyObject *ret=PyTuple_New(2);
6974            PyTuple_SetItem(ret,0,res);
6975            PyTuple_SetItem(ret,1,res2);
6976            return ret;
6977          }
6978        }
6979   };
6980   
6981   class MEDCouplingDefinitionTime
6982   {
6983   public:
6984     MEDCouplingDefinitionTime();
6985     void assign(const MEDCouplingDefinitionTime& other);
6986     bool isEqual(const MEDCouplingDefinitionTime& other) const;
6987     double getTimeResolution() const;
6988     std::vector<double> getHotSpotsTime() const;
6989     %extend
6990       {
6991         std::string __str__() const
6992           {
6993             std::ostringstream oss;
6994             self->appendRepr(oss);
6995             return oss.str();
6996           }
6997
6998         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
6999         {
7000           int meshId,arrId,arrIdInField,fieldId;
7001           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
7002           PyObject *res=PyList_New(4);
7003           PyList_SetItem(res,0,PyInt_FromLong(meshId));
7004           PyList_SetItem(res,1,PyInt_FromLong(arrId));
7005           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7006           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7007           return res;
7008         }
7009
7010         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
7011         {
7012           int meshId,arrId,arrIdInField,fieldId;
7013           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
7014           PyObject *res=PyList_New(4);
7015           PyList_SetItem(res,0,PyInt_FromLong(meshId));
7016           PyList_SetItem(res,1,PyInt_FromLong(arrId));
7017           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
7018           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
7019           return res;
7020         }
7021       }
7022   };
7023
7024   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
7025   {
7026   public:
7027     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
7028     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
7029     
7030     %extend
7031       {
7032         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
7033           {
7034             std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7035             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7036             int sz=tmp.size();
7037             std::vector<MEDCouplingFieldDouble *> fs(sz);
7038             for(int i=0;i<sz;i++)
7039               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7040             return MEDCouplingFieldOverTime::New(fs);
7041           }
7042         std::string __str__() const
7043           {
7044             return self->simpleRepr();
7045           }
7046         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
7047         {
7048           std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
7049           convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
7050            int sz=tmp.size();
7051            std::vector<MEDCouplingFieldDouble *> fs(sz);
7052            for(int i=0;i<sz;i++)
7053              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
7054            return MEDCouplingFieldOverTime::New(fs);
7055          }
7056       }
7057   };
7058 }
7059
7060 %pythoncode %{
7061 import os
7062 __filename=os.environ.get('PYTHONSTARTUP')
7063 if __filename and os.path.isfile(__filename):
7064   execfile(__filename)
7065   pass
7066 %}