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