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