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