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