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