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