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