Salome HOME
Missing swig of renumberCellsWithoutMesh and renumberNodesWithoutMesh
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2007-2013  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 "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingTypemaps.i"
44
45 #include "InterpKernelAutoPtr.hxx"
46
47 using namespace ParaMEDMEM;
48 using namespace INTERP_KERNEL;
49
50 %}
51
52 %template(ivec) std::vector<int>;
53 %template(dvec) std::vector<double>;
54 %template(svec) std::vector<std::string>;
55
56 ////////////////////
57 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
58 {
59   $result=convertMesh($1,$owner);
60 }
61
62 %typemap(out) MEDCouplingMesh*
63 {
64   $result=convertMesh($1,$owner);
65 }
66 //$$$$$$$$$$$$$$$$$$
67
68 ////////////////////
69 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
70 {
71   $result=convertMesh($1,$owner);
72 }
73
74 %typemap(out) MEDCouplingPointSet*
75 {
76   $result=convertMesh($1,$owner);
77 }
78 //$$$$$$$$$$$$$$$$$$
79
80
81 ////////////////////
82 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
83 {
84   $result=convertMesh($1,$owner);
85 }
86
87 %typemap(out) MEDCoupling1GTUMesh*
88 {
89   $result=convertMesh($1,$owner);
90 }
91 //$$$$$$$$$$$$$$$$$$
92
93 ////////////////////
94 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
95 {
96   $result=convertMesh($1,$owner);
97 }
98
99 %typemap(out) MEDCouplingStructuredMesh*
100 {
101   $result=convertMesh($1,$owner);
102 }
103 //$$$$$$$$$$$$$$$$$$
104
105 ////////////////////
106 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
107 {
108   $result=convertFieldDiscretization($1,$owner);
109 }
110
111 %typemap(out) MEDCouplingFieldDiscretization*
112 {
113   $result=convertFieldDiscretization($1,$owner);
114 }
115 //$$$$$$$$$$$$$$$$$$
116
117 ////////////////////
118 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
119 {
120   $result=convertMultiFields($1,$owner);
121 }
122
123 %typemap(out) MEDCouplingMultiFields*
124 {
125   $result=convertMultiFields($1,$owner);
126 }
127 //$$$$$$$$$$$$$$$$$$
128
129 ////////////////////
130 %typemap(out) ParaMEDMEM::DataArray*
131 {
132   $result=convertDataArray($1,$owner);
133 }
134
135 %typemap(out) DataArray*
136 {
137   $result=convertDataArray($1,$owner);
138 }
139 //$$$$$$$$$$$$$$$$$$
140
141 ////////////////////
142 %typemap(out) ParaMEDMEM::DataArrayChar*
143 {
144   $result=convertDataArrayChar($1,$owner);
145 }
146
147 %typemap(out) DataArrayChar*
148 {
149   $result=convertDataArrayChar($1,$owner);
150 }
151 //$$$$$$$$$$$$$$$$$$
152
153 #ifdef WITH_NUMPY
154 %init %{ import_array(); %}
155 #endif
156
157 %feature("autodoc", "1");
158 %feature("docstring");
159
160 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::New;
161 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
162 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy;
163 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
164 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
165 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePartRange;
166 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
167 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
168 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
169 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
170 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
171 %newobject ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshData;
172 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
173 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
174 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
190 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
191 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
192 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
193 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
194 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
195 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
196 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
197 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
198 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
199 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
200 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
201 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
202 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
203 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
204 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
205 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
206 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
207 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
208 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
209 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
210 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
211 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
212 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
213 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
214 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
215 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
216 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
217 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
218 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
219 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
220 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
221 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
222 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
223 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
224 %newobject ParaMEDMEM::DataArray::deepCpy;
225 %newobject ParaMEDMEM::DataArray::selectByTupleRanges;
226 %newobject ParaMEDMEM::DataArray::selectByTupleId;
227 %newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
228 %newobject ParaMEDMEM::DataArray::selectByTupleId2;
229 %newobject ParaMEDMEM::DataArray::Aggregate;
230 %newobject ParaMEDMEM::DataArrayInt::New;
231 %newobject ParaMEDMEM::DataArrayInt::__iter__;
232 %newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
233 %newobject ParaMEDMEM::DataArrayInt::performCpy;
234 %newobject ParaMEDMEM::DataArrayInt::substr;
235 %newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
236 %newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
237 %newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
238 %newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
239 %newobject ParaMEDMEM::DataArrayInt::renumber;
240 %newobject ParaMEDMEM::DataArrayInt::renumberR;
241 %newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
242 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
243 %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
244 %newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
245 %newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
246 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
247 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
248 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
249 %newobject ParaMEDMEM::DataArrayInt::negate;
250 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
251 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
252 %newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
253 %newobject ParaMEDMEM::DataArrayInt::Meld;
254 %newobject ParaMEDMEM::DataArrayInt::Add;
255 %newobject ParaMEDMEM::DataArrayInt::Substract;
256 %newobject ParaMEDMEM::DataArrayInt::Multiply;
257 %newobject ParaMEDMEM::DataArrayInt::Divide;
258 %newobject ParaMEDMEM::DataArrayInt::Pow;
259 %newobject ParaMEDMEM::DataArrayInt::BuildUnion;
260 %newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
261 %newobject ParaMEDMEM::DataArrayInt::Range;
262 %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
263 %newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
264 %newobject ParaMEDMEM::DataArrayInt::buildComplement;
265 %newobject ParaMEDMEM::DataArrayInt::buildUnion;
266 %newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
267 %newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
268 %newobject ParaMEDMEM::DataArrayInt::buildIntersection;
269 %newobject ParaMEDMEM::DataArrayInt::buildUnique;
270 %newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
271 %newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
272 %newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
273 %newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
274 %newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
275 %newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
276 %newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
277 %newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
278 %newobject ParaMEDMEM::DataArrayInt::__neg__;
279 %newobject ParaMEDMEM::DataArrayInt::__add__;
280 %newobject ParaMEDMEM::DataArrayInt::__radd__;
281 %newobject ParaMEDMEM::DataArrayInt::__sub__;
282 %newobject ParaMEDMEM::DataArrayInt::__rsub__;
283 %newobject ParaMEDMEM::DataArrayInt::__mul__;
284 %newobject ParaMEDMEM::DataArrayInt::__rmul__;
285 %newobject ParaMEDMEM::DataArrayInt::__div__;
286 %newobject ParaMEDMEM::DataArrayInt::__rdiv__;
287 %newobject ParaMEDMEM::DataArrayInt::__mod__;
288 %newobject ParaMEDMEM::DataArrayInt::__rmod__;
289 %newobject ParaMEDMEM::DataArrayInt::__pow__;
290 %newobject ParaMEDMEM::DataArrayInt::__rpow__;
291 %newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
292 %newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
293 %newobject ParaMEDMEM::DataArrayChar::renumber;
294 %newobject ParaMEDMEM::DataArrayChar::renumberR;
295 %newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
296 %newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
297 %newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
298 %newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
299 %newobject ParaMEDMEM::DataArrayChar::Aggregate;
300 %newobject ParaMEDMEM::DataArrayChar::Meld;
301 %newobject ParaMEDMEM::DataArrayByte::New;
302 %newobject ParaMEDMEM::DataArrayByte::__iter__;
303 %newobject ParaMEDMEM::DataArrayByte::performCpy;
304 %newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
305 %newobject ParaMEDMEM::DataArrayChar::substr;
306 %newobject ParaMEDMEM::DataArrayAsciiChar::New;
307 %newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
308 %newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
309 %newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
310 %newobject ParaMEDMEM::DataArrayDouble::New;
311 %newobject ParaMEDMEM::DataArrayDouble::__iter__;
312 %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
313 %newobject ParaMEDMEM::DataArrayDouble::performCpy;
314 %newobject ParaMEDMEM::DataArrayDouble::Aggregate;
315 %newobject ParaMEDMEM::DataArrayDouble::Meld;
316 %newobject ParaMEDMEM::DataArrayDouble::Dot;
317 %newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
318 %newobject ParaMEDMEM::DataArrayDouble::Add;
319 %newobject ParaMEDMEM::DataArrayDouble::Substract;
320 %newobject ParaMEDMEM::DataArrayDouble::Multiply;
321 %newobject ParaMEDMEM::DataArrayDouble::Divide;
322 %newobject ParaMEDMEM::DataArrayDouble::Pow;
323 %newobject ParaMEDMEM::DataArrayDouble::substr;
324 %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
325 %newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
326 %newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
327 %newobject ParaMEDMEM::DataArrayDouble::negate;
328 %newobject ParaMEDMEM::DataArrayDouble::applyFunc;
329 %newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
330 %newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
331 %newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
332 %newobject ParaMEDMEM::DataArrayDouble::determinant;
333 %newobject ParaMEDMEM::DataArrayDouble::eigenValues;
334 %newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
335 %newobject ParaMEDMEM::DataArrayDouble::inverse;
336 %newobject ParaMEDMEM::DataArrayDouble::trace;
337 %newobject ParaMEDMEM::DataArrayDouble::deviator;
338 %newobject ParaMEDMEM::DataArrayDouble::magnitude;
339 %newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
340 %newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
341 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
342 %newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
343 %newobject ParaMEDMEM::DataArrayDouble::renumber;
344 %newobject ParaMEDMEM::DataArrayDouble::renumberR;
345 %newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
346 %newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
347 %newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
348 %newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
349 %newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
350 %newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
351 %newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
352 %newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
353 %newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
354 %newobject ParaMEDMEM::DataArrayDouble::__neg__;
355 %newobject ParaMEDMEM::DataArrayDouble::__radd__;
356 %newobject ParaMEDMEM::DataArrayDouble::__rsub__;
357 %newobject ParaMEDMEM::DataArrayDouble::__rmul__;
358 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
359 %newobject ParaMEDMEM::DataArrayDouble::__pow__;
360 %newobject ParaMEDMEM::DataArrayDouble::__rpow__;
361 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
362 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
363 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
364 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
365 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
366 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
367 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
368 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
369 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
370 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
371 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
372 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
373 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
374 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
375 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
376 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
377 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
378 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
379 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
380 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
381 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
382 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
383 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
384 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
385 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
386 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
387 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
388 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
389 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
390 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
391 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
392 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
393 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
394 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
395 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
396 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
397 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
398 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
399 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
400 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
401 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
402 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
403 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
404 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
405 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
406 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
407 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
408 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
409 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
410 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
411 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
412 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
413 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
414 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
415 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
416 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
417 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
418 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
419 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
420 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
421 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
422 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
423 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
424 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
425 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
426 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
427 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
428 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
429 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
430 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
431 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
432 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
433 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
434 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
435 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
436 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
437 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
438 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
439 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
440 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
441 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
442 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
443 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
444 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
445 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
446 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
447 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
448 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
449 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
450 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
451 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
452 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
453 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
454 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
455 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
456 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
457 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
458 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
459 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
460 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
461 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
462 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
463 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
464 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
465 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
466 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
467
468 %feature("unref") DataArray "$this->decrRef();"
469 %feature("unref") DataArrayDouble "$this->decrRef();"
470 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
471 %feature("unref") MEDCouplingMesh "$this->decrRef();"
472 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
473 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
474 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
475 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
476 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
477 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
478 %feature("unref") DataArrayInt "$this->decrRef();"
479 %feature("unref") DataArrayChar "$this->decrRef();"
480 %feature("unref") DataArrayAsciiChar "$this->decrRef();"
481 %feature("unref") DataArrayByte "$this->decrRef();"
482 %feature("unref") MEDCouplingField "$this->decrRef();"
483 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
484 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
485 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
486 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
487 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
488 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
489 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
490 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
491 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
492
493 %rename(assign) *::operator=;
494 %ignore ParaMEDMEM::RefCountObject::decrRef;
495 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
496 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
497 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
498 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
499
500 %nodefaultctor;
501
502 %rename (InterpKernelException) INTERP_KERNEL::Exception;
503
504 namespace INTERP_KERNEL
505 {
506   class Exception
507   {
508   public:
509     Exception(const char* what);
510     ~Exception() throw ();
511     const char *what() const throw ();
512     %extend
513     {
514       std::string __str__() const
515         {
516           return std::string(self->what());
517         }
518     }
519   };
520 }
521
522 namespace ParaMEDMEM
523 {
524   class TimeLabel
525   {
526   public:
527     void declareAsNew() const;
528     virtual void updateTime() const;
529     unsigned int getTimeOfThis() const;
530   protected:
531     ~TimeLabel();
532   };
533 }
534
535 namespace ParaMEDMEM
536 {
537   typedef enum
538     {
539       C_DEALLOC = 2,
540       CPP_DEALLOC = 3
541     } DeallocType;
542
543   typedef enum
544     {
545       ON_CELLS = 0,
546       ON_NODES = 1,
547       ON_GAUSS_PT = 2,
548       ON_GAUSS_NE = 3,
549       ON_NODES_KR = 4
550     } TypeOfField;
551
552   typedef enum
553     {
554       NO_TIME = 4,
555       ONE_TIME = 5,
556       LINEAR_TIME = 6,
557       CONST_ON_TIME_INTERVAL = 7
558     } TypeOfTimeDiscretization;
559
560   const char *MEDCouplingVersionStr();
561   int MEDCouplingVersion();
562   int MEDCouplingSizeOfVoidStar();
563
564   class RefCountObject
565   {
566   protected:
567     RefCountObject();
568     RefCountObject(const RefCountObject& other);
569     ~RefCountObject();
570   public:
571     bool decrRef() const;
572     void incrRef() const;
573     int getRCValue() const;
574     virtual std::size_t getHeapMemorySize() const;
575   };
576 }
577
578 %inline
579 {
580   PyObject *MEDCouplingVersionMajMinRel()
581   {
582     int tmp0=0,tmp1=0,tmp2=0;
583     MEDCouplingVersionMajMinRel(tmp0,tmp1,tmp2);
584     PyObject *res = PyList_New(3);
585     PyList_SetItem(res,0,SWIG_From_int(tmp0));
586     PyList_SetItem(res,1,SWIG_From_int(tmp1));
587     PyList_SetItem(res,2,SWIG_From_int(tmp2));
588     return res;
589   }
590
591   bool MEDCouplingHasNumPyBindings()
592   {
593 #ifdef WITH_NUMPY
594     return true;
595 #else
596     return false;
597 #endif
598   }
599
600   std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
601   {
602     static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
603     std::ostringstream oss; oss << "MEDCouplingCompletionScript : error when trying to activate completion ! readline not present ?\nScript is :\n" << script;
604     if(PyRun_SimpleString(script)!=0)
605       throw INTERP_KERNEL::Exception(oss.str().c_str());
606     return std::string(script);
607   }
608 }
609
610 %include "MEDCouplingMemArray.i"
611
612 namespace ParaMEDMEM
613 {
614   typedef enum
615     {
616       UNSTRUCTURED = 5,
617       UNSTRUCTURED_DESC = 6,
618       CARTESIAN = 7,
619       EXTRUDED = 8,
620       CURVE_LINEAR = 9
621     } MEDCouplingMeshType;
622
623   class DataArrayInt;
624   class DataArrayDouble;
625   class MEDCouplingUMesh;
626   class MEDCouplingFieldDouble;
627
628   %extend RefCountObject
629   {
630     std::string getHiddenCppPointer() const
631     {
632       std::ostringstream oss; oss << "C++ Pointer address is : " << self;
633       return oss.str();
634     }
635   }
636
637   %extend MEDCouplingGaussLocalization
638   {
639     std::string __str__() const throw(INTERP_KERNEL::Exception)
640     {
641       return self->getStringRepr();
642     }
643
644     std::string __repr__() const throw(INTERP_KERNEL::Exception)
645     {
646       std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
647       oss << self->getStringRepr();
648       return oss.str();
649     }
650   }
651
652   //== MEDCouplingMesh
653   
654   class MEDCouplingMesh : public RefCountObject, public TimeLabel
655   {
656   public:
657     void setName(const char *name);
658     std::string getName() const;
659     void setDescription(const char *descr);
660     std::string getDescription() const;
661     void setTime(double val, int iteration, int order);
662     void setTimeUnit(const char *unit);
663     const char *getTimeUnit() const;
664     virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
665     bool isStructured() const throw(INTERP_KERNEL::Exception);
666     virtual MEDCouplingMesh *deepCpy() const;
667     virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
668     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
669     virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
670     virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
671     virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
672     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
673     virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
674     virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
675     virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
676     virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
677     virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
678     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
679     virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
680     virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
681     virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
682     virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
683     virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
684     virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
685     virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
686     virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
687     virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
688     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
689     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
690     void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
691     // tools
692     virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
693     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
694     virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
695     virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
696     virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) const throw(INTERP_KERNEL::Exception);
697     virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
698     virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
699     virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
700     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
701     virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
702     static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
703     static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
704     static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
705     static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
706     static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
707     static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
708     static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
709     %extend
710        {
711          std::string __str__() const throw(INTERP_KERNEL::Exception)
712          {
713            return self->simpleRepr();
714          }
715
716          PyObject *getTime() throw(INTERP_KERNEL::Exception)
717          {
718            int tmp1,tmp2;
719            double tmp0=self->getTime(tmp1,tmp2);
720            PyObject *res = PyList_New(3);
721            PyList_SetItem(res,0,SWIG_From_double(tmp0));
722            PyList_SetItem(res,1,SWIG_From_int(tmp1));
723            PyList_SetItem(res,2,SWIG_From_int(tmp2));
724            return res;
725          }
726
727          int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
728          {
729            double val;
730            DataArrayDouble *a;
731            DataArrayDoubleTuple *aa;
732            std::vector<double> bb;
733            int sw;
734            int spaceDim=self->getSpaceDimension();
735            const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
736            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
737            return self->getCellContainingPoint(pos,eps);
738          }
739
740          PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
741          {
742            double val;
743            DataArrayDouble *a;
744            DataArrayDoubleTuple *aa;
745            std::vector<double> bb;
746            int sw;
747            int spaceDim=self->getSpaceDimension();
748            const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
749            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
750            std::vector<int> elts,eltsIndex;
751            self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
752            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
753            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
754            d0->alloc(elts.size(),1);
755            d1->alloc(eltsIndex.size(),1);
756            std::copy(elts.begin(),elts.end(),d0->getPointer());
757            std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
758            PyObject *ret=PyTuple_New(2);
759            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
760            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
761            return ret;
762          }
763
764          PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
765          {
766            std::vector<int> elts,eltsIndex;
767            int spaceDim=self->getSpaceDimension();
768            void *da=0;
769            int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
770            if (!SWIG_IsOK(res1))
771              {
772                int size;
773                INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
774                int nbOfPoints=size/spaceDim;
775                if(size%spaceDim!=0)
776                  {
777                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
778                  }
779                self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
780              }
781            else
782              {
783                DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
784                if(!da2)
785                  throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
786                da2->checkAllocated();
787                int size=da2->getNumberOfTuples();
788                int nbOfCompo=da2->getNumberOfComponents();
789                if(nbOfCompo!=spaceDim)
790                  {
791                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
792                  }
793                self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
794              }
795            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
796            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
797            d0->alloc(elts.size(),1);
798            d1->alloc(eltsIndex.size(),1);
799            std::copy(elts.begin(),elts.end(),d0->getPointer());
800            std::copy(eltsIndex.begin(),eltsIndex.end(),d1->getPointer());
801            PyObject *ret=PyTuple_New(2);
802            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
803            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
804            return ret;
805          }
806
807          PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
808          {
809            double val;
810            DataArrayDouble *a;
811            DataArrayDoubleTuple *aa;
812            std::vector<double> bb;
813            int sw;
814            int spaceDim=self->getSpaceDimension();
815            const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
816            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
817            std::vector<int> elts;
818            self->getCellsContainingPoint(pos,eps,elts);
819            DataArrayInt *ret=DataArrayInt::New();
820            ret->alloc((int)elts.size(),1);
821            std::copy(elts.begin(),elts.end(),ret->getPointer());
822            return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
823          }
824          
825          void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
826          {
827            void *da=0;
828            int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
829            if (!SWIG_IsOK(res1))
830              {
831                int size;
832                INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
833                self->renumberCells(tmp,check);
834              }
835            else
836              {
837                DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
838                if(!da2)
839                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
840                da2->checkAllocated();
841                self->renumberCells(da2->getConstPointer(),check);
842              }
843          }
844
845          PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
846          {
847            DataArrayInt *cellCor, *nodeCor;
848            self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
849            PyObject *res = PyList_New(2);
850            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
851            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
852            return res;
853          }
854
855          PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
856          {
857            DataArrayInt *cellCor=0,*nodeCor=0;
858            self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
859            PyObject *res = PyList_New(2);
860            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
861            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
862            return res;
863          }
864          
865          DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
866          {
867            DataArrayInt *cellCor=0;
868            self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
869            return cellCor;
870          }
871
872          DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
873          {
874            void *da=0;
875            int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
876            if (!SWIG_IsOK(res1))
877              {
878                int size;
879                INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
880                return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
881              }
882            else
883              {
884                DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
885                if(!da2)
886                  throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
887                da2->checkAllocated();
888                return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
889              }
890          }
891          PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
892          {
893            std::vector<int> conn;
894            self->getNodeIdsOfCell(cellId,conn);
895            return convertIntArrToPyList2(conn);
896          }
897
898          PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
899          {
900            std::vector<double> coo;
901            self->getCoordinatesOfNode(nodeId,coo);
902            return convertDblArrToPyList2(coo);
903          }
904
905          void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
906          {
907            double val;
908            DataArrayDouble *a;
909            DataArrayDoubleTuple *aa;
910            std::vector<double> bb;
911            int sw;
912            int spaceDim=self->getSpaceDimension();
913            const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
914            const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
915            self->scale(pointPtr,factor);
916          }
917
918          PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
919          {
920            int spaceDim=self->getSpaceDimension();
921            INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
922            self->getBoundingBox(tmp);
923            PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
924            return ret;
925          }
926
927          PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
928          {
929            std::string ret1;
930            bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
931            PyObject *ret=PyTuple_New(2);
932            PyObject *ret0Py=ret0?Py_True:Py_False;
933            Py_XINCREF(ret0Py);
934            PyTuple_SetItem(ret,0,ret0Py);
935            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
936            return ret;
937          }
938
939          PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
940          {
941            int szArr,sw,iTypppArr;
942            std::vector<int> stdvecTyyppArr;
943            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
944            MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
945            if(sw==3)//DataArrayInt
946              { 
947                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
948                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
949                std::string name=argpt->getName();
950                if(!name.empty())
951                  ret->setName(name.c_str());
952              }
953            return convertMesh(ret, SWIG_POINTER_OWN | 0 );
954          }
955         
956          PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
957          {
958            int szArr,sw,iTypppArr;
959            std::vector<int> stdvecTyyppArr;
960            DataArrayInt *arr=0;
961            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
962            MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
963            if(sw==3)//DataArrayInt
964              { 
965                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
966                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
967                std::string name=argpt->getName();
968                if(!name.empty())
969                  ret->setName(name.c_str());
970              }
971            //
972            PyObject *res = PyList_New(2);
973            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
974            PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
975            PyList_SetItem(res,0,obj0);
976            PyList_SetItem(res,1,obj1);
977            return res;
978          }
979
980          PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
981          {
982            int a,b,c;
983            DataArrayInt *arr=0;
984            MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
985            PyObject *res = PyTuple_New(2);
986            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
987            PyObject *obj1=0;
988            if(arr)
989              obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
990            else
991              obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
992            PyTuple_SetItem(res,0,obj0);
993            PyTuple_SetItem(res,1,obj1);
994            return res;
995          }
996
997         PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
998         {
999           std::vector<int> vals=self->getDistributionOfTypes();
1000           if(vals.size()%3!=0)
1001             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1002           PyObject *ret=PyList_New((int)vals.size()/3);
1003           for(int j=0;j<(int)vals.size()/3;j++)
1004              {
1005                PyObject *ret1=PyList_New(3);
1006                PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
1007                PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
1008                PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
1009                PyList_SetItem(ret,j,ret1);
1010              }
1011           return ret;
1012         }
1013
1014         DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
1015         {
1016           std::vector<int> code;
1017           std::vector<const DataArrayInt *> idsPerType;
1018           convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
1019           convertPyToNewIntArr4(li,1,3,code);
1020           return self->checkTypeConsistencyAndContig(code,idsPerType);
1021         }
1022
1023         PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
1024         {
1025           std::vector<int> code;
1026           std::vector<DataArrayInt *> idsInPflPerType;
1027           std::vector<DataArrayInt *> idsPerType;
1028           self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
1029           PyObject *ret=PyTuple_New(3);
1030           //
1031           if(code.size()%3!=0)
1032             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1033           PyObject *ret0=PyList_New((int)code.size()/3);
1034           for(int j=0;j<(int)code.size()/3;j++)
1035              {
1036                PyObject *ret00=PyList_New(3);
1037                PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
1038                PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
1039                PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
1040                PyList_SetItem(ret0,j,ret00);
1041              }
1042           PyTuple_SetItem(ret,0,ret0);
1043           //
1044           PyObject *ret1=PyList_New(idsInPflPerType.size());
1045           for(std::size_t j=0;j<idsInPflPerType.size();j++)
1046             PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1047           PyTuple_SetItem(ret,1,ret1);
1048           int n=idsPerType.size();
1049           PyObject *ret2=PyList_New(n);
1050           for(int i=0;i<n;i++)
1051             PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1052           PyTuple_SetItem(ret,2,ret2);
1053           return ret;
1054         }
1055
1056         void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
1057         {
1058           double val;
1059           DataArrayDouble *a;
1060           DataArrayDoubleTuple *aa;
1061           std::vector<double> bb;
1062           int sw;
1063           int spaceDim=self->getSpaceDimension();
1064           const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1065           const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1066           self->translate(vectorPtr);
1067         }
1068
1069          void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
1070          {
1071            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1072            double val;
1073            DataArrayDouble *a;
1074            DataArrayDoubleTuple *aa;
1075            std::vector<double> bb;
1076            int sw;
1077            int spaceDim=self->getSpaceDimension();
1078            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1079            self->rotate(centerPtr,0,alpha);
1080          }
1081
1082          void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
1083          {
1084            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1085            double val,val2;
1086            DataArrayDouble *a,*a2;
1087            DataArrayDoubleTuple *aa,*aa2;
1088            std::vector<double> bb,bb2;
1089            int sw;
1090            int spaceDim=self->getSpaceDimension();
1091            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1092            const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,spaceDim,false);//vectorPtr can be null in case of space dim 2
1093            self->rotate(centerPtr,vectorPtr,alpha);
1094          }
1095
1096          PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
1097          {
1098            std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1099            std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1100            PyObject *res=PyList_New(result.size());
1101            for(int i=0;iL!=result.end(); i++, iL++)
1102              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1103            return res;
1104          }
1105          
1106          static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
1107          {
1108             std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
1109             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1110             return MEDCouplingMesh::MergeMeshes(tmp);
1111          }
1112        }
1113   };
1114 }
1115
1116 //== MEDCouplingMesh End
1117
1118 %include "NormalizedUnstructuredMesh.hxx"
1119 %include "MEDCouplingNatureOfField.hxx"
1120 %include "MEDCouplingTimeDiscretization.hxx"
1121 %include "MEDCouplingGaussLocalization.hxx"
1122 %include "MEDCouplingFieldDiscretization.hxx"
1123
1124 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
1125 %ignore ParaMEDMEM::MEDCouplingFieldDiscretization::buildSubMeshDataRange;
1126 %ignore ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell::getArrayOfDiscIds;
1127
1128 //== MEDCouplingPointSet
1129
1130 namespace ParaMEDMEM
1131 {
1132   class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
1133     {
1134     public:
1135       void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
1136       DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
1137       bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
1138       void zipCoords() throw(INTERP_KERNEL::Exception);
1139       double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
1140       void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
1141       void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
1142       void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1143       virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
1144       virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
1145       virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
1146       static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
1147       static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
1148       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
1149       virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
1150       virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
1151       virtual DataArrayInt *findBoundaryNodes() const;
1152       virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
1153       virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
1154       virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
1155       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
1156       virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
1157       %extend 
1158          {
1159            std::string __str__() const throw(INTERP_KERNEL::Exception)
1160            {
1161              return self->simpleRepr();
1162            }
1163            
1164            PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
1165            {
1166              int newNbOfNodes;
1167              DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1168              PyObject *res = PyList_New(2);
1169              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1170              PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
1171              return res;
1172            }
1173            
1174            PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
1175            {
1176              DataArrayInt *comm, *commIndex;
1177              self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1178              PyObject *res = PyList_New(2);
1179              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1180              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1181              return res;
1182            }
1183            
1184            PyObject *getCoords() throw(INTERP_KERNEL::Exception)
1185            {
1186              DataArrayDouble *ret1=self->getCoords();
1187              if (ret1)
1188                 ret1->incrRef();
1189              return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
1190            }
1191            
1192            PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
1193            {
1194              int szArr,sw,iTypppArr;
1195              std::vector<int> stdvecTyyppArr;
1196              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1197              MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1198              if(sw==3)//DataArrayInt
1199                { 
1200                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1201                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1202                  std::string name=argpt->getName();
1203                  if(!name.empty())
1204                    ret->setName(name.c_str());
1205                }
1206              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1207            }
1208            
1209            PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1210            {
1211              int szArr,sw,iTypppArr;
1212              std::vector<int> stdvecTyyppArr;
1213              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1214              MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1215              if(sw==3)//DataArrayInt
1216                { 
1217                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1218                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1219                  std::string name=argpt->getName();
1220                  if(!name.empty())
1221                    ret->setName(name.c_str());
1222                }
1223              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1224            }
1225
1226            virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1227            {
1228              int szArr,sw,iTypppArr;
1229              std::vector<int> stdvecTyyppArr;
1230              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1231              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1232              if(sw==3)//DataArrayInt
1233                { 
1234                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1235                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1236                  std::string name=argpt->getName();
1237                  if(!name.empty())
1238                    ret->setName(name.c_str());
1239                }
1240              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1241            }
1242
1243            virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1244            {
1245              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1246              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1247            }
1248
1249            PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1250            {
1251              int szArr,sw,iTypppArr;
1252              std::vector<int> stdvecTyyppArr;
1253              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1254              MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1255              if(sw==3)//DataArrayInt
1256                { 
1257                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1258                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1259                  std::string name=argpt->getName();
1260                  if(!name.empty())
1261                    ret->setName(name.c_str());
1262                }
1263              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1264            }
1265
1266            void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1267            {
1268              int szArr,sw,iTypppArr;
1269              std::vector<int> stdvecTyyppArr;
1270              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1271              self->renumberNodes(tmp,newNbOfNodes);
1272            }
1273
1274            void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1275            {
1276              int szArr,sw,iTypppArr;
1277              std::vector<int> stdvecTyyppArr;
1278              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1279              self->renumberNodes2(tmp,newNbOfNodes);
1280            }
1281
1282            PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1283              {
1284                int spaceDim=self->getSpaceDimension();
1285                double val,val2;
1286                DataArrayDouble *a,*a2;
1287                DataArrayDoubleTuple *aa,*aa2;
1288                std::vector<double> bb,bb2;
1289                int sw;
1290                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1291                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1292                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1293                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1294                std::vector<int> nodes;
1295                self->findNodesOnLine(p,v,eps,nodes);
1296                DataArrayInt *ret=DataArrayInt::New();
1297                ret->alloc((int)nodes.size(),1);
1298                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1299                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1300              }
1301            PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1302              {
1303                int spaceDim=self->getSpaceDimension();
1304                double val,val2;
1305                DataArrayDouble *a,*a2;
1306                DataArrayDoubleTuple *aa,*aa2;
1307                std::vector<double> bb,bb2;
1308                int sw;
1309                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1310                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1311                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1312                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1313                std::vector<int> nodes;
1314                self->findNodesOnPlane(p,v,eps,nodes);
1315                DataArrayInt *ret=DataArrayInt::New();
1316                ret->alloc((int)nodes.size(),1);
1317                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1318                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1319              }
1320            
1321            PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1322            {
1323              double val;
1324              DataArrayDouble *a;
1325              DataArrayDoubleTuple *aa;
1326              std::vector<double> bb;
1327              int sw;
1328              int spaceDim=self->getSpaceDimension();
1329              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1330              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1331              DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1332              return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1333            }
1334
1335            PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1336            {
1337              DataArrayInt *c=0,*cI=0;
1338              //
1339              double val;
1340              DataArrayDouble *a;
1341              DataArrayDoubleTuple *aa;
1342              std::vector<double> bb;
1343              int sw;
1344              int spaceDim=self->getSpaceDimension();
1345              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1346              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1347              self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1348              PyObject *ret=PyTuple_New(2);
1349              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1350              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1351              return ret;
1352            }
1353
1354            PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1355            {
1356              DataArrayInt *c=0,*cI=0;
1357              int spaceDim=self->getSpaceDimension();
1358              double val;
1359              DataArrayDouble *a;
1360              DataArrayDoubleTuple *aa;
1361              std::vector<double> bb;
1362              int sw;
1363              int nbOfTuples=-1;
1364              const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1365              self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1366              //
1367              PyObject *ret=PyTuple_New(2);
1368              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1369              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1370              return ret;
1371            }
1372
1373            PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1374            {
1375              double val;
1376              DataArrayDouble *a;
1377              DataArrayDoubleTuple *aa;
1378              std::vector<double> bb;
1379              int sw;
1380              int spaceDim=self->getSpaceDimension();
1381              const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1382              const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1383              //
1384              DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1385              return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1386            }
1387
1388            void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1389            {
1390              int sw;
1391              int singleVal;
1392              std::vector<int> multiVal;
1393              std::pair<int, std::pair<int,int> > slic;
1394              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1395              convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1396              switch(sw)
1397                {
1398                case 1:
1399                  return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1400                case 2:
1401                  return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1402                case 4:
1403                  return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1404                default:
1405                  throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1406                }
1407            }
1408
1409            virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
1410            {
1411              MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
1412              MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
1413              self->getReverseNodalConnectivity(d0,d1);
1414              PyObject *ret=PyTuple_New(2);
1415              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1416              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1417              return ret;
1418            }
1419
1420            virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1421            {
1422              DataArrayInt *v0=0,*v1=0;
1423              self->findCommonCells(compType,startCellId,v0,v1);
1424              PyObject *res = PyList_New(2);
1425              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1426              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1427              return res;
1428            }
1429
1430       
1431            virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1432            {
1433              void *da=0;
1434              int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1435              if (!SWIG_IsOK(res1))
1436                {
1437                  int size;
1438                  INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1439                  self->renumberNodesInConn(tmp);
1440                }
1441              else
1442                {
1443                  DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1444                  if(!da2)
1445                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1446                  da2->checkAllocated();
1447                  self->renumberNodesInConn(da2->getConstPointer());
1448                }
1449            }
1450
1451            virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1452            {
1453              int ret1=-1;
1454              DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1455              PyObject *ret=PyTuple_New(2);
1456              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1457              PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1458              return ret;
1459            }
1460
1461            virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1462            {
1463              DataArrayInt *ret=0;
1464              //
1465              int szArr,sw,iTypppArr;
1466              std::vector<int> stdvecTyyppArr;
1467              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1468              self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1469              return ret;
1470            }
1471
1472            virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1473            {
1474              bool ret1;
1475              int ret2;
1476              DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1477              PyObject *res = PyList_New(3);
1478              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1479              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1480              PyList_SetItem(res,2,SWIG_From_int(ret2));
1481              return res;
1482            }
1483            
1484            virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1485            {
1486              bool ret1;
1487              int ret2;
1488              DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1489              PyObject *res = PyList_New(3);
1490              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1491              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1492              PyList_SetItem(res,2,SWIG_From_int(ret2));
1493              return res;
1494            }
1495            
1496            DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1497            {
1498              void *da=0;
1499              int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
1500              if (!SWIG_IsOK(res1))
1501                {
1502                  int size;
1503                  INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1504                  return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1505                }
1506              else
1507                {
1508                  DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1509                  if(!da2)
1510                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1511                  da2->checkAllocated();
1512                  return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1513                }
1514            }
1515
1516            MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1517            {
1518              int sw;
1519              int singleVal;
1520              std::vector<int> multiVal;
1521              std::pair<int, std::pair<int,int> > slic;
1522              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1523              int nbc=self->getNumberOfCells();
1524              convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1525              switch(sw)
1526                {
1527                case 1:
1528                  {
1529                    if(singleVal>=nbc)
1530                      {
1531                        std::ostringstream oss;
1532                        oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1533                        throw INTERP_KERNEL::Exception(oss.str().c_str());
1534                      }
1535                    if(singleVal>=0)
1536                      return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1537                    else
1538                      {
1539                        if(nbc+singleVal>0)
1540                          {
1541                            int tmp=nbc+singleVal;
1542                            return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1543                          }
1544                        else
1545                          {
1546                            std::ostringstream oss;
1547                            oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1548                            throw INTERP_KERNEL::Exception(oss.str().c_str());
1549                          }
1550                      }
1551                  }
1552                case 2:
1553                  {
1554                    return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1555                  }
1556                case 3:
1557                  {
1558                    return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1559                  }
1560                case 4:
1561                  {
1562                    if(!daIntTyypp)
1563                      throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1564                    daIntTyypp->checkAllocated();
1565                    return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1566                  }
1567                default:
1568                  throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1569                }
1570            }
1571            
1572            static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1573            {
1574              int sz;
1575              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1576              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1577              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1578              for(int i=0;i<sz;i++)
1579                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1580            }
1581            
1582            static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1583            {
1584              int sz;
1585              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1586              int sw,nbNodes=0;
1587              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1588              std::vector<double> val3;
1589              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1590                                                             "Rotate2DAlg",2,true,nbNodes);
1591              if(sw!=2 && sw!=3)
1592                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1593              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1594            }
1595            
1596            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1597            {
1598              int sz,sz2;
1599              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1600              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1601              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1602              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1603              for(int i=0;i<sz;i++)
1604                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1605            }
1606            
1607            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1608            {
1609              int sz,sz2;
1610              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1611              int sw,nbNodes=0;
1612              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1613              std::vector<double> val3;
1614              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1615                                                             "Rotate3DAlg",3,true,nbNodes);
1616              if(sw!=2 && sw!=3)
1617                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1618              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1619              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1620            }
1621          }
1622     };
1623
1624   //== MEDCouplingPointSet End
1625
1626   class MEDCouplingUMeshCell
1627   {
1628   public:
1629     INTERP_KERNEL::NormalizedCellType getType() const;
1630     %extend
1631       {
1632         std::string __str__() const throw(INTERP_KERNEL::Exception)
1633         {
1634           return self->repr();
1635         }
1636
1637         PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1638         {
1639           int ret2;
1640           const int *r=self->getAllConn(ret2);
1641           PyObject *ret=PyTuple_New(ret2);
1642           for(int i=0;i<ret2;i++)
1643             PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1644           return ret;
1645         }
1646       }
1647   };
1648
1649   class MEDCouplingUMeshCellIterator
1650   {
1651   public:
1652     %extend
1653       {
1654         PyObject *next()
1655         {
1656           MEDCouplingUMeshCell *ret=self->nextt();
1657           if(ret)
1658             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1659           else
1660             {
1661               PyErr_SetString(PyExc_StopIteration,"No more data.");
1662               return 0;
1663             }
1664         }
1665       }
1666   };
1667
1668   class MEDCouplingUMeshCellByTypeIterator
1669   {
1670   public:
1671     ~MEDCouplingUMeshCellByTypeIterator();
1672     %extend
1673       {
1674         PyObject *next()
1675         {
1676           MEDCouplingUMeshCellEntry *ret=self->nextt();
1677           if(ret)
1678             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1679           else
1680             {
1681               PyErr_SetString(PyExc_StopIteration,"No more data.");
1682               return 0;
1683             }
1684         }
1685       }
1686   };
1687
1688   class MEDCouplingUMeshCellByTypeEntry
1689   {
1690   public:
1691     ~MEDCouplingUMeshCellByTypeEntry();
1692     %extend
1693       {
1694         MEDCouplingUMeshCellByTypeIterator *__iter__()
1695         {
1696           return self->iterator();
1697         }
1698       }
1699   };
1700
1701   class MEDCouplingUMeshCellEntry
1702   {
1703   public:
1704     INTERP_KERNEL::NormalizedCellType getType() const;
1705     int getNumberOfElems() const;
1706     %extend
1707       {
1708         MEDCouplingUMeshCellIterator *__iter__()
1709         {
1710           return self->iterator();
1711         }
1712       }
1713   };
1714   
1715   //== MEDCouplingUMesh
1716
1717   class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1718   {
1719   public:
1720     static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1721     static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1722     MEDCouplingUMesh *clone(bool recDeepCpy) const;
1723     void checkCoherency() const throw(INTERP_KERNEL::Exception);
1724     void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1725     void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1726     void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1727     MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1728     void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1729     INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1730     void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1731     int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
1732     int getMeshLength() const throw(INTERP_KERNEL::Exception);
1733     void computeTypes() throw(INTERP_KERNEL::Exception);
1734     std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1735     MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1736     //tools
1737     void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1738     std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1739     DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1740     MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1741     bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1742     bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1743     DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1744     DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1745     DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1746     DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1747     DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1748     MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1749     MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1750     MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1751     void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1752     bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1753     MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1754     bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1755     void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1756     void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1757     void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1758     DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1759     void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1760     bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1761     MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1762     MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1763     MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1764     MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1765     DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1766     std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1767     DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1768     DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1769     ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1770     DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1771     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1772     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1773     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1774     static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1775     static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1776     %extend {
1777       MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1778       {
1779         return MEDCouplingUMesh::New();
1780       }
1781       
1782       MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1783       {
1784         return MEDCouplingUMesh::New(meshName,meshDim);
1785       }
1786       
1787       std::string __str__() const throw(INTERP_KERNEL::Exception)
1788       {
1789         return self->simpleRepr();
1790       }
1791       
1792       std::string __repr__() const throw(INTERP_KERNEL::Exception)
1793       {
1794         std::ostringstream oss;
1795         self->reprQuickOverview(oss);
1796         return oss.str();
1797       }
1798       
1799       MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1800       {
1801         return self->cellIterator();
1802       }
1803       
1804       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1805       {
1806         int sw;
1807         int singleVal;
1808         std::vector<int> multiVal;
1809         std::pair<int, std::pair<int,int> > slic;
1810         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1811         int nbc=self->getNumberOfCells();
1812         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1813         switch(sw)
1814           {
1815           case 1:
1816             {
1817               if(singleVal>=nbc)
1818                 {
1819                   std::ostringstream oss;
1820                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1821                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1822                 }
1823               if(singleVal>=0)
1824                 {
1825                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1826                   break;
1827                 }
1828               else
1829                 {
1830                   if(nbc+singleVal>0)
1831                     {
1832                       int tmp=nbc+singleVal;
1833                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1834                       break;
1835                     }
1836                   else
1837                     {
1838                       std::ostringstream oss;
1839                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1840                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1841                     }
1842                 }
1843             }
1844           case 2:
1845             {
1846               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1847               break;
1848             }
1849           case 4:
1850             {
1851               if(!daIntTyypp)
1852                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1853               daIntTyypp->checkAllocated();
1854               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1855               break;
1856             }
1857           default:
1858             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1859           }
1860       }
1861
1862       void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1863       {
1864         int sw;
1865         int singleVal;
1866         std::vector<int> multiVal;
1867         std::pair<int, std::pair<int,int> > slic;
1868         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1869         int nbc=self->getNumberOfCells();
1870         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1871         switch(sw)
1872           {
1873           case 1:
1874             {
1875               if(singleVal>=nbc)
1876                 {
1877                   std::ostringstream oss;
1878                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1879                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1880                 }
1881               if(singleVal>=0)
1882                 {
1883                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1884                   break;
1885                 }
1886               else
1887                 {
1888                   if(nbc+singleVal>0)
1889                     {
1890                       int tmp=nbc+singleVal;
1891                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1892                       break;
1893                     }
1894                   else
1895                     {
1896                       std::ostringstream oss;
1897                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1898                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1899                     }
1900                 }
1901             }
1902           case 2:
1903             {
1904               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1905               break;
1906             }
1907           case 3:
1908             {
1909               self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1910               break;
1911             }
1912           case 4:
1913             {
1914               if(!daIntTyypp)
1915                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1916               daIntTyypp->checkAllocated();
1917               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1918               break;
1919             }
1920           default:
1921             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1922           }
1923       }
1924
1925       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1926       {
1927         int szArr,sw,iTypppArr;
1928         std::vector<int> stdvecTyyppArr;
1929         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1930         if(size>szArr)
1931           {
1932             std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1933             throw INTERP_KERNEL::Exception(oss.str().c_str());
1934           }
1935         self->insertNextCell(type,size,tmp);
1936       }
1937
1938       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1939       {
1940         int szArr,sw,iTypppArr;
1941         std::vector<int> stdvecTyyppArr;
1942         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1943         self->insertNextCell(type,szArr,tmp);
1944       }
1945       
1946       DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1947       {
1948         DataArrayInt *ret=self->getNodalConnectivity();
1949         if(ret)
1950           ret->incrRef();
1951         return ret;
1952       }
1953       DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1954       {
1955         DataArrayInt *ret=self->getNodalConnectivityIndex();
1956         if(ret)
1957           ret->incrRef();
1958         return ret;
1959       }
1960       PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
1961       {
1962         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
1963         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1964         PyObject *res = PyList_New(result.size());
1965         for (int i=0;iL!=result.end(); i++, iL++)
1966           PyList_SetItem(res,i,PyInt_FromLong(*iL));
1967         return res;
1968       }
1969       
1970       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1971       {
1972         int szArr,sw,iTypppArr;
1973         std::vector<int> stdvecTyyppArr;
1974         const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1975         int nbOfDepthPeelingPerformed=0;
1976         DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1977         PyObject *res=PyTuple_New(2);
1978         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1979         PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1980         return res;
1981       }
1982
1983       static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1984       {
1985         DataArrayInt *v0=0,*v1=0;
1986         MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1987         PyObject *res = PyList_New(2);
1988         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1989         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1990         return res;
1991       }
1992       
1993       PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1994       {
1995         double val;
1996         DataArrayDouble *a;
1997         DataArrayDoubleTuple *aa;
1998         std::vector<double> bb;
1999         int sw;
2000         int nbOfCompo=self->getSpaceDimension();
2001         const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2002         //
2003         int cellId=-1;
2004         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2005         PyObject *ret=PyTuple_New(2);
2006         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2007         PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2008         return ret;
2009       }
2010
2011       PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
2012       {
2013         DataArrayInt *ret1=0;
2014         DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2015         PyObject *ret=PyTuple_New(2);
2016         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2017         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2018         return ret;
2019       }
2020       
2021       PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
2022       {
2023         std::vector<int> cells;
2024         self->checkButterflyCells(cells,eps);
2025         DataArrayInt *ret=DataArrayInt::New();
2026         ret->alloc((int)cells.size(),1);
2027         std::copy(cells.begin(),cells.end(),ret->getPointer());
2028         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2029       }
2030
2031       PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
2032       {
2033         std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2034         int sz=ms.size();
2035         PyObject *ret = PyList_New(sz);
2036         for(int i=0;i<sz;i++)
2037           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2038         return ret;
2039       }
2040
2041       PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
2042       {
2043         std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
2044         int sz=retCpp.size();
2045         PyObject *ret=PyList_New(sz);
2046         for(int i=0;i<sz;i++)
2047           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2048         return ret;
2049       }
2050
2051       PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
2052       {
2053         int size;
2054         INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
2055         MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2056         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2057       }
2058
2059       bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
2060       {
2061         int sz;
2062         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2063         bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2064         return ret;
2065       }
2066
2067       DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
2068       {
2069         int sz;
2070         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2071         DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2072         return ret;
2073       }
2074
2075       PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2076       {
2077         DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
2078         self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2079         PyObject *ret=PyTuple_New(3);
2080         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2081         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2082         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2083         return ret;
2084       }
2085
2086       PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
2087       {
2088         DataArrayInt *tmp0=0,*tmp1=0;
2089         self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2090         PyObject *ret=PyTuple_New(2);
2091         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2092         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2093         return ret;
2094       }
2095
2096       void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
2097       {
2098         int sw;
2099         int singleVal;
2100         std::vector<int> multiVal;
2101         std::pair<int, std::pair<int,int> > slic;
2102         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2103         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2104         switch(sw)
2105           {
2106           case 1:
2107             return self->duplicateNodes(&singleVal,&singleVal+1);
2108           case 2:
2109             return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2110           case 4:
2111             return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2112           default:
2113             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2114           }
2115       }
2116
2117       void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
2118       {
2119         int sw;
2120         int singleVal;
2121         std::vector<int> multiVal;
2122         std::pair<int, std::pair<int,int> > slic;
2123         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2124         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2125         switch(sw)
2126           {
2127           case 1:
2128             return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2129           case 2:
2130             return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2131           case 4:
2132             return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2133           default:
2134             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2135           }
2136       }
2137
2138       PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
2139       {
2140         int sz;
2141         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
2142         DataArrayInt *tmp0,*tmp1=0;
2143         tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2144         PyObject *ret=PyTuple_New(2);
2145         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2146         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2147         return ret;
2148       }
2149
2150       PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
2151       {
2152         DataArrayInt *ret0=0,*ret1=0;
2153         self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2154         PyObject *ret=PyTuple_New(2);
2155         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2156         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2157         return ret;
2158       }
2159
2160       static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2161       {
2162         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2163         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2164         DataArrayInt *ret1=0,*ret2=0;
2165         MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2166         PyObject *ret=PyTuple_New(3);
2167         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2168         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2169         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2170         return ret;
2171       }
2172
2173       static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2174       {
2175         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
2176         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2177         MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2178         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2179       }
2180
2181       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
2182       {
2183         int sz;
2184         std::vector<const MEDCouplingUMesh *> meshes;
2185         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2186         std::vector<DataArrayInt *> corr;
2187         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2188         sz=corr.size();
2189         PyObject *ret1=PyList_New(sz);
2190         for(int i=0;i<sz;i++)
2191           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2192         PyObject *ret=PyList_New(2);
2193         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2194         PyList_SetItem(ret,1,ret1);
2195         return ret;
2196       }
2197
2198       static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2199       {
2200         std::vector<MEDCouplingUMesh *> meshes;
2201         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2202         MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2203       }
2204
2205       static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2206       {
2207         std::vector<MEDCouplingUMesh *> meshes;
2208         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2209         MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2210       }
2211
2212       static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2213       {
2214         int sw;
2215         int singleVal;
2216         std::vector<int> multiVal;
2217         std::pair<int, std::pair<int,int> > slic;
2218         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2219         if(!arrIndx)
2220           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2221         convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2222         switch(sw)
2223           {
2224           case 1:
2225             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2226           case 2:
2227             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2228           case 4:
2229             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2230           default:
2231             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2232           }
2233       }
2234       
2235       static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2236       {
2237         DataArrayInt *arrOut=0,*arrIndexOut=0;
2238         int sw;
2239         int singleVal;
2240         std::vector<int> multiVal;
2241         std::pair<int, std::pair<int,int> > slic;
2242         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2243         if(!arrIndxIn)
2244           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2245         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2246         switch(sw)
2247           {
2248           case 1:
2249             {
2250               MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2251               break;
2252             }
2253           case 2:
2254             {
2255               MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2256               break;
2257             }
2258           case 4:
2259             {
2260               MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2261               break;
2262             }
2263           default:
2264             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2265           }
2266         PyObject *ret=PyTuple_New(2);
2267         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2268         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2269         return ret;
2270       }
2271
2272       static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2273       {
2274         DataArrayInt *arrOut=0,*arrIndexOut=0;
2275         MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2276         PyObject *ret=PyTuple_New(2);
2277         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2278         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2279         return ret;
2280       }
2281
2282       static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2283       {
2284         if(!PySlice_Check(slic))
2285           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2286         Py_ssize_t strt=2,stp=2,step=2;
2287         PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2288         if(!arrIndxIn)
2289           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2290         arrIndxIn->checkAllocated();
2291         if(arrIndxIn->getNumberOfComponents()!=1)
2292           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2293         if(PySlice_GetIndices(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step)!=0)
2294           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2295         DataArrayInt *arrOut=0,*arrIndexOut=0;
2296         MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2297         PyObject *ret=PyTuple_New(2);
2298         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2299         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2300         return ret;
2301       }
2302
2303       static PyObject *SetPartOfIndexedArrays(PyObject *li,
2304                                               const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2305                                               const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2306       {
2307         DataArrayInt *arrOut=0,*arrIndexOut=0;
2308         int sw;
2309         int singleVal;
2310         std::vector<int> multiVal;
2311         std::pair<int, std::pair<int,int> > slic;
2312         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2313         if(!arrIndxIn)
2314           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2315         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2316         switch(sw)
2317           {
2318           case 1:
2319             {
2320               MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2321               break;
2322             }
2323           case 2:
2324             {
2325               MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2326               break;
2327             }
2328           case 4:
2329             {
2330               MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2331               break;
2332             }
2333           default:
2334             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2335           }
2336         PyObject *ret=PyTuple_New(2);
2337         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2338         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2339         return ret;
2340       }
2341
2342       static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2343                                                 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2344       {
2345         int sw;
2346         int singleVal;
2347         std::vector<int> multiVal;
2348         std::pair<int, std::pair<int,int> > slic;
2349         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2350         if(!arrIndxIn)
2351           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2352         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2353         switch(sw)
2354           {
2355           case 1:
2356             {
2357               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2358               break;
2359             }
2360           case 2:
2361             {
2362               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2363               break;
2364             }
2365           case 4:
2366             {
2367               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2368               break;
2369             }
2370           default:
2371             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2372           }
2373       }
2374
2375       PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2376       {
2377         double val;
2378         DataArrayDouble *a;
2379         DataArrayDoubleTuple *aa;
2380         std::vector<double> bb;
2381         int sw;
2382         int spaceDim=self->getSpaceDimension();
2383         const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2384         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2385         //
2386         std::vector<int> cells;
2387         self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2388         DataArrayInt *ret=DataArrayInt::New();
2389         ret->alloc((int)cells.size(),1);
2390         std::copy(cells.begin(),cells.end(),ret->getPointer());
2391         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2392       }
2393
2394       void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2395       {
2396         double val;
2397         DataArrayDouble *a;
2398         DataArrayDoubleTuple *aa;
2399         std::vector<double> bb;
2400         int sw;
2401         int spaceDim=self->getSpaceDimension();
2402         const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2403         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2404         self->orientCorrectly2DCells(v,polyOnly);
2405       }
2406       
2407       PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2408       {
2409         std::vector<int> cells;
2410         self->arePolyhedronsNotCorrectlyOriented(cells);
2411         DataArrayInt *ret=DataArrayInt::New();
2412         ret->alloc((int)cells.size(),1);
2413         std::copy(cells.begin(),cells.end(),ret->getPointer());
2414         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2415       }
2416
2417       PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2418       {
2419         double vec[3];
2420         double pos[3];
2421         self->getFastAveragePlaneOfThis(vec,pos);
2422         double vals[6];
2423         std::copy(vec,vec+3,vals);
2424         std::copy(pos,pos+3,vals+3);
2425         return convertDblArrToPyListOfTuple(vals,3,2);
2426       }
2427       
2428       static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2429       {
2430         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2431         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2432         return MEDCouplingUMesh::MergeUMeshes(tmp);
2433       }
2434
2435       PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2436       {
2437         DataArrayInt *ret1;
2438         bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2439         PyObject *ret=PyTuple_New(2);
2440         PyObject *ret0Py=ret0?Py_True:Py_False;
2441         Py_XINCREF(ret0Py);
2442         PyTuple_SetItem(ret,0,ret0Py);
2443         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2444         return ret;
2445       }
2446
2447       PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2448       {
2449         DataArrayInt *ret1;
2450         bool ret0=self->areCellsIncludedIn2(other,ret1);
2451         PyObject *ret=PyTuple_New(2);
2452         PyObject *ret0Py=ret0?Py_True:Py_False;
2453         Py_XINCREF(ret0Py);
2454         PyTuple_SetItem(ret,0,ret0Py);
2455         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2456         return ret;
2457       }
2458
2459       PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2460       {
2461         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2462         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2463         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2464         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2465         MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2466         PyObject *ret=PyTuple_New(5);
2467         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2468         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2469         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2470         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2471         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2472         return ret;
2473       }
2474
2475       PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2476       {
2477         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2478         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2479         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2480         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2481         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2482         PyObject *ret=PyTuple_New(5);
2483         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2484         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2485         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2486         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2487         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2488         return ret;
2489       }
2490
2491       PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2492       {
2493         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2494         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2495         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2496         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2497         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2498         PyObject *ret=PyTuple_New(5);
2499         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2500         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2501         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2502         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2503         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2504         return ret;
2505       }
2506       
2507       PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2508       {
2509         DataArrayInt *neighbors=0,*neighborsIdx=0;
2510         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2511         PyObject *ret=PyTuple_New(2);
2512         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2513         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2514         return ret;
2515       }
2516
2517       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2518       {
2519         DataArrayInt *neighbors=0,*neighborsIdx=0;
2520         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2521         PyObject *ret=PyTuple_New(2);
2522         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2523         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2524         return ret;
2525       }
2526
2527       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2528       {
2529         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2530         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2531         DataArrayInt *d2,*d3,*d4,*dd5;
2532         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2533         PyObject *ret=PyTuple_New(7);
2534         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2535         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2536         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2537         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2538         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2539         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2540         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2541         return ret;
2542       }
2543
2544       DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2545       {
2546         if(!da)
2547           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2548         da->checkAllocated();
2549         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2550       }
2551
2552       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2553       {
2554         if(!da)
2555           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2556         da->checkAllocated();
2557         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2558       }
2559
2560       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2561       {
2562         if(!da)
2563           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2564         da->checkAllocated();
2565         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2566       }
2567
2568       PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2569       {
2570         if(!da)
2571           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2572         da->checkAllocated();
2573         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2574         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2575         PyObject *res = PyList_New(result.size());
2576         for (int i=0;iL!=result.end(); i++, iL++)
2577           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2578         return res;
2579       }
2580
2581       DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2582       {
2583         if(!da)
2584           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2585         da->checkAllocated();
2586         DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2587         ret->setName(da->getName().c_str());
2588         return ret;
2589       }
2590
2591       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2592       {
2593         DataArrayInt *cellNb1=0,*cellNb2=0;
2594         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2595         PyObject *ret=PyTuple_New(3);
2596         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2597         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2598         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2599         return ret;
2600       }
2601
2602       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2603       {
2604         int spaceDim=self->getSpaceDimension();
2605         if(spaceDim!=3)
2606           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2607         double val,val2;
2608         DataArrayDouble *a,*a2;
2609         DataArrayDoubleTuple *aa,*aa2;
2610         std::vector<double> bb,bb2;
2611         int sw;
2612         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2613         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2614         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2615         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2616         //
2617         DataArrayInt *cellIds=0;
2618         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2619         PyObject *ret=PyTuple_New(2);
2620         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2621         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2622         return ret;
2623       }
2624
2625       PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2626       {
2627         int spaceDim=self->getSpaceDimension();
2628         if(spaceDim!=3)
2629           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2630         double val,val2;
2631         DataArrayDouble *a,*a2;
2632         DataArrayDoubleTuple *aa,*aa2;
2633         std::vector<double> bb,bb2;
2634         int sw;
2635         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2636         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2637         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2638         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2639         //
2640         DataArrayInt *cellIds=0;
2641         MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2642         PyObject *ret=PyTuple_New(2);
2643         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2644         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2645         return ret;
2646       }
2647
2648       DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2649       {
2650         int spaceDim=self->getSpaceDimension();
2651         if(spaceDim!=3)
2652           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2653         double val,val2;
2654         DataArrayDouble *a,*a2;
2655         DataArrayDoubleTuple *aa,*aa2;
2656         std::vector<double> bb,bb2;
2657         int sw;
2658         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2659         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2660         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2661         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2662         return self->getCellIdsCrossingPlane(orig,vect,eps);
2663       }
2664
2665       void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2666       {
2667         int sw;
2668         int pos1;
2669         std::vector<int> pos2;
2670         DataArrayInt *pos3=0;
2671         DataArrayIntTuple *pos4=0;
2672         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2673         switch(sw)
2674           {
2675           case 1:
2676             {
2677               self->convertToPolyTypes(&pos1,&pos1+1);
2678               return;
2679             }
2680           case 2:
2681             {
2682               if(pos2.empty())
2683                 return;
2684               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2685               return ;
2686             }
2687           case 3:
2688             {
2689               self->convertToPolyTypes(pos3->begin(),pos3->end());
2690               return ;
2691             }
2692           default:
2693             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2694           }
2695       }
2696     }
2697     void convertAllToPoly();
2698     void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2699     bool unPolyze() throw(INTERP_KERNEL::Exception);
2700     void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2701     MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2702     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2703   };
2704
2705   //== MEDCouplingUMesh End
2706
2707   //== MEDCouplingExtrudedMesh
2708
2709   class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2710   {
2711   public:
2712     static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2713     MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2714     %extend {
2715       MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2716       {
2717         return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2718       }
2719       
2720       std::string __str__() const throw(INTERP_KERNEL::Exception)
2721       {
2722         return self->simpleRepr();
2723       }
2724
2725       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2726       {
2727         std::ostringstream oss;
2728         self->reprQuickOverview(oss);
2729         return oss.str();
2730       }
2731       
2732       PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2733       {
2734         MEDCouplingUMesh *ret=self->getMesh2D();
2735         if(ret)
2736           ret->incrRef();
2737         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2738       }
2739       PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2740       {
2741         MEDCouplingUMesh *ret=self->getMesh1D();
2742         if(ret)
2743           ret->incrRef();
2744         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2745       }
2746       PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2747       {
2748         DataArrayInt *ret=self->getMesh3DIds();
2749         if(ret)
2750           ret->incrRef();
2751         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2752       } 
2753     }
2754   };
2755
2756   //== MEDCouplingExtrudedMesh End
2757
2758   class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2759   {
2760   public:
2761     static MEDCoupling1GTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2762     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2763     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2764     int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2765     virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2766     virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2767     %extend
2768     {
2769       virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2770       {
2771         int szArr,sw,iTypppArr;
2772         std::vector<int> stdvecTyyppArr;
2773         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2774         self->insertNextCell(tmp,tmp+szArr);
2775       }
2776
2777       virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2778       {
2779         DataArrayInt *ret=self->getNodalConnectivity();
2780         if(ret) ret->incrRef();
2781         return ret;
2782       }
2783       
2784       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2785       {
2786         std::vector< const MEDCoupling1GTUMesh *> parts;
2787         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2788         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2789       }
2790     }
2791   };
2792
2793   //== MEDCoupling1SGTUMesh
2794
2795   class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2796   {
2797   public:
2798     static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2799     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2800     void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2801     int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2802     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2803     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2804     %extend
2805     {
2806       MEDCoupling1SGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2807       {
2808         return MEDCoupling1SGTUMesh::New(name,type);
2809       }
2810
2811       std::string __str__() const throw(INTERP_KERNEL::Exception)
2812       {
2813         return self->simpleRepr();
2814       }
2815       
2816       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2817       {
2818         std::ostringstream oss;
2819         self->reprQuickOverview(oss);
2820         return oss.str();
2821       }
2822
2823       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2824       {
2825         std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2826         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2827         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2828       }
2829       
2830       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2831       {
2832         std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2833         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2834         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2835       }
2836     }
2837   };
2838   
2839   //== MEDCoupling1SGTUMesh End
2840
2841   //== MEDCoupling1DGTUMesh
2842
2843   class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2844   {
2845   public:
2846     static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2847     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2848     void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2849     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2850     bool isPacked() const throw(INTERP_KERNEL::Exception);
2851     %extend
2852     {
2853       MEDCoupling1DGTUMesh(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2854       {
2855         return MEDCoupling1DGTUMesh::New(name,type);
2856       }
2857
2858       std::string __str__() const throw(INTERP_KERNEL::Exception)
2859       {
2860         return self->simpleRepr();
2861       }
2862       
2863       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2864       {
2865         std::ostringstream oss;
2866         self->reprQuickOverview(oss);
2867         return oss.str();
2868       }
2869
2870       DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2871       {
2872         DataArrayInt *ret=self->getNodalConnectivityIndex();
2873         if(ret) ret->incrRef();
2874         return ret;
2875       }
2876
2877       PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2878       {
2879         DataArrayInt *ret1=0,*ret2=0;
2880         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2881         PyObject *ret0Py=ret0?Py_True:Py_False;
2882         Py_XINCREF(ret0Py);
2883         PyObject *ret=PyTuple_New(3);
2884         PyTuple_SetItem(ret,0,ret0Py);
2885         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2886         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2887         return ret;
2888       }
2889       
2890       PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2891       {
2892         bool ret1;
2893         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2894         PyObject *ret=PyTuple_New(2);
2895         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2896         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2897         PyTuple_SetItem(ret,1,ret1Py);
2898         return ret;
2899       }
2900
2901       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2902       {
2903         std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2904         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2905         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2906       }
2907       
2908       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2909       {
2910         std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2911         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2912         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2913       }
2914       
2915       static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2916       {
2917         std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2918         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2919         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2920       }
2921     }
2922   };
2923
2924   //== MEDCoupling1DGTUMeshEnd
2925
2926   class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2927   {
2928   public:
2929     int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2930     int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2931     virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2932     std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2933     MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2934     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2935     %extend
2936     {
2937       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2938       {
2939         int tmpp1=-1,tmpp2=-1;
2940         std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2941         std::vector< std::pair<int,int> > inp;
2942         if(tmpp2==2)
2943           {
2944             inp.resize(tmpp1);
2945             for(int i=0;i<tmpp1;i++)
2946               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2947           }
2948         else if(tmpp2==1)
2949           {
2950             if(tmpp1%2!=0)
2951               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2952             inp.resize(tmpp1/2);
2953             for(int i=0;i<tmpp1/2;i++)
2954               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2955           }
2956         else
2957           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2958         return self->buildStructuredSubPart(inp);
2959       }
2960
2961       static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2962       {
2963         int tmpp1=-1,tmpp2=-1;
2964         std::vector<int> tmp=fillArrayWithPyListInt2(part,tmpp1,tmpp2);
2965         std::vector< std::pair<int,int> > inp;
2966         if(tmpp2==2)
2967           {
2968             inp.resize(tmpp1);
2969             for(int i=0;i<tmpp1;i++)
2970               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2971           }
2972         else if(tmpp2==1)
2973           {
2974             if(tmpp1%2!=0)
2975               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size ! Must be even size !");
2976             inp.resize(tmpp1/2);
2977             for(int i=0;i<tmpp1/2;i++)
2978               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2979           }
2980         else
2981           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.BuildExplicitIdsFrom : invalid input size !");
2982         //
2983         int szArr,sw,iTypppArr;
2984         std::vector<int> stdvecTyyppArr;
2985         const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2986         std::vector<int> tmp5(tmp4,tmp4+szArr);
2987         //
2988         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2989       }
2990
2991       static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
2992       {
2993         int szArr,sw,iTypppArr;
2994         std::vector<int> stdvecTyyppArr;
2995         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2996         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
2997       }
2998
2999       static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3000       {
3001         int szArr,sw,iTypppArr;
3002         std::vector<int> stdvecTyyppArr;
3003         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3004         int szArr2,sw2,iTypppArr2;
3005         std::vector<int> stdvecTyyppArr2;
3006         const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3007         std::vector<int> tmp3(tmp2,tmp2+szArr2);
3008         std::vector< std::pair<int,int> > partCompactFormat;
3009         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3010         PyObject *ret=PyTuple_New(2);
3011         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3012         PyTuple_SetItem(ret,0,ret0Py);
3013         PyObject *ret1Py=PyList_New(partCompactFormat.size());
3014         for(std::size_t i=0;i<partCompactFormat.size();i++)
3015           {
3016             PyObject *tmp4=PyTuple_New(2);
3017             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3018             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3019             PyList_SetItem(ret1Py,i,tmp4);
3020           }
3021         PyTuple_SetItem(ret,1,ret1Py);
3022         return ret;
3023       }
3024     }
3025   };
3026
3027   //== MEDCouplingCMesh
3028   
3029   class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3030   {
3031   public:
3032     static MEDCouplingCMesh *New();
3033     static MEDCouplingCMesh *New(const char *meshName);
3034     MEDCouplingCMesh *clone(bool recDeepCpy) const;
3035     void setCoords(const DataArrayDouble *coordsX,
3036                    const DataArrayDouble *coordsY=0,
3037                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3038     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3039     %extend {
3040       MEDCouplingCMesh()
3041       {
3042         return MEDCouplingCMesh::New();
3043       }
3044       MEDCouplingCMesh(const char *meshName)
3045       {
3046         return MEDCouplingCMesh::New(meshName);
3047       }
3048       std::string __str__() const throw(INTERP_KERNEL::Exception)
3049       {
3050         return self->simpleRepr();
3051       }
3052       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3053       {
3054         std::ostringstream oss;
3055         self->reprQuickOverview(oss);
3056         return oss.str();
3057       }
3058       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3059       {
3060         DataArrayDouble *ret=self->getCoordsAt(i);
3061         if(ret)
3062           ret->incrRef();
3063         return ret;
3064       }
3065     }
3066   };
3067
3068   //== MEDCouplingCMesh End
3069
3070   //== MEDCouplingCurveLinearMesh
3071
3072   class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3073   {
3074   public:
3075     static MEDCouplingCurveLinearMesh *New();
3076     static MEDCouplingCurveLinearMesh *New(const char *meshName);
3077     MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3078     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3079     %extend {
3080       MEDCouplingCurveLinearMesh()
3081       {
3082         return MEDCouplingCurveLinearMesh::New();
3083       }
3084       MEDCouplingCurveLinearMesh(const char *meshName)
3085       {
3086         return MEDCouplingCurveLinearMesh::New(meshName);
3087       }
3088       std::string __str__() const throw(INTERP_KERNEL::Exception) 
3089       {
3090         return self->simpleRepr();
3091       }
3092       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3093       {
3094         std::ostringstream oss;
3095         self->reprQuickOverview(oss);
3096         return oss.str();
3097       }
3098       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3099       {
3100         DataArrayDouble *ret=self->getCoords();
3101         if(ret)
3102           ret->incrRef();
3103         return ret;
3104       }
3105       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3106       {
3107         int szArr,sw,iTypppArr;
3108         std::vector<int> stdvecTyyppArr;
3109         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3110         self->setNodeGridStructure(tmp,tmp+szArr);
3111       }
3112     }
3113   };
3114
3115   //== MEDCouplingCurveLinearMesh End
3116 }
3117
3118 %extend ParaMEDMEM::MEDCouplingFieldDiscretization
3119 {
3120   MEDCouplingFieldDiscretization *clonePart(PyObject *li)
3121   {
3122     int sz=0,sw=-1,val1=-1;
3123     std::vector<int> val2;
3124     const int *inp=convertObjToPossibleCpp1_Safe(li,sw,sz,val1,val2);
3125     return self->clonePart(inp,inp+sz);
3126   }
3127
3128   PyObject *buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const throw(INTERP_KERNEL::Exception)
3129   {
3130     DataArrayInt *ret1=0;
3131     int bb,ee,ss;
3132     MEDCouplingMesh *ret0=self->buildSubMeshDataRange(mesh,begin,end,step,bb,ee,ss,ret1);
3133     PyObject *res=PyTuple_New(2);
3134     PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3135     if(ret1)
3136       PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3137     else
3138       {
3139         PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3140         PyTuple_SetItem(res,1,res1);
3141       }
3142     return res;
3143   }
3144   
3145   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3146   {
3147     std::vector<int> vVal; int iVal=-1;
3148     int sz=-1,sw=0;
3149     const int *tupleIdsBg=convertObjToPossibleCpp1_Safe(tupleIds,sw,sz,iVal,vVal);
3150     if(sw==0)
3151       throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::computeMeshRestrictionFromTupleIds : none parameter in input !");
3152     DataArrayInt *ret0=0,*ret1=0;
3153     self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
3154     PyObject *pyRet=PyTuple_New(2);
3155     PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3156     PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3157     return pyRet;
3158   }
3159 }
3160
3161 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationP0
3162 {
3163   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3164   { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3165 }
3166
3167 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationOnNodes
3168 {
3169   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3170   { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3171 }
3172
3173 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGauss
3174 {
3175   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3176   { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3177 }
3178
3179 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE
3180 {
3181   PyObject *computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, PyObject *tupleIds) const throw(INTERP_KERNEL::Exception)
3182   { return ParaMEDMEM_MEDCouplingFieldDiscretization_computeMeshRestrictionFromTupleIds__SWIG_1(self,mesh,tupleIds); }
3183 }
3184
3185 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationPerCell
3186 {
3187   PyObject *getArrayOfDiscIds() const
3188   {
3189     DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
3190     if(ret)
3191       ret->incrRef();
3192     return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3193   }
3194
3195   PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
3196   {
3197     std::vector<int> ret1;
3198     std::vector<DataArrayInt *> ret0=self->splitIntoSingleGaussDicrPerCellType(ret1);
3199     std::size_t sz=ret0.size();
3200     PyObject *pyRet=PyTuple_New(2);
3201     PyObject *pyRet0=PyList_New((int)sz);
3202     PyObject *pyRet1=PyList_New((int)sz);
3203     for(std::size_t i=0;i<sz;i++)
3204       {
3205         PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3206         PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
3207       }
3208     PyTuple_SetItem(pyRet,0,pyRet0);
3209     PyTuple_SetItem(pyRet,1,pyRet1);
3210     return pyRet;
3211   }
3212 }
3213
3214 %extend ParaMEDMEM::MEDCouplingFieldDiscretizationKriging
3215 {
3216   PyObject *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr) const
3217   {
3218     int ret1;
3219     DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
3220     PyObject *ret=PyTuple_New(2);
3221     PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3222     PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
3223     return ret;
3224   }
3225 }
3226
3227 namespace ParaMEDMEM
3228 {
3229   class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3230   {
3231   public:
3232     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3233     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3234     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3235     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3236     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3237     void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3238     void setName(const char *name) throw(INTERP_KERNEL::Exception);
3239     std::string getDescription() const throw(INTERP_KERNEL::Exception);
3240     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3241     std::string getName() const throw(INTERP_KERNEL::Exception);
3242     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3243     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3244     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3245     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3246     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3247     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3248     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3249     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3250                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3251     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3252     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3253     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3254     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3255     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3256     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3257     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3258     %extend {
3259       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3260       {
3261         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3262         if(ret1)
3263           ret1->incrRef();
3264         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3265       }
3266
3267       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3268       {
3269         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3270         if(ret)
3271           ret->incrRef();
3272         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3273       }
3274
3275       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3276       {
3277         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3278         return convertIntArrToPyList3(ret);
3279       }
3280
3281       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3282       {
3283         std::string ret1;
3284         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3285         PyObject *ret=PyTuple_New(2);
3286         PyObject *ret0Py=ret0?Py_True:Py_False;
3287         Py_XINCREF(ret0Py);
3288         PyTuple_SetItem(ret,0,ret0Py);
3289         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3290         return ret;
3291       }
3292
3293       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3294       {
3295         DataArrayInt *ret1=0;
3296         MEDCouplingMesh *ret0=0;
3297         void *da=0;
3298         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3299         if (!SWIG_IsOK(res1))
3300           {
3301             int size;
3302             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3303             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3304           }
3305         else
3306           {
3307             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3308             if(!da2)
3309               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3310             da2->checkAllocated();
3311             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3312           }
3313         PyObject *res = PyList_New(2);
3314         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3315         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3316         return res;
3317       }
3318
3319       PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3320       {
3321         DataArrayInt *ret1=0;
3322         int bb,ee,ss;
3323         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3324         PyObject *res=PyTuple_New(2);
3325         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3326         if(ret1)
3327           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3328         else
3329           {
3330             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3331             PyTuple_SetItem(res,1,res1);
3332           }
3333         return res;
3334       }
3335
3336       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *li) const
3337       {
3338         int sw;
3339         int pos1;
3340         std::vector<int> pos2;
3341         DataArrayInt *pos3=0;
3342         DataArrayIntTuple *pos4=0;
3343         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
3344         switch(sw)
3345           {
3346           case 1:
3347             {
3348               return self->computeTupleIdsToSelectFromCellIds(&pos1,&pos1+1);
3349             }
3350           case 2:
3351             {
3352               return self->computeTupleIdsToSelectFromCellIds(&pos2[0],&pos2[0]+pos2.size());
3353             }
3354           case 3:
3355             {
3356               return self->computeTupleIdsToSelectFromCellIds(pos3->begin(),pos3->end());
3357             }
3358           default:
3359             throw INTERP_KERNEL::Exception("MEDCouplingField::computeTupleIdsToSelectFromCellIds : unexpected input array type recognized !");
3360           }
3361       }
3362
3363       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3364                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3365       {
3366         void *da=0;
3367         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3368         if (!SWIG_IsOK(res1))
3369           {
3370             int size;
3371             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3372             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3373           }
3374         else
3375           {
3376             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3377             if(!da2)
3378               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3379             da2->checkAllocated();
3380             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3381           }
3382       }
3383
3384       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3385       {
3386         std::vector<int> tmp;
3387         self->getCellIdsHavingGaussLocalization(locId,tmp);
3388         DataArrayInt *ret=DataArrayInt::New();
3389         ret->alloc((int)tmp.size(),1);
3390         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3391         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3392       }
3393     }
3394   };
3395   
3396   class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3397   {
3398   public:
3399     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3400     static MEDCouplingFieldTemplate *New(TypeOfField type);
3401     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3402     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3403     %extend
3404        {
3405          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3406          {
3407            return MEDCouplingFieldTemplate::New(f);
3408          }
3409          
3410          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3411          {
3412            return MEDCouplingFieldTemplate::New(type);
3413          }
3414          
3415          std::string __str__() const throw(INTERP_KERNEL::Exception)
3416          {
3417            return self->simpleRepr();
3418          }
3419          
3420          std::string __repr__() const throw(INTERP_KERNEL::Exception)
3421          {
3422            std::ostringstream oss;
3423            self->reprQuickOverview(oss);
3424            return oss.str();
3425          }
3426        }
3427   };
3428   
3429   class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3430   {
3431   public:
3432     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3433     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3434     void setTimeUnit(const char *unit);
3435     const char *getTimeUnit() const;
3436     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3437     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3438     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3439     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3440     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3441     void writeVTK(const char *fileName) const throw(INTERP_KERNEL::Exception);
3442     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3443     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3444     MEDCouplingFieldDouble *deepCpy() const;
3445     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3446     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3447     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3448     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3449     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3450     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3451     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3452     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3453     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3454     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3455     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3456     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3457     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3458     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3459     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3460     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3461     void setIteration(int it) throw(INTERP_KERNEL::Exception);
3462     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3463     void setOrder(int order) throw(INTERP_KERNEL::Exception);
3464     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3465     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3466     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3467     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3468     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3469     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3470     bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3471     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3472     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3473     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3474     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3475     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3476     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3477     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3478     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3479     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3480     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3481     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3482     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3483     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3484     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3485     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3486     void fillFromAnalytic(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3487     void fillFromAnalytic2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3488     void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3489     void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3490     void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
3491     void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
3492     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3493     void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
3494     void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
3495     void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
3496     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3497     double getMaxValue() const throw(INTERP_KERNEL::Exception);
3498     double getMinValue() const throw(INTERP_KERNEL::Exception);
3499     double getAverageValue() const throw(INTERP_KERNEL::Exception);
3500     double norm2() const throw(INTERP_KERNEL::Exception);
3501     double normMax() const throw(INTERP_KERNEL::Exception);
3502     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3503     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3504     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3505     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3506     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3507     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3508     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3509     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3510     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3511     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3512     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3513     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3514     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3515     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3516     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3517     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3518     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3519     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3520     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3521     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3522     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3523     MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3524     %extend {
3525       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3526       {
3527         return MEDCouplingFieldDouble::New(type,td);
3528       }
3529
3530       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3531       {
3532         return MEDCouplingFieldDouble::New(ft,td);
3533       }
3534
3535       std::string __str__() const throw(INTERP_KERNEL::Exception)
3536       {
3537         return self->simpleRepr();
3538       }
3539
3540       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3541       {
3542         std::ostringstream oss;
3543         self->reprQuickOverview(oss);
3544         return oss.str();
3545       }
3546
3547       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3548       {
3549         DataArrayDouble *ret=self->getArray();
3550         if(ret)
3551           ret->incrRef();
3552         return ret;
3553       }
3554
3555       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3556       {
3557         std::vector<DataArrayDouble *> arrs=self->getArrays();
3558         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3559           if(*it)
3560             (*it)->incrRef();
3561         int sz=arrs.size();
3562         PyObject *ret=PyTuple_New(sz);
3563         for(int i=0;i<sz;i++)
3564           {
3565             if(arrs[i])
3566               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3567             else
3568               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3569           }
3570         return ret;
3571       }
3572
3573       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3574       {
3575         std::vector<const DataArrayDouble *> tmp;
3576         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3577         int sz=tmp.size();
3578         std::vector<DataArrayDouble *> arrs(sz);
3579         for(int i=0;i<sz;i++)
3580           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3581         self->setArrays(arrs);
3582       }
3583
3584       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3585       {
3586         DataArrayDouble *ret=self->getEndArray();
3587         if(ret)
3588           ret->incrRef();
3589         return ret;
3590       }
3591
3592       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3593       {
3594         double val;
3595         DataArrayDouble *a;
3596         DataArrayDoubleTuple *aa;
3597         std::vector<double> bb;
3598         int sw;
3599         const MEDCouplingMesh *mesh=self->getMesh();
3600         if(!mesh)
3601           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3602         int spaceDim=mesh->getSpaceDimension();
3603         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3604         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3605         //
3606         int sz=self->getNumberOfComponents();
3607         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3608         self->getValueOn(spaceLoc,res);
3609         return convertDblArrToPyList(res,sz);
3610       }
3611
3612        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3613        {
3614          int sz=self->getNumberOfComponents();
3615          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3616          self->getValueOnPos(i,j,k,res);
3617          return convertDblArrToPyList(res,sz);
3618        }
3619
3620       DataArrayDouble *getValueOnMulti(PyObject *li) const throw(INTERP_KERNEL::Exception)
3621       {
3622         void *da=0;
3623         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
3624         if (!SWIG_IsOK(res1))
3625           {
3626             int size;
3627             INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(li,&size);
3628             const MEDCouplingMesh *mesh=self->getMesh();
3629             if(!mesh)
3630               throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3631             int spaceDim=mesh->getSpaceDimension();
3632             int nbOfPoints=size/spaceDim;
3633             if(size%spaceDim!=0)
3634               {
3635                 throw INTERP_KERNEL::Exception("Invalid list length ! Must be a multiple of self.getMesh().getSpaceDimension() !");
3636               }
3637             return self->getValueOnMulti(tmp,nbOfPoints);
3638           }
3639         else
3640           {
3641             DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
3642             if(!da2)
3643               throw INTERP_KERNEL::Exception("Not null DataArrayDouble instance expected !");
3644             da2->checkAllocated();
3645             int size=da2->getNumberOfTuples();
3646             int nbOfCompo=da2->getNumberOfComponents();
3647             const MEDCouplingMesh *mesh=self->getMesh();
3648             if(!mesh)
3649               throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3650             if(nbOfCompo!=mesh->getSpaceDimension())
3651               {
3652                 throw INTERP_KERNEL::Exception("Invalid DataArrayDouble nb of components ! Expected same as self.getMesh().getSpaceDimension() !");
3653               }
3654             return self->getValueOnMulti(da2->getConstPointer(),size);
3655           }
3656       }
3657
3658       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3659       {
3660         double val;
3661         DataArrayDouble *a;
3662         DataArrayDoubleTuple *aa;
3663         std::vector<double> bb;
3664         int sw;
3665         const MEDCouplingMesh *mesh=self->getMesh();
3666         if(!mesh)
3667           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3668         int spaceDim=mesh->getSpaceDimension();
3669         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3670         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3671         //
3672         //
3673         int sz=self->getNumberOfComponents();
3674         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3675         self->getValueOn(spaceLoc,time,res);
3676         return convertDblArrToPyList(res,sz);
3677       }
3678
3679       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3680       {
3681         if(self->getArray()!=0)
3682           ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3683         else
3684           {
3685             MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3686             ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3687             self->setArray(arr);
3688           }
3689       }
3690       
3691       PyObject *getTime() throw(INTERP_KERNEL::Exception)
3692       {
3693         int tmp1,tmp2;
3694         double tmp0=self->getTime(tmp1,tmp2);
3695         PyObject *res = PyList_New(3);
3696         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3697         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3698         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3699         return res;
3700       }
3701
3702       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3703       {
3704         int tmp1,tmp2;
3705         double tmp0=self->getStartTime(tmp1,tmp2);
3706         PyObject *res = PyList_New(3);
3707         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3708         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3709         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3710         return res;
3711       }
3712
3713       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3714       {
3715         int tmp1,tmp2;
3716         double tmp0=self->getEndTime(tmp1,tmp2);
3717         PyObject *res = PyList_New(3);
3718         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3719         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3720         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3721         return res;
3722       }
3723       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3724       {
3725         int sz=self->getNumberOfComponents();
3726         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3727         self->accumulate(tmp);
3728         return convertDblArrToPyList(tmp,sz);
3729       }
3730       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3731       {
3732         int sz=self->getNumberOfComponents();
3733         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3734         self->integral(isWAbs,tmp);
3735         return convertDblArrToPyList(tmp,sz);
3736       }
3737       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3738       {
3739         int sz=self->getNumberOfComponents();
3740         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3741         self->getWeightedAverageValue(tmp,isWAbs);
3742         return convertDblArrToPyList(tmp,sz);
3743       }
3744       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3745       {
3746         int sz=self->getNumberOfComponents();
3747         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3748         self->normL1(tmp);
3749         return convertDblArrToPyList(tmp,sz);
3750       }
3751       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3752       {
3753         int sz=self->getNumberOfComponents();
3754         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3755         self->normL2(tmp);
3756         return convertDblArrToPyList(tmp,sz);
3757       }
3758       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3759       {
3760         int szArr,sw,iTypppArr;
3761         std::vector<int> stdvecTyyppArr;
3762         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3763         self->renumberCells(tmp,check);
3764       }
3765       
3766       void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3767       {
3768         int szArr,sw,iTypppArr;
3769         std::vector<int> stdvecTyyppArr;
3770         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3771         self->renumberCellsWithoutMesh(tmp,check);
3772       }
3773       
3774       void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3775       {
3776         int szArr,sw,iTypppArr;
3777         std::vector<int> stdvecTyyppArr;
3778         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3779         self->renumberNodes(tmp,eps);
3780       }
3781
3782       void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3783       {
3784         int szArr,sw,iTypppArr;
3785         std::vector<int> stdvecTyyppArr;
3786         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3787         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3788       }
3789
3790       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3791       {
3792         int sw;
3793         int singleVal;
3794         std::vector<int> multiVal;
3795         std::pair<int, std::pair<int,int> > slic;
3796         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3797         const MEDCouplingMesh *mesh=self->getMesh();
3798         if(!mesh)
3799           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3800         int nbc=mesh->getNumberOfCells();
3801         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3802         switch(sw)
3803           {
3804           case 1:
3805             {
3806               if(singleVal>=nbc)
3807                 {
3808                   std::ostringstream oss;
3809                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3810                   throw INTERP_KERNEL::Exception(oss.str().c_str());
3811                 }
3812               if(singleVal>=0)
3813                 return self->buildSubPart(&singleVal,&singleVal+1);
3814               else
3815                 {
3816                   if(nbc+singleVal>0)
3817                     {
3818                       int tmp=nbc+singleVal;
3819                       return self->buildSubPart(&tmp,&tmp+1);
3820                     }
3821                   else
3822                     {
3823                       std::ostringstream oss;
3824                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3825                       throw INTERP_KERNEL::Exception(oss.str().c_str());
3826                     }
3827                 }
3828             }
3829           case 2:
3830             {
3831               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3832             }
3833           case 3:
3834             {
3835               return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3836             }
3837           case 4:
3838             {
3839               if(!daIntTyypp)
3840                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3841               daIntTyypp->checkAllocated();
3842               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3843             }
3844           default:
3845             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3846           }
3847       }
3848
3849       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3850       {
3851         const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call  Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
3852         if(PyTuple_Check(li))
3853           {
3854             Py_ssize_t sz=PyTuple_Size(li);
3855             if(sz!=2)
3856               throw INTERP_KERNEL::Exception(msg);
3857             PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3858             int sw;
3859             int singleVal;
3860             std::vector<int> multiVal;
3861             std::pair<int, std::pair<int,int> > slic;
3862             ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3863             if(!self->getArray())
3864               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3865             try
3866               { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3867             catch(INTERP_KERNEL::Exception& e)
3868               { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3869             MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3870             DataArrayDouble *ret0Arr=ret0->getArray();
3871             if(!ret0Arr)
3872               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3873             switch(sw)
3874               {
3875               case 1:
3876                 {
3877                   std::vector<int> v2(1,singleVal);
3878                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3879                   ret0->setArray(aarr);
3880                   return ret0.retn();
3881                 }
3882               case 2:
3883                 {
3884                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3885                   ret0->setArray(aarr);
3886                   return ret0.retn();
3887                 }
3888               case 3:
3889                 {
3890                   int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3891                   std::vector<int> v2(nbOfComp);
3892                   for(int i=0;i<nbOfComp;i++)
3893                     v2[i]=slic.first+i*slic.second.second;
3894                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3895                   ret0->setArray(aarr);
3896                   return ret0.retn();
3897                 }
3898               default:
3899                 throw INTERP_KERNEL::Exception(msg);
3900               }
3901             
3902           }
3903         else
3904           return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3905       }
3906
3907       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3908       {
3909         DataArrayInt *tmp;
3910         double r1=self->getMaxValue2(tmp);
3911         PyObject *ret=PyTuple_New(2);
3912         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3913         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3914         return ret;
3915       }
3916       
3917       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3918       {
3919         DataArrayInt *tmp;
3920         double r1=self->getMinValue2(tmp);
3921         PyObject *ret=PyTuple_New(2);
3922         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3923         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3924         return ret;
3925       }
3926       
3927       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3928       {
3929         std::vector<int> tmp;
3930         convertPyToNewIntArr3(li,tmp);
3931         return self->keepSelectedComponents(tmp);
3932       }
3933
3934       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3935       {
3936         std::vector<int> tmp;
3937         convertPyToNewIntArr3(li,tmp);
3938         self->setSelectedComponents(f,tmp);
3939       }
3940
3941       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3942       {
3943         double val,val2;
3944         DataArrayDouble *a,*a2;
3945         DataArrayDoubleTuple *aa,*aa2;
3946         std::vector<double> bb,bb2;
3947         int sw;
3948         int spaceDim=3;
3949         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3950         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3951         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3952         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3953         //
3954         return self->extractSlice3D(orig,vect,eps);
3955       }
3956
3957       MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3958       {
3959         return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3960       }
3961
3962       MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3963       {
3964         return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3965       }
3966
3967       MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3968       {
3969         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__sub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
3970         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3971         void *argp;
3972         //
3973         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3974           {
3975             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3976             if(other)
3977               return (*self)-(*other);
3978             else
3979               throw INTERP_KERNEL::Exception(msg);
3980           }
3981         //
3982         double val;
3983         DataArrayDouble *a;
3984         DataArrayDoubleTuple *aa;
3985         std::vector<double> bb;
3986         int sw;
3987         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3988         switch(sw)
3989           {
3990           case 1:
3991             {
3992               if(!self->getArray())
3993                 throw INTERP_KERNEL::Exception(msg2);
3994               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3995               ret->applyLin(1.,-val);
3996               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3997               ret2->setArray(ret);
3998               return ret2.retn();
3999             }
4000           case 2:
4001             {
4002               if(!self->getArray())
4003                 throw INTERP_KERNEL::Exception(msg2);
4004               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4005               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4006               ret2->setArray(ret);
4007               return ret2.retn();
4008             }
4009           case 3:
4010             {
4011               if(!self->getArray())
4012                 throw INTERP_KERNEL::Exception(msg2);
4013               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4014               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4015               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4016               ret2->setArray(ret);
4017               return ret2.retn();
4018             }
4019           case 4:
4020             {
4021               if(!self->getArray())
4022                 throw INTERP_KERNEL::Exception(msg2);
4023               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4024               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4025               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4026               ret2->setArray(ret);
4027               return ret2.retn();
4028             }
4029           default:
4030             { throw INTERP_KERNEL::Exception(msg); }
4031           }
4032       }
4033
4034       MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4035       {
4036         return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4037       }
4038
4039       MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4040       {
4041         return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4042       }
4043
4044       MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4045       {
4046         return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4047       }
4048
4049       MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4050       {
4051         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__div__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4052         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4053         void *argp;
4054         //
4055         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4056           {
4057             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4058             if(other)
4059               return (*self)/(*other);
4060             else
4061               throw INTERP_KERNEL::Exception(msg);
4062           }
4063         //
4064         double val;
4065         DataArrayDouble *a;
4066         DataArrayDoubleTuple *aa;
4067         std::vector<double> bb;
4068         int sw;
4069         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4070         switch(sw)
4071           {
4072           case 1:
4073             {
4074               if(val==0.)
4075                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4076               if(!self->getArray())
4077                 throw INTERP_KERNEL::Exception(msg2);
4078               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4079               ret->applyLin(1./val,0);
4080               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4081               ret2->setArray(ret);
4082               return ret2.retn();
4083             }
4084           case 2:
4085             {
4086               if(!self->getArray())
4087                 throw INTERP_KERNEL::Exception(msg2);
4088               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4089               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4090               ret2->setArray(ret);
4091               return ret2.retn();
4092             }
4093           case 3:
4094             {
4095               if(!self->getArray())
4096                 throw INTERP_KERNEL::Exception(msg2);
4097               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4098               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4099               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4100               ret2->setArray(ret);
4101               return ret2.retn();
4102             }
4103           case 4:
4104             {
4105               if(!self->getArray())
4106                 throw INTERP_KERNEL::Exception(msg2);
4107               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4108               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4109               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4110               ret2->setArray(ret);
4111               return ret2.retn();
4112             }
4113           default:
4114             { throw INTERP_KERNEL::Exception(msg); }
4115           }
4116       }
4117
4118       MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4119       {
4120         return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4121       }
4122
4123       MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4124       {
4125         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__pow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4126         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4127         void *argp;
4128         //
4129         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4130           {
4131             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4132             if(other)
4133               return (*self)^(*other);
4134             else
4135               throw INTERP_KERNEL::Exception(msg);
4136           }
4137         //
4138         double val;
4139         DataArrayDouble *a;
4140         DataArrayDoubleTuple *aa;
4141         std::vector<double> bb;
4142         int sw;
4143         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4144         switch(sw)
4145           {
4146           case 1:
4147             {
4148               if(!self->getArray())
4149                 throw INTERP_KERNEL::Exception(msg2);
4150               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4151               ret->applyPow(val);
4152               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4153               ret2->setArray(ret);
4154               return ret2.retn();
4155             }
4156           case 2:
4157             {
4158               if(!self->getArray())
4159                 throw INTERP_KERNEL::Exception(msg2);
4160               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4161               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4162               ret2->setArray(ret);
4163               return ret2.retn();
4164             }
4165           case 3:
4166             {
4167               if(!self->getArray())
4168                 throw INTERP_KERNEL::Exception(msg2);
4169               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4170               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4171               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4172               ret2->setArray(ret);
4173               return ret2.retn();
4174             }
4175           case 4:
4176             {
4177               if(!self->getArray())
4178                 throw INTERP_KERNEL::Exception(msg2);
4179               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4180               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4181               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4182               ret2->setArray(ret);
4183               return ret2.retn();
4184             }
4185           default:
4186             { throw INTERP_KERNEL::Exception(msg); }
4187           }
4188       }
4189
4190       MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4191       {
4192         return self->negate();
4193       }
4194
4195       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4196       {
4197         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__iadd__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4198         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4199         void *argp;
4200         //
4201         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4202           {
4203             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4204             if(other)
4205               {
4206                 *self+=*other;
4207                 Py_XINCREF(trueSelf);
4208                 return trueSelf;
4209               }
4210             else
4211               throw INTERP_KERNEL::Exception(msg);
4212           }
4213         //
4214         double val;
4215         DataArrayDouble *a;
4216         DataArrayDoubleTuple *aa;
4217         std::vector<double> bb;
4218         int sw;
4219         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4220         switch(sw)
4221           {
4222           case 1:
4223             {
4224               if(!self->getArray())
4225                 throw INTERP_KERNEL::Exception(msg2);
4226               self->getArray()->applyLin(1.,val);
4227               Py_XINCREF(trueSelf);
4228               return trueSelf;
4229             }
4230           case 2:
4231             {
4232               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4233               ret2->setArray(a);
4234               *self+=*ret2;
4235               Py_XINCREF(trueSelf);
4236               return trueSelf;
4237             }
4238           case 3:
4239             {
4240               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4241               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4242               ret2->setArray(aaa);
4243               *self+=*ret2;
4244               Py_XINCREF(trueSelf);
4245               return trueSelf;
4246             }
4247           case 4:
4248             {
4249               if(!self->getArray())
4250                 throw INTERP_KERNEL::Exception(msg2);
4251               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4252               self->getArray()->addEqual(aaa);
4253               Py_XINCREF(trueSelf);
4254               return trueSelf;
4255             }
4256           default:
4257             { throw INTERP_KERNEL::Exception(msg); }
4258           }
4259       }
4260
4261       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4262       {
4263         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__isub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4264         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4265         void *argp;
4266         //
4267         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4268           {
4269             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4270             if(other)
4271               {
4272                 *self-=*other;
4273                 Py_XINCREF(trueSelf);
4274                 return trueSelf;
4275               }
4276             else
4277               throw INTERP_KERNEL::Exception(msg);
4278           }
4279         //
4280         double val;
4281         DataArrayDouble *a;
4282         DataArrayDoubleTuple *aa;
4283         std::vector<double> bb;
4284         int sw;
4285         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4286         switch(sw)
4287           {
4288           case 1:
4289             {
4290               if(!self->getArray())
4291                 throw INTERP_KERNEL::Exception(msg2);
4292               self->getArray()->applyLin(1.,-val);
4293               Py_XINCREF(trueSelf);
4294               return trueSelf;
4295             }
4296           case 2:
4297             {
4298               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4299               ret2->setArray(a);
4300               *self-=*ret2;
4301               Py_XINCREF(trueSelf);
4302               return trueSelf;
4303             }
4304           case 3:
4305             {
4306               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4307               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4308               ret2->setArray(aaa);
4309               *self-=*ret2;
4310               Py_XINCREF(trueSelf);
4311               return trueSelf;
4312             }
4313           case 4:
4314             {
4315               if(!self->getArray())
4316                 throw INTERP_KERNEL::Exception(msg2);
4317               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4318               self->getArray()->substractEqual(aaa);
4319               Py_XINCREF(trueSelf);
4320               return trueSelf;
4321             }
4322           default:
4323             { throw INTERP_KERNEL::Exception(msg); }
4324           }
4325       }
4326
4327       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4328       {
4329         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__imul__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4330         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4331         void *argp;
4332         //
4333         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4334           {
4335             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4336             if(other)
4337               {
4338                 *self*=*other;
4339                 Py_XINCREF(trueSelf);
4340                 return trueSelf;
4341               }
4342             else
4343               throw INTERP_KERNEL::Exception(msg);
4344           }
4345         //
4346         double val;
4347         DataArrayDouble *a;
4348         DataArrayDoubleTuple *aa;
4349         std::vector<double> bb;
4350         int sw;
4351         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4352         switch(sw)
4353           {
4354           case 1:
4355             {
4356               if(!self->getArray())
4357                 throw INTERP_KERNEL::Exception(msg2);
4358               self->getArray()->applyLin(val,0);
4359               Py_XINCREF(trueSelf);
4360               return trueSelf;
4361             }
4362           case 2:
4363             {
4364               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4365               ret2->setArray(a);
4366               *self*=*ret2;
4367               Py_XINCREF(trueSelf);
4368               return trueSelf;
4369             }
4370           case 3:
4371             {
4372               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4373               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4374               ret2->setArray(aaa);
4375               *self*=*ret2;
4376               Py_XINCREF(trueSelf);
4377               return trueSelf;
4378             }
4379           case 4:
4380             {
4381               if(!self->getArray())
4382                 throw INTERP_KERNEL::Exception(msg2);
4383               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4384               self->getArray()->multiplyEqual(aaa);
4385               Py_XINCREF(trueSelf);
4386               return trueSelf;
4387             }
4388           default:
4389             { throw INTERP_KERNEL::Exception(msg); }
4390           }
4391       }
4392
4393       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4394       {
4395         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__idiv__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4396         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4397         void *argp;
4398         //
4399         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4400           {
4401             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4402             if(other)
4403               {
4404                 *self/=*other;
4405                 Py_XINCREF(trueSelf);
4406                 return trueSelf;
4407               }
4408             else
4409               throw INTERP_KERNEL::Exception(msg);
4410           }
4411         //
4412         double val;
4413         DataArrayDouble *a;
4414         DataArrayDoubleTuple *aa;
4415         std::vector<double> bb;
4416         int sw;
4417         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4418         switch(sw)
4419           {
4420           case 1:
4421             {
4422               if(val==0.)
4423                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4424               if(!self->getArray())
4425                 throw INTERP_KERNEL::Exception(msg2);
4426               self->getArray()->applyLin(1./val,0);
4427               Py_XINCREF(trueSelf);
4428               return trueSelf;
4429             }
4430           case 2:
4431             {
4432               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4433               ret2->setArray(a);
4434               *self/=*ret2;
4435               Py_XINCREF(trueSelf);
4436               return trueSelf;
4437             }
4438           case 3:
4439             {
4440               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4441               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4442               ret2->setArray(aaa);
4443               *self/=*ret2;
4444               Py_XINCREF(trueSelf);
4445               return trueSelf;
4446             }
4447           case 4:
4448             {
4449               if(!self->getArray())
4450                 throw INTERP_KERNEL::Exception(msg2);
4451               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4452               self->getArray()->divideEqual(aaa);
4453               Py_XINCREF(trueSelf);
4454               return trueSelf;
4455             }
4456           default:
4457             { throw INTERP_KERNEL::Exception(msg); }
4458           }
4459       }
4460
4461       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4462       {
4463         const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__ipow__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
4464         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4465         void *argp;
4466         //
4467         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4468           {
4469             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4470             if(other)
4471               {
4472                 *self^=*other;
4473                 Py_XINCREF(trueSelf);
4474                 return trueSelf;
4475               }
4476             else
4477               throw INTERP_KERNEL::Exception(msg);
4478           }
4479         //
4480         double val;
4481         DataArrayDouble *a;
4482         DataArrayDoubleTuple *aa;
4483         std::vector<double> bb;
4484         int sw;
4485         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4486         switch(sw)
4487           {
4488           case 1:
4489             {
4490               if(!self->getArray())
4491                 throw INTERP_KERNEL::Exception(msg2);
4492               self->getArray()->applyPow(val);
4493               Py_XINCREF(trueSelf);
4494               return trueSelf;
4495             }
4496           case 2:
4497             {
4498               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4499               ret2->setArray(a);
4500               *self^=*ret2;
4501               Py_XINCREF(trueSelf);
4502               return trueSelf;
4503             }
4504           case 3:
4505             {
4506               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4507               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4508               ret2->setArray(aaa);
4509               *self^=*ret2;
4510               Py_XINCREF(trueSelf);
4511               return trueSelf;
4512             }
4513           case 4:
4514             {
4515               if(!self->getArray())
4516                 throw INTERP_KERNEL::Exception(msg2);
4517               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4518               self->getArray()->powEqual(aaa);
4519               Py_XINCREF(trueSelf);
4520               return trueSelf;
4521             }
4522           default:
4523             { throw INTERP_KERNEL::Exception(msg); }
4524           }
4525       }
4526
4527       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4528       {
4529         std::vector<const MEDCouplingFieldDouble *> tmp;
4530         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4531         return MEDCouplingFieldDouble::MergeFields(tmp);
4532       }
4533
4534       static void WriteVTK(const char *fileName, PyObject *li) throw(INTERP_KERNEL::Exception)
4535       {
4536         std::vector<const MEDCouplingFieldDouble *> tmp;
4537         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4538         MEDCouplingFieldDouble::WriteVTK(fileName,tmp);
4539       }
4540     }
4541   };
4542
4543   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4544   {
4545   public:
4546     int getNumberOfFields() const;
4547     MEDCouplingMultiFields *deepCpy() const;
4548     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4549     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4550     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4551     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4552     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4553     %extend
4554        {
4555          std::string __str__() const throw(INTERP_KERNEL::Exception)
4556          {
4557            return self->simpleRepr();
4558          }
4559          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4560          {
4561            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4562            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4563            int sz=tmp.size();
4564            std::vector<MEDCouplingFieldDouble *> fs(sz);
4565            for(int i=0;i<sz;i++)
4566              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4567            return MEDCouplingMultiFields::New(fs);
4568          }
4569          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4570          {
4571            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4572            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4573            int sz=tmp.size();
4574            std::vector<MEDCouplingFieldDouble *> fs(sz);
4575            for(int i=0;i<sz;i++)
4576              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4577            return MEDCouplingMultiFields::New(fs);
4578          }
4579          PyObject *getFields() const
4580          {
4581            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4582            int sz=fields.size();
4583            PyObject *res = PyList_New(sz);
4584            for(int i=0;i<sz;i++)
4585              {
4586                if(fields[i])
4587                  {
4588                    fields[i]->incrRef();
4589                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4590                  }
4591                else
4592                  {
4593                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4594                  }
4595              }
4596            return res;
4597          }
4598          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4599          {
4600            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4601            if(ret)
4602              {
4603                ret->incrRef();
4604                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4605              }
4606            else
4607              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4608          }
4609          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4610          {
4611            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4612            int sz=ms.size();
4613            PyObject *res = PyList_New(sz);
4614            for(int i=0;i<sz;i++)
4615              {
4616                if(ms[i])
4617                  {
4618                    ms[i]->incrRef();
4619                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4620                  }
4621                else
4622                  {
4623                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4624                  }
4625              }
4626            return res;
4627          }
4628          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4629          {
4630            std::vector<int> refs;
4631            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4632            int sz=ms.size();
4633            PyObject *res = PyList_New(sz);
4634            for(int i=0;i<sz;i++)
4635              {
4636                if(ms[i])
4637                  {
4638                    ms[i]->incrRef();
4639                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4640                  }
4641                else
4642                  {
4643                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4644                  }
4645              }
4646            //
4647            PyObject *ret=PyTuple_New(2);
4648            PyTuple_SetItem(ret,0,res);
4649            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4650            return ret;
4651          }
4652          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4653          {
4654            std::vector<DataArrayDouble *> ms=self->getArrays();
4655            int sz=ms.size();
4656            PyObject *res = PyList_New(sz);
4657            for(int i=0;i<sz;i++)
4658              {
4659                if(ms[i])
4660                  {
4661                    ms[i]->incrRef();
4662                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4663                  }
4664                else
4665                  {
4666                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4667                  }
4668              }
4669            return res;
4670          }
4671          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4672          {
4673            std::vector< std::vector<int> > refs;
4674            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4675            int sz=ms.size();
4676            PyObject *res = PyList_New(sz);
4677            PyObject *res2 = PyList_New(sz);
4678            for(int i=0;i<sz;i++)
4679              {
4680                if(ms[i])
4681                  {
4682                    ms[i]->incrRef();
4683                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4684                  }
4685                else
4686                  {
4687                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4688                  }
4689                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4690              }
4691            //
4692            PyObject *ret=PyTuple_New(2);
4693            PyTuple_SetItem(ret,0,res);
4694            PyTuple_SetItem(ret,1,res2);
4695            return ret;
4696          }
4697        }
4698   };
4699   
4700   class MEDCouplingDefinitionTime
4701   {
4702   public:
4703     MEDCouplingDefinitionTime();
4704     void assign(const MEDCouplingDefinitionTime& other);
4705     bool isEqual(const MEDCouplingDefinitionTime& other) const;
4706     double getTimeResolution() const;
4707     std::vector<double> getHotSpotsTime() const;
4708     %extend
4709       {
4710         std::string __str__() const throw(INTERP_KERNEL::Exception)
4711           {
4712             std::ostringstream oss;
4713             self->appendRepr(oss);
4714             return oss.str();
4715           }
4716
4717         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4718         {
4719           int meshId,arrId,arrIdInField,fieldId;
4720           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4721           PyObject *res=PyList_New(4);
4722           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4723           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4724           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4725           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4726           return res;
4727         }
4728
4729         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4730         {
4731           int meshId,arrId,arrIdInField,fieldId;
4732           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4733           PyObject *res=PyList_New(4);
4734           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4735           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4736           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4737           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4738           return res;
4739         }
4740       }
4741   };
4742
4743   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4744   {
4745   public:
4746     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4747     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4748     
4749     %extend
4750       {
4751         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4752           {
4753             std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4754             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4755             int sz=tmp.size();
4756             std::vector<MEDCouplingFieldDouble *> fs(sz);
4757             for(int i=0;i<sz;i++)
4758               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4759             return MEDCouplingFieldOverTime::New(fs);
4760           }
4761         std::string __str__() const throw(INTERP_KERNEL::Exception)
4762           {
4763             return self->simpleRepr();
4764           }
4765         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4766         {
4767           std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4768           convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4769            int sz=tmp.size();
4770            std::vector<MEDCouplingFieldDouble *> fs(sz);
4771            for(int i=0;i<sz;i++)
4772              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4773            return MEDCouplingFieldOverTime::New(fs);
4774          }
4775       }
4776   };
4777 }
4778
4779 %pythoncode %{
4780 import os
4781 __filename=os.environ.get('PYTHONSTARTUP')
4782 if __filename and os.path.isfile(__filename):
4783   execfile(__filename)
4784   pass
4785 %}