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