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