]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDCoupling_Swig/MEDCouplingCommon.i
Salome HOME
Small refactoring of interpolation and implementation of localization of points regar...
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2017-2022  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, or (at your option) any later version.
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 // Author : Anthony Geay (EDF R&D)
20
21 #ifdef WITH_DOCSTRINGS
22 %include MEDCoupling_doc.i
23 #endif
24
25 %include std_vector.i
26 %include std_string.i
27
28 %{
29 #include "MEDCouplingMemArray.hxx"
30 #include "MEDCouplingMemArray.txx"
31 #include "MEDCouplingUMesh.hxx"
32 #include "MEDCouplingMappedExtrudedMesh.hxx"
33 #include "MEDCouplingCMesh.hxx"
34 #include "MEDCouplingIMesh.hxx"
35 #include "MEDCouplingMap.txx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt32.hxx"
41 #include "MEDCouplingFieldInt64.hxx"
42 #include "MEDCouplingFieldFloat.hxx"
43 #include "MEDCouplingFieldTemplate.hxx"
44 #include "MEDCouplingGaussLocalization.hxx"
45 #include "MCAuto.hxx"
46 #include "MEDCouplingMultiFields.hxx"
47 #include "MEDCouplingFieldOverTime.hxx"
48 #include "MEDCouplingDefinitionTime.hxx"
49 #include "MEDCouplingFieldDiscretization.hxx"
50 #include "MEDCouplingFieldDiscretizationOnNodesFE.hxx"
51 #include "MEDCouplingCartesianAMRMesh.hxx"
52 #include "MEDCouplingAMRAttribute.hxx"
53 #include "MEDCouplingMatrix.hxx"
54 #include "MEDCouplingPartDefinition.hxx"
55 #include "MEDCouplingSkyLineArray.hxx"
56 #include "MEDCouplingTypemaps.i"
57
58 #include "InterpKernelAutoPtr.hxx"
59 #include "BoxSplittingOptions.hxx"
60
61 using namespace MEDCoupling;
62 using namespace INTERP_KERNEL;
63
64 %}
65
66 %template(dvec) std::vector<double>;
67 %template(svec) std::vector<std::string>;
68
69 //%include stdint.i
70
71 #ifndef MEDCOUPLING_USE_64BIT_IDS
72 //typedef std::int32_t mcIdType;
73 typedef int mcIdType;
74 typedef DataArrayInt32 DataArrayIdType;
75 %template(ivec) std::vector<int>;
76 %template(i64vec) std::vector<long>;
77 #else
78 //typedef std::int64_t mcIdType;
79 typedef DataArrayInt64 DataArrayIdType;
80 #ifdef WIN32
81 %template(ivec) std::vector<long long>;
82 typedef long long mcIdType;
83 #else 
84 %template(ivec) std::vector<long>;
85 typedef long int mcIdType;
86 #endif
87 %template(i32vec) std::vector<int>;
88 #endif
89 #ifdef WIN32
90 typedef long long mcPyPtrType;
91 #else
92 typedef long mcPyPtrType;
93 #endif
94
95 ////////////////////
96 %typemap(out) MEDCoupling::MEDCouplingMesh*
97 {
98   $result=convertMesh($1,$owner);
99 }
100
101 %typemap(out) MEDCouplingMesh*
102 {
103   $result=convertMesh($1,$owner);
104 }
105 //$$$$$$$$$$$$$$$$$$
106
107 ////////////////////
108 %typemap(out) MEDCoupling::MEDCouplingPointSet*
109 {
110   $result=convertMesh($1,$owner);
111 }
112
113 %typemap(out) MEDCouplingPointSet*
114 {
115   $result=convertMesh($1,$owner);
116 }
117 //$$$$$$$$$$$$$$$$$$
118
119 ////////////////////
120 %typemap(out) MEDCouplingCartesianAMRPatchGen*
121 {
122   $result=convertCartesianAMRPatch($1,$owner);
123 }
124 //$$$$$$$$$$$$$$$$$$
125
126 ////////////////////
127 %typemap(out) MEDCouplingCartesianAMRMeshGen*
128 {
129   $result=convertCartesianAMRMesh($1,$owner);
130 }
131 //$$$$$$$$$$$$$$$$$$
132
133 ////////////////////
134 %typemap(out) MEDCouplingDataForGodFather*
135 {
136   $result=convertDataForGodFather($1,$owner);
137 }
138 //$$$$$$$$$$$$$$$$$$
139
140 ////////////////////
141 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
142 {
143   $result=convertMesh($1,$owner);
144 }
145
146 %typemap(out) MEDCoupling1GTUMesh*
147 {
148   $result=convertMesh($1,$owner);
149 }
150 //$$$$$$$$$$$$$$$$$$
151
152 ////////////////////
153 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
154 {
155   $result=convertMesh($1,$owner);
156 }
157
158 %typemap(out) MEDCouplingStructuredMesh*
159 {
160   $result=convertMesh($1,$owner);
161 }
162 //$$$$$$$$$$$$$$$$$$
163
164 ////////////////////
165 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
166 {
167   $result=convertFieldDiscretization($1,$owner);
168 }
169
170 %typemap(out) MEDCouplingFieldDiscretization*
171 {
172   $result=convertFieldDiscretization($1,$owner);
173 }
174 //$$$$$$$$$$$$$$$$$$
175
176 ////////////////////
177 %typemap(out) MEDCoupling::MEDCouplingField*
178 {
179   $result=convertField($1,$owner);
180 }
181
182 %typemap(out) MEDCouplingField*
183 {
184   $result=convertField($1,$owner);
185 }
186 //$$$$$$$$$$$$$$$$$$
187
188 ////////////////////
189 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
190 {
191   $result=convertMultiFields($1,$owner);
192 }
193
194 %typemap(out) MEDCouplingMultiFields*
195 {
196   $result=convertMultiFields($1,$owner);
197 }
198 //$$$$$$$$$$$$$$$$$$
199
200 ////////////////////
201 %typemap(out) MEDCoupling::PartDefinition*
202 {
203   $result=convertPartDefinition($1,$owner);
204 }
205
206 %typemap(out) PartDefinition*
207 {
208   $result=convertPartDefinition($1,$owner);
209 }
210 //$$$$$$$$$$$$$$$$$$
211
212 #ifdef WITH_NUMPY
213 %init %{ import_array(); %}
214 #endif
215
216 %init %{ initializeMe(); %}
217
218 %feature("autodoc", "1");
219 %feature("docstring");
220
221 %newobject MEDCoupling::MEDCouplingFieldDiscretizationOnNodesFE::getCooInRefElement;
222 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
223 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
224 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToFloatField;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
239 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
240 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
241 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
242 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
243 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
244 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
245 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
246 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
247 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
248 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
249 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
250 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
251 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
252 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
253 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
254 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
255 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
256 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
257 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
258 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
259 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
260 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
261 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
262 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
263 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
264 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
265 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
266 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
267 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
268 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
269 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
270 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
271 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
272 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
273 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
274 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
275 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
276 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
277 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
278 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
279 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
280 %newobject MEDCoupling::MEDCouplingFieldInt32::New;
281 %newobject MEDCoupling::MEDCouplingFieldInt32::convertToDblField;
282 %newobject MEDCoupling::MEDCouplingFieldInt32::getArray;
283 %newobject MEDCoupling::MEDCouplingFieldInt32::deepCopy;
284 %newobject MEDCoupling::MEDCouplingFieldInt32::clone;
285 %newobject MEDCoupling::MEDCouplingFieldInt32::cloneWithMesh;
286 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPart;
287 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPartRange;
288 %newobject MEDCoupling::MEDCouplingFieldInt32::__getitem__;
289 %newobject MEDCoupling::MEDCouplingFieldInt64::New;
290 %newobject MEDCoupling::MEDCouplingFieldInt64::convertToDblField;
291 %newobject MEDCoupling::MEDCouplingFieldInt64::getArray;
292 %newobject MEDCoupling::MEDCouplingFieldInt64::deepCopy;
293 %newobject MEDCoupling::MEDCouplingFieldInt64::clone;
294 %newobject MEDCoupling::MEDCouplingFieldInt64::cloneWithMesh;
295 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPart;
296 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPartRange;
297 %newobject MEDCoupling::MEDCouplingFieldInt64::__getitem__;
298 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
299 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
300 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
301 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
302 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
303 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
304 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
305 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
306 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
307 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
308 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
309 %newobject MEDCoupling::MEDCouplingMesh::clone;
310 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
311 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
312 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
313 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
314 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
315 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
316 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
317 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
318 %newobject MEDCoupling::MEDCouplingMesh::computeMeshCenterOfMass;
319 %newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
320 %newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
321 %newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
322 %newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
323 %newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
324 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
325 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
326 %newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
327 %newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
328 %newobject MEDCoupling::MEDCouplingMesh::simplexize;
329 %newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
330 %newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
331 %newobject MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure;
332 %newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
333 %newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
334 %newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
335 %newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
336 %newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
337 %newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
338 %newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
339 %newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
340 %newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
341 %newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
342 %newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
343 %newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
344 %newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
345 %newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
346 %newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
347 %newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
348 %newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
349 %newobject MEDCoupling::MEDCouplingUMesh::New;
350 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
351 %newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
352 %newobject MEDCoupling::MEDCouplingUMesh::__iter__;
353 %newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
354 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
355 %newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
356 %newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
357 %newobject MEDCoupling::MEDCouplingUMesh::explodeMeshIntoMicroEdges;
358 %newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
359 %newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
360 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
361 %newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
362 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
363 %newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
364 %newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
365 %newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
366 %newobject MEDCoupling::MEDCouplingUMesh::conformize3D;
367 %newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
368 %newobject MEDCoupling::MEDCouplingUMesh::colinearizeKeepingConform2D;
369 %newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
370 %newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
371 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
372 %newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
373 %newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
374 %newobject MEDCoupling::MEDCouplingUMesh::findNodesToDuplicate;
375 %newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
376 %newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
377 %newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
378 %newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
379 %newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
380 %newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
381 %newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
382 %newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
383 %newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
384 %newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
385 %newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
386 %newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
387 %newobject MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords;
388 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
389 %newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
390 %newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
391 %newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
392 %newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
393 %newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
394 %newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
395 %newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
396 %newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
397 %newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
398 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
399 %newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
400 %newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
401 %newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
402 %newobject MEDCoupling::MEDCouplingUMesh::clipSingle3DCellByPlane;
403 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
404 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
405 %newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
406 %newobject MEDCoupling::MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes;
407 %newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
408 %newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
409 %newobject MEDCoupling::MEDCoupling1GTUMesh::New;
410 %newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
411 %newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
412 %newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
413 %newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
414 %newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
415 %newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
416 %newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
417 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
418 %newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
419 %newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
420 %newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
421 %newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
422 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
423 %newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
424 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
425 %newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
426 %newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
427 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
428 %newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
429 %newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
430 %newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
431 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
432 %newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
433 %newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
434 %newobject MEDCoupling::MEDCouplingCMesh::New;
435 %newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
436 %newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
437 %newobject MEDCoupling::MEDCouplingIMesh::New;
438 %newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
439 %newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
440 %newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
441 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
442 %newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
443 %newobject MEDCoupling::MEDCouplingMultiFields::New;
444 %newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
445 %newobject MEDCoupling::MEDCouplingFieldOverTime::New;
446 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
447 %newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
448 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
449 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
450 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
451 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
452 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
453 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
454 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
455 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
456 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
457 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
458 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
459 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
460 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
461 %newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
462 %newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
463 %newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
464 %newobject MEDCoupling::MEDCouplingAMRAttribute::New;
465 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
466 %newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
467 %newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
468 %newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
469 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
470 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
471 %newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
472 %newobject MEDCoupling::DenseMatrix::New;
473 %newobject MEDCoupling::DenseMatrix::deepCopy;
474 %newobject MEDCoupling::DenseMatrix::shallowCpy;
475 %newobject MEDCoupling::DenseMatrix::getData;
476 %newobject MEDCoupling::DenseMatrix::matVecMult;
477 %newobject MEDCoupling::DenseMatrix::MatVecMult;
478 %newobject MEDCoupling::DenseMatrix::__add__;
479 %newobject MEDCoupling::DenseMatrix::__sub__;
480 %newobject MEDCoupling::DenseMatrix::__mul__;
481 %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
482 %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
483 %newobject MEDCoupling::MEDCouplingGaussLocalization::getShapeFunctionValues;
484 %newobject MEDCoupling::MEDCouplingGaussLocalization::getDerivativeOfShapeFunctionValues;
485 %newobject MEDCoupling::MEDCouplingGaussLocalization::GetDefaultReferenceCoordinatesOf;
486 %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn;
487 %newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray;
488 %newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray;
489 %newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray;
490 %newobject MEDCoupling::MEDCouplingSkyLineArray::groupPacks;
491 %newobject MEDCoupling::MEDCouplingSkyLineArray::uniqueNotSortedByPack;
492 %newobject MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks;
493 %newobject MEDCoupling::MEDCouplingSkyLineArray::deepCopy;
494
495 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
496 %feature("unref") MEDCouplingMesh "$this->decrRef();"
497 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
498 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
499 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
500 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
501 %feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
502 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
503 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
504 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
505 %feature("unref") MEDCouplingField "$this->decrRef();"
506 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
507 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
508 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
509 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
510 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
511 %feature("unref") MEDCouplingFieldDiscretizationOnNodesFE "$this->decrRef();"
512 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
513 %feature("unref") MEDCouplingFieldFloat "$this->decrRef();"
514 %feature("unref") MEDCouplingFieldInt32 "$this->decrRef();"
515 %feature("unref") MEDCouplingFieldInt64 "$this->decrRef();"
516 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
517 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
518 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
519 %feature("unref") MEDCouplingCartesianAMRMeshGen "$this->decrRef();"
520 %feature("unref") MEDCouplingCartesianAMRMesh "$this->decrRef();"
521 %feature("unref") MEDCouplingCartesianAMRMeshSub "$this->decrRef();"
522 %feature("unref") MEDCouplingCartesianAMRPatchGen "$this->decrRef();"
523 %feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
524 %feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
525 %feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
526 %feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
527 %feature("unref") DenseMatrix "$this->decrRef();"
528 %feature("unref") MEDCouplingSkyLineArray "$this->decrRef();"
529
530 %rename(assign) *::operator=;
531 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
532 %ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
533 %ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
534 %ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
535
536 %nodefaultctor;
537
538 // ABN: Instruct SWIG that INTERP_KERNEL::Exception is an exception class and that it should inherit Exception
539 // on the Python side. Must be put BEFORE the %rename clause:
540 %exceptionclass INTERP_KERNEL::Exception;
541 %rename (InterpKernelException) INTERP_KERNEL::Exception;
542
543 %include "MEDCouplingRefCountObject.i"
544 %include "MEDCouplingMemArray.i"
545
546 %{
547   void initializeMe()
548   {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
549     SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
550     SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
551     SWIGTITraits<Int32>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt32;
552     SWIGTITraits<Int64>::TI=SWIGTYPE_p_MEDCoupling__DataArrayInt64;
553     SWIGTITraits<double>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple;
554     SWIGTITraits<float>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayFloatTuple;
555     SWIGTITraits<Int32>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt32Tuple;
556     SWIGTITraits<Int64>::TI_TUPLE=SWIGTYPE_p_MEDCoupling__DataArrayInt64Tuple;
557   }
558 %}
559
560 %inline
561 {
562   PyObject *med2vtk_cell_types()
563   {
564     Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
565     PyObject *ret(PyList_New(sz));
566     for(Py_ssize_t i=0;i<sz;i++)
567       {
568         mcIdType elt = MEDCOUPLING2VTKTYPETRADUCER[i]!=MEDCOUPLING2VTKTYPETRADUCER_NONE ? MEDCOUPLING2VTKTYPETRADUCER[i] : -1;
569         PyList_SetItem(ret,i,PyInt_FromLong(elt));
570       }
571     return ret;
572   }
573
574   PyObject *vtk2med_cell_types()
575   {
576     Py_ssize_t sz(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCOUPLING2VTKTYPETRADUCER[0])));
577     auto maxElt(*std::max_element(MEDCOUPLING2VTKTYPETRADUCER,MEDCOUPLING2VTKTYPETRADUCER+sz,[](unsigned char a, unsigned char b) { if(b==MEDCOUPLING2VTKTYPETRADUCER_NONE) return false; else return a<b; } ));
578     auto szOut(maxElt+1);
579     std::vector< mcIdType > retCpp(szOut,-1);
580     mcIdType id(0);
581     for(const unsigned char *it=MEDCOUPLING2VTKTYPETRADUCER;it!=MEDCOUPLING2VTKTYPETRADUCER+sz;it++,id++)
582       {
583         if(*it!=MEDCOUPLING2VTKTYPETRADUCER_NONE)
584           retCpp[*it]=id;
585       }
586     //
587     PyObject *ret(PyList_New(szOut));
588     id = 0;
589     for(auto it=retCpp.begin();it!=retCpp.end();it++,id++)
590       PyList_SetItem(ret,id,PyInt_FromLong(*it));
591     return ret;
592   }
593
594   PyObject *AllGeometricTypes()
595   {
596     Py_ssize_t sz(MEDCouplingUMesh::N_MEDMEM_ORDER);
597     PyObject *ret(PyList_New(sz));
598     for(Py_ssize_t i=0;i<sz;i++)
599       PyList_SetItem(ret,i,PyInt_FromLong(MEDCouplingUMesh::MEDMEM_ORDER[i]));
600     return ret;
601   }
602 }
603
604 namespace INTERP_KERNEL
605
606   /*!
607    * \class BoxSplittingOptions
608    * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
609    */
610   class BoxSplittingOptions
611   {
612   public:
613     BoxSplittingOptions();
614     void init();
615     double getEfficiencyGoal() const;
616     void setEfficiencyGoal(double efficiency);
617     double getEfficiencyThreshold() const;
618     void setEfficiencyThreshold(double efficiencyThreshold);
619     int getMinimumPatchLength() const;
620     void setMinimumPatchLength(int minPatchLength);
621     int getMaximumPatchLength() const;
622     void setMaximumPatchLength(int maxPatchLength);
623     int getMaximumNbOfCellsInPatch() const;
624     void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch);
625     void copyOptions(const BoxSplittingOptions & other);
626     std::string printOptions() const;
627     %extend
628     {
629       std::string __str__() const
630       {
631         return self->printOptions();
632       }
633     }
634   };
635 }
636
637 namespace MEDCoupling
638 {
639   typedef enum
640     {
641       ON_CELLS = 0,
642       ON_NODES = 1,
643       ON_GAUSS_PT = 2,
644       ON_GAUSS_NE = 3,
645       ON_NODES_KR = 4,
646       ON_NODES_FE = 5
647     } TypeOfField;
648
649   typedef enum
650     {
651       NO_TIME = 4,
652       ONE_TIME = 5,
653       LINEAR_TIME = 6,
654       CONST_ON_TIME_INTERVAL = 7
655     } TypeOfTimeDiscretization;
656
657   typedef enum
658     {
659       UNSTRUCTURED = 5,
660       CARTESIAN = 7,
661       EXTRUDED = 8,
662       CURVE_LINEAR = 9,
663       SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
664       SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
665       IMAGE_GRID = 12
666     } MEDCouplingMeshType;
667
668   class DataArrayInt32;
669   class DataArrayInt64;
670   class DataArrayDouble;
671   class MEDCouplingUMesh;
672   class MEDCouplingCMesh;
673   class MEDCouplingFieldDouble;
674
675   %extend RefCountObject
676   {
677     std::string getHiddenCppPointer() const
678     {
679       std::ostringstream oss; oss << "C++ Pointer address is : " << self;
680       return oss.str();
681     }
682   }
683
684   %extend MEDCouplingGaussLocalization
685   {
686     std::string __str__() const
687     {
688       return self->getStringRepr();
689     }
690
691     std::string __repr__() const
692     {
693       std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
694       oss << self->getStringRepr();
695       return oss.str();
696     }
697   }
698
699   //== MEDCouplingMesh
700   
701   class MEDCouplingMesh : public RefCountObject, public TimeLabel
702   {
703   public:
704     void setName(const std::string& name);
705     std::string getName() const;
706     void setDescription(const std::string& descr);
707     std::string getDescription() const;
708     void setTime(double val, int iteration, int order);
709     void setTimeUnit(const std::string& unit);
710     std::string getTimeUnit() const;
711     virtual MEDCouplingMeshType getType() const;
712     bool isStructured() const;
713     virtual MEDCouplingMesh *deepCopy() const;
714     virtual MEDCouplingMesh *clone(bool recDeepCpy) const;
715     virtual bool isEqual(const MEDCouplingMesh *other, double prec) const;
716     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
717     virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
718     virtual void copyTinyStringsFrom(const MEDCouplingMesh *other);
719     virtual void copyTinyInfoFrom(const MEDCouplingMesh *other);
720     virtual void checkConsistencyLight() const;
721     virtual void checkConsistency(double eps=1e-12) const;
722     virtual int getNumberOfCells() const;
723     virtual int getNumberOfNodes() const;
724     virtual int getSpaceDimension() const;
725     virtual int getMeshDimension() const;
726     virtual DataArrayDouble *getCoordinatesAndOwner() const;
727     virtual DataArrayDouble *computeCellCenterOfMass() const;
728     virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
729     virtual DataArrayIdType *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
730     virtual DataArrayIdType *computeNbOfNodesPerCell() const;
731     virtual DataArrayIdType *computeNbOfFacesPerCell() const;
732     virtual DataArrayIdType *computeEffectiveNbOfNodesPerCell() const;
733     virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
734     virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
735     virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
736     virtual std::string simpleRepr() const;
737     virtual std::string advancedRepr() const;
738     std::string writeVTK(const std::string& fileName, bool isBinary=true) const;
739     virtual std::string getVTKFileExtension() const;
740     std::string getVTKFileNameOf(const std::string& fileName) const;
741     // tools
742     virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
743     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
744     virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
745     virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const;
746     virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
747     virtual MEDCouplingFieldDouble *buildOrthogonalField() const;
748     virtual MEDCouplingUMesh *buildUnstructured() const;
749     virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
750     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
751     virtual DataArrayIdType *simplexize(int policy);
752     virtual void unserialization(const std::vector<double>& tinyInfoD, const std::vector<mcIdType>& tinyInfo, const DataArrayIdType *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
753     static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
754     static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type);
755     static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type);
756     static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type);
757     static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
758     static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
759     static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type);
760     %extend
761        {
762          std::string __str__() const
763          {
764            return self->simpleRepr();
765          }
766          
767           DataArrayDouble *computeMeshCenterOfMass() const
768           {
769             MCAuto<DataArrayDouble> ret(self->computeMeshCenterOfMass());
770             return ret.retn();
771           }
772
773          PyObject *getTime()
774          {
775            int tmp1,tmp2;
776            double tmp0=self->getTime(tmp1,tmp2);
777            PyObject *res = PyList_New(3);
778            PyList_SetItem(res,0,SWIG_From_double(tmp0));
779            PyList_SetItem(res,1,SWIG_From_int(tmp1));
780            PyList_SetItem(res,2,SWIG_From_int(tmp2));
781            return res;
782          }
783
784          DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const
785          {
786            const DataArrayDouble *ret(self->getDirectAccessOfCoordsArrIfInStructure());
787            DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
788            if(ret2)
789              ret2->incrRef();
790            return ret2;
791          }
792          
793          mcIdType getCellContainingPoint(PyObject *p, double eps) const
794          {
795            double val;
796            DataArrayDouble *a;
797            DataArrayDoubleTuple *aa;
798            std::vector<double> bb;
799            mcIdType sw;
800            int spaceDim=self->getSpaceDimension();
801            const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
802            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
803            return self->getCellContainingPoint(pos,eps);
804          }
805
806          PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const
807          {
808            double val;
809            DataArrayDouble *a;
810            DataArrayDoubleTuple *aa;
811            std::vector<double> bb;
812            mcIdType sw;
813            int spaceDim=self->getSpaceDimension();
814            const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
815            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
816            MCAuto<DataArrayIdType> elts,eltsIndex;
817            self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
818            PyObject *ret=PyTuple_New(2);
819            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
820            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
821            return ret;
822          }
823
824          PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, int nbOfPoints, double eps) const
825          {
826            double val;
827            DataArrayDouble *a;
828            DataArrayDoubleTuple *aa;
829            std::vector<double> bb;
830            mcIdType sw;
831            int spaceDim=self->getSpaceDimension();
832            const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType : ";
833            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
834            MCAuto<DataArrayIdType> elts,eltsIndex;
835            self->getCellsContainingPointsLinearPartOnlyOnNonDynType(pos,nbOfPoints,eps,elts,eltsIndex);
836            PyObject *ret=PyTuple_New(2);
837            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
838            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
839            return ret;
840          }
841
842          PyObject *getCellsContainingPoints(PyObject *p, double eps) const
843          {
844            auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPoints(a,b,c,d,e); };
845            return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
846          }
847
848          PyObject *getCellsContainingPointsLinearPartOnlyOnNonDynType(PyObject *p, double eps) const
849          {
850            auto getCellsContainingPointsFunc=[self](const double *a, int b,double c, MCAuto<DataArrayIdType>& d, MCAuto<DataArrayIdType>& e) { self->getCellsContainingPointsLinearPartOnlyOnNonDynType(a,b,c,d,e); };
851            return Mesh_getCellsContainingPointsLike(p,eps,self,getCellsContainingPointsFunc);
852          }
853          
854          PyObject *getCellsContainingPoint(PyObject *p, double eps) const
855          {
856            double val;
857            DataArrayDouble *a;
858            DataArrayDoubleTuple *aa;
859            std::vector<double> bb;
860            mcIdType sw;
861            int spaceDim=self->getSpaceDimension();
862            const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
863            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
864            std::vector<mcIdType> elts;
865            self->getCellsContainingPoint(pos,eps,elts);
866            DataArrayIdType *ret=DataArrayIdType::New();
867            ret->alloc((int)elts.size(),1);
868            std::copy(elts.begin(),elts.end(),ret->getPointer());
869            return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
870          }
871          
872          virtual PyObject *getReverseNodalConnectivity() const
873          {
874            MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
875            MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
876            self->getReverseNodalConnectivity(d0,d1);
877            PyObject *ret=PyTuple_New(2);
878            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
879            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
880            return ret;
881          }
882          
883          void renumberCells(PyObject *li, bool check=true)
884          {
885            mcIdType sw,sz(-1);
886            mcIdType v0; std::vector<mcIdType> v1;
887            const mcIdType *ids(convertIntStarLikePyObjToCppIntStar(li,sw,sz,v0,v1));
888            self->renumberCells(ids,check);
889          }
890
891          PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const
892          {
893            DataArrayIdType *cellCor, *nodeCor;
894            self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
895            PyObject *res = PyList_New(2);
896            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
897            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
898            return res;
899          }
900
901          PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
902          {
903            DataArrayIdType *cellCor=0,*nodeCor=0;
904            self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
905            PyObject *res = PyList_New(2);
906            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTITraits<mcIdType>::TI, cellCor?SWIG_POINTER_OWN | 0:0 ));
907            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTITraits<mcIdType>::TI, nodeCor?SWIG_POINTER_OWN | 0:0 ));
908            return res;
909          }
910          
911          DataArrayIdType *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const
912          {
913            DataArrayIdType *cellCor=0;
914            self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
915            return cellCor;
916          }
917
918          DataArrayIdType *getCellIdsFullyIncludedInNodeIds(PyObject *li) const
919          {
920            void *da=0;
921            int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
922            if (!SWIG_IsOK(res1))
923              {
924                mcIdType size;
925                INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
926                return self->getCellIdsFullyIncludedInNodeIds(tmp,((const mcIdType *)tmp)+size);
927              }
928            else
929              {
930                DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
931                if(!da2)
932                  throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
933                da2->checkAllocated();
934                return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
935              }
936          }
937          PyObject *getNodeIdsOfCell(int cellId) const
938          {
939            std::vector<mcIdType> conn;
940            self->getNodeIdsOfCell(cellId,conn);
941            return convertIntArrToPyList2(conn);
942          }
943
944          PyObject *getCoordinatesOfNode(mcIdType nodeId) const
945          {
946            std::vector<double> coo;
947            self->getCoordinatesOfNode(nodeId,coo);
948            return convertDblArrToPyList2(coo);
949          }
950
951          void scale(PyObject *point, double factor)
952          {
953            double val;
954            DataArrayDouble *a;
955            DataArrayDoubleTuple *aa;
956            std::vector<double> bb;
957            mcIdType sw;
958            int spaceDim=self->getSpaceDimension();
959            const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
960            const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
961            self->scale(pointPtr,factor);
962          }
963
964          PyObject *getBoundingBox() const
965          {
966            int spaceDim=self->getSpaceDimension();
967            INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
968            self->getBoundingBox(tmp);
969            PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,spaceDim);
970            return ret;
971          }
972
973          PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const
974          {
975            std::string ret1;
976            bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
977            PyObject *ret=PyTuple_New(2);
978            PyObject *ret0Py=ret0?Py_True:Py_False;
979            Py_XINCREF(ret0Py);
980            PyTuple_SetItem(ret,0,ret0Py);
981            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
982            return ret;
983          }
984
985          PyObject *buildPart(PyObject *li) const
986          {
987            mcIdType szArr,sw,iTypppArr;
988            std::vector<mcIdType> stdvecTyyppArr;
989            const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
990            MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
991            if(sw==3)//DataArrayIdType
992              { 
993                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
994                DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
995                std::string name=argpt->getName();
996                if(!name.empty())
997                  ret->setName(name.c_str());
998              }
999            return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1000          }
1001         
1002          PyObject *buildPartAndReduceNodes(PyObject *li) const
1003          {
1004            mcIdType szArr,sw,iTypppArr;
1005            std::vector<mcIdType> stdvecTyyppArr;
1006            DataArrayIdType *arr=0;
1007            const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1008            MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
1009            if(sw==3)//DataArrayIdType
1010              { 
1011                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1012                DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1013                std::string name=argpt->getName();
1014                if(!name.empty())
1015                  ret->setName(name.c_str());
1016              }
1017            //
1018            PyObject *res = PyList_New(2);
1019            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1020            PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1021            PyList_SetItem(res,0,obj0);
1022            PyList_SetItem(res,1,obj1);
1023            return res;
1024          }
1025
1026          PyObject *buildPartRangeAndReduceNodes(mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds) const
1027          {
1028            mcIdType a,b,c;
1029            DataArrayIdType *arr=0;
1030            MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
1031            PyObject *res = PyTuple_New(2);
1032            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
1033            PyObject *obj1=0;
1034            if(arr)
1035              obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1036            else
1037              obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
1038            PyTuple_SetItem(res,0,obj0);
1039            PyTuple_SetItem(res,1,obj1);
1040            return res;
1041          }
1042
1043         PyObject *getDistributionOfTypes() const
1044         {
1045           std::vector<mcIdType> vals=self->getDistributionOfTypes();
1046           if(vals.size()%3!=0)
1047             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
1048           PyObject *ret=PyList_New((mcIdType)vals.size()/3);
1049           for(std::size_t j=0;j<vals.size()/3;j++)
1050              {
1051                PyObject *ret1=PyList_New(3);
1052                PyList_SetItem(ret1,0,PyInt_FromLong(vals[3*j]));
1053                PyList_SetItem(ret1,1,PyInt_FromLong(vals[3*j+1]));
1054                PyList_SetItem(ret1,2,PyInt_FromLong(vals[3*j+2]));
1055                PyList_SetItem(ret,j,ret1);
1056              }
1057           return ret;
1058         }
1059
1060         DataArrayIdType *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const
1061         {
1062           std::vector<mcIdType> code;
1063           std::vector<const DataArrayIdType *> idsPerType;
1064           convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li2,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",idsPerType);
1065           convertPyToNewIntArr4(li,1,3,code);
1066           return self->checkTypeConsistencyAndContig(code,idsPerType);
1067         }
1068
1069         PyObject *splitProfilePerType(const DataArrayIdType *profile, bool smartPflKiller=true) const
1070         {
1071           std::vector<mcIdType> code;
1072           std::vector<DataArrayIdType *> idsInPflPerType;
1073           std::vector<DataArrayIdType *> idsPerType;
1074           self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType,smartPflKiller);
1075           PyObject *ret=PyTuple_New(3);
1076           //
1077           if(code.size()%3!=0)
1078             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
1079           PyObject *ret0=PyList_New((mcIdType)code.size()/3);
1080           for(std::size_t j=0;j<code.size()/3;j++)
1081              {
1082                PyObject *ret00=PyList_New(3);
1083                PyList_SetItem(ret00,0,PyInt_FromLong(code[3*j]));
1084                PyList_SetItem(ret00,1,PyInt_FromLong(code[3*j+1]));
1085                PyList_SetItem(ret00,2,PyInt_FromLong(code[3*j+2]));
1086                PyList_SetItem(ret0,j,ret00);
1087              }
1088           PyTuple_SetItem(ret,0,ret0);
1089           //
1090           PyObject *ret1=PyList_New(idsInPflPerType.size());
1091           for(std::size_t j=0;j<idsInPflPerType.size();j++)
1092             PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1093           PyTuple_SetItem(ret,1,ret1);
1094           std::size_t n=idsPerType.size();
1095           PyObject *ret2=PyList_New(n);
1096           for(std::size_t i=0;i<n;i++)
1097             PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1098           PyTuple_SetItem(ret,2,ret2);
1099           return ret;
1100         }
1101
1102         void translate(PyObject *vector)
1103         {
1104           double val;
1105           DataArrayDouble *a;
1106           DataArrayDoubleTuple *aa;
1107           std::vector<double> bb;
1108           mcIdType sw;
1109           int spaceDim=self->getSpaceDimension();
1110           const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
1111           const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
1112           self->translate(vectorPtr);
1113         }
1114
1115          void rotate(PyObject *center, double alpha)
1116          {
1117            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1118            double val;
1119            DataArrayDouble *a;
1120            DataArrayDoubleTuple *aa;
1121            std::vector<double> bb;
1122            mcIdType sw;
1123            int spaceDim=self->getSpaceDimension();
1124            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1125            self->rotate(centerPtr,0,alpha);
1126          }
1127
1128          void rotate(PyObject *center, PyObject *vector, double alpha)
1129          {
1130            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
1131            double val,val2;
1132            DataArrayDouble *a,*a2;
1133            DataArrayDoubleTuple *aa,*aa2;
1134            std::vector<double> bb,bb2;
1135            mcIdType sw;
1136            int spaceDim=self->getSpaceDimension();
1137            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
1138            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
1139            self->rotate(centerPtr,vectorPtr,alpha);
1140          }
1141
1142          PyObject *getAllGeoTypes() const
1143          {
1144            std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
1145            std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1146            PyObject *res=PyList_New(result.size());
1147            for(int i=0;iL!=result.end(); i++, iL++)
1148              PyList_SetItem(res,i,PyInt_FromLong(*iL));
1149            return res;
1150          }
1151
1152          virtual PyObject *getTinySerializationInformation() const
1153          {
1154            std::vector<double> a0;
1155            std::vector<mcIdType> a1;
1156            std::vector<std::string> a2;
1157            self->getTinySerializationInformation(a0,a1,a2);
1158            PyObject *ret(PyTuple_New(3));
1159            PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
1160            PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
1161            std::size_t sz(a2.size());
1162            PyObject *ret2(PyList_New(sz));
1163            {
1164              for(std::size_t i=0;i<sz;i++)
1165                PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
1166            }
1167            PyTuple_SetItem(ret,2,ret2);
1168            return ret;
1169          }
1170
1171          virtual PyObject *serialize() const
1172          {
1173            DataArrayIdType *a0Tmp(0);
1174            DataArrayDouble *a1Tmp(0);
1175            self->serialize(a0Tmp,a1Tmp);
1176            PyObject *ret(PyTuple_New(2));
1177            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1178            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1179            return ret;
1180          }
1181
1182          void resizeForUnserialization(const std::vector<mcIdType>& tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2) const
1183          {
1184            std::vector<std::string> littleStrings;
1185            self->resizeForUnserialization(tinyInfo,a1,a2,littleStrings);
1186          }
1187          
1188          PyObject *__getstate__() const
1189          {
1190            PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
1191            PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
1192            PyObject *ret(PyTuple_New(2));
1193            PyTuple_SetItem(ret,0,ret0);
1194            PyTuple_SetItem(ret,1,ret1);
1195            return ret;
1196          }
1197
1198          void __setstate__(PyObject *inp)
1199          {
1200            static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
1201            if(!PyTuple_Check(inp))
1202              throw INTERP_KERNEL::Exception(MSG);
1203            std::size_t sz(PyTuple_Size(inp));
1204            if(sz!=2)
1205              throw INTERP_KERNEL::Exception(MSG);
1206            PyObject *elt0(PyTuple_GetItem(inp,0));
1207            PyObject *elt1(PyTuple_GetItem(inp,1));
1208            std::vector<double> a0;
1209            std::vector<mcIdType> a1;
1210            std::vector<std::string> a2;
1211            DataArrayIdType *b0(0);
1212            DataArrayDouble *b1(0);
1213            {
1214              if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
1215                throw INTERP_KERNEL::Exception(MSG);
1216              PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
1217              mcIdType tmp(-1);
1218              fillArrayWithPyListDbl3(a0py,tmp,a0);
1219              convertPyToNewIntArr3(a1py,a1);
1220              fillStringVector(a2py,a2);
1221            }
1222            {
1223              if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
1224                throw INTERP_KERNEL::Exception(MSG);
1225              PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
1226              void *argp(0);
1227              int status(SWIG_ConvertPtr(b0py,&argp,SWIGTITraits<mcIdType>::TI,0|0));
1228              if(!SWIG_IsOK(status))
1229                throw INTERP_KERNEL::Exception(MSG);
1230              b0=reinterpret_cast<DataArrayIdType *>(argp);
1231              status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
1232              if(!SWIG_IsOK(status))
1233                throw INTERP_KERNEL::Exception(MSG);
1234              b1=reinterpret_cast<DataArrayDouble *>(argp);
1235            }
1236            // useless here to call resizeForUnserialization because arrays are well resized.
1237            self->unserialization(a0,a1,b0,b1,a2);
1238          }
1239          
1240          static MEDCouplingMesh *MergeMeshes(PyObject *li)
1241          {
1242             std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
1243             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
1244             return MEDCouplingMesh::MergeMeshes(tmp);
1245          }
1246        }
1247   };
1248 }
1249
1250 //== MEDCouplingMesh End
1251
1252 %include "NormalizedGeometricTypes"
1253 %include "MEDCouplingNatureOfFieldEnum"
1254 //
1255 namespace MEDCoupling
1256 {
1257   class MEDCouplingNatureOfField
1258   {
1259   public:
1260     static const char *GetRepr(NatureOfField nat);
1261     static std::string GetReprNoThrow(NatureOfField nat);
1262     static std::string GetAllPossibilitiesStr();
1263   };
1264 }
1265
1266 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
1267 // include "MEDCouplingTimeDiscretization.i"
1268
1269 namespace MEDCoupling
1270 {
1271   class MEDCouplingGaussLocalization
1272   {
1273   public:
1274     MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
1275                                  const std::vector<double>& gsCoo, const std::vector<double>& w);
1276     MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ);
1277     INTERP_KERNEL::NormalizedCellType getType() const;
1278     void setType(INTERP_KERNEL::NormalizedCellType typ);
1279     int getNumberOfGaussPt() const;
1280     int getDimension() const;
1281     int getNumberOfPtsInRefCell() const;
1282     std::string getStringRepr() const;
1283     void checkConsistencyLight() const;
1284     bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
1285     //
1286     const std::vector<double>& getRefCoords() const;
1287     double getRefCoord(int ptIdInCell, int comp) const;
1288     const std::vector<double>& getGaussCoords() const;
1289     double getGaussCoord(int gaussPtIdInCell, int comp) const;
1290     const std::vector<double>& getWeights() const;
1291     double getWeight(int gaussPtIdInCell, double newVal) const;
1292     void setRefCoord(int ptIdInCell, int comp, double newVal);
1293     void setGaussCoord(int gaussPtIdInCell, int comp, double newVal);
1294     void setWeight(int gaussPtIdInCell, double newVal);
1295     void setRefCoords(const std::vector<double>& refCoo);
1296     void setGaussCoords(const std::vector<double>& gsCoo);
1297     void setWeights(const std::vector<double>& w);
1298     //
1299     static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
1300     //
1301     %extend 
1302     {
1303       DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const
1304       {
1305         MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
1306         return ret.retn();
1307       }
1308
1309       MEDCouplingUMesh *buildRefCell() const
1310       {
1311         MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
1312         return ret.retn();
1313       }
1314       
1315       DataArrayDouble *getShapeFunctionValues() const
1316       {
1317         MCAuto<DataArrayDouble> ret(self->getShapeFunctionValues());
1318         return ret.retn();
1319       }
1320       
1321       DataArrayDouble *getDerivativeOfShapeFunctionValues() const
1322       {
1323         MCAuto<DataArrayDouble> ret(self->getDerivativeOfShapeFunctionValues());
1324         return ret.retn();
1325       }
1326
1327       static DataArrayDouble *GetDefaultReferenceCoordinatesOf(INTERP_KERNEL::NormalizedCellType type)
1328       {
1329         MCAuto<DataArrayDouble> ret(MEDCouplingGaussLocalization::GetDefaultReferenceCoordinatesOf(type));
1330         return ret.retn();
1331       }
1332     }
1333   };
1334
1335   class MEDCouplingSkyLineArray
1336   {
1337   public:  
1338     static MEDCouplingSkyLineArray *BuildFromPolyhedronConn( const DataArrayIdType* c, const DataArrayIdType* cI );
1339   
1340     void set( DataArrayIdType* index, DataArrayIdType* value );
1341     void set3( DataArrayIdType* superIndex, DataArrayIdType* index, DataArrayIdType* value );
1342     
1343     int getSuperNumberOf() const;
1344     int getNumberOf() const;
1345     int getLength() const;
1346     
1347     void deletePack(const int i, const int j);
1348     
1349     void deleteSimplePack(const int i);
1350     void deleteSimplePacks(const DataArrayIdType* idx);
1351
1352     MEDCouplingSkyLineArray *groupPacks(const DataArrayIdType *indexedPacks) const;
1353     MEDCouplingSkyLineArray *uniqueNotSortedByPack() const;
1354
1355     MEDCouplingSkyLineArray *deepCopy() const;
1356     
1357     %extend 
1358     {
1359       MEDCouplingSkyLineArray()
1360       {
1361         return MEDCouplingSkyLineArray::New();
1362       }
1363
1364       MEDCouplingSkyLineArray( const std::vector<mcIdType>& index, const std::vector<mcIdType>& value)
1365       {
1366         return MEDCouplingSkyLineArray::New(index, value);
1367       }
1368
1369       MEDCouplingSkyLineArray( DataArrayIdType* index, DataArrayIdType* value )
1370       {
1371         return MEDCouplingSkyLineArray::New(index, value);
1372       }
1373
1374       MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray & other )
1375       {
1376         return MEDCouplingSkyLineArray::New(other);
1377       }
1378
1379       std::string __str__() const
1380       {
1381         return self->simpleRepr();
1382       }
1383       
1384       DataArrayIdType *getSuperIndexArray() const
1385       {
1386         DataArrayIdType *ret(self->getSuperIndexArray());
1387         if(ret)
1388           ret->incrRef();
1389         return ret;
1390       }
1391       
1392       DataArrayIdType *getIndexArray() const
1393       {
1394         DataArrayIdType *ret(self->getIndexArray());
1395         if(ret)
1396           ret->incrRef();
1397         return ret;
1398       }
1399       
1400       DataArrayIdType *getValuesArray() const
1401       {
1402         DataArrayIdType *ret(self->getValuesArray());
1403         if(ret)
1404           ret->incrRef();
1405         return ret;
1406       }
1407      
1408       PyObject *getSimplePackSafe(mcIdType absolutePackId) const
1409       {
1410         std::vector<mcIdType> ret;
1411         self->getSimplePackSafe(absolutePackId,ret);
1412         return convertIntArrToPyList2(ret);
1413       }
1414
1415       PyObject *findPackIds(PyObject *superPackIndices, PyObject *pack) const
1416       {
1417           std::vector<mcIdType> vpack, vspIdx, out;
1418           
1419           convertPyToNewIntArr3(superPackIndices,vspIdx);
1420           convertPyToNewIntArr3(pack,vpack);
1421           
1422           self->findPackIds(vspIdx, vpack.data(), vpack.data()+vpack.size(), out);
1423           return convertIntArrToPyList2(out);
1424       }
1425       
1426       void pushBackPack(const mcIdType i, PyObject *pack)
1427         {
1428           std::vector<mcIdType> vpack;
1429           convertPyToNewIntArr3(pack,vpack);
1430           self->pushBackPack(i,vpack.data(), vpack.data()+vpack.size());
1431         }
1432         
1433       void replaceSimplePack(const mcIdType idx, PyObject *pack)
1434         {
1435           std::vector<mcIdType> vpack;
1436           convertPyToNewIntArr3(pack,vpack);
1437           self->replaceSimplePack(idx, vpack.data(), vpack.data()+vpack.size());
1438         }
1439         
1440       void replaceSimplePacks(const DataArrayIdType* idx, PyObject *listePacks)
1441         {
1442           std::vector<const DataArrayIdType*> packs;
1443           convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType*>(listePacks,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",packs);
1444           self->replaceSimplePacks(idx, packs);
1445         }
1446
1447       static MEDCouplingSkyLineArray *AggregatePacks(PyObject *sks)
1448       {
1449         std::vector<const MEDCouplingSkyLineArray *> sksCpp;
1450         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingSkyLineArray*>(sks,SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray,"MEDCouplingSkyLineArray",sksCpp);
1451         return MEDCoupling::MEDCouplingSkyLineArray::AggregatePacks(sksCpp);
1452       }
1453         
1454       void replacePack(const mcIdType superIdx, const mcIdType idx, PyObject *pack)
1455         {
1456           std::vector<mcIdType> vpack;
1457           convertPyToNewIntArr3(pack,vpack);
1458           self->replacePack(superIdx, idx, vpack.data(), vpack.data()+vpack.size());
1459         }
1460
1461       PyObject *convertToPolyhedronConn() const
1462          {
1463            MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
1464            MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
1465            self->convertToPolyhedronConn(d0,d1);
1466            PyObject *ret=PyTuple_New(2);
1467            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1468            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1469            return ret;
1470          } 
1471
1472       PyObject *thresholdPerPack(mcIdType threshold) const
1473       {
1474         MCAuto<MEDCouplingSkyLineArray> left, right;
1475         self->thresholdPerPack(threshold,left,right);
1476         PyObject *ret=PyTuple_New(2);
1477         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(left.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1478         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(right.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingSkyLineArray, SWIG_POINTER_OWN | 0 ));
1479         return ret;
1480       }
1481     }
1482   };
1483 }
1484
1485 %include "MEDCouplingFieldDiscretization.i"
1486
1487 //== MEDCouplingPointSet
1488
1489 namespace MEDCoupling
1490 {
1491   class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
1492     {
1493     public:
1494       void setCoords(const DataArrayDouble *coords);
1495       DataArrayDouble *getCoordinatesAndOwner() const;
1496       bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const;
1497       void zipCoords();
1498       double getCaracteristicDimension() const;
1499       void recenterForMaxPrecision(double eps);
1500       void changeSpaceDimension(int newSpaceDim, double dftVal=0.);
1501       void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon);
1502       virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
1503       virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const;
1504       virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon);
1505       static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
1506       static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type);
1507       static DataArrayIdType *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps);
1508       virtual DataArrayIdType *computeFetchedNodeIds() const;
1509       virtual int getNumberOfNodesInCell(int cellId) const;
1510       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
1511       virtual DataArrayIdType *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
1512       virtual DataArrayIdType *zipCoordsTraducer();
1513       virtual DataArrayIdType *findBoundaryNodes() const;
1514       virtual DataArrayIdType *zipConnectivityTraducer(int compType, int startCellId=0);
1515       virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
1516       virtual void checkFullyDefined() const;
1517       virtual bool isEmptyMesh(const std::vector<mcIdType>& tinyInfo) const;
1518       virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const;
1519       virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
1520       virtual void renumberNodesWithOffsetInConn(int offset);
1521       virtual bool areAllNodesFetched() const;
1522       virtual MEDCouplingFieldDouble *computeDiameterField() const;
1523       virtual void invertOrientationOfAllCells();
1524       %extend 
1525          {
1526            std::string __str__() const
1527            {
1528              return self->simpleRepr();
1529            }
1530            
1531            PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayIdType *comm, const DataArrayIdType *commIndex) const
1532            {
1533              mcIdType newNbOfNodes;
1534              DataArrayIdType *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
1535              PyObject *res = PyList_New(2);
1536              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1537              PyList_SetItem(res,1,PyInt_FromLong(newNbOfNodes));
1538              return res;
1539            }
1540            
1541            PyObject *findCommonNodes(double prec, mcIdType limitTupleId=-1) const
1542            {
1543              DataArrayIdType *comm, *commIndex;
1544              self->findCommonNodes(prec,limitTupleId,comm,commIndex);
1545              PyObject *res = PyList_New(2);
1546              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1547              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1548              return res;
1549            }
1550            
1551            PyObject *getCoords()
1552            {
1553              DataArrayDouble *ret1=self->getCoords();
1554              if (ret1)
1555                 ret1->incrRef();
1556              return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
1557            }
1558            
1559            PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const
1560            {
1561              mcIdType szArr,sw,iTypppArr;
1562              std::vector<mcIdType> stdvecTyyppArr;
1563              const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1564              MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
1565              if(sw==3)//DataArrayIdType
1566                { 
1567                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1568                  DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1569                  std::string name=argpt->getName();
1570                  if(!name.empty())
1571                    ret->setName(name.c_str());
1572                }
1573              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1574            }
1575            
1576            PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const
1577            {
1578              mcIdType szArr,sw,iTypppArr;
1579              std::vector<mcIdType> stdvecTyyppArr;
1580              const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1581              MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1582              if(sw==3)//DataArrayIdType
1583                { 
1584                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1585                  DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1586                  std::string name=argpt->getName();
1587                  if(!name.empty())
1588                    ret->setName(name.c_str());
1589                }
1590              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1591            }
1592
1593            virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const
1594            {
1595              mcIdType szArr,sw,iTypppArr;
1596              std::vector<mcIdType> stdvecTyyppArr;
1597              const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1598              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1599              if(sw==3)//DataArrayIdType
1600                { 
1601                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1602                  DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1603                  std::string name=argpt->getName();
1604                  if(!name.empty())
1605                    ret->setName(name.c_str());
1606                }
1607              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1608            }
1609
1610            virtual PyObject *buildPartOfMySelfKeepCoordsSlice(mcIdType start, mcIdType end, mcIdType step) const
1611            {
1612              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
1613              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1614            }
1615
1616            PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const
1617            {
1618              mcIdType szArr,sw,iTypppArr;
1619              std::vector<mcIdType> stdvecTyyppArr;
1620              const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1621              MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1622              if(sw==3)//DataArrayIdType
1623                { 
1624                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTITraits<mcIdType>::TI,0|0);
1625                  DataArrayIdType *argpt=reinterpret_cast< MEDCoupling::DataArrayIdType * >(argp);
1626                  std::string name=argpt->getName();
1627                  if(!name.empty())
1628                    ret->setName(name.c_str());
1629                }
1630              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1631            }
1632
1633            void renumberNodes(PyObject *li, mcIdType newNbOfNodes)
1634            {
1635              mcIdType szArr,sw,iTypppArr;
1636              std::vector<mcIdType> stdvecTyyppArr;
1637              const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1638              self->renumberNodes(tmp,newNbOfNodes);
1639            }
1640
1641            void renumberNodesCenter(PyObject *li, mcIdType newNbOfNodes)
1642            {
1643              mcIdType szArr,sw,iTypppArr;
1644              std::vector<mcIdType> stdvecTyyppArr;
1645              const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1646              self->renumberNodesCenter(tmp,newNbOfNodes);
1647            }
1648
1649            PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const
1650              {
1651                int spaceDim=self->getSpaceDimension();
1652                double val,val2;
1653                DataArrayDouble *a,*a2;
1654                DataArrayDoubleTuple *aa,*aa2;
1655                std::vector<double> bb,bb2;
1656                mcIdType sw;
1657                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st parameter for point.";
1658                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd parameter for vector.";
1659                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1660                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1661                std::vector<mcIdType> nodes;
1662                self->findNodesOnLine(p,v,eps,nodes);
1663                DataArrayIdType *ret=DataArrayIdType::New();
1664                ret->alloc(nodes.size(),1);
1665                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1666                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1667              }
1668            PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const
1669              {
1670                int spaceDim=self->getSpaceDimension();
1671                double val,val2;
1672                DataArrayDouble *a,*a2;
1673                DataArrayDoubleTuple *aa,*aa2;
1674                std::vector<double> bb,bb2;
1675                mcIdType sw;
1676                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st parameter for point.";
1677                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd parameter for vector.";
1678                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1679                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1680                std::vector<mcIdType> nodes;
1681                self->findNodesOnPlane(p,v,eps,nodes);
1682                DataArrayIdType *ret=DataArrayIdType::New();
1683                ret->alloc(nodes.size(),1);
1684                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1685                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1686              }
1687            
1688            PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const
1689            {
1690              double val;
1691              DataArrayDouble *a;
1692              DataArrayDoubleTuple *aa;
1693              std::vector<double> bb;
1694              mcIdType sw;
1695              int spaceDim=self->getSpaceDimension();
1696              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1697              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1698              DataArrayIdType *ret=self->getNodeIdsNearPoint(pos,eps);
1699              return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1700            }
1701
1702            PyObject *getNodeIdsNearPoints(PyObject *pt, mcIdType nbOfPoints, double eps) const
1703            {
1704              DataArrayIdType *c=0,*cI=0;
1705              //
1706              double val;
1707              DataArrayDouble *a;
1708              DataArrayDoubleTuple *aa;
1709              std::vector<double> bb;
1710              mcIdType sw;
1711              int spaceDim=self->getSpaceDimension();
1712              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1713              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1714              self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1715              PyObject *ret=PyTuple_New(2);
1716              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1717              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1718              return ret;
1719            }
1720
1721            PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const
1722            {
1723              DataArrayIdType *c=0,*cI=0;
1724              int spaceDim=self->getSpaceDimension();
1725              double val;
1726              DataArrayDouble *a;
1727              DataArrayDoubleTuple *aa;
1728              std::vector<double> bb;
1729              mcIdType sw;
1730              mcIdType nbOfTuples=-1;
1731              const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1732              self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1733              //
1734              PyObject *ret=PyTuple_New(2);
1735              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1736              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1737              return ret;
1738            }
1739
1740            PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const
1741            {
1742              double val;
1743              DataArrayDouble *a;
1744              DataArrayDoubleTuple *aa;
1745              std::vector<double> bb;
1746              mcIdType sw;
1747              int spaceDim=self->getSpaceDimension();
1748              const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1749              const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1750              //
1751              DataArrayIdType *elems=self->getCellsInBoundingBox(tmp,eps);
1752              return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
1753            }
1754
1755            void duplicateNodesInCoords(PyObject *li)
1756            {
1757              mcIdType sw;
1758              mcIdType singleVal;
1759              std::vector<mcIdType> multiVal;
1760              std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1761              MEDCoupling::DataArrayIdType *daIntTyypp=0;
1762              convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1763              switch(sw)
1764                {
1765                case 1:
1766                  return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1767                case 2:
1768                  return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1769                case 4:
1770                  return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1771                default:
1772                  throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
1773                }
1774            }
1775
1776            virtual PyObject *findCommonCells(int compType, mcIdType startCellId=0) const
1777            {
1778              DataArrayIdType *v0(nullptr),*v1(nullptr);
1779              self->findCommonCells(compType,startCellId,v0,v1);
1780              PyObject *res = PyList_New(2);
1781              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1782              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1783              return res;
1784            }
1785
1786       
1787            virtual void renumberNodesInConn(PyObject *li)
1788            {
1789              void *da(nullptr);
1790              {
1791                int res1(SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__MapII, 0 |  0 ));
1792                if(SWIG_IsOK(res1))
1793                  {
1794                    MapII *da2(reinterpret_cast<MapII *>(da));
1795                    self->renumberNodesInConn(da2->data());
1796                    return ;
1797                  }
1798              }
1799              int res1(SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 | 0 ));
1800              if (!SWIG_IsOK(res1))
1801                {
1802                  mcIdType size;
1803                  INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1804                  self->renumberNodesInConn(tmp);
1805                }
1806              else
1807                {
1808                  DataArrayIdType *da2(reinterpret_cast< DataArrayIdType * >(da));
1809                  if(!da2)
1810                    throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1811                  da2->checkAllocated();
1812                  self->renumberNodesInConn(da2->getConstPointer());
1813                }
1814            }
1815
1816            virtual PyObject *getNodeIdsInUse() const
1817            {
1818              mcIdType ret1=-1;
1819              DataArrayIdType *ret0=self->getNodeIdsInUse(ret1);
1820              PyObject *ret=PyTuple_New(2);
1821              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1822              PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1823              return ret;
1824            }
1825
1826            virtual DataArrayIdType *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1827            {
1828              DataArrayIdType *ret(nullptr);
1829              //
1830              mcIdType szArr,sw,iTypppArr;
1831              std::vector<mcIdType> stdvecTyyppArr;
1832              const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1833              self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1834              return ret;
1835            }
1836
1837            virtual PyObject *mergeNodes(double precision)
1838            {
1839              bool ret1;
1840              mcIdType ret2;
1841              DataArrayIdType *ret0=self->mergeNodes(precision,ret1,ret2);
1842              PyObject *res = PyList_New(3);
1843              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1844              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1845              PyList_SetItem(res,2,PyInt_FromLong(ret2));
1846              return res;
1847            }
1848            
1849            virtual PyObject *mergeNodesCenter(double precision)
1850            {
1851              bool ret1;
1852              mcIdType ret2;
1853              DataArrayIdType *ret0=self->mergeNodesCenter(precision,ret1,ret2);
1854              PyObject *res = PyList_New(3);
1855              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
1856              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1857              PyList_SetItem(res,2,PyInt_FromLong(ret2));
1858              return res;
1859            }
1860            
1861            DataArrayIdType *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const
1862            {
1863              void *da=0;
1864              int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
1865              if (!SWIG_IsOK(res1))
1866                {
1867                  mcIdType size;
1868                  INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
1869                  return self->getCellIdsLyingOnNodes(tmp,((const mcIdType *)tmp)+size,fullyIn);
1870                }
1871              else
1872                {
1873                  DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
1874                  if(!da2)
1875                    throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
1876                  da2->checkAllocated();
1877                  return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1878                }
1879            }
1880
1881            MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI)
1882            {
1883              mcIdType sw;
1884              mcIdType singleVal;
1885              std::vector<mcIdType> multiVal;
1886              std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
1887              MEDCoupling::DataArrayIdType *daIntTyypp=0;
1888              mcIdType nbc=self->getNumberOfCells();
1889              convertIntStarOrSliceLikePyObjToCpp(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1890              switch(sw)
1891                {
1892                case 1:
1893                  {
1894                    if(singleVal>=nbc)
1895                      {
1896                        std::ostringstream oss;
1897                        oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1898                        throw INTERP_KERNEL::Exception(oss.str().c_str());
1899                      }
1900                    if(singleVal>=0)
1901                      return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1902                    else
1903                      {
1904                        if(nbc+singleVal>0)
1905                          {
1906                            mcIdType tmp=nbc+singleVal;
1907                            return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1908                          }
1909                        else
1910                          {
1911                            std::ostringstream oss;
1912                            oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1913                            throw INTERP_KERNEL::Exception(oss.str().c_str());
1914                          }
1915                      }
1916                  }
1917                case 2:
1918                  {
1919                    return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1920                  }
1921                case 3:
1922                  {
1923                    return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
1924                  }
1925                case 4:
1926                  {
1927                    if(!daIntTyypp)
1928                      throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1929                    daIntTyypp->checkAllocated();
1930                    return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1931                  }
1932                default:
1933                  throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
1934                }
1935            }
1936            
1937            static void Rotate2DAlg(PyObject *center, double angle, mcIdType nbNodes, PyObject *coords)
1938            {
1939              mcIdType sz;
1940              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1941              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1942              MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,coo);
1943              for(mcIdType i=0;i<sz;i++)
1944                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1945            }
1946            
1947            static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords)
1948            {
1949              mcIdType sz;
1950              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1951              mcIdType sw,nbNodes=0;
1952              double val0;  MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1953              std::vector<double> val3;
1954              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1955                                                             "Rotate2DAlg",2,true,nbNodes);
1956              if(sw!=2 && sw!=3)
1957                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1958              MEDCoupling::DataArrayDouble::Rotate2DAlg(c,angle,nbNodes,coo,const_cast<double *>(coo));
1959            }
1960            
1961            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, mcIdType nbNodes, PyObject *coords)
1962            {
1963              mcIdType sz,sz2;
1964              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1965              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1966              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1967              MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,coo);
1968              for(mcIdType i=0;i<sz;i++)
1969                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1970            }
1971            
1972            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords)
1973            {
1974              mcIdType sz,sz2;
1975              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1976              mcIdType sw,nbNodes=0;
1977              double val0;  MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
1978              std::vector<double> val3;
1979              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1980                                                             "Rotate3DAlg",3,true,nbNodes);
1981              if(sw!=2 && sw!=3)
1982                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1983              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1984              MEDCoupling::DataArrayDouble::Rotate3DAlg(c,v,angle,nbNodes,coo,const_cast<double *>(coo));
1985            }
1986          }
1987     };
1988
1989   //== MEDCouplingPointSet End
1990
1991   class MEDCouplingUMeshCell
1992   {
1993   public:
1994     INTERP_KERNEL::NormalizedCellType getType() const;
1995     %extend
1996       {
1997         std::string __str__() const
1998         {
1999           return self->repr();
2000         }
2001
2002         PyObject *getAllConn() const
2003         {
2004           mcIdType ret2;
2005           const mcIdType *r=self->getAllConn(ret2);
2006           PyObject *ret=PyTuple_New(ret2);
2007           for(mcIdType i=0;i<ret2;i++)
2008             PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
2009           return ret;
2010         }
2011       }
2012   };
2013
2014   class MEDCouplingUMeshCellIterator
2015   {
2016   public:
2017     %extend
2018       {
2019         PyObject *next()
2020         {
2021           MEDCouplingUMeshCell *ret=self->nextt();
2022           if(ret)
2023             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
2024           else
2025             {
2026               PyErr_SetString(PyExc_StopIteration,"No more data.");
2027               return 0;
2028             }
2029         }
2030       }
2031   };
2032
2033   class MEDCouplingUMeshCellByTypeIterator
2034   {
2035   public:
2036     ~MEDCouplingUMeshCellByTypeIterator();
2037     %extend
2038       {
2039         PyObject *next()
2040         {
2041           MEDCouplingUMeshCellEntry *ret=self->nextt();
2042           if(ret)
2043             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
2044           else
2045             {
2046               PyErr_SetString(PyExc_StopIteration,"No more data.");
2047               return 0;
2048             }
2049         }
2050       }
2051   };
2052
2053   class MEDCouplingUMeshCellByTypeEntry
2054   {
2055   public:
2056     ~MEDCouplingUMeshCellByTypeEntry();
2057     %extend
2058       {
2059         MEDCouplingUMeshCellByTypeIterator *__iter__()
2060         {
2061           return self->iterator();
2062         }
2063       }
2064   };
2065
2066   class MEDCouplingUMeshCellEntry
2067   {
2068   public:
2069     INTERP_KERNEL::NormalizedCellType getType() const;
2070     int getNumberOfElems() const;
2071     %extend
2072       {
2073         MEDCouplingUMeshCellIterator *__iter__()
2074         {
2075           return self->iterator();
2076         }
2077       }
2078   };
2079   
2080   //== MEDCouplingUMesh
2081
2082   class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
2083   {
2084   public:
2085     static MEDCouplingUMesh *New();
2086     static MEDCouplingUMesh *New(const char *meshName, int meshDim);
2087     void checkConsistencyLight() const;
2088     void checkGeomConsistency(double eps=1e-12) const;
2089     void setMeshDimension(int meshDim);
2090     void allocateCells(int nbOfCells=0);
2091     void finishInsertingCells();
2092     MEDCouplingUMeshCellByTypeEntry *cellsByType();
2093     void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
2094     INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
2095     void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
2096     int getNodalConnectivityArrayLen() const;
2097     void computeTypes();
2098     std::string reprConnectivityOfThis() const;
2099     MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
2100     //tools
2101     DataArrayIdType *conformize2D(double eps);
2102     DataArrayIdType *conformize3D(double eps);
2103     DataArrayIdType *colinearize2D(double eps);
2104     DataArrayIdType *colinearizeKeepingConform2D(double eps);
2105     void shiftNodeNumbersInConn(int delta);
2106     std::vector<bool> getQuadraticStatus() const;
2107     DataArrayIdType *findCellIdsOnBoundary() const;
2108     MEDCouplingUMesh *computeSkin() const;
2109     bool checkConsecutiveCellTypes() const;
2110     bool checkConsecutiveCellTypesForMEDFileFrmt() const;
2111     DataArrayIdType *rearrange2ConsecutiveCellTypes();
2112     DataArrayIdType *sortCellsInMEDFileFrmt();
2113     DataArrayIdType *getRenumArrForMEDFileFrmt() const;
2114     DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
2115     MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2116     MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2117     MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2118     MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2119     void orientCorrectlyPolyhedrons();
2120     bool isPresenceOfQuadratic() const;
2121     bool isFullyQuadratic() const;
2122     MEDCouplingFieldDouble *buildDirectionVectorField() const;
2123     bool isContiguous1D() const;
2124     void tessellate2D(double eps);
2125     void convertQuadraticCellsToLinear();
2126     DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
2127     void convertDegeneratedCells();
2128     DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
2129     bool removeDegenerated1DCells();
2130     bool areOnlySimplexCells() const;
2131     MEDCouplingFieldDouble *getEdgeRatioField() const;
2132     MEDCouplingFieldDouble *getAspectRatioField() const;
2133     MEDCouplingFieldDouble *getWarpField() const;
2134     MEDCouplingFieldDouble *getSkewField() const;
2135     DataArrayDouble *computePlaneEquationOf3DFaces() const;
2136     DataArrayIdType *convexEnvelop2D();
2137     std::string cppRepr() const;
2138     DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
2139     DataArrayIdType *findAndCorrectBadOriented3DCells();
2140     MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
2141     MEDCouplingSkyLineArray *generateGraph() const;
2142     DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
2143     DataArrayIdType *buildUnionOf2DMesh() const;
2144     DataArrayIdType *buildUnionOf3DMesh() const;
2145     DataArrayIdType *orderConsecutiveCells1D() const;
2146     DataArrayDouble *getBoundingBoxForBBTreeFast() const;
2147     DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
2148     DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
2149     void changeOrientationOfCells();
2150     void orientCorrectly2DCells(const MEDCouplingUMesh *refFaces);
2151     DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2152     int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
2153     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2154     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2155     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2156     static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
2157     static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
2158     %extend {
2159       MEDCouplingUMesh()
2160       {
2161         return MEDCouplingUMesh::New();
2162       }
2163       
2164       MEDCouplingUMesh(const char *meshName, int meshDim)
2165       {
2166         return MEDCouplingUMesh::New(meshName,meshDim);
2167       }
2168
2169       std::string __str__() const
2170       {
2171         return self->simpleRepr();
2172       }
2173       
2174       std::string __repr__() const
2175       {
2176         std::ostringstream oss;
2177         self->reprQuickOverview(oss);
2178         return oss.str();
2179       }
2180       
2181       MEDCouplingUMeshCellIterator *__iter__()
2182       {
2183         return self->cellIterator();
2184       }
2185
2186       static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2187       {
2188         MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2189         return ret.retn();
2190       }
2191       
2192       PyObject *getAllGeoTypesSorted() const
2193       {
2194         std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2195         std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2196         PyObject *res=PyList_New(result.size());
2197         for(int i=0;iL!=result.end(); i++, iL++)
2198           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2199         return res;
2200       }
2201       
2202       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2203       {
2204         mcIdType sw;
2205         mcIdType singleVal;
2206         std::vector<mcIdType> multiVal;
2207         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2208         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2209         mcIdType nbc=self->getNumberOfCells();
2210         convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2211         switch(sw)
2212           {
2213           case 1:
2214             {
2215               if(singleVal>=nbc)
2216                 {
2217                   std::ostringstream oss;
2218                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2219                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2220                 }
2221               if(singleVal>=0)
2222                 {
2223                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2224                   break;
2225                 }
2226               else
2227                 {
2228                   if(nbc+singleVal>0)
2229                     {
2230                       mcIdType tmp=nbc+singleVal;
2231                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2232                       break;
2233                     }
2234                   else
2235                     {
2236                       std::ostringstream oss;
2237                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2238                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2239                     }
2240                 }
2241             }
2242           case 2:
2243             {
2244               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2245               break;
2246             }
2247           case 4:
2248             {
2249               if(!daIntTyypp)
2250                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2251               daIntTyypp->checkAllocated();
2252               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2253               break;
2254             }
2255           default:
2256             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
2257           }
2258       }
2259
2260       void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2261       {
2262         mcIdType sw;
2263         mcIdType singleVal;
2264         std::vector<mcIdType> multiVal;
2265         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2266         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2267         mcIdType nbc=self->getNumberOfCells();
2268         convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2269         switch(sw)
2270           {
2271           case 1:
2272             {
2273               if(singleVal>=nbc)
2274                 {
2275                   std::ostringstream oss;
2276                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2277                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2278                 }
2279               if(singleVal>=0)
2280                 {
2281                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2282                   break;
2283                 }
2284               else
2285                 {
2286                   if(nbc+singleVal>0)
2287                     {
2288                       mcIdType tmp=nbc+singleVal;
2289                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2290                       break;
2291                     }
2292                   else
2293                     {
2294                       std::ostringstream oss;
2295                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2296                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2297                     }
2298                 }
2299             }
2300           case 2:
2301             {
2302               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2303               break;
2304             }
2305           case 3:
2306             {
2307               self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2308               break;
2309             }
2310           case 4:
2311             {
2312               if(!daIntTyypp)
2313                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2314               daIntTyypp->checkAllocated();
2315               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2316               break;
2317             }
2318           default:
2319             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
2320           }
2321       }
2322
2323       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
2324       {
2325         mcIdType szArr,sw,iTypppArr;
2326         std::vector<mcIdType> stdvecTyyppArr;
2327         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2328         if(size>szArr)
2329           {
2330             std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2331             throw INTERP_KERNEL::Exception(oss.str().c_str());
2332           }
2333         self->insertNextCell(type,size,tmp);
2334       }
2335
2336       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2337       {
2338         mcIdType szArr,sw,iTypppArr;
2339         std::vector<mcIdType> stdvecTyyppArr;
2340         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2341         self->insertNextCell(type,szArr,tmp);
2342       }
2343       
2344       DataArrayIdType *getNodalConnectivity()
2345       {
2346         DataArrayIdType *ret=self->getNodalConnectivity();
2347         if(ret)
2348           ret->incrRef();
2349         return ret;
2350       }
2351       DataArrayIdType *getNodalConnectivityIndex()
2352       {
2353         DataArrayIdType *ret=self->getNodalConnectivityIndex();
2354         if(ret)
2355           ret->incrRef();
2356         return ret;
2357       }
2358       
2359       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
2360       {
2361         mcIdType szArr,sw,iTypppArr;
2362         std::vector<mcIdType> stdvecTyyppArr;
2363         const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2364         mcIdType nbOfDepthPeelingPerformed=0;
2365         DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2366         PyObject *res=PyTuple_New(2);
2367         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2368         PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2369         return res;
2370       }
2371
2372       static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
2373       {
2374         DataArrayIdType *v0=0,*v1=0;
2375         MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2376         PyObject *res = PyList_New(2);
2377         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2378         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2379         return res;
2380       }
2381       
2382       PyObject *distanceToPoint(PyObject *point) const
2383       {
2384         double val;
2385         DataArrayDouble *a;
2386         DataArrayDoubleTuple *aa;
2387         std::vector<double> bb;
2388         mcIdType sw;
2389         int nbOfCompo=self->getSpaceDimension();
2390         const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2391         //
2392         mcIdType cellId=-1;
2393         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2394         PyObject *ret=PyTuple_New(2);
2395         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2396         PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2397         return ret;
2398       }
2399
2400       PyObject *distanceToPoints(const DataArrayDouble *pts) const
2401       {
2402         DataArrayIdType *ret1=0;
2403         DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2404         PyObject *ret=PyTuple_New(2);
2405         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2406         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2407         return ret;
2408       }
2409
2410       PyObject *tetrahedrize(int policy)
2411       {
2412         mcIdType ret2(-1);
2413         DataArrayIdType *ret1(0);
2414         MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2415         PyObject *ret=PyTuple_New(3);
2416         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2417         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2418         PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2419         return ret;
2420       }
2421       
2422       PyObject *checkButterflyCells(double eps=1e-12)
2423       {
2424         std::vector<mcIdType> cells;
2425         self->checkButterflyCells(cells,eps);
2426         DataArrayIdType *ret=DataArrayIdType::New();
2427         ret->alloc(cells.size(),1);
2428         std::copy(cells.begin(),cells.end(),ret->getPointer());
2429         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2430       }
2431
2432       PyObject *splitByType() const
2433       {
2434         std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2435         std::size_t sz=ms.size();
2436         PyObject *ret = PyList_New(sz);
2437         for(std::size_t i=0;i<sz;i++)
2438           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2439         return ret;
2440       }
2441
2442       PyObject *partitionBySpreadZone() const
2443       {
2444         std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
2445         std::size_t sz=retCpp.size();
2446         PyObject *ret=PyList_New(sz);
2447         for(std::size_t i=0;i<sz;i++)
2448           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2449         return ret;
2450       }
2451
2452       static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
2453       {
2454         std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2455         std::size_t sz=retCpp.size();
2456         PyObject *ret=PyList_New(sz);
2457         for(std::size_t i=0;i<sz;i++)
2458           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2459         return ret;
2460       }
2461
2462       PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2463       {
2464         mcIdType size;
2465         INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
2466         MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2467         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2468       }
2469
2470       bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2471       {
2472         mcIdType sz;
2473         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2474         bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2475         return ret;
2476       }
2477
2478       DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2479       {
2480         mcIdType sz;
2481         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2482         DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2483         return ret;
2484       }
2485
2486       DataArrayIdType *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2487       {
2488         DataArrayIdType *ret=self->findNodesToDuplicate(otherDimM1OnSameCoords);
2489         return ret;
2490       }
2491
2492       PyObject *findCellsToRenumber(const MEDCouplingUMesh& otherDimM1OnSameCoords, const DataArrayIdType *dupNodes) const
2493       {
2494         DataArrayIdType *tmp0=0,*tmp1=0;
2495         self->findCellsToRenumber(otherDimM1OnSameCoords,dupNodes->begin(), dupNodes->end(), tmp0,tmp1);
2496         PyObject *ret=PyTuple_New(2);
2497         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2498         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2499         return ret;
2500       }
2501
2502       PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2503       {
2504         DataArrayIdType *tmp0=0,*tmp1=0;
2505         self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2506         PyObject *ret=PyTuple_New(2);
2507         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2508         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2509         return ret;
2510       }
2511
2512       void duplicateNodes(PyObject *li)
2513       {
2514         mcIdType sw;
2515         mcIdType singleVal;
2516         std::vector<mcIdType> multiVal;
2517         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2518         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2519         convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2520         switch(sw)
2521           {
2522           case 1:
2523             return self->duplicateNodes(&singleVal,&singleVal+1);
2524           case 2:
2525             return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2526           case 4:
2527             return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2528           default:
2529             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2530           }
2531       }
2532
2533       void duplicateNodesInConn(PyObject *li, mcIdType offset)
2534       {
2535         mcIdType sw;
2536         mcIdType singleVal;
2537         std::vector<mcIdType> multiVal;
2538         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2539         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2540         convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2541         switch(sw)
2542           {
2543           case 1:
2544             return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2545           case 2:
2546             return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2547           case 4:
2548             return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2549           default:
2550             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2551           }
2552       }
2553
2554       void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2555       {
2556         mcIdType szArr,sw,iTypppArr;
2557         std::vector<mcIdType> stdvecTyyppArr;
2558         const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2559         self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2560       }
2561
2562       PyObject *getLevArrPerCellTypes(PyObject *li) const
2563       {
2564         mcIdType sz;
2565         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2566         DataArrayIdType *tmp0,*tmp1=0;
2567         tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2568         PyObject *ret=PyTuple_New(2);
2569         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2570         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2571         return ret;
2572       }
2573
2574       PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2575       {
2576         DataArrayIdType *ret0=0,*ret1=0;
2577         self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2578         PyObject *ret=PyTuple_New(2);
2579         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2580         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2581         return ret;
2582       }
2583
2584       static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2585       {
2586         std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2587         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2588         DataArrayIdType *ret1=0,*ret2=0;
2589         MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2590         PyObject *ret=PyTuple_New(3);
2591         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2592         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2593         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2594         return ret;
2595       }
2596
2597       static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2598       {
2599         std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2600         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2601         MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2602         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2603       }
2604
2605       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2606       {
2607         std::size_t sz;
2608         std::vector<const MEDCouplingUMesh *> meshes;
2609         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2610         std::vector<DataArrayIdType *> corr;
2611         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2612         sz=corr.size();
2613         PyObject *ret1=PyList_New(sz);
2614         for(std::size_t i=0;i<sz;i++)
2615           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2616         PyObject *ret=PyList_New(2);
2617         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2618         PyList_SetItem(ret,1,ret1);
2619         return ret;
2620       }
2621
2622       static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2623       {
2624         std::vector<MEDCouplingUMesh *> meshes;
2625         convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2626         MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2627       }
2628
2629       static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2630       {
2631         std::vector<MEDCouplingUMesh *> meshes;
2632         convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2633         MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2634       }
2635
2636       PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2637       {
2638         double val;
2639         DataArrayDouble *a;
2640         DataArrayDoubleTuple *aa;
2641         std::vector<double> bb;
2642         mcIdType sw;
2643         int spaceDim=self->getSpaceDimension();
2644         const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2645         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2646         //
2647         std::vector<mcIdType> cells;
2648         self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2649         DataArrayIdType *ret=DataArrayIdType::New();
2650         ret->alloc(cells.size(),1);
2651         std::copy(cells.begin(),cells.end(),ret->getPointer());
2652         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2653       }
2654
2655       void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2656       {
2657         double val;
2658         DataArrayDouble *a;
2659         DataArrayDoubleTuple *aa;
2660         std::vector<double> bb;
2661         mcIdType sw;
2662         int spaceDim=self->getSpaceDimension();
2663         const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2664         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2665         self->orientCorrectly2DCells(v,polyOnly);
2666       }
2667       
2668       PyObject *arePolyhedronsNotCorrectlyOriented() const
2669       {
2670         std::vector<mcIdType> cells;
2671         self->arePolyhedronsNotCorrectlyOriented(cells);
2672         DataArrayIdType *ret=DataArrayIdType::New();
2673         ret->alloc(cells.size(),1);
2674         std::copy(cells.begin(),cells.end(),ret->getPointer());
2675         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2676       }
2677
2678       PyObject *getFastAveragePlaneOfThis() const
2679       {
2680         double vec[3];
2681         double pos[3];
2682         self->getFastAveragePlaneOfThis(vec,pos);
2683         double vals[6];
2684         std::copy(vec,vec+3,vals);
2685         std::copy(pos,pos+3,vals+3);
2686         return convertDblArrToPyListOfTuple<double>(vals,3,2);
2687       }
2688       
2689       static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2690       {
2691         std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2692         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2693         return MEDCouplingUMesh::MergeUMeshes(tmp);
2694       }
2695
2696       PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2697       {
2698         DataArrayIdType *ret1;
2699         bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2700         PyObject *ret=PyTuple_New(2);
2701         PyObject *ret0Py=ret0?Py_True:Py_False;
2702         Py_XINCREF(ret0Py);
2703         PyTuple_SetItem(ret,0,ret0Py);
2704         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2705         return ret;
2706       }
2707
2708       PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2709       {
2710         DataArrayIdType *ret1;
2711         bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2712         PyObject *ret=PyTuple_New(2);
2713         PyObject *ret0Py=ret0?Py_True:Py_False;
2714         Py_XINCREF(ret0Py);
2715         PyTuple_SetItem(ret,0,ret0Py);
2716         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2717         return ret;
2718       }
2719
2720       PyObject *explode3DMeshTo1D() const
2721       {
2722         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2723         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2724         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2725         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2726         MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2727         PyObject *ret=PyTuple_New(5);
2728         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2729         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2730         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2731         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2732         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2733         return ret;
2734       }
2735
2736       PyObject *explodeIntoEdges() const
2737       {
2738         MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
2739         MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2740         PyObject *ret=PyTuple_New(5);
2741         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2742         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2743         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2744         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2745         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2746         return ret;
2747       }
2748
2749       PyObject *explodeMeshIntoMicroEdges() const
2750       {
2751         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2752         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2753         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2754         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2755         MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2756         PyObject *ret=PyTuple_New(5);
2757         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2758         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2759         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2760         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2761         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2762         return ret;
2763       }
2764
2765       PyObject *buildDescendingConnectivity() const
2766       {
2767         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2768         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2769         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2770         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2771         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2772         PyObject *ret=PyTuple_New(5);
2773         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2774         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2775         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2776         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2777         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2778         return ret;
2779       }
2780
2781       PyObject *buildDescendingConnectivity2() const
2782       {
2783         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2784         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2785         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2786         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2787         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2788         PyObject *ret=PyTuple_New(5);
2789         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2790         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2791         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2792         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2793         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2794         return ret;
2795       }
2796       
2797       PyObject *computeNeighborsOfCells() const
2798       {
2799         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2800         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2801         PyObject *ret=PyTuple_New(2);
2802         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2803         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2804         return ret;
2805       }
2806
2807       PyObject *computeNeighborsOfNodes() const
2808       {
2809         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2810         self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2811         PyObject *ret=PyTuple_New(2);
2812         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2813         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2814         return ret;
2815       }
2816
2817       PyObject *computeEnlargedNeighborsOfNodes() const
2818       {
2819         MCAuto<DataArrayIdType> neighbors,neighborsIdx;
2820         self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2821         PyObject *ret=PyTuple_New(2);
2822         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2823         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2824         return ret;
2825       }
2826       
2827       PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
2828       {
2829         MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
2830         self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2831         PyObject *ret=PyTuple_New(2);
2832         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2833         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2834         return ret;
2835       }
2836       
2837       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
2838       {
2839         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2840         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2841         PyObject *ret=PyTuple_New(2);
2842         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2843         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2844         return ret;
2845       }
2846
2847       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2848       {
2849         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2850         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2851         DataArrayIdType *d2,*d3,*d4,*dd5;
2852         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2853         PyObject *ret=PyTuple_New(7);
2854         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2855         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2856         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2857         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2858         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2859         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2860         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2861         return ret;
2862       }
2863
2864       DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
2865       {
2866         if(!da)
2867           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2868         da->checkAllocated();
2869         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2870       }
2871
2872       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
2873       {
2874         if(!da)
2875           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2876         da->checkAllocated();
2877         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2878       }
2879
2880       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
2881       {
2882         if(!da)
2883           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2884         da->checkAllocated();
2885         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2886       }
2887
2888       PyObject *getTypesOfPart(DataArrayIdType *da) const
2889       {
2890         if(!da)
2891           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2892         da->checkAllocated();
2893         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2894         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2895         PyObject *res = PyList_New(result.size());
2896         for (int i=0;iL!=result.end(); i++, iL++)
2897           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2898         return res;
2899       }
2900
2901       DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
2902       {
2903         if(!da)
2904           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2905         da->checkAllocated();
2906         DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2907         ret->setName(da->getName().c_str());
2908         return ret;
2909       }
2910
2911       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2912       {
2913         DataArrayIdType *cellNb1=0,*cellNb2=0;
2914         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2915         PyObject *ret=PyTuple_New(3);
2916         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2917         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2918         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2919         return ret;
2920       }
2921
2922       static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2923       {
2924         MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2925         DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2926         MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2927         PyObject *ret(PyTuple_New(4));
2928         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2929         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2930         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2931         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2932         return ret;
2933       }
2934
2935       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2936       {
2937         int spaceDim=self->getSpaceDimension();
2938         if(spaceDim!=3)
2939           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2940         double val,val2;
2941         DataArrayDouble *a,*a2;
2942         DataArrayDoubleTuple *aa,*aa2;
2943         std::vector<double> bb,bb2;
2944         mcIdType sw;
2945         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2946         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2947         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2948         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2949         //
2950         DataArrayIdType *cellIds=0;
2951         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2952         PyObject *ret=PyTuple_New(2);
2953         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2954         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2955         return ret;
2956       }
2957
2958       PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2959       {
2960         int spaceDim=self->getSpaceDimension();
2961         if(spaceDim!=3)
2962           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2963         double val,val2;
2964         DataArrayDouble *a,*a2;
2965         DataArrayDoubleTuple *aa,*aa2;
2966         std::vector<double> bb,bb2;
2967         mcIdType sw;
2968         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2969         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2970         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2971         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2972         //
2973         DataArrayIdType *cellIds=0;
2974         MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2975         PyObject *ret=PyTuple_New(2);
2976         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2977         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2978         return ret;
2979       }
2980
2981       MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2982       {
2983         double val,val2;
2984         DataArrayDouble *a,*a2;
2985         DataArrayDoubleTuple *aa,*aa2;
2986         std::vector<double> bb,bb2;
2987         mcIdType sw;
2988         const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2989         const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2990         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2991         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2992         MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2993         return ret.retn();
2994       }
2995
2996       DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2997       {
2998         int spaceDim=self->getSpaceDimension();
2999         if(spaceDim!=3)
3000           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
3001         double val,val2;
3002         DataArrayDouble *a,*a2;
3003         DataArrayDoubleTuple *aa,*aa2;
3004         std::vector<double> bb,bb2;
3005         mcIdType sw;
3006         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
3007         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
3008         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3009         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3010         return self->getCellIdsCrossingPlane(orig,vect,eps);
3011       }
3012
3013       void convertToPolyTypes(PyObject *li)
3014       {
3015         mcIdType sw;
3016         mcIdType pos1;
3017         std::vector<mcIdType> pos2;
3018         DataArrayIdType *pos3=0;
3019         DataArrayIdTypeTuple *pos4=0;
3020         convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
3021         switch(sw)
3022           {
3023           case 1:
3024             {
3025               self->convertToPolyTypes(&pos1,&pos1+1);
3026               return;
3027             }
3028           case 2:
3029             {
3030               if(pos2.empty())
3031                 return;
3032               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3033               return ;
3034             }
3035           case 3:
3036             {
3037               self->convertToPolyTypes(pos3->begin(),pos3->end());
3038               return ;
3039             }
3040           default:
3041             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3042           }
3043       }      
3044     }
3045     void convertAllToPoly();
3046     void convertExtrudedPolyhedra();
3047     bool unPolyze();
3048     void simplifyPolyhedra(double eps);
3049     MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
3050     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
3051   };
3052
3053   //== MEDCouplingUMesh End
3054
3055   //== MEDCouplingMappedExtrudedMesh
3056
3057   class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3058   {
3059   public:
3060     static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
3061     static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
3062     MEDCouplingUMesh *build3DUnstructuredMesh() const;
3063     int get2DCellIdForExtrusion() const;
3064     %extend {
3065       MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
3066       {
3067         return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3068       }
3069
3070       MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
3071       {
3072         return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3073       }
3074
3075       MEDCouplingMappedExtrudedMesh()
3076       {
3077         return MEDCouplingMappedExtrudedMesh::New();
3078       }
3079       
3080       std::string __str__() const
3081       {
3082         return self->simpleRepr();
3083       }
3084
3085       std::string __repr__() const
3086       {
3087         std::ostringstream oss;
3088         self->reprQuickOverview(oss);
3089         return oss.str();
3090       }
3091       
3092       PyObject *getMesh2D() const
3093       {
3094         MEDCouplingUMesh *ret=self->getMesh2D();
3095         if(ret)
3096           ret->incrRef();
3097         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3098       }
3099       PyObject *getMesh1D() const
3100       {
3101         MEDCouplingUMesh *ret=self->getMesh1D();
3102         if(ret)
3103           ret->incrRef();
3104         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3105       }
3106       PyObject *getMesh3DIds() const
3107       {
3108         DataArrayIdType *ret=self->getMesh3DIds();
3109         if(ret)
3110           ret->incrRef();
3111         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3112       } 
3113     }
3114   };
3115
3116   //== MEDCouplingMappedExtrudedMesh End
3117
3118   class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3119   {
3120   public:
3121     static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3122     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
3123     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
3124     int getNodalConnectivityLength() const;
3125     virtual void allocateCells(int nbOfCells=0);
3126     virtual void checkConsistencyOfConnectivity() const;
3127     %extend
3128     {
3129       virtual void insertNextCell(PyObject *li)
3130       {
3131         mcIdType szArr,sw,iTypppArr;
3132         std::vector<mcIdType> stdvecTyyppArr;
3133         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3134         self->insertNextCell(tmp,tmp+szArr);
3135       }
3136
3137       virtual DataArrayIdType *getNodalConnectivity() const
3138       {
3139         DataArrayIdType *ret=self->getNodalConnectivity();
3140         if(ret) ret->incrRef();
3141         return ret;
3142       }
3143       
3144       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
3145       {
3146         std::vector< const MEDCoupling1GTUMesh *> parts;
3147         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3148         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3149       }
3150     }
3151   };
3152
3153   //== MEDCoupling1SGTUMesh
3154
3155   class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3156   {
3157   public:
3158     static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3159     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3160     void setNodalConnectivity(DataArrayIdType *nodalConn);
3161     int getNumberOfNodesPerCell() const;
3162     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3163     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3164     MEDCoupling1GTUMesh *computeDualMesh() const;
3165     MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3166     DataArrayIdType *sortHexa8EachOther();
3167     %extend
3168     {
3169       MEDCoupling1SGTUMesh()
3170       {
3171         return MEDCoupling1SGTUMesh::New();
3172       }
3173
3174       MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3175       {
3176         return MEDCoupling1SGTUMesh::New(name,type);
3177       }
3178
3179       MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3180       {
3181         return MEDCoupling1SGTUMesh::New(m);
3182       }
3183
3184       std::string __str__() const
3185       {
3186         return self->simpleRepr();
3187       }
3188       
3189       std::string __repr__() const
3190       {
3191         std::ostringstream oss;
3192         self->reprQuickOverview(oss);
3193         return oss.str();
3194       }
3195
3196       PyObject *structurizeMe(double eps=1e-12) const
3197       {
3198         DataArrayIdType *cellPerm(0),*nodePerm(0);
3199         MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3200         PyObject *ret(PyTuple_New(3));
3201         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3202         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3203         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3204         return ret;
3205       }
3206
3207       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3208       {
3209         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3210         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3211         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3212       }
3213       
3214       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3215       {
3216         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3217         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3218         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3219       }
3220     }
3221   };
3222   
3223   //== MEDCoupling1SGTUMesh End
3224
3225   //== MEDCoupling1DGTUMesh
3226
3227   class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3228   {
3229   public:
3230     static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3231     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3232     void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
3233     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3234     bool isPacked() const;
3235     %extend
3236     {
3237       MEDCoupling1DGTUMesh()
3238       {
3239         return MEDCoupling1DGTUMesh::New();
3240       }
3241       MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3242       {
3243         return MEDCoupling1DGTUMesh::New(name,type);
3244       }
3245
3246       MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3247       {
3248         return MEDCoupling1DGTUMesh::New(m);
3249       }
3250
3251       std::string __str__() const
3252       {
3253         return self->simpleRepr();
3254       }
3255       
3256       std::string __repr__() const
3257       {
3258         std::ostringstream oss;
3259         self->reprQuickOverview(oss);
3260         return oss.str();
3261       }
3262
3263       DataArrayIdType *getNodalConnectivityIndex() const
3264       {
3265         DataArrayIdType *ret=self->getNodalConnectivityIndex();
3266         if(ret) ret->incrRef();
3267         return ret;
3268       }
3269
3270       PyObject *retrievePackedNodalConnectivity() const
3271       {
3272         DataArrayIdType *ret1=0,*ret2=0;
3273         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3274         PyObject *ret0Py=ret0?Py_True:Py_False;
3275         Py_XINCREF(ret0Py);
3276         PyObject *ret=PyTuple_New(3);
3277         PyTuple_SetItem(ret,0,ret0Py);
3278         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3279         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3280         return ret;
3281       }
3282       
3283       PyObject *copyWithNodalConnectivityPacked() const
3284       {
3285         bool ret1;
3286         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3287         PyObject *ret=PyTuple_New(2);
3288         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3289         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3290         PyTuple_SetItem(ret,1,ret1Py);
3291         return ret;
3292       }
3293
3294       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3295       {
3296         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3297         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3298         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3299       }
3300       
3301       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3302       {
3303         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3304         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3305         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3306       }
3307       
3308       static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
3309       {
3310         std::vector<const MEDCoupling::DataArrayIdType *> tmp;
3311         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
3312         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3313       }
3314     }
3315   };
3316
3317   //== MEDCoupling1DGTUMeshEnd
3318
3319   class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3320   {
3321   public:
3322     mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3323     mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3324     mcIdType getNumberOfCellsOfSubLevelMesh() const;
3325     int getSpaceDimensionOnNodeStruct() const;
3326     double computeSquareness() const;
3327     virtual std::vector<mcIdType> getNodeGridStructure() const;
3328     std::vector<mcIdType> getCellGridStructure() const;
3329     MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3330     std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
3331     std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
3332     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3333     MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3334     static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
3335     static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
3336     static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
3337     %extend
3338     {
3339       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3340       {
3341         mcIdType tmpp1=-1,tmpp2=-1;
3342         std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3343         std::vector< std::pair<mcIdType,mcIdType> > inp;
3344         if(tmpp2==2)
3345           {
3346             inp.resize(tmpp1);
3347             for(mcIdType i=0;i<tmpp1;i++)
3348               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3349           }
3350         else if(tmpp2==1)
3351           {
3352             if(tmpp1%2!=0)
3353               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3354             inp.resize(tmpp1/2);
3355             for(mcIdType i=0;i<tmpp1/2;i++)
3356               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3357           }
3358         else
3359           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3360         return self->buildStructuredSubPart(inp);
3361       }
3362
3363       static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3364       {
3365         std::vector< std::pair<mcIdType,mcIdType> > inp;
3366         convertPyToVectorPairInt(part,inp);
3367         //
3368         mcIdType szArr,sw,iTypppArr;
3369         std::vector<mcIdType> stdvecTyyppArr;
3370         const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3371         std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
3372         //
3373         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3374       }
3375
3376       static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
3377       {
3378         std::vector< std::pair<mcIdType,mcIdType> > inp;
3379         convertPyToVectorPairInt(part,inp);
3380         MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3381       }
3382
3383       static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
3384       {
3385         std::vector< std::pair<mcIdType,mcIdType> > inp;
3386         convertPyToVectorPairInt(part,inp);
3387         MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3388       }
3389
3390       static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
3391       {
3392         std::vector< std::pair<mcIdType,mcIdType> > inp;
3393         convertPyToVectorPairInt(part,inp);
3394         std::vector<mcIdType> stWithGhost;
3395         std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
3396         MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3397         PyObject *ret(PyTuple_New(2));
3398         PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3399         PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3400         return ret;
3401       }
3402
3403       static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3404       {
3405         std::vector< std::pair<mcIdType,mcIdType> > inp;
3406         convertPyToVectorPairInt(partCompactFormat,inp);
3407         return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3408       }
3409
3410       static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3411       {
3412         std::vector< std::pair<mcIdType,mcIdType> > inp;
3413         convertPyToVectorPairInt(partCompactFormat,inp);
3414         MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3415       }
3416
3417       static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3418       {
3419         std::vector< std::pair<mcIdType,mcIdType> > inp;
3420         convertPyToVectorPairInt(part,inp);
3421         return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3422       }
3423
3424       static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
3425       {
3426         mcIdType szArr,sw,iTypppArr;
3427         std::vector<mcIdType> stdvecTyyppArr;
3428         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3429         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3430       }
3431
3432       static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3433       {
3434         mcIdType szArr,sw,iTypppArr;
3435         std::vector<mcIdType> stdvecTyyppArr;
3436         const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3437         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3438       }
3439
3440       static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3441       {
3442         std::vector< std::pair<mcIdType,mcIdType> > inp;
3443         convertPyToVectorPairInt(partCompactFormat,inp);
3444         return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3445       }
3446
3447       static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
3448       {
3449         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3450         PyObject *retPy=PyList_New(ret.size());
3451         for(std::size_t i=0;i<ret.size();i++)
3452           {
3453             PyObject *tmp=PyTuple_New(2);
3454             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3455             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3456             PyList_SetItem(retPy,i,tmp);
3457           }
3458         return retPy;
3459       }
3460
3461       static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3462       {
3463         std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3464         convertPyToVectorPairInt(r1,r1Cpp);
3465         convertPyToVectorPairInt(r2,r2Cpp);
3466         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3467         PyObject *retPy=PyList_New(ret.size());
3468         for(std::size_t i=0;i<ret.size();i++)
3469           {
3470             PyObject *tmp=PyTuple_New(2);
3471             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3472             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3473             PyList_SetItem(retPy,i,tmp);
3474           }
3475         return retPy;
3476       }
3477
3478       static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3479       {
3480         std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3481         convertPyToVectorPairInt(r1,r1Cpp);
3482         convertPyToVectorPairInt(r2,r2Cpp);
3483         return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3484       }
3485
3486       static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3487       {
3488         mcIdType szArr,sw,iTypppArr;
3489         std::vector<mcIdType> stdvecTyyppArr;
3490         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3491         mcIdType szArr2,sw2,iTypppArr2;
3492         std::vector<mcIdType> stdvecTyyppArr2;
3493         const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3494         std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
3495         std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
3496         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3497         PyObject *ret=PyTuple_New(2);
3498         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3499         PyTuple_SetItem(ret,0,ret0Py);
3500         PyObject *ret1Py=PyList_New(partCompactFormat.size());
3501         for(std::size_t i=0;i<partCompactFormat.size();i++)
3502           {
3503             PyObject *tmp4=PyTuple_New(2);
3504             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3505             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3506             PyList_SetItem(ret1Py,i,tmp4);
3507           }
3508         PyTuple_SetItem(ret,1,ret1Py);
3509         return ret;
3510       }
3511
3512       static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3513       {
3514         std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3515         convertPyToVectorPairInt(bigInAbs,param0);
3516         convertPyToVectorPairInt(partOfBigInAbs,param1);
3517         MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3518         PyObject *retPy(PyList_New(ret.size()));
3519         for(std::size_t i=0;i<ret.size();i++)
3520           {
3521             PyObject *tmp(PyTuple_New(2));
3522             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3523             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3524             PyList_SetItem(retPy,i,tmp);
3525           }
3526         return retPy;
3527       }
3528
3529       static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
3530       {
3531         std::vector< std::pair<mcIdType,mcIdType> > param0;
3532         convertPyToVectorPairInt(part,param0);
3533         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3534         PyObject *retPy(PyList_New(ret.size()));
3535         for(std::size_t i=0;i<ret.size();i++)
3536           {
3537             PyObject *tmp(PyTuple_New(2));
3538             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3539             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3540             PyList_SetItem(retPy,i,tmp);
3541           }
3542         return retPy;
3543       }
3544
3545       static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3546       {
3547         std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
3548         convertPyToVectorPairInt(startingFrom,param0);
3549         convertPyToVectorPairInt(goingTo,param1);
3550         return  MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3551       }
3552
3553       static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3554       {
3555         std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3556         convertPyToVectorPairInt(bigInAbs,param0);
3557         convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3558         MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3559         PyObject *retPy(PyList_New(ret.size()));
3560         for(std::size_t i=0;i<ret.size();i++)
3561           {
3562             PyObject *tmp(PyTuple_New(2));
3563             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3564             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3565             PyList_SetItem(retPy,i,tmp);
3566           }
3567         return retPy;
3568       }
3569     }
3570   };
3571
3572   class MEDCouplingCurveLinearMesh;
3573
3574   //== MEDCouplingCMesh
3575   
3576   class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3577   {
3578   public:
3579     static MEDCouplingCMesh *New();
3580     static MEDCouplingCMesh *New(const std::string& meshName);
3581     void setCoords(const DataArrayDouble *coordsX,
3582                    const DataArrayDouble *coordsY=0,
3583                    const DataArrayDouble *coordsZ=0);
3584     void setCoordsAt(int i, const DataArrayDouble *arr);
3585     MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3586     %extend {
3587       MEDCouplingCMesh()
3588       {
3589         return MEDCouplingCMesh::New();
3590       }
3591       MEDCouplingCMesh(const std::string& meshName)
3592       {
3593         return MEDCouplingCMesh::New(meshName);
3594       }
3595       std::string __str__() const
3596       {
3597         return self->simpleRepr();
3598       }
3599       std::string __repr__() const
3600       {
3601         std::ostringstream oss;
3602         self->reprQuickOverview(oss);
3603         return oss.str();
3604       }
3605       DataArrayDouble *getCoordsAt(int i)
3606       {
3607         DataArrayDouble *ret=self->getCoordsAt(i);
3608         if(ret)
3609           ret->incrRef();
3610         return ret;
3611       }
3612     }
3613   };
3614
3615   //== MEDCouplingCMesh End
3616
3617   //== MEDCouplingCurveLinearMesh
3618
3619   class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3620   {
3621   public:
3622     static MEDCouplingCurveLinearMesh *New();
3623     static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3624     void setCoords(const DataArrayDouble *coords);
3625     %extend {
3626       MEDCouplingCurveLinearMesh()
3627       {
3628         return MEDCouplingCurveLinearMesh::New();
3629       }
3630       MEDCouplingCurveLinearMesh(const std::string& meshName)
3631       {
3632         return MEDCouplingCurveLinearMesh::New(meshName);
3633       }
3634       std::string __str__() const 
3635       {
3636         return self->simpleRepr();
3637       }
3638       std::string __repr__() const
3639       {
3640         std::ostringstream oss;
3641         self->reprQuickOverview(oss);
3642         return oss.str();
3643       }
3644       DataArrayDouble *getCoords()
3645       {
3646         DataArrayDouble *ret=self->getCoords();
3647         if(ret)
3648           ret->incrRef();
3649         return ret;
3650       }
3651       void setNodeGridStructure(PyObject *gridStruct)
3652       {
3653         mcIdType szArr,sw,iTypppArr;
3654         std::vector<mcIdType> stdvecTyyppArr;
3655         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3656         self->setNodeGridStructure(tmp,tmp+szArr);
3657       }
3658     }
3659   };
3660
3661   //== MEDCouplingCurveLinearMesh End
3662
3663   //== MEDCouplingIMesh
3664
3665   class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3666   {
3667   public:
3668     static MEDCouplingIMesh *New();
3669     //
3670     void setSpaceDimension(int spaceDim);
3671     std::vector<mcIdType> getNodeStruct() const;
3672     std::vector<double> getOrigin() const;
3673     std::vector<double> getDXYZ() const;
3674     void setAxisUnit(const std::string& unitName);
3675     std::string getAxisUnit() const;
3676     double getMeasureOfAnyCell() const;
3677     MEDCouplingCMesh *convertToCartesian() const;
3678     void refineWithFactor(const std::vector<mcIdType>& factors);
3679     MEDCouplingIMesh *asSingleCell() const;
3680     MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
3681     %extend
3682     {
3683       MEDCouplingIMesh()
3684       {
3685         return MEDCouplingIMesh::New();
3686       }
3687       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3688       {
3689         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3690         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3691         const mcIdType *nodeStrctPtr(0);
3692         const double *originPtr(0),*dxyzPtr(0);
3693         mcIdType sw,sz,val0;
3694         std::vector<mcIdType> bb0;
3695         nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3696         //
3697         double val,val2;
3698         std::vector<double> bb,bb2;
3699         mcIdType sz1,sz2;
3700         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3701         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3702         //
3703         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3704       }
3705
3706       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3707       {
3708         return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3709       }
3710
3711       void setNodeStruct(PyObject *nodeStrct)
3712       {
3713         mcIdType sw,sz,val0;
3714         std::vector<mcIdType> bb0;
3715         const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3716         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3717       }
3718
3719       void setOrigin(PyObject *origin)
3720       {
3721         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3722         double val;
3723         std::vector<double> bb;
3724         mcIdType sw,nbTuples;
3725         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3726         self->setOrigin(originPtr,originPtr+nbTuples);
3727       }
3728       
3729       void setDXYZ(PyObject *dxyz)
3730       {
3731         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3732         double val;
3733         std::vector<double> bb;
3734         mcIdType sw,nbTuples;
3735         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3736         self->setDXYZ(originPtr,originPtr+nbTuples);
3737       }
3738
3739       static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
3740       {
3741         std::vector< std::pair<mcIdType,mcIdType> > inp;
3742         convertPyToVectorPairInt(fineLocInCoarse,inp);
3743         MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3744       }
3745
3746       static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
3747       {
3748         std::vector< std::pair<mcIdType,mcIdType> > inp;
3749         convertPyToVectorPairInt(fineLocInCoarse,inp);
3750         MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3751       }
3752
3753       static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
3754       {
3755         std::vector< std::pair<mcIdType,mcIdType> > inp;
3756         convertPyToVectorPairInt(fineLocInCoarse,inp);
3757         MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3758       }
3759
3760       static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3761       {
3762         std::vector< std::pair<mcIdType,mcIdType> > inp;
3763         convertPyToVectorPairInt(fineLocInCoarse,inp);
3764         MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3765       }
3766
3767       static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3768       {
3769         std::vector< std::pair<mcIdType,mcIdType> > inp;
3770         convertPyToVectorPairInt(fineLocInCoarse,inp);
3771         MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3772       }
3773
3774       std::string __str__() const
3775       {
3776         return self->simpleRepr();
3777       }
3778       std::string __repr__() const
3779       {
3780         std::ostringstream oss;
3781         self->reprQuickOverview(oss);
3782         return oss.str();
3783       }
3784     }
3785   };
3786
3787   //== MEDCouplingIMesh End
3788
3789 }
3790
3791 namespace MEDCoupling
3792 {
3793   class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3794   {
3795   public:
3796     virtual void checkConsistencyLight() const;
3797     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3798     bool areStrictlyCompatible(const MEDCouplingField *other) const;
3799     bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
3800     virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3801     void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3802     void setName(const char *name);
3803     std::string getDescription() const;
3804     void setDescription(const char *desc);
3805     std::string getName() const;
3806     TypeOfField getTypeOfField() const;
3807     NatureOfField getNature() const;
3808     virtual void setNature(NatureOfField nat);
3809     DataArrayDouble *getLocalizationOfDiscr() const;
3810     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3811     mcIdType getNumberOfTuplesExpected() const;
3812     mcIdType getNumberOfMeshPlacesExpected() const;
3813     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3814                                     const std::vector<double>& gsCoo, const std::vector<double>& wg);
3815     void clearGaussLocalizations();
3816     MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3817     mcIdType getNbOfGaussLocalization() const;
3818     mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
3819     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3820     mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3821     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3822     %extend {
3823       PyObject *getMesh() const
3824       {
3825         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3826         if(ret1)
3827           ret1->incrRef();
3828         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3829       }
3830
3831       PyObject *getDiscretization()
3832       {
3833         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3834         if(ret)
3835           ret->incrRef();
3836         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3837       }
3838
3839       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3840       {
3841         std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
3842         return convertIntArrToPyList3(ret);
3843       }
3844
3845       PyObject *buildSubMeshData(PyObject *li) const
3846       {
3847         DataArrayIdType *ret1=0;
3848         MEDCouplingMesh *ret0=0;
3849         void *da=0;
3850         int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
3851         if (!SWIG_IsOK(res1))
3852           {
3853             mcIdType size;
3854             INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3855             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3856           }
3857         else
3858           {
3859             DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3860             if(!da2)
3861               throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3862             da2->checkAllocated();
3863             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3864           }
3865         PyObject *res = PyList_New(2);
3866         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3867         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3868         return res;
3869       }
3870
3871       PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
3872       {
3873         DataArrayIdType *ret1=0;
3874         mcIdType bb,ee,ss;
3875         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3876         PyObject *res=PyTuple_New(2);
3877         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3878         if(ret1)
3879           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3880         else
3881           {
3882             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3883             PyTuple_SetItem(res,1,res1);
3884           }
3885         return res;
3886       }
3887
3888       DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3889       {
3890         mcIdType sw,sz(-1);
3891         mcIdType v0; std::vector<mcIdType> v1;
3892         const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3893         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3894       }
3895
3896       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3897                                        const std::vector<double>& gsCoo, const std::vector<double>& wg)
3898       {
3899         void *da=0;
3900         int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
3901         if (!SWIG_IsOK(res1))
3902           {
3903             mcIdType size;
3904             INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3905             self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
3906           }
3907         else
3908           {
3909             DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3910             if(!da2)
3911               throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3912             da2->checkAllocated();
3913             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3914           }
3915       }
3916
3917       PyObject *getCellIdsHavingGaussLocalization(int locId) const
3918       {
3919         std::vector<mcIdType> tmp;
3920         self->getCellIdsHavingGaussLocalization(locId,tmp);
3921         DataArrayIdType *ret=DataArrayIdType::New();
3922         ret->alloc((mcIdType)tmp.size(),1);
3923         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3924         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3925       }
3926       
3927       mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3928       {
3929         std::vector<mcIdType> inp0;
3930         convertPyToNewIntArr4(code,1,3,inp0);
3931         std::vector<const DataArrayIdType *> inp1;
3932         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
3933         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3934       }
3935     }
3936   };
3937   
3938   class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3939   {
3940   public:
3941     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3942     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3943     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
3944     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
3945     static MEDCouplingFieldTemplate *New(TypeOfField type);
3946     std::string simpleRepr() const;
3947     std::string advancedRepr() const;
3948     bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3949     bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3950     %extend
3951        {
3952          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3953          {
3954            return MEDCouplingFieldTemplate::New(f);
3955          }
3956
3957          MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3958          {
3959            return MEDCouplingFieldTemplate::New(f);
3960          }
3961          
3962          MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
3963          {
3964            return MEDCouplingFieldTemplate::New(f);
3965          }
3966
3967          MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
3968          {
3969            return MEDCouplingFieldTemplate::New(f);
3970          }
3971          
3972          MEDCouplingFieldTemplate(TypeOfField type)
3973          {
3974            return MEDCouplingFieldTemplate::New(type);
3975          }
3976          
3977          std::string __str__() const
3978          {
3979            return self->simpleRepr();
3980          }
3981          
3982          std::string __repr__() const
3983          {
3984            std::ostringstream oss;
3985            self->reprQuickOverview(oss);
3986            return oss.str();
3987          }
3988
3989          PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3990          {
3991            std::string ret1;
3992            bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3993            PyObject *ret=PyTuple_New(2);
3994            PyObject *ret0Py=ret0?Py_True:Py_False;
3995            Py_XINCREF(ret0Py);
3996            PyTuple_SetItem(ret,0,ret0Py);
3997            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3998            return ret;
3999          }
4000        }
4001   };
4002
4003   template<class T>
4004  class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
4005   {
4006   public:
4007     TypeOfTimeDiscretization getTimeDiscretization() const;
4008   protected:
4009     MEDCouplingFieldT();
4010     ~MEDCouplingFieldT();
4011   };
4012
4013   %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
4014   %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
4015   %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
4016   
4017   class MEDCouplingFieldInt32;
4018   class MEDCouplingFieldInt64;
4019   class MEDCouplingFieldFloat;
4020   
4021   class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
4022   {
4023   public:
4024     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
4025     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
4026     bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
4027     bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
4028     void setTimeUnit(const std::string& unit);
4029     std::string getTimeUnit() const;
4030     void synchronizeTimeWithSupport();
4031     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
4032     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
4033     std::string simpleRepr() const;
4034     std::string advancedRepr() const;
4035     std::string  writeVTK(const std::string& fileName, bool isBinary=true) const;
4036     MEDCouplingFieldInt32 *convertToIntField() const;
4037     MEDCouplingFieldFloat *convertToFloatField() const;
4038     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4039     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4040     MEDCouplingFieldDouble *deepCopy() const;
4041     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
4042     MEDCouplingFieldDouble *nodeToCellDiscretization() const;
4043     MEDCouplingFieldDouble *cellToNodeDiscretization() const;
4044     double getIJ(int tupleId, int compoId) const;
4045     double getIJK(int cellId, int nodeIdInCell, int compoId) const;
4046     void synchronizeTimeWithMesh();
4047     void setArray(DataArrayDouble *array);
4048     void setEndArray(DataArrayDouble *array);
4049     void setTime(double val, int iteration, int order);
4050     void setStartTime(double val, int iteration, int order);
4051     void setEndTime(double val, int iteration, int order);
4052     void applyLin(double a, double b, int compoId);
4053     void applyLin(double a, double b);
4054     int getNumberOfComponents() const;
4055     int getNumberOfTuples() const;
4056     int getNumberOfValues() const;
4057     void setTimeTolerance(double val);
4058     double getTimeTolerance() const;
4059     void setIteration(int it);
4060     void setEndIteration(int it);
4061     void setOrder(int order);
4062     void setEndOrder(int order);
4063     void setTimeValue(double val);
4064     void setEndTimeValue(double val);
4065     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
4066     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
4067     bool mergeNodes(double eps, double epsOnVals=1e-15);
4068     bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
4069     bool zipCoords(double epsOnVals=1e-15);
4070     bool zipConnectivity(int compType,double epsOnVals=1e-15);
4071     bool simplexize(int policy);
4072     MEDCouplingFieldDouble *doublyContractedProduct() const;
4073     MEDCouplingFieldDouble *determinant() const;
4074     MEDCouplingFieldDouble *eigenValues() const;
4075     MEDCouplingFieldDouble *eigenVectors() const;
4076     MEDCouplingFieldDouble *inverse() const;
4077     MEDCouplingFieldDouble *trace() const;
4078     MEDCouplingFieldDouble *deviator() const;
4079     MEDCouplingFieldDouble *magnitude() const;
4080     MEDCouplingFieldDouble *maxPerTuple() const;
4081     void changeNbOfComponents(std::size_t newNbOfComp, double dftValue=0.);
4082     void sortPerTuple(bool asc);
4083     MEDCouplingFieldDouble &operator=(double value);
4084     void fillFromAnalytic(int nbOfComp, const std::string& func);
4085     void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
4086     void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4087     void applyFunc(int nbOfComp, const std::string& func);
4088     void applyFuncCompo(int nbOfComp, const std::string& func);
4089     void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4090     void applyFunc(int nbOfComp, double val);
4091     void applyFunc(const std::string& func);
4092     void applyFuncFast32(const std::string& func);
4093     void applyFuncFast64(const std::string& func);
4094     double accumulate(int compId) const;
4095     double getMaxValue() const;
4096     double getMinValue() const;
4097     double getAverageValue() const;
4098     double norm2() const;
4099     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4100     double getWeightedAverageValue(int compId, bool isWAbs) const;
4101     double integral(int compId, bool isWAbs) const;
4102     double normL1(int compId) const;
4103     double normL2(int compId) const;
4104     double normMax(int compId) const;
4105     DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
4106     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
4107     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4108     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4109     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4110     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
4111     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4112     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
4113     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4114     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
4115     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4116     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4117     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4118     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4119     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4120     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
4121     MEDCouplingFieldDouble *negate() const;
4122     %extend {
4123       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4124       {
4125         return MEDCouplingFieldDouble::New(type,td);
4126       }
4127
4128       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4129       {
4130         return MEDCouplingFieldDouble::New(ft,td);
4131       }
4132
4133       std::string __str__() const
4134       {
4135         return self->simpleRepr();
4136       }
4137
4138       std::string __repr__() const
4139       {
4140         std::ostringstream oss;
4141         self->reprQuickOverview(oss);
4142         return oss.str();
4143       }
4144
4145       PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
4146       {
4147         std::string ret1;
4148         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4149         PyObject *ret=PyTuple_New(2);
4150         PyObject *ret0Py=ret0?Py_True:Py_False;
4151         Py_XINCREF(ret0Py);
4152         PyTuple_SetItem(ret,0,ret0Py);
4153         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4154         return ret;
4155       }
4156       
4157       MEDCouplingFieldDouble *voronoize(double eps) const
4158       {
4159         MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4160         return ret.retn();
4161       }
4162
4163       MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4164       {
4165         MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4166         return ret.retn();
4167       }
4168       
4169       MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4170       {
4171         const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4172         double val,val2;
4173         DataArrayDouble *a,*a2;
4174         DataArrayDoubleTuple *aa,*aa2;
4175         std::vector<double> bb,bb2;
4176         mcIdType sw;
4177         const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4178         const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4179         return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4180       }
4181
4182       DataArrayDouble *getArray()
4183       {
4184         DataArrayDouble *ret=self->getArray();
4185         if(ret)
4186           ret->incrRef();
4187         return ret;
4188       }
4189
4190       PyObject *getArrays() const
4191       {
4192         std::vector<DataArrayDouble *> arrs=self->getArrays();
4193         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4194           if(*it)
4195             (*it)->incrRef();
4196         std::size_t sz=arrs.size();
4197         PyObject *ret=PyTuple_New(sz);
4198         for(std::size_t i=0;i<sz;i++)
4199           {
4200             if(arrs[i])
4201               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4202             else
4203               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4204           }
4205         return ret;
4206       }
4207
4208       void setArrays(PyObject *ls)
4209       {
4210         std::vector<const DataArrayDouble *> tmp;
4211         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4212         std::size_t sz=tmp.size();
4213         std::vector<DataArrayDouble *> arrs(sz);
4214         for(std::size_t i=0;i<sz;i++)
4215           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4216         self->setArrays(arrs);
4217       }
4218
4219       DataArrayDouble *getEndArray()
4220       {
4221         DataArrayDouble *ret=self->getEndArray();
4222         if(ret)
4223           ret->incrRef();
4224         return ret;
4225       }
4226
4227       PyObject *getValueOn(PyObject *sl) const
4228       {
4229         double val;
4230         DataArrayDouble *a;
4231         DataArrayDoubleTuple *aa;
4232         std::vector<double> bb;
4233         mcIdType sw;
4234         const MEDCouplingMesh *mesh=self->getMesh();
4235         if(!mesh)
4236           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4237         int spaceDim=mesh->getSpaceDimension();
4238         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4239         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4240         //
4241         mcIdType sz=ToIdType(self->getNumberOfComponents());
4242         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4243         self->getValueOn(spaceLoc,res);
4244         return convertDblArrToPyList<double>(res,sz);
4245       }
4246
4247        PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
4248        {
4249          mcIdType sz=ToIdType(self->getNumberOfComponents());
4250          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4251          self->getValueOnPos(i,j,k,res);
4252          return convertDblArrToPyList<double>(res,sz);
4253        }
4254
4255       DataArrayDouble *getValueOnMulti(PyObject *locs) const
4256       {
4257         const MEDCouplingMesh *mesh(self->getMesh());
4258         if(!mesh)
4259           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4260         //
4261         mcIdType sw,nbPts;
4262         double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4263         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4264                                                          mesh->getSpaceDimension(),true,nbPts);
4265         return self->getValueOnMulti(inp,(int)nbPts);
4266       }
4267
4268       PyObject *getValueOn(PyObject *sl, double time) const
4269       {
4270         double val;
4271         DataArrayDouble *a;
4272         DataArrayDoubleTuple *aa;
4273         std::vector<double> bb;
4274         mcIdType sw;
4275         const MEDCouplingMesh *mesh=self->getMesh();
4276         if(!mesh)
4277           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4278         int spaceDim=mesh->getSpaceDimension();
4279         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4280         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4281         //
4282         //
4283         mcIdType sz=ToIdType(self->getNumberOfComponents());
4284         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4285         self->getValueOn(spaceLoc,time,res);
4286         return convertDblArrToPyList<double>(res,sz);
4287       }
4288
4289       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4290       {
4291         if(self->getArray()!=0)
4292           MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4293         else
4294           {
4295             MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4296             MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4297             self->setArray(arr);
4298           }
4299       }
4300       
4301       PyObject *getTime()
4302       {
4303         int tmp1,tmp2;
4304         double tmp0=self->getTime(tmp1,tmp2);
4305         PyObject *res = PyList_New(3);
4306         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4307         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4308         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4309         return res;
4310       }
4311
4312       PyObject *getStartTime()
4313       {
4314         int tmp1,tmp2;
4315         double tmp0=self->getStartTime(tmp1,tmp2);
4316         PyObject *res = PyList_New(3);
4317         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4318         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4319         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4320         return res;
4321       }
4322
4323       PyObject *getEndTime()
4324       {
4325         int tmp1,tmp2;
4326         double tmp0=self->getEndTime(tmp1,tmp2);
4327         PyObject *res = PyList_New(3);
4328         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4329         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4330         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4331         return res;
4332       }
4333       PyObject *accumulate() const
4334       {
4335         mcIdType sz=ToIdType(self->getNumberOfComponents());
4336         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4337         self->accumulate(tmp);
4338         return convertDblArrToPyList<double>(tmp,sz);
4339       }
4340       PyObject *integral(bool isWAbs) const
4341       {
4342         mcIdType sz=ToIdType(self->getNumberOfComponents());
4343         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4344         self->integral(isWAbs,tmp);
4345         return convertDblArrToPyList<double>(tmp,sz);
4346       }
4347       PyObject *getWeightedAverageValue(bool isWAbs=true) const
4348       {
4349         mcIdType sz=ToIdType(self->getNumberOfComponents());
4350         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4351         self->getWeightedAverageValue(tmp,isWAbs);
4352         return convertDblArrToPyList<double>(tmp,sz);
4353       }
4354       PyObject *normL1() const
4355       {
4356         mcIdType sz=ToIdType(self->getNumberOfComponents());
4357         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4358         self->normL1(tmp);
4359         return convertDblArrToPyList<double>(tmp,sz);
4360       }
4361       PyObject *normL2() const
4362       {
4363         mcIdType sz=ToIdType(self->getNumberOfComponents());
4364         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4365         self->normL2(tmp);
4366         return convertDblArrToPyList<double>(tmp,sz);
4367       }
4368       PyObject *normMax() const
4369       {
4370         mcIdType sz=ToIdType(self->getNumberOfComponents());
4371         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4372         self->normMax(tmp);
4373         return convertDblArrToPyList<double>(tmp,sz);
4374       }
4375       void renumberCells(PyObject *li, bool check=true)
4376       {
4377         mcIdType szArr,sw,iTypppArr;
4378         std::vector<mcIdType> stdvecTyyppArr;
4379         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4380         self->renumberCells(tmp,check);
4381       }
4382       
4383       void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4384       {
4385         mcIdType szArr,sw,iTypppArr;
4386         std::vector<mcIdType> stdvecTyyppArr;
4387         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4388         self->renumberCellsWithoutMesh(tmp,check);
4389       }
4390       
4391       void renumberNodes(PyObject *li, double eps=1e-15)
4392       {
4393         mcIdType szArr,sw,iTypppArr;
4394         std::vector<mcIdType> stdvecTyyppArr;
4395         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4396         self->renumberNodes(tmp,eps);
4397       }
4398
4399       void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
4400       {
4401         mcIdType szArr,sw,iTypppArr;
4402         std::vector<mcIdType> stdvecTyyppArr;
4403         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4404         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4405       }
4406
4407       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4408       {
4409         return fieldT_buildSubPart(self,li);
4410       }
4411
4412       MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4413       {
4414         return fieldT__getitem__(self,li);
4415       }
4416
4417       PyObject *getMaxValue2() const
4418       {
4419         DataArrayIdType *tmp;
4420         double r1=self->getMaxValue2(tmp);
4421         PyObject *ret=PyTuple_New(2);
4422         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4423         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4424         return ret;
4425       }
4426       
4427       PyObject *getMinValue2() const
4428       {
4429         DataArrayIdType *tmp;
4430         double r1=self->getMinValue2(tmp);
4431         PyObject *ret=PyTuple_New(2);
4432         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4433         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4434         return ret;
4435       }
4436       
4437       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4438       {
4439         std::vector<std::size_t> tmp;
4440         convertPyToNewIntArr3(li,tmp);
4441         return self->keepSelectedComponents(tmp);
4442       }
4443
4444       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4445       {
4446         std::vector<std::size_t> tmp;
4447         convertPyToNewIntArr3(li,tmp);
4448         self->setSelectedComponents(f,tmp);
4449       }
4450
4451       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4452       {
4453         double val,val2;
4454         DataArrayDouble *a,*a2;
4455         DataArrayDoubleTuple *aa,*aa2;
4456         std::vector<double> bb,bb2;
4457         mcIdType sw;
4458         int spaceDim=3;
4459         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4460         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4461         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4462         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4463         //
4464         return self->extractSlice3D(orig,vect,eps);
4465       }
4466
4467       MEDCouplingFieldDouble *__add__(PyObject *obj)
4468       {
4469         return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4470       }
4471
4472       MEDCouplingFieldDouble *__radd__(PyObject *obj)
4473       {
4474         return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4475       }
4476
4477       MEDCouplingFieldDouble *__sub__(PyObject *obj)
4478       {
4479         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.";
4480         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4481         void *argp;
4482         //
4483         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4484           {
4485             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4486             if(other)
4487               return (*self)-(*other);
4488             else
4489               throw INTERP_KERNEL::Exception(msg);
4490           }
4491         //
4492         double val;
4493         DataArrayDouble *a;
4494         DataArrayDoubleTuple *aa;
4495         std::vector<double> bb;
4496         mcIdType sw;
4497         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4498         switch(sw)
4499           {
4500           case 1:
4501             {
4502               if(!self->getArray())
4503                 throw INTERP_KERNEL::Exception(msg2);
4504               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4505               ret->applyLin(1.,-val);
4506               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4507               ret2->setArray(ret);
4508               return ret2.retn();
4509             }
4510           case 2:
4511             {
4512               if(!self->getArray())
4513                 throw INTERP_KERNEL::Exception(msg2);
4514               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4515               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4516               ret2->setArray(ret);
4517               return ret2.retn();
4518             }
4519           case 3:
4520             {
4521               if(!self->getArray())
4522                 throw INTERP_KERNEL::Exception(msg2);
4523               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4524               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4525               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4526               ret2->setArray(ret);
4527               return ret2.retn();
4528             }
4529           case 4:
4530             {
4531               if(!self->getArray())
4532                 throw INTERP_KERNEL::Exception(msg2);
4533               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4534               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4535               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4536               ret2->setArray(ret);
4537               return ret2.retn();
4538             }
4539           default:
4540             { throw INTERP_KERNEL::Exception(msg); }
4541           }
4542       }
4543
4544       MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4545       {
4546         return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4547       }
4548
4549       MEDCouplingFieldDouble *__mul__(PyObject *obj)
4550       {
4551         return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4552       }
4553
4554       MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4555       {
4556         return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4557       }
4558
4559       MEDCouplingFieldDouble *__div__(PyObject *obj)
4560       {
4561         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.";
4562         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4563         void *argp;
4564         //
4565         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4566           {
4567             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4568             if(other)
4569               return (*self)/(*other);
4570             else
4571               throw INTERP_KERNEL::Exception(msg);
4572           }
4573         //
4574         double val;
4575         DataArrayDouble *a;
4576         DataArrayDoubleTuple *aa;
4577         std::vector<double> bb;
4578         mcIdType sw;
4579         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4580         switch(sw)
4581           {
4582           case 1:
4583             {
4584               if(val==0.)
4585                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4586               if(!self->getArray())
4587                 throw INTERP_KERNEL::Exception(msg2);
4588               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4589               ret->applyLin(1./val,0);
4590               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4591               ret2->setArray(ret);
4592               return ret2.retn();
4593             }
4594           case 2:
4595             {
4596               if(!self->getArray())
4597                 throw INTERP_KERNEL::Exception(msg2);
4598               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4599               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4600               ret2->setArray(ret);
4601               return ret2.retn();
4602             }
4603           case 3:
4604             {
4605               if(!self->getArray())
4606                 throw INTERP_KERNEL::Exception(msg2);
4607               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4608               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4609               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4610               ret2->setArray(ret);
4611               return ret2.retn();
4612             }
4613           case 4:
4614             {
4615               if(!self->getArray())
4616                 throw INTERP_KERNEL::Exception(msg2);
4617               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4618               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4619               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4620               ret2->setArray(ret);
4621               return ret2.retn();
4622             }
4623           default:
4624             { throw INTERP_KERNEL::Exception(msg); }
4625           }
4626       }
4627
4628       MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4629       {
4630         return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4631       }
4632
4633       MEDCouplingFieldDouble *__pow__(PyObject *obj)
4634       {
4635         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.";
4636         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4637         void *argp;
4638         //
4639         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4640           {
4641             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4642             if(other)
4643               return (*self)^(*other);
4644             else
4645               throw INTERP_KERNEL::Exception(msg);
4646           }
4647         //
4648         double val;
4649         DataArrayDouble *a;
4650         DataArrayDoubleTuple *aa;
4651         std::vector<double> bb;
4652         mcIdType sw;
4653         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4654         switch(sw)
4655           {
4656           case 1:
4657             {
4658               if(!self->getArray())
4659                 throw INTERP_KERNEL::Exception(msg2);
4660               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4661               ret->applyPow(val);
4662               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4663               ret2->setArray(ret);
4664               return ret2.retn();
4665             }
4666           case 2:
4667             {
4668               if(!self->getArray())
4669                 throw INTERP_KERNEL::Exception(msg2);
4670               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4671               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4672               ret2->setArray(ret);
4673               return ret2.retn();
4674             }
4675           case 3:
4676             {
4677               if(!self->getArray())
4678                 throw INTERP_KERNEL::Exception(msg2);
4679               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4680               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4681               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4682               ret2->setArray(ret);
4683               return ret2.retn();
4684             }
4685           case 4:
4686             {
4687               if(!self->getArray())
4688                 throw INTERP_KERNEL::Exception(msg2);
4689               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4690               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4691               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4692               ret2->setArray(ret);
4693               return ret2.retn();
4694             }
4695           default:
4696             { throw INTERP_KERNEL::Exception(msg); }
4697           }
4698       }
4699
4700       MEDCouplingFieldDouble *__neg__() const
4701       {
4702         return self->negate();
4703       }
4704
4705       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4706       {
4707         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.";
4708         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4709         void *argp;
4710         //
4711         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4712           {
4713             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4714             if(other)
4715               {
4716                 *self+=*other;
4717                 Py_XINCREF(trueSelf);
4718                 return trueSelf;
4719               }
4720             else
4721               throw INTERP_KERNEL::Exception(msg);
4722           }
4723         //
4724         double val;
4725         DataArrayDouble *a;
4726         DataArrayDoubleTuple *aa;
4727         std::vector<double> bb;
4728         mcIdType sw;
4729         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4730         switch(sw)
4731           {
4732           case 1:
4733             {
4734               if(!self->getArray())
4735                 throw INTERP_KERNEL::Exception(msg2);
4736               self->getArray()->applyLin(1.,val);
4737               Py_XINCREF(trueSelf);
4738               return trueSelf;
4739             }
4740           case 2:
4741             {
4742               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4743               ret2->setArray(a);
4744               *self+=*ret2;
4745               Py_XINCREF(trueSelf);
4746               return trueSelf;
4747             }
4748           case 3:
4749             {
4750               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4751               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4752               ret2->setArray(aaa);
4753               *self+=*ret2;
4754               Py_XINCREF(trueSelf);
4755               return trueSelf;
4756             }
4757           case 4:
4758             {
4759               if(!self->getArray())
4760                 throw INTERP_KERNEL::Exception(msg2);
4761               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4762               self->getArray()->addEqual(aaa);
4763               Py_XINCREF(trueSelf);
4764               return trueSelf;
4765             }
4766           default:
4767             { throw INTERP_KERNEL::Exception(msg); }
4768           }
4769       }
4770
4771       PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4772       {
4773         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.";
4774         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4775         void *argp;
4776         //
4777         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4778           {
4779             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4780             if(other)
4781               {
4782                 *self-=*other;
4783                 Py_XINCREF(trueSelf);
4784                 return trueSelf;
4785               }
4786             else
4787               throw INTERP_KERNEL::Exception(msg);
4788           }
4789         //
4790         double val;
4791         DataArrayDouble *a;
4792         DataArrayDoubleTuple *aa;
4793         std::vector<double> bb;
4794         mcIdType sw;
4795         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4796         switch(sw)
4797           {
4798           case 1:
4799             {
4800               if(!self->getArray())
4801                 throw INTERP_KERNEL::Exception(msg2);
4802               self->getArray()->applyLin(1.,-val);
4803               Py_XINCREF(trueSelf);
4804               return trueSelf;
4805             }
4806           case 2:
4807             {
4808               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4809               ret2->setArray(a);
4810               *self-=*ret2;
4811               Py_XINCREF(trueSelf);
4812               return trueSelf;
4813             }
4814           case 3:
4815             {
4816               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4817               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4818               ret2->setArray(aaa);
4819               *self-=*ret2;
4820               Py_XINCREF(trueSelf);
4821               return trueSelf;
4822             }
4823           case 4:
4824             {
4825               if(!self->getArray())
4826                 throw INTERP_KERNEL::Exception(msg2);
4827               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4828               self->getArray()->substractEqual(aaa);
4829               Py_XINCREF(trueSelf);
4830               return trueSelf;
4831             }
4832           default:
4833             { throw INTERP_KERNEL::Exception(msg); }
4834           }
4835       }
4836
4837       PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4838       {
4839         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.";
4840         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4841         void *argp;
4842         //
4843         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4844           {
4845             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4846             if(other)
4847               {
4848                 *self*=*other;
4849                 Py_XINCREF(trueSelf);
4850                 return trueSelf;
4851               }
4852             else
4853               throw INTERP_KERNEL::Exception(msg);
4854           }
4855         //
4856         double val;
4857         DataArrayDouble *a;
4858         DataArrayDoubleTuple *aa;
4859         std::vector<double> bb;
4860         mcIdType sw;
4861         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4862         switch(sw)
4863           {
4864           case 1:
4865             {
4866               if(!self->getArray())
4867                 throw INTERP_KERNEL::Exception(msg2);
4868               self->getArray()->applyLin(val,0);
4869               Py_XINCREF(trueSelf);
4870               return trueSelf;
4871             }
4872           case 2:
4873             {
4874               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4875               ret2->setArray(a);
4876               *self*=*ret2;
4877               Py_XINCREF(trueSelf);
4878               return trueSelf;
4879             }
4880           case 3:
4881             {
4882               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4883               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4884               ret2->setArray(aaa);
4885               *self*=*ret2;
4886               Py_XINCREF(trueSelf);
4887               return trueSelf;
4888             }
4889           case 4:
4890             {
4891               if(!self->getArray())
4892                 throw INTERP_KERNEL::Exception(msg2);
4893               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4894               self->getArray()->multiplyEqual(aaa);
4895               Py_XINCREF(trueSelf);
4896               return trueSelf;
4897             }
4898           default:
4899             { throw INTERP_KERNEL::Exception(msg); }
4900           }
4901       }
4902
4903       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4904       {
4905         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.";
4906         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4907         void *argp;
4908         //
4909         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4910           {
4911             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4912             if(other)
4913               {
4914                 *self/=*other;
4915                 Py_XINCREF(trueSelf);
4916                 return trueSelf;
4917               }
4918             else
4919               throw INTERP_KERNEL::Exception(msg);
4920           }
4921         //
4922         double val;
4923         DataArrayDouble *a;
4924         DataArrayDoubleTuple *aa;
4925         std::vector<double> bb;
4926         mcIdType sw;
4927         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4928         switch(sw)
4929           {
4930           case 1:
4931             {
4932               if(val==0.)
4933                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4934               if(!self->getArray())
4935                 throw INTERP_KERNEL::Exception(msg2);
4936               self->getArray()->applyLin(1./val,0);
4937               Py_XINCREF(trueSelf);
4938               return trueSelf;
4939             }
4940           case 2:
4941             {
4942               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4943               ret2->setArray(a);
4944               *self/=*ret2;
4945               Py_XINCREF(trueSelf);
4946               return trueSelf;
4947             }
4948           case 3:
4949             {
4950               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4951               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4952               ret2->setArray(aaa);
4953               *self/=*ret2;
4954               Py_XINCREF(trueSelf);
4955               return trueSelf;
4956             }
4957           case 4:
4958             {
4959               if(!self->getArray())
4960                 throw INTERP_KERNEL::Exception(msg2);
4961               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4962               self->getArray()->divideEqual(aaa);
4963               Py_XINCREF(trueSelf);
4964               return trueSelf;
4965             }
4966           default:
4967             { throw INTERP_KERNEL::Exception(msg); }
4968           }
4969       }
4970
4971       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4972       {
4973         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.";
4974         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4975         void *argp;
4976         //
4977         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4978           {
4979             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4980             if(other)
4981               {
4982                 *self^=*other;
4983                 Py_XINCREF(trueSelf);
4984                 return trueSelf;
4985               }
4986             else
4987               throw INTERP_KERNEL::Exception(msg);
4988           }
4989         //
4990         double val;
4991         DataArrayDouble *a;
4992         DataArrayDoubleTuple *aa;
4993         std::vector<double> bb;
4994         mcIdType sw;
4995         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4996         switch(sw)
4997           {
4998           case 1:
4999             {
5000               if(!self->getArray())
5001                 throw INTERP_KERNEL::Exception(msg2);
5002               self->getArray()->applyPow(val);
5003               Py_XINCREF(trueSelf);
5004               return trueSelf;
5005             }
5006           case 2:
5007             {
5008               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5009               ret2->setArray(a);
5010               *self^=*ret2;
5011               Py_XINCREF(trueSelf);
5012               return trueSelf;
5013             }
5014           case 3:
5015             {
5016               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5017               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5018               ret2->setArray(aaa);
5019               *self^=*ret2;
5020               Py_XINCREF(trueSelf);
5021               return trueSelf;
5022             }
5023           case 4:
5024             {
5025               if(!self->getArray())
5026                 throw INTERP_KERNEL::Exception(msg2);
5027               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
5028               self->getArray()->powEqual(aaa);
5029               Py_XINCREF(trueSelf);
5030               return trueSelf;
5031             }
5032           default:
5033             { throw INTERP_KERNEL::Exception(msg); }
5034           }
5035       }
5036
5037       static MEDCouplingFieldDouble *MergeFields(PyObject *li)
5038       {
5039         std::vector<const MEDCouplingFieldDouble *> tmp;
5040         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5041         return MEDCouplingFieldDouble::MergeFields(tmp);
5042       }
5043
5044       static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
5045       {
5046         std::vector<const MEDCouplingFieldDouble *> tmp;
5047         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5048         return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5049       }
5050
5051       PyObject *getTinySerializationInformation() const
5052       {
5053         return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5054       }
5055       
5056       PyObject *serialize() const
5057       {
5058         return field_serialize<double>(self);
5059       }
5060
5061       PyObject *__getstate__() const
5062       {
5063         return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5064       }
5065       
5066       void __setstate__(PyObject *inp)
5067       {
5068         field__setstate__<double>(self,inp);
5069       }
5070     }
5071   };
5072
5073   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5074   {
5075   public:
5076     int getNumberOfFields() const;
5077     MEDCouplingMultiFields *deepCopy() const;
5078     virtual std::string simpleRepr() const;
5079     virtual std::string advancedRepr() const;
5080     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5081     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5082     virtual void checkConsistencyLight() const;
5083     %extend
5084        {
5085          std::string __str__() const
5086          {
5087            return self->simpleRepr();
5088          }
5089          static MEDCouplingMultiFields *New(PyObject *li)
5090          {
5091            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5092            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5093            std::size_t sz=tmp.size();
5094            std::vector<MEDCouplingFieldDouble *> fs(sz);
5095            for(std::size_t i=0;i<sz;i++)
5096              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5097            return MEDCouplingMultiFields::New(fs);
5098          }
5099          MEDCouplingMultiFields(PyObject *li)
5100          {
5101            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5102            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5103            std::size_t sz=tmp.size();
5104            std::vector<MEDCouplingFieldDouble *> fs(sz);
5105            for(std::size_t i=0;i<sz;i++)
5106              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5107            return MEDCouplingMultiFields::New(fs);
5108          }
5109          PyObject *getFields() const
5110          {
5111            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5112            std::size_t sz=fields.size();
5113            PyObject *res = PyList_New(sz);
5114            for(std::size_t i=0;i<sz;i++)
5115              {
5116                if(fields[i])
5117                  {
5118                    fields[i]->incrRef();
5119                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5120                  }
5121                else
5122                  {
5123                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5124                  }
5125              }
5126            return res;
5127          }
5128          PyObject *getFieldAtPos(int id) const
5129          {
5130            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5131            if(ret)
5132              {
5133                ret->incrRef();
5134                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5135              }
5136            else
5137              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5138          }
5139          PyObject *getMeshes() const
5140          {
5141            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5142            std::size_t sz=ms.size();
5143            PyObject *res = PyList_New(sz);
5144            for(std::size_t i=0;i<sz;i++)
5145              {
5146                if(ms[i])
5147                  {
5148                    ms[i]->incrRef();
5149                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5150                  }
5151                else
5152                  {
5153                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5154                  }
5155              }
5156            return res;
5157          }
5158          PyObject *getDifferentMeshes() const
5159          {
5160            std::vector<int> refs;
5161            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5162            std::size_t sz=ms.size();
5163            PyObject *res = PyList_New(sz);
5164            for(std::size_t i=0;i<sz;i++)
5165              {
5166                if(ms[i])
5167                  {
5168                    ms[i]->incrRef();
5169                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5170                  }
5171                else
5172                  {
5173                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5174                  }
5175              }
5176            //
5177            PyObject *ret=PyTuple_New(2);
5178            PyTuple_SetItem(ret,0,res);
5179            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5180            return ret;
5181          }
5182          PyObject *getArrays() const
5183          {
5184            std::vector<DataArrayDouble *> ms=self->getArrays();
5185            std::size_t sz=ms.size();
5186            PyObject *res = PyList_New(sz);
5187            for(std::size_t i=0;i<sz;i++)
5188              {
5189                if(ms[i])
5190                  {
5191                    ms[i]->incrRef();
5192                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5193                  }
5194                else
5195                  {
5196                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5197                  }
5198              }
5199            return res;
5200          }
5201          PyObject *getDifferentArrays() const
5202          {
5203            std::vector< std::vector<int> > refs;
5204            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5205            std::size_t sz=ms.size();
5206            PyObject *res = PyList_New(sz);
5207            PyObject *res2 = PyList_New(sz);
5208            for(std::size_t i=0;i<sz;i++)
5209              {
5210                if(ms[i])
5211                  {
5212                    ms[i]->incrRef();
5213                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5214                  }
5215                else
5216                  {
5217                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5218                  }
5219                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5220              }
5221            //
5222            PyObject *ret=PyTuple_New(2);
5223            PyTuple_SetItem(ret,0,res);
5224            PyTuple_SetItem(ret,1,res2);
5225            return ret;
5226          }
5227        }
5228   };
5229
5230   class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
5231   {
5232   public:
5233     static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5234     static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5235     bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5236     bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5237     void setTimeUnit(const std::string& unit);
5238     std::string getTimeUnit() const;
5239     void setTime(double val, int iteration, int order);
5240     void setArray(DataArrayInt32 *array);
5241     MEDCouplingFieldInt32 *deepCopy() const;
5242     MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
5243     MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
5244     MEDCouplingFieldDouble *convertToDblField() const;
5245     MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
5246     %extend {
5247       MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5248       {
5249         return MEDCouplingFieldInt32::New(type,td);
5250       }
5251
5252       MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5253       {
5254         return MEDCouplingFieldInt32::New(ft,td);
5255       }
5256
5257       PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
5258       {
5259         std::string ret1;
5260         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5261         PyObject *ret=PyTuple_New(2);
5262         PyObject *ret0Py=ret0?Py_True:Py_False;
5263         Py_XINCREF(ret0Py);
5264         PyTuple_SetItem(ret,0,ret0Py);
5265         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5266         return ret;
5267       }
5268       
5269       std::string __str__() const
5270       {
5271         return self->simpleRepr();
5272       }
5273
5274       std::string __repr__() const
5275       {
5276         std::ostringstream oss;
5277         self->reprQuickOverview(oss);
5278         return oss.str();
5279       }
5280
5281       MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
5282       {
5283         return fieldT_buildSubPart(self,li);
5284       }
5285
5286       MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
5287       {
5288         return fieldT__getitem__(self,li);
5289       }
5290
5291       DataArrayInt32 *getArray()
5292       {
5293         DataArrayInt32 *ret=self->getArray();
5294         if(ret)
5295           ret->incrRef();
5296         return ret;
5297       }
5298       
5299       PyObject *getTime()
5300         {
5301         int tmp1,tmp2;
5302         double tmp0=self->getTime(tmp1,tmp2);
5303         PyObject *res = PyList_New(3);
5304         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5305         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5306         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5307         return res;
5308         }
5309
5310       PyObject *getTinySerializationInformation() const
5311       {
5312         return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
5313       }
5314       
5315       PyObject *serialize() const
5316       {
5317         return field_serialize<int>(self);
5318       }
5319
5320       PyObject *__getstate__() const
5321       {
5322         return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
5323       }
5324       
5325       void __setstate__(PyObject *inp)
5326       {
5327         field__setstate__<int>(self,inp);
5328       }
5329     }
5330   };
5331
5332   class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
5333   {
5334   public:
5335     static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5336     static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5337     bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5338     bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5339     void setTimeUnit(const std::string& unit);
5340     std::string getTimeUnit() const;
5341     void setTime(double val, int iteration, int order);
5342     void setArray(DataArrayInt64 *array);
5343     MEDCouplingFieldInt64 *deepCopy() const;
5344     MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
5345     MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
5346     MEDCouplingFieldDouble *convertToDblField() const;
5347     MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
5348     %extend {
5349       MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5350       {
5351         return MEDCouplingFieldInt64::New(type,td);
5352       }
5353
5354       MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5355       {
5356         return MEDCouplingFieldInt64::New(ft,td);
5357       }
5358
5359       PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
5360       {
5361         std::string ret1;
5362         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5363         PyObject *ret=PyTuple_New(2);
5364         PyObject *ret0Py=ret0?Py_True:Py_False;
5365         Py_XINCREF(ret0Py);
5366         PyTuple_SetItem(ret,0,ret0Py);
5367         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5368         return ret;
5369       }
5370       
5371       std::string __str__() const
5372       {
5373         return self->simpleRepr();
5374       }
5375
5376       std::string __repr__() const
5377       {
5378         std::ostringstream oss;
5379         self->reprQuickOverview(oss);
5380         return oss.str();
5381       }
5382
5383       MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
5384       {
5385         return fieldT_buildSubPart(self,li);
5386       }
5387
5388       MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
5389       {
5390         return fieldT__getitem__(self,li);
5391       }
5392
5393       DataArrayInt64 *getArray()
5394       {
5395         DataArrayInt64 *ret=self->getArray();
5396         if(ret)
5397           ret->incrRef();
5398         return ret;
5399       }
5400       
5401       PyObject *getTime()
5402         {
5403         int tmp1,tmp2;
5404         double tmp0=self->getTime(tmp1,tmp2);
5405         PyObject *res = PyList_New(3);
5406         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5407         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5408         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5409         return res;
5410         }
5411
5412       PyObject *getTinySerializationInformation() const
5413       {
5414         return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
5415       }
5416       
5417       PyObject *serialize() const
5418       {
5419         return field_serialize<Int64>(self);
5420       }
5421
5422       PyObject *__getstate__() const
5423       {
5424         return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
5425       }
5426       
5427       void __setstate__(PyObject *inp)
5428       {
5429         field__setstate__<Int64>(self,inp);
5430       }
5431     }
5432   };
5433
5434   class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5435   {
5436   public:
5437     static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5438     static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5439     bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5440     bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5441     void setTimeUnit(const std::string& unit);
5442     std::string getTimeUnit() const;
5443     void setTime(double val, int iteration, int order);
5444     void setArray(DataArrayFloat *array);
5445     MEDCouplingFieldFloat *deepCopy() const;
5446     MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5447     MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5448     MEDCouplingFieldDouble *convertToDblField() const;
5449     MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5450     %extend {
5451       MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5452       {
5453         return MEDCouplingFieldFloat::New(type,td);
5454       }
5455
5456       MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5457       {
5458         return MEDCouplingFieldFloat::New(ft,td);
5459       }
5460
5461       PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5462       {
5463         std::string ret1;
5464         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5465         PyObject *ret=PyTuple_New(2);
5466         PyObject *ret0Py=ret0?Py_True:Py_False;
5467         Py_XINCREF(ret0Py);
5468         PyTuple_SetItem(ret,0,ret0Py);
5469         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5470         return ret;
5471       }
5472
5473       std::string __str__() const
5474       {
5475         return self->simpleRepr();
5476       }
5477
5478       std::string __repr__() const
5479       {
5480         std::ostringstream oss;
5481         self->reprQuickOverview(oss);
5482         return oss.str();
5483       }
5484
5485       MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5486       {
5487         return fieldT_buildSubPart(self,li);
5488       }
5489
5490       MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5491       {
5492         return fieldT__getitem__(self,li);
5493       }
5494
5495       DataArrayFloat *getArray()
5496       {
5497         DataArrayFloat *ret=self->getArray();
5498         if(ret)
5499           ret->incrRef();
5500         return ret;
5501       }
5502       
5503       PyObject *getTime()
5504       {
5505         int tmp1,tmp2;
5506         double tmp0=self->getTime(tmp1,tmp2);
5507         PyObject *res = PyList_New(3);
5508         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5509         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5510         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5511         return res;
5512       }
5513
5514       PyObject *getTinySerializationInformation() const
5515       {
5516         return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5517       }
5518       
5519       PyObject *serialize() const
5520       {
5521         return field_serialize<float>(self);
5522       }
5523       
5524       PyObject *__getstate__() const
5525       {
5526         return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5527       }
5528         
5529       void __setstate__(PyObject *inp)
5530       {
5531         field__setstate__<float>(self,inp);
5532       }
5533     }
5534   };
5535   
5536   class MEDCouplingDefinitionTime
5537   {
5538   public:
5539     MEDCouplingDefinitionTime();
5540     void assign(const MEDCouplingDefinitionTime& other);
5541     bool isEqual(const MEDCouplingDefinitionTime& other) const;
5542     double getTimeResolution() const;
5543     std::vector<double> getHotSpotsTime() const;
5544     %extend
5545       {
5546         std::string __str__() const
5547           {
5548             std::ostringstream oss;
5549             self->appendRepr(oss);
5550             return oss.str();
5551           }
5552
5553         PyObject *getIdsOnTimeRight(double tm) const
5554         {
5555           int meshId,arrId,arrIdInField,fieldId;
5556           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5557           PyObject *res=PyList_New(4);
5558           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5559           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5560           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5561           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5562           return res;
5563         }
5564
5565         PyObject *getIdsOnTimeLeft(double tm) const
5566         {
5567           int meshId,arrId,arrIdInField,fieldId;
5568           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5569           PyObject *res=PyList_New(4);
5570           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5571           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5572           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5573           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5574           return res;
5575         }
5576       }
5577   };
5578
5579   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5580   {
5581   public:
5582     double getTimeTolerance() const;
5583     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5584     
5585     %extend
5586       {
5587         MEDCouplingFieldOverTime(PyObject *li)
5588           {
5589             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5590             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5591             std::size_t sz=tmp.size();
5592             std::vector<MEDCouplingFieldDouble *> fs(sz);
5593             for(std::size_t i=0;i<sz;i++)
5594               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5595             return MEDCouplingFieldOverTime::New(fs);
5596           }
5597         std::string __str__() const
5598           {
5599             return self->simpleRepr();
5600           }
5601         static MEDCouplingFieldOverTime *New(PyObject *li)
5602           {
5603             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5604             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5605             std::size_t sz=tmp.size();
5606             std::vector<MEDCouplingFieldDouble *> fs(sz);
5607             for(std::size_t i=0;i<sz;i++)
5608               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5609             return MEDCouplingFieldOverTime::New(fs);
5610           }
5611       }
5612   };
5613
5614   class MEDCouplingCartesianAMRMesh;
5615   
5616   class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5617   {
5618   public:
5619     int getNumberOfCellsRecursiveWithOverlap() const;
5620     int getNumberOfCellsRecursiveWithoutOverlap() const;
5621     int getMaxNumberOfLevelsRelativeToThis() const;
5622     %extend
5623     {
5624       MEDCouplingCartesianAMRMeshGen *getMesh() const
5625       {
5626         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5627         if(ret)
5628           ret->incrRef();
5629         return ret;
5630       }
5631     }
5632   };
5633
5634   class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5635   {
5636   public:
5637     int getNumberOfOverlapedCellsForFather() const;
5638     bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5639     std::vector<mcIdType> computeCellGridSt() const;
5640     %extend
5641     {
5642       PyObject *getBLTRRange() const
5643       {
5644         const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
5645         return convertFromVectorPairInt(ret);
5646       }
5647
5648       PyObject *getBLTRRangeRelativeToGF() const
5649       {
5650         std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
5651         return convertFromVectorPairInt(ret);
5652       }
5653
5654       void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5655       {
5656         std::vector< std::pair<mcIdType,mcIdType> > inp;
5657         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5658         self->addPatch(inp,factors);
5659       }
5660
5661       MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5662       {
5663         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5664         if(!mesh)
5665           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5666         if(patchId==mesh->getNumberOfPatches())
5667           {
5668             std::ostringstream oss;
5669             oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5670             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5671             return 0;
5672           }
5673         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5674         if(ret)
5675           ret->incrRef();
5676         return ret;
5677       }
5678
5679       void __delitem__(mcIdType patchId)
5680       {
5681         MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5682         if(!mesh)
5683           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5684         mesh->removePatch(patchId);
5685       }
5686
5687       mcIdType __len__() const
5688       {
5689         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5690         if(!mesh)
5691           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5692         return mesh->getNumberOfPatches();
5693       }
5694     }
5695   };
5696
5697   class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5698   {
5699   };
5700   
5701   class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5702   {
5703   public:
5704     mcIdType getAbsoluteLevel() const;
5705     mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5706     std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5707     int getSpaceDimension() const;
5708     const std::vector<mcIdType>& getFactors() const;
5709     void setFactors(const std::vector<mcIdType>& newFactors);
5710     mcIdType getMaxNumberOfLevelsRelativeToThis() const;
5711     mcIdType getNumberOfCellsAtCurrentLevel() const;
5712     mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
5713     mcIdType getNumberOfCellsRecursiveWithOverlap() const;
5714     mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
5715     bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
5716    virtual void detachFromFather();
5717     //
5718     mcIdType getNumberOfPatches() const;
5719     mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5720     MEDCouplingUMesh *buildUnstructured() const;
5721     DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
5722     std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5723     MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5724     MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5725     void removeAllPatches();
5726     void removePatch(mcIdType patchId);
5727     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
5728     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
5729     DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
5730     void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5731     void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
5732     void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
5733     void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5734     void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5735     void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
5736     DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5737     std::string buildPythonDumpOfThis() const;
5738     %extend
5739     {
5740       void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5741       {
5742         std::vector< std::pair<mcIdType,mcIdType> > inp;
5743         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5744         self->addPatch(inp,factors);
5745       }
5746
5747       PyObject *getPatches() const
5748       {
5749         std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5750         std::size_t sz(ps.size());
5751         PyObject *ret = PyList_New(sz);
5752         for(std::size_t i=0;i<sz;i++)
5753           {
5754             MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5755             if(elt)
5756               elt->incrRef();
5757             PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5758           }
5759         return ret;
5760       }
5761
5762       // agy : don't know why typemap fails here ??? let it in the extend section
5763       PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5764       {
5765         return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5766       }
5767
5768       MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
5769       {
5770         const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5771         MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5772         if(ret2)
5773           ret2->incrRef();
5774         return ret2;
5775       }
5776
5777       MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
5778       {
5779         const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5780         MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5781         if(ret2)
5782           ret2->incrRef();
5783         return ret2;
5784       }
5785
5786       virtual PyObject *positionRelativeToGodFather() const
5787       {
5788         std::vector<mcIdType> out1;
5789         std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
5790         PyObject *ret(PyTuple_New(2));
5791         PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5792         PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5793         return ret;
5794       }
5795
5796       virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
5797       {
5798         std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5799         std::size_t sz(ps.size());
5800         PyObject *ret = PyList_New(sz);
5801         for(std::size_t i=0;i<sz;i++)
5802           PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5803         return ret;
5804       }
5805
5806       MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
5807       {
5808         std::vector<const DataArrayDouble *> inp;
5809         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5810         return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5811       }
5812
5813       virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5814       {
5815         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5816         if(ret)
5817           ret->incrRef();
5818         return ret;
5819       }
5820       
5821       virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5822       {
5823         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5824         if(ret)
5825           ret->incrRef();
5826         return ret;
5827       }
5828
5829       MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
5830       {
5831         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5832         if(ret)
5833           ret->incrRef();
5834         return ret;
5835       }
5836
5837       MEDCouplingIMesh *getImageMesh() const
5838       {
5839         const MEDCouplingIMesh *ret(self->getImageMesh());
5840         if(ret)
5841           ret->incrRef();
5842         return const_cast<MEDCouplingIMesh *>(ret);
5843       }
5844
5845       MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5846       {
5847         if(patchId==self->getNumberOfPatches())
5848           {
5849             std::ostringstream oss;
5850             oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5851             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5852             return 0;
5853           }
5854         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5855         if(ret)
5856           ret->incrRef();
5857         return ret;
5858       }
5859
5860       void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5861       {
5862         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5863         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5864         self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5865       }
5866
5867       void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
5868       {
5869         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5870         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5871         self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5872       }
5873
5874       void __delitem__(mcIdType patchId)
5875       {
5876         self->removePatch(patchId);
5877       }
5878
5879       mcIdType __len__() const
5880       {
5881         return self->getNumberOfPatches();
5882       }
5883     }
5884   };
5885
5886   class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5887   {
5888   };
5889
5890   class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5891   {
5892   public:
5893     static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5894     %extend
5895     {
5896       static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5897       {
5898         static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5899         static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5900         const mcIdType *nodeStrctPtr(0);
5901         const double *originPtr(0),*dxyzPtr(0);
5902         mcIdType sw,sz,val0;
5903         std::vector<mcIdType> bb0;
5904         nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5905         //
5906         double val,val2;
5907         std::vector<double> bb,bb2;
5908         mcIdType sz1,sz2;
5909         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5910         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5911         //
5912         return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5913       }
5914
5915       void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5916       {
5917         std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5918         convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5919         std::vector< std::vector<mcIdType> > inp2;
5920         convertPyToVectorOfVectorOfInt(factors,inp2);
5921         self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5922       }
5923
5924       MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5925       {
5926         return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5927       }
5928
5929       MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5930       {
5931         return MEDCouplingCartesianAMRMesh::New(mesh);
5932       }
5933     }
5934   };
5935
5936   class MEDCouplingDataForGodFather : public RefCountObject
5937   {
5938   public:
5939     virtual void synchronizeFineToCoarse();
5940     virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
5941     virtual void synchronizeCoarseToFine();
5942     virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
5943     virtual void synchronizeAllGhostZones();
5944     virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5945     virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
5946     virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
5947     virtual void alloc();
5948     virtual void dealloc();
5949     %extend
5950     {
5951       MEDCouplingCartesianAMRMesh *getMyGodFather()
5952       {
5953         MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5954         if(ret)
5955           ret->incrRef();
5956         return ret;
5957       }
5958     }
5959   };
5960   
5961   class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5962   {
5963   public:
5964     mcIdType getNumberOfLevels() const;
5965     MEDCouplingAMRAttribute *deepCopy() const;
5966     MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5967     MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5968     MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5969     MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5970     bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5971     MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5972     std::string writeVTHB(const std::string& fileName) const;
5973     %extend
5974     {
5975       static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5976       {
5977         std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5978         std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5979         MEDCouplingAMRAttribute *ret(0);
5980         try
5981           {
5982             convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5983             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5984           }
5985         catch(INTERP_KERNEL::Exception&)
5986           {
5987             convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5988             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5989           }
5990         return ret;
5991       }
5992
5993       MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5994       {
5995         return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5996       }
5997
5998       DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5999       {
6000         const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
6001         DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
6002         if(ret2)
6003           ret2->incrRef();
6004         return ret2;
6005       }
6006
6007       void spillInfoOnComponents(PyObject *compNames)
6008       {
6009         std::vector< std::vector<std::string> > compNamesCpp;
6010         convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
6011         self->spillInfoOnComponents(compNamesCpp);
6012       }
6013
6014       void spillNatures(PyObject *nfs)
6015       {
6016         std::vector<mcIdType> inp0;
6017         if(!fillIntVector(nfs,inp0))
6018           throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
6019         std::size_t sz(inp0.size());
6020         std::vector<NatureOfField> inp00(sz);
6021         for(std::size_t i=0;i<sz;i++)
6022           inp00[i]=(NatureOfField)inp0[i];
6023         self->spillNatures(inp00);
6024       }
6025       
6026       PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
6027       {
6028         std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
6029         std::size_t sz(ret.size());
6030         PyObject *retPy(PyList_New(sz));
6031         for(std::size_t i=0;i<sz;i++)
6032           PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6033         return retPy;
6034       }
6035     }
6036   };
6037
6038   class DenseMatrix : public RefCountObject, public TimeLabel
6039   {
6040   public:
6041     static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
6042     static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
6043     DenseMatrix *deepCopy() const;
6044     DenseMatrix *shallowCpy() const;
6045     //
6046     mcIdType getNumberOfRows() const;
6047     mcIdType getNumberOfCols() const;
6048     mcIdType getNbOfElems() const;
6049     void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
6050     void reShape(mcIdType nbRows, mcIdType nbCols);
6051     void transpose();
6052     //
6053     bool isEqual(const DenseMatrix& other, double eps) const;
6054     DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
6055     static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
6056     %extend
6057     {
6058       DenseMatrix(mcIdType nbRows, mcIdType nbCols)
6059       {
6060         return DenseMatrix::New(nbRows,nbCols);
6061       }
6062
6063       DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
6064       {
6065         return DenseMatrix::New(array,nbRows,nbCols);
6066       }
6067
6068       PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
6069       {
6070         std::string ret1;
6071         bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
6072         PyObject *ret=PyTuple_New(2);
6073         PyObject *ret0Py=ret0?Py_True:Py_False;
6074         Py_XINCREF(ret0Py);
6075         PyTuple_SetItem(ret,0,ret0Py);
6076         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6077         return ret;
6078       }
6079
6080       DataArrayDouble *getData()
6081       {
6082         DataArrayDouble *ret(self->getData());
6083         if(ret)
6084           ret->incrRef();
6085         return ret;
6086       }
6087
6088       DenseMatrix *__add__(const DenseMatrix *other)
6089       {
6090         return MEDCoupling::DenseMatrix::Add(self,other);
6091       }
6092
6093       DenseMatrix *__sub__(const DenseMatrix *other)
6094       {
6095         return MEDCoupling::DenseMatrix::Substract(self,other);
6096       }
6097
6098       DenseMatrix *__mul__(const DenseMatrix *other)
6099       {
6100         return MEDCoupling::DenseMatrix::Multiply(self,other);
6101       }
6102
6103       DenseMatrix *__mul__(const DataArrayDouble *other)
6104       {
6105         return MEDCoupling::DenseMatrix::Multiply(self,other);
6106       }
6107
6108       PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
6109       {
6110         self->addEqual(other);
6111         Py_XINCREF(trueSelf);
6112         return trueSelf;
6113       }
6114
6115       PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
6116       {
6117         self->substractEqual(other);
6118         Py_XINCREF(trueSelf);
6119         return trueSelf;
6120       }
6121 #ifdef WITH_NUMPY
6122       PyObject *toNumPyMatrix() // not const. It is not a bug !
6123       {
6124         PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6125         return obj;
6126       }
6127 #endif
6128     }
6129   };
6130 }
6131
6132 %pythoncode %{
6133 def MEDCouplingUMeshReduce(self):
6134     return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6135 def MEDCouplingCMeshReduce(self):
6136     return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6137 def MEDCouplingIMeshReduce(self):
6138     return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6139 def MEDCouplingMappedExtrudedMeshReduce(self):
6140     return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6141 def MEDCouplingCurveLinearMeshReduce(self):
6142     return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6143 def MEDCoupling1SGTUMeshReduce(self):
6144     return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6145 def MEDCoupling1DGTUMeshReduce(self):
6146     return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6147 def MEDCouplingFieldDoubleReduce(self):
6148     self.checkConsistencyLight()
6149     d=(self.getTypeOfField(),self.getTimeDiscretization())
6150     return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6151 def MEDCouplingFieldInt32Reduce(self):
6152     self.checkConsistencyLight()
6153     d=(self.getTypeOfField(),self.getTimeDiscretization())
6154     return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
6155 def MEDCouplingFieldInt64Reduce(self):
6156     self.checkConsistencyLight()
6157     d=(self.getTypeOfField(),self.getTimeDiscretization())
6158     return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
6159 def MEDCouplingFieldFloatReduce(self):
6160     self.checkConsistencyLight()
6161     d=(self.getTypeOfField(),self.getTimeDiscretization())
6162     return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6163 def MEDCouplingFTReduceFunct(cls,params):
6164     a,b=params
6165     ret=object.__new__(cls)
6166     ret.__init__(*a)
6167     return ret
6168     
6169 def MEDCouplingFieldTemplateReduce(self):
6170     ret = MEDCouplingFieldDouble(self)
6171     nbTuples = self.getNumberOfTuplesExpected()
6172     arr = DataArrayDouble(nbTuples) ; arr[:] = 0.
6173     ret.setArray(arr)
6174     return MEDCouplingFTReduceFunct,(MEDCouplingFieldTemplate,((ret,),()))
6175 #
6176 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
6177 #
6178 MEDCouplingUMesh.ExtractFromIndexedArrays           = DataArrayInt.ExtractFromIndexedArrays
6179 MEDCouplingUMesh.ExtractFromIndexedArraysSlice      = DataArrayInt.ExtractFromIndexedArraysSlice
6180 MEDCouplingUMesh.SetPartOfIndexedArrays             = DataArrayInt.SetPartOfIndexedArrays
6181 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx      = DataArrayInt.SetPartOfIndexedArraysSameIdx
6182 MEDCouplingUMesh.RemoveIdsFromIndexedArrays         = DataArrayInt.RemoveIdsFromIndexedArrays
6183 MEDCouplingFieldInt = MEDCouplingFieldInt32
6184
6185 if MEDCouplingUse64BitIDs():
6186   MEDCouplingFieldID = MEDCouplingFieldInt64
6187 else:
6188   MEDCouplingFieldID = MEDCouplingFieldInt32
6189
6190 %}
6191
6192 %pythoncode %{
6193 import os
6194 __filename=os.environ.get('PYTHONSTARTUP')
6195 if __filename and os.path.isfile(__filename):
6196     with open(__filename) as __fp:
6197         exec(__fp.read())
6198 %}