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