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