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