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