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