]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDCoupling_Swig/MEDCouplingCommon.i
Salome HOME
bos #26452 [EDF] (2021) SMESH: orientation of faces
[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     void orientCorrectly2DCells(const MEDCouplingUMesh *refFaces);
2122     DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2123     int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
2124     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2125     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2126     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2127     static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
2128     static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
2129     %extend {
2130       MEDCouplingUMesh()
2131       {
2132         return MEDCouplingUMesh::New();
2133       }
2134       
2135       MEDCouplingUMesh(const char *meshName, int meshDim)
2136       {
2137         return MEDCouplingUMesh::New(meshName,meshDim);
2138       }
2139
2140       std::string __str__() const
2141       {
2142         return self->simpleRepr();
2143       }
2144       
2145       std::string __repr__() const
2146       {
2147         std::ostringstream oss;
2148         self->reprQuickOverview(oss);
2149         return oss.str();
2150       }
2151       
2152       MEDCouplingUMeshCellIterator *__iter__()
2153       {
2154         return self->cellIterator();
2155       }
2156
2157       static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2158       {
2159         MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2160         return ret.retn();
2161       }
2162       
2163       PyObject *getAllGeoTypesSorted() const
2164       {
2165         std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2166         std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2167         PyObject *res=PyList_New(result.size());
2168         for(int i=0;iL!=result.end(); i++, iL++)
2169           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2170         return res;
2171       }
2172       
2173       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2174       {
2175         mcIdType sw;
2176         mcIdType singleVal;
2177         std::vector<mcIdType> multiVal;
2178         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2179         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2180         mcIdType nbc=self->getNumberOfCells();
2181         convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2182         switch(sw)
2183           {
2184           case 1:
2185             {
2186               if(singleVal>=nbc)
2187                 {
2188                   std::ostringstream oss;
2189                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2190                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2191                 }
2192               if(singleVal>=0)
2193                 {
2194                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2195                   break;
2196                 }
2197               else
2198                 {
2199                   if(nbc+singleVal>0)
2200                     {
2201                       mcIdType tmp=nbc+singleVal;
2202                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2203                       break;
2204                     }
2205                   else
2206                     {
2207                       std::ostringstream oss;
2208                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2209                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2210                     }
2211                 }
2212             }
2213           case 2:
2214             {
2215               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2216               break;
2217             }
2218           case 4:
2219             {
2220               if(!daIntTyypp)
2221                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2222               daIntTyypp->checkAllocated();
2223               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2224               break;
2225             }
2226           default:
2227             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
2228           }
2229       }
2230
2231       void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2232       {
2233         mcIdType sw;
2234         mcIdType singleVal;
2235         std::vector<mcIdType> multiVal;
2236         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2237         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2238         mcIdType nbc=self->getNumberOfCells();
2239         convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2240         switch(sw)
2241           {
2242           case 1:
2243             {
2244               if(singleVal>=nbc)
2245                 {
2246                   std::ostringstream oss;
2247                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2248                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2249                 }
2250               if(singleVal>=0)
2251                 {
2252                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2253                   break;
2254                 }
2255               else
2256                 {
2257                   if(nbc+singleVal>0)
2258                     {
2259                       mcIdType tmp=nbc+singleVal;
2260                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2261                       break;
2262                     }
2263                   else
2264                     {
2265                       std::ostringstream oss;
2266                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2267                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2268                     }
2269                 }
2270             }
2271           case 2:
2272             {
2273               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2274               break;
2275             }
2276           case 3:
2277             {
2278               self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2279               break;
2280             }
2281           case 4:
2282             {
2283               if(!daIntTyypp)
2284                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2285               daIntTyypp->checkAllocated();
2286               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2287               break;
2288             }
2289           default:
2290             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
2291           }
2292       }
2293
2294       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
2295       {
2296         mcIdType szArr,sw,iTypppArr;
2297         std::vector<mcIdType> stdvecTyyppArr;
2298         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2299         if(size>szArr)
2300           {
2301             std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2302             throw INTERP_KERNEL::Exception(oss.str().c_str());
2303           }
2304         self->insertNextCell(type,size,tmp);
2305       }
2306
2307       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2308       {
2309         mcIdType szArr,sw,iTypppArr;
2310         std::vector<mcIdType> stdvecTyyppArr;
2311         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2312         self->insertNextCell(type,szArr,tmp);
2313       }
2314       
2315       DataArrayIdType *getNodalConnectivity()
2316       {
2317         DataArrayIdType *ret=self->getNodalConnectivity();
2318         if(ret)
2319           ret->incrRef();
2320         return ret;
2321       }
2322       DataArrayIdType *getNodalConnectivityIndex()
2323       {
2324         DataArrayIdType *ret=self->getNodalConnectivityIndex();
2325         if(ret)
2326           ret->incrRef();
2327         return ret;
2328       }
2329       
2330       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
2331       {
2332         mcIdType szArr,sw,iTypppArr;
2333         std::vector<mcIdType> stdvecTyyppArr;
2334         const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2335         mcIdType nbOfDepthPeelingPerformed=0;
2336         DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2337         PyObject *res=PyTuple_New(2);
2338         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2339         PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2340         return res;
2341       }
2342
2343       static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
2344       {
2345         DataArrayIdType *v0=0,*v1=0;
2346         MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2347         PyObject *res = PyList_New(2);
2348         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2349         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2350         return res;
2351       }
2352       
2353       PyObject *distanceToPoint(PyObject *point) const
2354       {
2355         double val;
2356         DataArrayDouble *a;
2357         DataArrayDoubleTuple *aa;
2358         std::vector<double> bb;
2359         mcIdType sw;
2360         int nbOfCompo=self->getSpaceDimension();
2361         const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2362         //
2363         mcIdType cellId=-1;
2364         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2365         PyObject *ret=PyTuple_New(2);
2366         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2367         PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2368         return ret;
2369       }
2370
2371       PyObject *distanceToPoints(const DataArrayDouble *pts) const
2372       {
2373         DataArrayIdType *ret1=0;
2374         DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2375         PyObject *ret=PyTuple_New(2);
2376         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2377         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2378         return ret;
2379       }
2380
2381       PyObject *tetrahedrize(int policy)
2382       {
2383         mcIdType ret2(-1);
2384         DataArrayIdType *ret1(0);
2385         MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2386         PyObject *ret=PyTuple_New(3);
2387         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2388         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2389         PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2390         return ret;
2391       }
2392       
2393       PyObject *checkButterflyCells(double eps=1e-12)
2394       {
2395         std::vector<mcIdType> cells;
2396         self->checkButterflyCells(cells,eps);
2397         DataArrayIdType *ret=DataArrayIdType::New();
2398         ret->alloc(cells.size(),1);
2399         std::copy(cells.begin(),cells.end(),ret->getPointer());
2400         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2401       }
2402
2403       PyObject *splitByType() const
2404       {
2405         std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2406         std::size_t sz=ms.size();
2407         PyObject *ret = PyList_New(sz);
2408         for(std::size_t i=0;i<sz;i++)
2409           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2410         return ret;
2411       }
2412
2413       PyObject *partitionBySpreadZone() const
2414       {
2415         std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
2416         std::size_t sz=retCpp.size();
2417         PyObject *ret=PyList_New(sz);
2418         for(std::size_t i=0;i<sz;i++)
2419           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2420         return ret;
2421       }
2422
2423       static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
2424       {
2425         std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2426         std::size_t sz=retCpp.size();
2427         PyObject *ret=PyList_New(sz);
2428         for(std::size_t i=0;i<sz;i++)
2429           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2430         return ret;
2431       }
2432
2433       PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2434       {
2435         mcIdType size;
2436         INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
2437         MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2438         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2439       }
2440
2441       bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2442       {
2443         mcIdType sz;
2444         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2445         bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2446         return ret;
2447       }
2448
2449       DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2450       {
2451         mcIdType sz;
2452         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2453         DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2454         return ret;
2455       }
2456
2457       DataArrayIdType *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2458       {
2459         DataArrayIdType *ret=self->findNodesToDuplicate(otherDimM1OnSameCoords);
2460         return ret;
2461       }
2462
2463       PyObject *findCellsToRenumber(const MEDCouplingUMesh& otherDimM1OnSameCoords, const DataArrayIdType *dupNodes) const
2464       {
2465         DataArrayIdType *tmp0=0,*tmp1=0;
2466         self->findCellsToRenumber(otherDimM1OnSameCoords,dupNodes->begin(), dupNodes->end(), tmp0,tmp1);
2467         PyObject *ret=PyTuple_New(2);
2468         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2469         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2470         return ret;
2471       }
2472
2473       PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2474       {
2475         DataArrayIdType *tmp0=0,*tmp1=0;
2476         self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2477         PyObject *ret=PyTuple_New(2);
2478         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2479         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2480         return ret;
2481       }
2482
2483       void duplicateNodes(PyObject *li)
2484       {
2485         mcIdType sw;
2486         mcIdType singleVal;
2487         std::vector<mcIdType> multiVal;
2488         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2489         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2490         convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2491         switch(sw)
2492           {
2493           case 1:
2494             return self->duplicateNodes(&singleVal,&singleVal+1);
2495           case 2:
2496             return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2497           case 4:
2498             return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2499           default:
2500             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2501           }
2502       }
2503
2504       void duplicateNodesInConn(PyObject *li, mcIdType offset)
2505       {
2506         mcIdType sw;
2507         mcIdType singleVal;
2508         std::vector<mcIdType> multiVal;
2509         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2510         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2511         convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2512         switch(sw)
2513           {
2514           case 1:
2515             return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2516           case 2:
2517             return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2518           case 4:
2519             return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2520           default:
2521             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2522           }
2523       }
2524
2525       void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2526       {
2527         mcIdType szArr,sw,iTypppArr;
2528         std::vector<mcIdType> stdvecTyyppArr;
2529         const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2530         self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2531       }
2532
2533       PyObject *getLevArrPerCellTypes(PyObject *li) const
2534       {
2535         mcIdType sz;
2536         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2537         DataArrayIdType *tmp0,*tmp1=0;
2538         tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2539         PyObject *ret=PyTuple_New(2);
2540         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2541         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2542         return ret;
2543       }
2544
2545       PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2546       {
2547         DataArrayIdType *ret0=0,*ret1=0;
2548         self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2549         PyObject *ret=PyTuple_New(2);
2550         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2551         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2552         return ret;
2553       }
2554
2555       static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2556       {
2557         std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2558         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2559         DataArrayIdType *ret1=0,*ret2=0;
2560         MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2561         PyObject *ret=PyTuple_New(3);
2562         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2563         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2564         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2565         return ret;
2566       }
2567
2568       static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2569       {
2570         std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2571         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2572         MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2573         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2574       }
2575
2576       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2577       {
2578         std::size_t sz;
2579         std::vector<const MEDCouplingUMesh *> meshes;
2580         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2581         std::vector<DataArrayIdType *> corr;
2582         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2583         sz=corr.size();
2584         PyObject *ret1=PyList_New(sz);
2585         for(std::size_t i=0;i<sz;i++)
2586           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2587         PyObject *ret=PyList_New(2);
2588         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2589         PyList_SetItem(ret,1,ret1);
2590         return ret;
2591       }
2592
2593       static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2594       {
2595         std::vector<MEDCouplingUMesh *> meshes;
2596         convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2597         MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2598       }
2599
2600       static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2601       {
2602         std::vector<MEDCouplingUMesh *> meshes;
2603         convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2604         MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2605       }
2606
2607       PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2608       {
2609         double val;
2610         DataArrayDouble *a;
2611         DataArrayDoubleTuple *aa;
2612         std::vector<double> bb;
2613         mcIdType sw;
2614         int spaceDim=self->getSpaceDimension();
2615         const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2616         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2617         //
2618         std::vector<mcIdType> cells;
2619         self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2620         DataArrayIdType *ret=DataArrayIdType::New();
2621         ret->alloc(cells.size(),1);
2622         std::copy(cells.begin(),cells.end(),ret->getPointer());
2623         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2624       }
2625
2626       void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2627       {
2628         double val;
2629         DataArrayDouble *a;
2630         DataArrayDoubleTuple *aa;
2631         std::vector<double> bb;
2632         mcIdType sw;
2633         int spaceDim=self->getSpaceDimension();
2634         const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2635         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2636         self->orientCorrectly2DCells(v,polyOnly);
2637       }
2638       
2639       PyObject *arePolyhedronsNotCorrectlyOriented() const
2640       {
2641         std::vector<mcIdType> cells;
2642         self->arePolyhedronsNotCorrectlyOriented(cells);
2643         DataArrayIdType *ret=DataArrayIdType::New();
2644         ret->alloc(cells.size(),1);
2645         std::copy(cells.begin(),cells.end(),ret->getPointer());
2646         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2647       }
2648
2649       PyObject *getFastAveragePlaneOfThis() const
2650       {
2651         double vec[3];
2652         double pos[3];
2653         self->getFastAveragePlaneOfThis(vec,pos);
2654         double vals[6];
2655         std::copy(vec,vec+3,vals);
2656         std::copy(pos,pos+3,vals+3);
2657         return convertDblArrToPyListOfTuple<double>(vals,3,2);
2658       }
2659       
2660       static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2661       {
2662         std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2663         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2664         return MEDCouplingUMesh::MergeUMeshes(tmp);
2665       }
2666
2667       PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2668       {
2669         DataArrayIdType *ret1;
2670         bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2671         PyObject *ret=PyTuple_New(2);
2672         PyObject *ret0Py=ret0?Py_True:Py_False;
2673         Py_XINCREF(ret0Py);
2674         PyTuple_SetItem(ret,0,ret0Py);
2675         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2676         return ret;
2677       }
2678
2679       PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2680       {
2681         DataArrayIdType *ret1;
2682         bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2683         PyObject *ret=PyTuple_New(2);
2684         PyObject *ret0Py=ret0?Py_True:Py_False;
2685         Py_XINCREF(ret0Py);
2686         PyTuple_SetItem(ret,0,ret0Py);
2687         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2688         return ret;
2689       }
2690
2691       PyObject *explode3DMeshTo1D() const
2692       {
2693         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2694         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2695         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2696         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2697         MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2698         PyObject *ret=PyTuple_New(5);
2699         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2700         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2701         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2702         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2703         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2704         return ret;
2705       }
2706
2707       PyObject *explodeIntoEdges() const
2708       {
2709         MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
2710         MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2711         PyObject *ret=PyTuple_New(5);
2712         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2713         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2714         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2715         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2716         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2717         return ret;
2718       }
2719
2720       PyObject *explodeMeshIntoMicroEdges() const
2721       {
2722         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2723         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2724         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2725         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2726         MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2727         PyObject *ret=PyTuple_New(5);
2728         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2729         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2730         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2731         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2732         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2733         return ret;
2734       }
2735
2736       PyObject *buildDescendingConnectivity() const
2737       {
2738         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2739         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2740         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2741         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2742         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2743         PyObject *ret=PyTuple_New(5);
2744         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2745         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2746         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2747         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2748         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2749         return ret;
2750       }
2751
2752       PyObject *buildDescendingConnectivity2() const
2753       {
2754         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2755         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2756         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2757         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2758         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2759         PyObject *ret=PyTuple_New(5);
2760         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2761         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2762         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2763         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2764         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2765         return ret;
2766       }
2767       
2768       PyObject *computeNeighborsOfCells() const
2769       {
2770         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2771         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2772         PyObject *ret=PyTuple_New(2);
2773         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2774         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2775         return ret;
2776       }
2777
2778       PyObject *computeNeighborsOfNodes() const
2779       {
2780         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2781         self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2782         PyObject *ret=PyTuple_New(2);
2783         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2784         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2785         return ret;
2786       }
2787
2788       PyObject *computeEnlargedNeighborsOfNodes() const
2789       {
2790         MCAuto<DataArrayIdType> neighbors,neighborsIdx;
2791         self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2792         PyObject *ret=PyTuple_New(2);
2793         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2794         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2795         return ret;
2796       }
2797       
2798       PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
2799       {
2800         MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
2801         self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2802         PyObject *ret=PyTuple_New(2);
2803         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2804         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2805         return ret;
2806       }
2807       
2808       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
2809       {
2810         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2811         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2812         PyObject *ret=PyTuple_New(2);
2813         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2814         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2815         return ret;
2816       }
2817
2818       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2819       {
2820         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2821         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2822         DataArrayIdType *d2,*d3,*d4,*dd5;
2823         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2824         PyObject *ret=PyTuple_New(7);
2825         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2826         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2827         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2828         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2829         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2830         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2831         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2832         return ret;
2833       }
2834
2835       DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
2836       {
2837         if(!da)
2838           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2839         da->checkAllocated();
2840         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2841       }
2842
2843       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
2844       {
2845         if(!da)
2846           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2847         da->checkAllocated();
2848         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2849       }
2850
2851       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
2852       {
2853         if(!da)
2854           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2855         da->checkAllocated();
2856         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2857       }
2858
2859       PyObject *getTypesOfPart(DataArrayIdType *da) const
2860       {
2861         if(!da)
2862           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2863         da->checkAllocated();
2864         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2865         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2866         PyObject *res = PyList_New(result.size());
2867         for (int i=0;iL!=result.end(); i++, iL++)
2868           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2869         return res;
2870       }
2871
2872       DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
2873       {
2874         if(!da)
2875           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2876         da->checkAllocated();
2877         DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2878         ret->setName(da->getName().c_str());
2879         return ret;
2880       }
2881
2882       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2883       {
2884         DataArrayIdType *cellNb1=0,*cellNb2=0;
2885         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2886         PyObject *ret=PyTuple_New(3);
2887         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2888         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2889         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2890         return ret;
2891       }
2892
2893       static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2894       {
2895         MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2896         DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2897         MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2898         PyObject *ret(PyTuple_New(4));
2899         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2900         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2901         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2902         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2903         return ret;
2904       }
2905
2906       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2907       {
2908         int spaceDim=self->getSpaceDimension();
2909         if(spaceDim!=3)
2910           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2911         double val,val2;
2912         DataArrayDouble *a,*a2;
2913         DataArrayDoubleTuple *aa,*aa2;
2914         std::vector<double> bb,bb2;
2915         mcIdType sw;
2916         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2917         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2918         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2919         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2920         //
2921         DataArrayIdType *cellIds=0;
2922         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2923         PyObject *ret=PyTuple_New(2);
2924         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2925         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2926         return ret;
2927       }
2928
2929       PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2930       {
2931         int spaceDim=self->getSpaceDimension();
2932         if(spaceDim!=3)
2933           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2934         double val,val2;
2935         DataArrayDouble *a,*a2;
2936         DataArrayDoubleTuple *aa,*aa2;
2937         std::vector<double> bb,bb2;
2938         mcIdType sw;
2939         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2940         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2941         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2942         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2943         //
2944         DataArrayIdType *cellIds=0;
2945         MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2946         PyObject *ret=PyTuple_New(2);
2947         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2948         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2949         return ret;
2950       }
2951
2952       MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2953       {
2954         double val,val2;
2955         DataArrayDouble *a,*a2;
2956         DataArrayDoubleTuple *aa,*aa2;
2957         std::vector<double> bb,bb2;
2958         mcIdType sw;
2959         const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2960         const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2961         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2962         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2963         MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2964         return ret.retn();
2965       }
2966
2967       DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2968       {
2969         int spaceDim=self->getSpaceDimension();
2970         if(spaceDim!=3)
2971           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2972         double val,val2;
2973         DataArrayDouble *a,*a2;
2974         DataArrayDoubleTuple *aa,*aa2;
2975         std::vector<double> bb,bb2;
2976         mcIdType sw;
2977         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
2978         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
2979         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2980         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2981         return self->getCellIdsCrossingPlane(orig,vect,eps);
2982       }
2983
2984       void convertToPolyTypes(PyObject *li)
2985       {
2986         mcIdType sw;
2987         mcIdType pos1;
2988         std::vector<mcIdType> pos2;
2989         DataArrayIdType *pos3=0;
2990         DataArrayIdTypeTuple *pos4=0;
2991         convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2992         switch(sw)
2993           {
2994           case 1:
2995             {
2996               self->convertToPolyTypes(&pos1,&pos1+1);
2997               return;
2998             }
2999           case 2:
3000             {
3001               if(pos2.empty())
3002                 return;
3003               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
3004               return ;
3005             }
3006           case 3:
3007             {
3008               self->convertToPolyTypes(pos3->begin(),pos3->end());
3009               return ;
3010             }
3011           default:
3012             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
3013           }
3014       }      
3015     }
3016     void convertAllToPoly();
3017     void convertExtrudedPolyhedra();
3018     bool unPolyze();
3019     void simplifyPolyhedra(double eps);
3020     MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
3021     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
3022   };
3023
3024   //== MEDCouplingUMesh End
3025
3026   //== MEDCouplingMappedExtrudedMesh
3027
3028   class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3029   {
3030   public:
3031     static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
3032     static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
3033     MEDCouplingUMesh *build3DUnstructuredMesh() const;
3034     int get2DCellIdForExtrusion() const;
3035     %extend {
3036       MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
3037       {
3038         return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3039       }
3040
3041       MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
3042       {
3043         return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3044       }
3045
3046       MEDCouplingMappedExtrudedMesh()
3047       {
3048         return MEDCouplingMappedExtrudedMesh::New();
3049       }
3050       
3051       std::string __str__() const
3052       {
3053         return self->simpleRepr();
3054       }
3055
3056       std::string __repr__() const
3057       {
3058         std::ostringstream oss;
3059         self->reprQuickOverview(oss);
3060         return oss.str();
3061       }
3062       
3063       PyObject *getMesh2D() const
3064       {
3065         MEDCouplingUMesh *ret=self->getMesh2D();
3066         if(ret)
3067           ret->incrRef();
3068         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3069       }
3070       PyObject *getMesh1D() const
3071       {
3072         MEDCouplingUMesh *ret=self->getMesh1D();
3073         if(ret)
3074           ret->incrRef();
3075         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3076       }
3077       PyObject *getMesh3DIds() const
3078       {
3079         DataArrayIdType *ret=self->getMesh3DIds();
3080         if(ret)
3081           ret->incrRef();
3082         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3083       } 
3084     }
3085   };
3086
3087   //== MEDCouplingMappedExtrudedMesh End
3088
3089   class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3090   {
3091   public:
3092     static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3093     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
3094     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
3095     int getNodalConnectivityLength() const;
3096     virtual void allocateCells(int nbOfCells=0);
3097     virtual void checkConsistencyOfConnectivity() const;
3098     %extend
3099     {
3100       virtual void insertNextCell(PyObject *li)
3101       {
3102         mcIdType szArr,sw,iTypppArr;
3103         std::vector<mcIdType> stdvecTyyppArr;
3104         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3105         self->insertNextCell(tmp,tmp+szArr);
3106       }
3107
3108       virtual DataArrayIdType *getNodalConnectivity() const
3109       {
3110         DataArrayIdType *ret=self->getNodalConnectivity();
3111         if(ret) ret->incrRef();
3112         return ret;
3113       }
3114       
3115       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
3116       {
3117         std::vector< const MEDCoupling1GTUMesh *> parts;
3118         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3119         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3120       }
3121     }
3122   };
3123
3124   //== MEDCoupling1SGTUMesh
3125
3126   class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3127   {
3128   public:
3129     static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3130     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3131     void setNodalConnectivity(DataArrayIdType *nodalConn);
3132     int getNumberOfNodesPerCell() const;
3133     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3134     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3135     MEDCoupling1GTUMesh *computeDualMesh() const;
3136     MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3137     DataArrayIdType *sortHexa8EachOther();
3138     %extend
3139     {
3140       MEDCoupling1SGTUMesh()
3141       {
3142         return MEDCoupling1SGTUMesh::New();
3143       }
3144
3145       MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3146       {
3147         return MEDCoupling1SGTUMesh::New(name,type);
3148       }
3149
3150       MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3151       {
3152         return MEDCoupling1SGTUMesh::New(m);
3153       }
3154
3155       std::string __str__() const
3156       {
3157         return self->simpleRepr();
3158       }
3159       
3160       std::string __repr__() const
3161       {
3162         std::ostringstream oss;
3163         self->reprQuickOverview(oss);
3164         return oss.str();
3165       }
3166
3167       PyObject *structurizeMe(double eps=1e-12) const
3168       {
3169         DataArrayIdType *cellPerm(0),*nodePerm(0);
3170         MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3171         PyObject *ret(PyTuple_New(3));
3172         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3173         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3174         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3175         return ret;
3176       }
3177
3178       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3179       {
3180         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3181         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3182         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3183       }
3184       
3185       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3186       {
3187         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3188         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3189         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3190       }
3191     }
3192   };
3193   
3194   //== MEDCoupling1SGTUMesh End
3195
3196   //== MEDCoupling1DGTUMesh
3197
3198   class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3199   {
3200   public:
3201     static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3202     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3203     void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
3204     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3205     bool isPacked() const;
3206     %extend
3207     {
3208       MEDCoupling1DGTUMesh()
3209       {
3210         return MEDCoupling1DGTUMesh::New();
3211       }
3212       MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3213       {
3214         return MEDCoupling1DGTUMesh::New(name,type);
3215       }
3216
3217       MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3218       {
3219         return MEDCoupling1DGTUMesh::New(m);
3220       }
3221
3222       std::string __str__() const
3223       {
3224         return self->simpleRepr();
3225       }
3226       
3227       std::string __repr__() const
3228       {
3229         std::ostringstream oss;
3230         self->reprQuickOverview(oss);
3231         return oss.str();
3232       }
3233
3234       DataArrayIdType *getNodalConnectivityIndex() const
3235       {
3236         DataArrayIdType *ret=self->getNodalConnectivityIndex();
3237         if(ret) ret->incrRef();
3238         return ret;
3239       }
3240
3241       PyObject *retrievePackedNodalConnectivity() const
3242       {
3243         DataArrayIdType *ret1=0,*ret2=0;
3244         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3245         PyObject *ret0Py=ret0?Py_True:Py_False;
3246         Py_XINCREF(ret0Py);
3247         PyObject *ret=PyTuple_New(3);
3248         PyTuple_SetItem(ret,0,ret0Py);
3249         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3250         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3251         return ret;
3252       }
3253       
3254       PyObject *copyWithNodalConnectivityPacked() const
3255       {
3256         bool ret1;
3257         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3258         PyObject *ret=PyTuple_New(2);
3259         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3260         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3261         PyTuple_SetItem(ret,1,ret1Py);
3262         return ret;
3263       }
3264
3265       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3266       {
3267         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3268         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3269         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3270       }
3271       
3272       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3273       {
3274         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3275         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3276         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3277       }
3278       
3279       static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
3280       {
3281         std::vector<const MEDCoupling::DataArrayIdType *> tmp;
3282         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
3283         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3284       }
3285     }
3286   };
3287
3288   //== MEDCoupling1DGTUMeshEnd
3289
3290   class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3291   {
3292   public:
3293     mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3294     mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3295     mcIdType getNumberOfCellsOfSubLevelMesh() const;
3296     int getSpaceDimensionOnNodeStruct() const;
3297     double computeSquareness() const;
3298     virtual std::vector<mcIdType> getNodeGridStructure() const;
3299     std::vector<mcIdType> getCellGridStructure() const;
3300     MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3301     std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
3302     std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
3303     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3304     MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3305     static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
3306     static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
3307     static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
3308     %extend
3309     {
3310       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3311       {
3312         mcIdType tmpp1=-1,tmpp2=-1;
3313         std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3314         std::vector< std::pair<mcIdType,mcIdType> > inp;
3315         if(tmpp2==2)
3316           {
3317             inp.resize(tmpp1);
3318             for(mcIdType i=0;i<tmpp1;i++)
3319               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3320           }
3321         else if(tmpp2==1)
3322           {
3323             if(tmpp1%2!=0)
3324               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3325             inp.resize(tmpp1/2);
3326             for(mcIdType i=0;i<tmpp1/2;i++)
3327               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3328           }
3329         else
3330           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3331         return self->buildStructuredSubPart(inp);
3332       }
3333
3334       static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3335       {
3336         std::vector< std::pair<mcIdType,mcIdType> > inp;
3337         convertPyToVectorPairInt(part,inp);
3338         //
3339         mcIdType szArr,sw,iTypppArr;
3340         std::vector<mcIdType> stdvecTyyppArr;
3341         const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3342         std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
3343         //
3344         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3345       }
3346
3347       static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
3348       {
3349         std::vector< std::pair<mcIdType,mcIdType> > inp;
3350         convertPyToVectorPairInt(part,inp);
3351         MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3352       }
3353
3354       static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
3355       {
3356         std::vector< std::pair<mcIdType,mcIdType> > inp;
3357         convertPyToVectorPairInt(part,inp);
3358         MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3359       }
3360
3361       static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
3362       {
3363         std::vector< std::pair<mcIdType,mcIdType> > inp;
3364         convertPyToVectorPairInt(part,inp);
3365         std::vector<mcIdType> stWithGhost;
3366         std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
3367         MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3368         PyObject *ret(PyTuple_New(2));
3369         PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3370         PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3371         return ret;
3372       }
3373
3374       static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3375       {
3376         std::vector< std::pair<mcIdType,mcIdType> > inp;
3377         convertPyToVectorPairInt(partCompactFormat,inp);
3378         return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3379       }
3380
3381       static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3382       {
3383         std::vector< std::pair<mcIdType,mcIdType> > inp;
3384         convertPyToVectorPairInt(partCompactFormat,inp);
3385         MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3386       }
3387
3388       static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3389       {
3390         std::vector< std::pair<mcIdType,mcIdType> > inp;
3391         convertPyToVectorPairInt(part,inp);
3392         return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3393       }
3394
3395       static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
3396       {
3397         mcIdType szArr,sw,iTypppArr;
3398         std::vector<mcIdType> stdvecTyyppArr;
3399         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3400         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3401       }
3402
3403       static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3404       {
3405         mcIdType szArr,sw,iTypppArr;
3406         std::vector<mcIdType> stdvecTyyppArr;
3407         const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3408         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3409       }
3410
3411       static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3412       {
3413         std::vector< std::pair<mcIdType,mcIdType> > inp;
3414         convertPyToVectorPairInt(partCompactFormat,inp);
3415         return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3416       }
3417
3418       static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
3419       {
3420         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3421         PyObject *retPy=PyList_New(ret.size());
3422         for(std::size_t i=0;i<ret.size();i++)
3423           {
3424             PyObject *tmp=PyTuple_New(2);
3425             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3426             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3427             PyList_SetItem(retPy,i,tmp);
3428           }
3429         return retPy;
3430       }
3431
3432       static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3433       {
3434         std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3435         convertPyToVectorPairInt(r1,r1Cpp);
3436         convertPyToVectorPairInt(r2,r2Cpp);
3437         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3438         PyObject *retPy=PyList_New(ret.size());
3439         for(std::size_t i=0;i<ret.size();i++)
3440           {
3441             PyObject *tmp=PyTuple_New(2);
3442             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3443             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3444             PyList_SetItem(retPy,i,tmp);
3445           }
3446         return retPy;
3447       }
3448
3449       static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3450       {
3451         std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3452         convertPyToVectorPairInt(r1,r1Cpp);
3453         convertPyToVectorPairInt(r2,r2Cpp);
3454         return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3455       }
3456
3457       static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3458       {
3459         mcIdType szArr,sw,iTypppArr;
3460         std::vector<mcIdType> stdvecTyyppArr;
3461         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3462         mcIdType szArr2,sw2,iTypppArr2;
3463         std::vector<mcIdType> stdvecTyyppArr2;
3464         const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3465         std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
3466         std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
3467         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3468         PyObject *ret=PyTuple_New(2);
3469         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3470         PyTuple_SetItem(ret,0,ret0Py);
3471         PyObject *ret1Py=PyList_New(partCompactFormat.size());
3472         for(std::size_t i=0;i<partCompactFormat.size();i++)
3473           {
3474             PyObject *tmp4=PyTuple_New(2);
3475             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3476             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3477             PyList_SetItem(ret1Py,i,tmp4);
3478           }
3479         PyTuple_SetItem(ret,1,ret1Py);
3480         return ret;
3481       }
3482
3483       static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3484       {
3485         std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3486         convertPyToVectorPairInt(bigInAbs,param0);
3487         convertPyToVectorPairInt(partOfBigInAbs,param1);
3488         MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3489         PyObject *retPy(PyList_New(ret.size()));
3490         for(std::size_t i=0;i<ret.size();i++)
3491           {
3492             PyObject *tmp(PyTuple_New(2));
3493             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3494             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3495             PyList_SetItem(retPy,i,tmp);
3496           }
3497         return retPy;
3498       }
3499
3500       static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
3501       {
3502         std::vector< std::pair<mcIdType,mcIdType> > param0;
3503         convertPyToVectorPairInt(part,param0);
3504         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3505         PyObject *retPy(PyList_New(ret.size()));
3506         for(std::size_t i=0;i<ret.size();i++)
3507           {
3508             PyObject *tmp(PyTuple_New(2));
3509             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3510             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3511             PyList_SetItem(retPy,i,tmp);
3512           }
3513         return retPy;
3514       }
3515
3516       static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3517       {
3518         std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
3519         convertPyToVectorPairInt(startingFrom,param0);
3520         convertPyToVectorPairInt(goingTo,param1);
3521         return  MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3522       }
3523
3524       static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3525       {
3526         std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3527         convertPyToVectorPairInt(bigInAbs,param0);
3528         convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3529         MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3530         PyObject *retPy(PyList_New(ret.size()));
3531         for(std::size_t i=0;i<ret.size();i++)
3532           {
3533             PyObject *tmp(PyTuple_New(2));
3534             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3535             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3536             PyList_SetItem(retPy,i,tmp);
3537           }
3538         return retPy;
3539       }
3540     }
3541   };
3542
3543   class MEDCouplingCurveLinearMesh;
3544
3545   //== MEDCouplingCMesh
3546   
3547   class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3548   {
3549   public:
3550     static MEDCouplingCMesh *New();
3551     static MEDCouplingCMesh *New(const std::string& meshName);
3552     void setCoords(const DataArrayDouble *coordsX,
3553                    const DataArrayDouble *coordsY=0,
3554                    const DataArrayDouble *coordsZ=0);
3555     void setCoordsAt(int i, const DataArrayDouble *arr);
3556     MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3557     %extend {
3558       MEDCouplingCMesh()
3559       {
3560         return MEDCouplingCMesh::New();
3561       }
3562       MEDCouplingCMesh(const std::string& meshName)
3563       {
3564         return MEDCouplingCMesh::New(meshName);
3565       }
3566       std::string __str__() const
3567       {
3568         return self->simpleRepr();
3569       }
3570       std::string __repr__() const
3571       {
3572         std::ostringstream oss;
3573         self->reprQuickOverview(oss);
3574         return oss.str();
3575       }
3576       DataArrayDouble *getCoordsAt(int i)
3577       {
3578         DataArrayDouble *ret=self->getCoordsAt(i);
3579         if(ret)
3580           ret->incrRef();
3581         return ret;
3582       }
3583     }
3584   };
3585
3586   //== MEDCouplingCMesh End
3587
3588   //== MEDCouplingCurveLinearMesh
3589
3590   class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3591   {
3592   public:
3593     static MEDCouplingCurveLinearMesh *New();
3594     static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3595     void setCoords(const DataArrayDouble *coords);
3596     %extend {
3597       MEDCouplingCurveLinearMesh()
3598       {
3599         return MEDCouplingCurveLinearMesh::New();
3600       }
3601       MEDCouplingCurveLinearMesh(const std::string& meshName)
3602       {
3603         return MEDCouplingCurveLinearMesh::New(meshName);
3604       }
3605       std::string __str__() const 
3606       {
3607         return self->simpleRepr();
3608       }
3609       std::string __repr__() const
3610       {
3611         std::ostringstream oss;
3612         self->reprQuickOverview(oss);
3613         return oss.str();
3614       }
3615       DataArrayDouble *getCoords()
3616       {
3617         DataArrayDouble *ret=self->getCoords();
3618         if(ret)
3619           ret->incrRef();
3620         return ret;
3621       }
3622       void setNodeGridStructure(PyObject *gridStruct)
3623       {
3624         mcIdType szArr,sw,iTypppArr;
3625         std::vector<mcIdType> stdvecTyyppArr;
3626         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3627         self->setNodeGridStructure(tmp,tmp+szArr);
3628       }
3629     }
3630   };
3631
3632   //== MEDCouplingCurveLinearMesh End
3633
3634   //== MEDCouplingIMesh
3635
3636   class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3637   {
3638   public:
3639     static MEDCouplingIMesh *New();
3640     //
3641     void setSpaceDimension(int spaceDim);
3642     std::vector<mcIdType> getNodeStruct() const;
3643     std::vector<double> getOrigin() const;
3644     std::vector<double> getDXYZ() const;
3645     void setAxisUnit(const std::string& unitName);
3646     std::string getAxisUnit() const;
3647     double getMeasureOfAnyCell() const;
3648     MEDCouplingCMesh *convertToCartesian() const;
3649     void refineWithFactor(const std::vector<mcIdType>& factors);
3650     MEDCouplingIMesh *asSingleCell() const;
3651     MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
3652     %extend
3653     {
3654       MEDCouplingIMesh()
3655       {
3656         return MEDCouplingIMesh::New();
3657       }
3658       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3659       {
3660         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3661         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3662         const mcIdType *nodeStrctPtr(0);
3663         const double *originPtr(0),*dxyzPtr(0);
3664         mcIdType sw,sz,val0;
3665         std::vector<mcIdType> bb0;
3666         nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3667         //
3668         double val,val2;
3669         std::vector<double> bb,bb2;
3670         mcIdType sz1,sz2;
3671         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3672         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3673         //
3674         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3675       }
3676
3677       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3678       {
3679         return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3680       }
3681
3682       void setNodeStruct(PyObject *nodeStrct)
3683       {
3684         mcIdType sw,sz,val0;
3685         std::vector<mcIdType> bb0;
3686         const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3687         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3688       }
3689
3690       void setOrigin(PyObject *origin)
3691       {
3692         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3693         double val;
3694         std::vector<double> bb;
3695         mcIdType sw,nbTuples;
3696         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3697         self->setOrigin(originPtr,originPtr+nbTuples);
3698       }
3699       
3700       void setDXYZ(PyObject *dxyz)
3701       {
3702         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3703         double val;
3704         std::vector<double> bb;
3705         mcIdType sw,nbTuples;
3706         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3707         self->setDXYZ(originPtr,originPtr+nbTuples);
3708       }
3709
3710       static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
3711       {
3712         std::vector< std::pair<mcIdType,mcIdType> > inp;
3713         convertPyToVectorPairInt(fineLocInCoarse,inp);
3714         MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3715       }
3716
3717       static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
3718       {
3719         std::vector< std::pair<mcIdType,mcIdType> > inp;
3720         convertPyToVectorPairInt(fineLocInCoarse,inp);
3721         MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3722       }
3723
3724       static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
3725       {
3726         std::vector< std::pair<mcIdType,mcIdType> > inp;
3727         convertPyToVectorPairInt(fineLocInCoarse,inp);
3728         MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3729       }
3730
3731       static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3732       {
3733         std::vector< std::pair<mcIdType,mcIdType> > inp;
3734         convertPyToVectorPairInt(fineLocInCoarse,inp);
3735         MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3736       }
3737
3738       static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3739       {
3740         std::vector< std::pair<mcIdType,mcIdType> > inp;
3741         convertPyToVectorPairInt(fineLocInCoarse,inp);
3742         MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3743       }
3744
3745       std::string __str__() const
3746       {
3747         return self->simpleRepr();
3748       }
3749       std::string __repr__() const
3750       {
3751         std::ostringstream oss;
3752         self->reprQuickOverview(oss);
3753         return oss.str();
3754       }
3755     }
3756   };
3757
3758   //== MEDCouplingIMesh End
3759
3760 }
3761
3762 namespace MEDCoupling
3763 {
3764   class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3765   {
3766   public:
3767     virtual void checkConsistencyLight() const;
3768     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3769     bool areStrictlyCompatible(const MEDCouplingField *other) const;
3770     bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
3771     virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3772     void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3773     void setName(const char *name);
3774     std::string getDescription() const;
3775     void setDescription(const char *desc);
3776     std::string getName() const;
3777     TypeOfField getTypeOfField() const;
3778     NatureOfField getNature() const;
3779     virtual void setNature(NatureOfField nat);
3780     DataArrayDouble *getLocalizationOfDiscr() const;
3781     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3782     mcIdType getNumberOfTuplesExpected() const;
3783     mcIdType getNumberOfMeshPlacesExpected() const;
3784     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3785                                     const std::vector<double>& gsCoo, const std::vector<double>& wg);
3786     void clearGaussLocalizations();
3787     MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3788     mcIdType getNbOfGaussLocalization() const;
3789     mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
3790     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3791     mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3792     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3793     %extend {
3794       PyObject *getMesh() const
3795       {
3796         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3797         if(ret1)
3798           ret1->incrRef();
3799         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3800       }
3801
3802       PyObject *getDiscretization()
3803       {
3804         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3805         if(ret)
3806           ret->incrRef();
3807         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3808       }
3809
3810       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3811       {
3812         std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
3813         return convertIntArrToPyList3(ret);
3814       }
3815
3816       PyObject *buildSubMeshData(PyObject *li) const
3817       {
3818         DataArrayIdType *ret1=0;
3819         MEDCouplingMesh *ret0=0;
3820         void *da=0;
3821         int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
3822         if (!SWIG_IsOK(res1))
3823           {
3824             mcIdType size;
3825             INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3826             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3827           }
3828         else
3829           {
3830             DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3831             if(!da2)
3832               throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3833             da2->checkAllocated();
3834             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3835           }
3836         PyObject *res = PyList_New(2);
3837         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3838         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3839         return res;
3840       }
3841
3842       PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
3843       {
3844         DataArrayIdType *ret1=0;
3845         mcIdType bb,ee,ss;
3846         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3847         PyObject *res=PyTuple_New(2);
3848         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3849         if(ret1)
3850           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3851         else
3852           {
3853             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3854             PyTuple_SetItem(res,1,res1);
3855           }
3856         return res;
3857       }
3858
3859       DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3860       {
3861         mcIdType sw,sz(-1);
3862         mcIdType v0; std::vector<mcIdType> v1;
3863         const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3864         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3865       }
3866
3867       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3868                                        const std::vector<double>& gsCoo, const std::vector<double>& wg)
3869       {
3870         void *da=0;
3871         int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
3872         if (!SWIG_IsOK(res1))
3873           {
3874             mcIdType size;
3875             INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3876             self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
3877           }
3878         else
3879           {
3880             DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3881             if(!da2)
3882               throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3883             da2->checkAllocated();
3884             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3885           }
3886       }
3887
3888       PyObject *getCellIdsHavingGaussLocalization(int locId) const
3889       {
3890         std::vector<mcIdType> tmp;
3891         self->getCellIdsHavingGaussLocalization(locId,tmp);
3892         DataArrayIdType *ret=DataArrayIdType::New();
3893         ret->alloc((mcIdType)tmp.size(),1);
3894         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3895         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3896       }
3897       
3898       mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3899       {
3900         std::vector<mcIdType> inp0;
3901         convertPyToNewIntArr4(code,1,3,inp0);
3902         std::vector<const DataArrayIdType *> inp1;
3903         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
3904         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3905       }
3906     }
3907   };
3908   
3909   class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3910   {
3911   public:
3912     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3913     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3914     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
3915     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
3916     static MEDCouplingFieldTemplate *New(TypeOfField type);
3917     std::string simpleRepr() const;
3918     std::string advancedRepr() const;
3919     bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3920     bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3921     %extend
3922        {
3923          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3924          {
3925            return MEDCouplingFieldTemplate::New(f);
3926          }
3927
3928          MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3929          {
3930            return MEDCouplingFieldTemplate::New(f);
3931          }
3932          
3933          MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
3934          {
3935            return MEDCouplingFieldTemplate::New(f);
3936          }
3937
3938          MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
3939          {
3940            return MEDCouplingFieldTemplate::New(f);
3941          }
3942          
3943          MEDCouplingFieldTemplate(TypeOfField type)
3944          {
3945            return MEDCouplingFieldTemplate::New(type);
3946          }
3947          
3948          std::string __str__() const
3949          {
3950            return self->simpleRepr();
3951          }
3952          
3953          std::string __repr__() const
3954          {
3955            std::ostringstream oss;
3956            self->reprQuickOverview(oss);
3957            return oss.str();
3958          }
3959
3960          PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3961          {
3962            std::string ret1;
3963            bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3964            PyObject *ret=PyTuple_New(2);
3965            PyObject *ret0Py=ret0?Py_True:Py_False;
3966            Py_XINCREF(ret0Py);
3967            PyTuple_SetItem(ret,0,ret0Py);
3968            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3969            return ret;
3970          }
3971        }
3972   };
3973
3974   template<class T>
3975  class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3976   {
3977   public:
3978     TypeOfTimeDiscretization getTimeDiscretization() const;
3979   protected:
3980     MEDCouplingFieldT();
3981     ~MEDCouplingFieldT();
3982   };
3983
3984   %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
3985   %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
3986   %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
3987   
3988   class MEDCouplingFieldInt32;
3989   class MEDCouplingFieldInt64;
3990   class MEDCouplingFieldFloat;
3991   
3992   class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
3993   {
3994   public:
3995     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3996     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3997     bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3998     bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3999     void setTimeUnit(const std::string& unit);
4000     std::string getTimeUnit() const;
4001     void synchronizeTimeWithSupport();
4002     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
4003     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
4004     std::string simpleRepr() const;
4005     std::string advancedRepr() const;
4006     std::string  writeVTK(const std::string& fileName, bool isBinary=true) const;
4007     MEDCouplingFieldInt32 *convertToIntField() const;
4008     MEDCouplingFieldFloat *convertToFloatField() const;
4009     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
4010     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
4011     MEDCouplingFieldDouble *deepCopy() const;
4012     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
4013     MEDCouplingFieldDouble *nodeToCellDiscretization() const;
4014     MEDCouplingFieldDouble *cellToNodeDiscretization() const;
4015     double getIJ(int tupleId, int compoId) const;
4016     double getIJK(int cellId, int nodeIdInCell, int compoId) const;
4017     void synchronizeTimeWithMesh();
4018     void setArray(DataArrayDouble *array);
4019     void setEndArray(DataArrayDouble *array);
4020     void setTime(double val, int iteration, int order);
4021     void setStartTime(double val, int iteration, int order);
4022     void setEndTime(double val, int iteration, int order);
4023     void applyLin(double a, double b, int compoId);
4024     void applyLin(double a, double b);
4025     int getNumberOfComponents() const;
4026     int getNumberOfTuples() const;
4027     int getNumberOfValues() const;
4028     void setTimeTolerance(double val);
4029     double getTimeTolerance() const;
4030     void setIteration(int it);
4031     void setEndIteration(int it);
4032     void setOrder(int order);
4033     void setEndOrder(int order);
4034     void setTimeValue(double val);
4035     void setEndTimeValue(double val);
4036     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
4037     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
4038     bool mergeNodes(double eps, double epsOnVals=1e-15);
4039     bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
4040     bool zipCoords(double epsOnVals=1e-15);
4041     bool zipConnectivity(int compType,double epsOnVals=1e-15);
4042     bool simplexize(int policy);
4043     MEDCouplingFieldDouble *doublyContractedProduct() const;
4044     MEDCouplingFieldDouble *determinant() const;
4045     MEDCouplingFieldDouble *eigenValues() const;
4046     MEDCouplingFieldDouble *eigenVectors() const;
4047     MEDCouplingFieldDouble *inverse() const;
4048     MEDCouplingFieldDouble *trace() const;
4049     MEDCouplingFieldDouble *deviator() const;
4050     MEDCouplingFieldDouble *magnitude() const;
4051     MEDCouplingFieldDouble *maxPerTuple() const;
4052     void changeNbOfComponents(std::size_t newNbOfComp, double dftValue=0.);
4053     void sortPerTuple(bool asc);
4054     MEDCouplingFieldDouble &operator=(double value);
4055     void fillFromAnalytic(int nbOfComp, const std::string& func);
4056     void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
4057     void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4058     void applyFunc(int nbOfComp, const std::string& func);
4059     void applyFuncCompo(int nbOfComp, const std::string& func);
4060     void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4061     void applyFunc(int nbOfComp, double val);
4062     void applyFunc(const std::string& func);
4063     void applyFuncFast32(const std::string& func);
4064     void applyFuncFast64(const std::string& func);
4065     double accumulate(int compId) const;
4066     double getMaxValue() const;
4067     double getMinValue() const;
4068     double getAverageValue() const;
4069     double norm2() const;
4070     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4071     double getWeightedAverageValue(int compId, bool isWAbs) const;
4072     double integral(int compId, bool isWAbs) const;
4073     double normL1(int compId) const;
4074     double normL2(int compId) const;
4075     double normMax(int compId) const;
4076     DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
4077     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
4078     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4079     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4080     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4081     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
4082     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4083     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
4084     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4085     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
4086     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4087     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4088     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4089     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4090     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4091     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
4092     MEDCouplingFieldDouble *negate() const;
4093     %extend {
4094       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4095       {
4096         return MEDCouplingFieldDouble::New(type,td);
4097       }
4098
4099       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4100       {
4101         return MEDCouplingFieldDouble::New(ft,td);
4102       }
4103
4104       std::string __str__() const
4105       {
4106         return self->simpleRepr();
4107       }
4108
4109       std::string __repr__() const
4110       {
4111         std::ostringstream oss;
4112         self->reprQuickOverview(oss);
4113         return oss.str();
4114       }
4115
4116       PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
4117       {
4118         std::string ret1;
4119         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4120         PyObject *ret=PyTuple_New(2);
4121         PyObject *ret0Py=ret0?Py_True:Py_False;
4122         Py_XINCREF(ret0Py);
4123         PyTuple_SetItem(ret,0,ret0Py);
4124         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4125         return ret;
4126       }
4127       
4128       MEDCouplingFieldDouble *voronoize(double eps) const
4129       {
4130         MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4131         return ret.retn();
4132       }
4133
4134       MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4135       {
4136         MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4137         return ret.retn();
4138       }
4139       
4140       MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4141       {
4142         const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4143         double val,val2;
4144         DataArrayDouble *a,*a2;
4145         DataArrayDoubleTuple *aa,*aa2;
4146         std::vector<double> bb,bb2;
4147         mcIdType sw;
4148         const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4149         const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4150         return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4151       }
4152
4153       DataArrayDouble *getArray()
4154       {
4155         DataArrayDouble *ret=self->getArray();
4156         if(ret)
4157           ret->incrRef();
4158         return ret;
4159       }
4160
4161       PyObject *getArrays() const
4162       {
4163         std::vector<DataArrayDouble *> arrs=self->getArrays();
4164         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4165           if(*it)
4166             (*it)->incrRef();
4167         std::size_t sz=arrs.size();
4168         PyObject *ret=PyTuple_New(sz);
4169         for(std::size_t i=0;i<sz;i++)
4170           {
4171             if(arrs[i])
4172               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4173             else
4174               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4175           }
4176         return ret;
4177       }
4178
4179       void setArrays(PyObject *ls)
4180       {
4181         std::vector<const DataArrayDouble *> tmp;
4182         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4183         std::size_t sz=tmp.size();
4184         std::vector<DataArrayDouble *> arrs(sz);
4185         for(std::size_t i=0;i<sz;i++)
4186           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4187         self->setArrays(arrs);
4188       }
4189
4190       DataArrayDouble *getEndArray()
4191       {
4192         DataArrayDouble *ret=self->getEndArray();
4193         if(ret)
4194           ret->incrRef();
4195         return ret;
4196       }
4197
4198       PyObject *getValueOn(PyObject *sl) const
4199       {
4200         double val;
4201         DataArrayDouble *a;
4202         DataArrayDoubleTuple *aa;
4203         std::vector<double> bb;
4204         mcIdType sw;
4205         const MEDCouplingMesh *mesh=self->getMesh();
4206         if(!mesh)
4207           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4208         int spaceDim=mesh->getSpaceDimension();
4209         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4210         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4211         //
4212         mcIdType sz=ToIdType(self->getNumberOfComponents());
4213         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4214         self->getValueOn(spaceLoc,res);
4215         return convertDblArrToPyList<double>(res,sz);
4216       }
4217
4218        PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
4219        {
4220          mcIdType sz=ToIdType(self->getNumberOfComponents());
4221          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4222          self->getValueOnPos(i,j,k,res);
4223          return convertDblArrToPyList<double>(res,sz);
4224        }
4225
4226       DataArrayDouble *getValueOnMulti(PyObject *locs) const
4227       {
4228         const MEDCouplingMesh *mesh(self->getMesh());
4229         if(!mesh)
4230           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4231         //
4232         mcIdType sw,nbPts;
4233         double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4234         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4235                                                          mesh->getSpaceDimension(),true,nbPts);
4236         return self->getValueOnMulti(inp,(int)nbPts);
4237       }
4238
4239       PyObject *getValueOn(PyObject *sl, double time) const
4240       {
4241         double val;
4242         DataArrayDouble *a;
4243         DataArrayDoubleTuple *aa;
4244         std::vector<double> bb;
4245         mcIdType sw;
4246         const MEDCouplingMesh *mesh=self->getMesh();
4247         if(!mesh)
4248           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4249         int spaceDim=mesh->getSpaceDimension();
4250         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4251         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4252         //
4253         //
4254         mcIdType sz=ToIdType(self->getNumberOfComponents());
4255         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4256         self->getValueOn(spaceLoc,time,res);
4257         return convertDblArrToPyList<double>(res,sz);
4258       }
4259
4260       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4261       {
4262         if(self->getArray()!=0)
4263           MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4264         else
4265           {
4266             MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4267             MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4268             self->setArray(arr);
4269           }
4270       }
4271       
4272       PyObject *getTime()
4273       {
4274         int tmp1,tmp2;
4275         double tmp0=self->getTime(tmp1,tmp2);
4276         PyObject *res = PyList_New(3);
4277         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4278         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4279         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4280         return res;
4281       }
4282
4283       PyObject *getStartTime()
4284       {
4285         int tmp1,tmp2;
4286         double tmp0=self->getStartTime(tmp1,tmp2);
4287         PyObject *res = PyList_New(3);
4288         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4289         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4290         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4291         return res;
4292       }
4293
4294       PyObject *getEndTime()
4295       {
4296         int tmp1,tmp2;
4297         double tmp0=self->getEndTime(tmp1,tmp2);
4298         PyObject *res = PyList_New(3);
4299         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4300         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4301         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4302         return res;
4303       }
4304       PyObject *accumulate() const
4305       {
4306         mcIdType sz=ToIdType(self->getNumberOfComponents());
4307         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4308         self->accumulate(tmp);
4309         return convertDblArrToPyList<double>(tmp,sz);
4310       }
4311       PyObject *integral(bool isWAbs) const
4312       {
4313         mcIdType sz=ToIdType(self->getNumberOfComponents());
4314         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4315         self->integral(isWAbs,tmp);
4316         return convertDblArrToPyList<double>(tmp,sz);
4317       }
4318       PyObject *getWeightedAverageValue(bool isWAbs=true) const
4319       {
4320         mcIdType sz=ToIdType(self->getNumberOfComponents());
4321         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4322         self->getWeightedAverageValue(tmp,isWAbs);
4323         return convertDblArrToPyList<double>(tmp,sz);
4324       }
4325       PyObject *normL1() const
4326       {
4327         mcIdType sz=ToIdType(self->getNumberOfComponents());
4328         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4329         self->normL1(tmp);
4330         return convertDblArrToPyList<double>(tmp,sz);
4331       }
4332       PyObject *normL2() const
4333       {
4334         mcIdType sz=ToIdType(self->getNumberOfComponents());
4335         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4336         self->normL2(tmp);
4337         return convertDblArrToPyList<double>(tmp,sz);
4338       }
4339       PyObject *normMax() const
4340       {
4341         mcIdType sz=ToIdType(self->getNumberOfComponents());
4342         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4343         self->normMax(tmp);
4344         return convertDblArrToPyList<double>(tmp,sz);
4345       }
4346       void renumberCells(PyObject *li, bool check=true)
4347       {
4348         mcIdType szArr,sw,iTypppArr;
4349         std::vector<mcIdType> stdvecTyyppArr;
4350         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4351         self->renumberCells(tmp,check);
4352       }
4353       
4354       void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4355       {
4356         mcIdType szArr,sw,iTypppArr;
4357         std::vector<mcIdType> stdvecTyyppArr;
4358         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4359         self->renumberCellsWithoutMesh(tmp,check);
4360       }
4361       
4362       void renumberNodes(PyObject *li, double eps=1e-15)
4363       {
4364         mcIdType szArr,sw,iTypppArr;
4365         std::vector<mcIdType> stdvecTyyppArr;
4366         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4367         self->renumberNodes(tmp,eps);
4368       }
4369
4370       void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
4371       {
4372         mcIdType szArr,sw,iTypppArr;
4373         std::vector<mcIdType> stdvecTyyppArr;
4374         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4375         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4376       }
4377
4378       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4379       {
4380         return fieldT_buildSubPart(self,li);
4381       }
4382
4383       MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4384       {
4385         return fieldT__getitem__(self,li);
4386       }
4387
4388       PyObject *getMaxValue2() const
4389       {
4390         DataArrayIdType *tmp;
4391         double r1=self->getMaxValue2(tmp);
4392         PyObject *ret=PyTuple_New(2);
4393         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4394         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4395         return ret;
4396       }
4397       
4398       PyObject *getMinValue2() const
4399       {
4400         DataArrayIdType *tmp;
4401         double r1=self->getMinValue2(tmp);
4402         PyObject *ret=PyTuple_New(2);
4403         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4404         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4405         return ret;
4406       }
4407       
4408       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4409       {
4410         std::vector<std::size_t> tmp;
4411         convertPyToNewIntArr3(li,tmp);
4412         return self->keepSelectedComponents(tmp);
4413       }
4414
4415       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4416       {
4417         std::vector<std::size_t> tmp;
4418         convertPyToNewIntArr3(li,tmp);
4419         self->setSelectedComponents(f,tmp);
4420       }
4421
4422       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4423       {
4424         double val,val2;
4425         DataArrayDouble *a,*a2;
4426         DataArrayDoubleTuple *aa,*aa2;
4427         std::vector<double> bb,bb2;
4428         mcIdType sw;
4429         int spaceDim=3;
4430         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4431         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4432         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4433         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4434         //
4435         return self->extractSlice3D(orig,vect,eps);
4436       }
4437
4438       MEDCouplingFieldDouble *__add__(PyObject *obj)
4439       {
4440         return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4441       }
4442
4443       MEDCouplingFieldDouble *__radd__(PyObject *obj)
4444       {
4445         return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4446       }
4447
4448       MEDCouplingFieldDouble *__sub__(PyObject *obj)
4449       {
4450         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.";
4451         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4452         void *argp;
4453         //
4454         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4455           {
4456             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4457             if(other)
4458               return (*self)-(*other);
4459             else
4460               throw INTERP_KERNEL::Exception(msg);
4461           }
4462         //
4463         double val;
4464         DataArrayDouble *a;
4465         DataArrayDoubleTuple *aa;
4466         std::vector<double> bb;
4467         mcIdType sw;
4468         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4469         switch(sw)
4470           {
4471           case 1:
4472             {
4473               if(!self->getArray())
4474                 throw INTERP_KERNEL::Exception(msg2);
4475               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4476               ret->applyLin(1.,-val);
4477               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4478               ret2->setArray(ret);
4479               return ret2.retn();
4480             }
4481           case 2:
4482             {
4483               if(!self->getArray())
4484                 throw INTERP_KERNEL::Exception(msg2);
4485               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4486               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4487               ret2->setArray(ret);
4488               return ret2.retn();
4489             }
4490           case 3:
4491             {
4492               if(!self->getArray())
4493                 throw INTERP_KERNEL::Exception(msg2);
4494               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4495               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4496               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4497               ret2->setArray(ret);
4498               return ret2.retn();
4499             }
4500           case 4:
4501             {
4502               if(!self->getArray())
4503                 throw INTERP_KERNEL::Exception(msg2);
4504               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4505               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4506               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4507               ret2->setArray(ret);
4508               return ret2.retn();
4509             }
4510           default:
4511             { throw INTERP_KERNEL::Exception(msg); }
4512           }
4513       }
4514
4515       MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4516       {
4517         return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4518       }
4519
4520       MEDCouplingFieldDouble *__mul__(PyObject *obj)
4521       {
4522         return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4523       }
4524
4525       MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4526       {
4527         return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4528       }
4529
4530       MEDCouplingFieldDouble *__div__(PyObject *obj)
4531       {
4532         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.";
4533         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4534         void *argp;
4535         //
4536         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4537           {
4538             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4539             if(other)
4540               return (*self)/(*other);
4541             else
4542               throw INTERP_KERNEL::Exception(msg);
4543           }
4544         //
4545         double val;
4546         DataArrayDouble *a;
4547         DataArrayDoubleTuple *aa;
4548         std::vector<double> bb;
4549         mcIdType sw;
4550         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4551         switch(sw)
4552           {
4553           case 1:
4554             {
4555               if(val==0.)
4556                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4557               if(!self->getArray())
4558                 throw INTERP_KERNEL::Exception(msg2);
4559               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4560               ret->applyLin(1./val,0);
4561               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4562               ret2->setArray(ret);
4563               return ret2.retn();
4564             }
4565           case 2:
4566             {
4567               if(!self->getArray())
4568                 throw INTERP_KERNEL::Exception(msg2);
4569               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4570               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4571               ret2->setArray(ret);
4572               return ret2.retn();
4573             }
4574           case 3:
4575             {
4576               if(!self->getArray())
4577                 throw INTERP_KERNEL::Exception(msg2);
4578               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4579               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4580               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4581               ret2->setArray(ret);
4582               return ret2.retn();
4583             }
4584           case 4:
4585             {
4586               if(!self->getArray())
4587                 throw INTERP_KERNEL::Exception(msg2);
4588               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4589               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4590               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4591               ret2->setArray(ret);
4592               return ret2.retn();
4593             }
4594           default:
4595             { throw INTERP_KERNEL::Exception(msg); }
4596           }
4597       }
4598
4599       MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4600       {
4601         return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4602       }
4603
4604       MEDCouplingFieldDouble *__pow__(PyObject *obj)
4605       {
4606         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.";
4607         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4608         void *argp;
4609         //
4610         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4611           {
4612             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4613             if(other)
4614               return (*self)^(*other);
4615             else
4616               throw INTERP_KERNEL::Exception(msg);
4617           }
4618         //
4619         double val;
4620         DataArrayDouble *a;
4621         DataArrayDoubleTuple *aa;
4622         std::vector<double> bb;
4623         mcIdType sw;
4624         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4625         switch(sw)
4626           {
4627           case 1:
4628             {
4629               if(!self->getArray())
4630                 throw INTERP_KERNEL::Exception(msg2);
4631               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4632               ret->applyPow(val);
4633               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4634               ret2->setArray(ret);
4635               return ret2.retn();
4636             }
4637           case 2:
4638             {
4639               if(!self->getArray())
4640                 throw INTERP_KERNEL::Exception(msg2);
4641               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4642               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4643               ret2->setArray(ret);
4644               return ret2.retn();
4645             }
4646           case 3:
4647             {
4648               if(!self->getArray())
4649                 throw INTERP_KERNEL::Exception(msg2);
4650               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4651               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4652               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4653               ret2->setArray(ret);
4654               return ret2.retn();
4655             }
4656           case 4:
4657             {
4658               if(!self->getArray())
4659                 throw INTERP_KERNEL::Exception(msg2);
4660               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4661               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4662               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4663               ret2->setArray(ret);
4664               return ret2.retn();
4665             }
4666           default:
4667             { throw INTERP_KERNEL::Exception(msg); }
4668           }
4669       }
4670
4671       MEDCouplingFieldDouble *__neg__() const
4672       {
4673         return self->negate();
4674       }
4675
4676       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4677       {
4678         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.";
4679         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4680         void *argp;
4681         //
4682         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4683           {
4684             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4685             if(other)
4686               {
4687                 *self+=*other;
4688                 Py_XINCREF(trueSelf);
4689                 return trueSelf;
4690               }
4691             else
4692               throw INTERP_KERNEL::Exception(msg);
4693           }
4694         //
4695         double val;
4696         DataArrayDouble *a;
4697         DataArrayDoubleTuple *aa;
4698         std::vector<double> bb;
4699         mcIdType sw;
4700         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4701         switch(sw)
4702           {
4703           case 1:
4704             {
4705               if(!self->getArray())
4706                 throw INTERP_KERNEL::Exception(msg2);
4707               self->getArray()->applyLin(1.,val);
4708               Py_XINCREF(trueSelf);
4709               return trueSelf;
4710             }
4711           case 2:
4712             {
4713               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4714               ret2->setArray(a);
4715               *self+=*ret2;
4716               Py_XINCREF(trueSelf);
4717               return trueSelf;
4718             }
4719           case 3:
4720             {
4721               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4722               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4723               ret2->setArray(aaa);
4724               *self+=*ret2;
4725               Py_XINCREF(trueSelf);
4726               return trueSelf;
4727             }
4728           case 4:
4729             {
4730               if(!self->getArray())
4731                 throw INTERP_KERNEL::Exception(msg2);
4732               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4733               self->getArray()->addEqual(aaa);
4734               Py_XINCREF(trueSelf);
4735               return trueSelf;
4736             }
4737           default:
4738             { throw INTERP_KERNEL::Exception(msg); }
4739           }
4740       }
4741
4742       PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4743       {
4744         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.";
4745         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4746         void *argp;
4747         //
4748         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4749           {
4750             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4751             if(other)
4752               {
4753                 *self-=*other;
4754                 Py_XINCREF(trueSelf);
4755                 return trueSelf;
4756               }
4757             else
4758               throw INTERP_KERNEL::Exception(msg);
4759           }
4760         //
4761         double val;
4762         DataArrayDouble *a;
4763         DataArrayDoubleTuple *aa;
4764         std::vector<double> bb;
4765         mcIdType sw;
4766         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4767         switch(sw)
4768           {
4769           case 1:
4770             {
4771               if(!self->getArray())
4772                 throw INTERP_KERNEL::Exception(msg2);
4773               self->getArray()->applyLin(1.,-val);
4774               Py_XINCREF(trueSelf);
4775               return trueSelf;
4776             }
4777           case 2:
4778             {
4779               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4780               ret2->setArray(a);
4781               *self-=*ret2;
4782               Py_XINCREF(trueSelf);
4783               return trueSelf;
4784             }
4785           case 3:
4786             {
4787               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4788               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4789               ret2->setArray(aaa);
4790               *self-=*ret2;
4791               Py_XINCREF(trueSelf);
4792               return trueSelf;
4793             }
4794           case 4:
4795             {
4796               if(!self->getArray())
4797                 throw INTERP_KERNEL::Exception(msg2);
4798               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4799               self->getArray()->substractEqual(aaa);
4800               Py_XINCREF(trueSelf);
4801               return trueSelf;
4802             }
4803           default:
4804             { throw INTERP_KERNEL::Exception(msg); }
4805           }
4806       }
4807
4808       PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4809       {
4810         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.";
4811         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4812         void *argp;
4813         //
4814         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4815           {
4816             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4817             if(other)
4818               {
4819                 *self*=*other;
4820                 Py_XINCREF(trueSelf);
4821                 return trueSelf;
4822               }
4823             else
4824               throw INTERP_KERNEL::Exception(msg);
4825           }
4826         //
4827         double val;
4828         DataArrayDouble *a;
4829         DataArrayDoubleTuple *aa;
4830         std::vector<double> bb;
4831         mcIdType sw;
4832         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4833         switch(sw)
4834           {
4835           case 1:
4836             {
4837               if(!self->getArray())
4838                 throw INTERP_KERNEL::Exception(msg2);
4839               self->getArray()->applyLin(val,0);
4840               Py_XINCREF(trueSelf);
4841               return trueSelf;
4842             }
4843           case 2:
4844             {
4845               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4846               ret2->setArray(a);
4847               *self*=*ret2;
4848               Py_XINCREF(trueSelf);
4849               return trueSelf;
4850             }
4851           case 3:
4852             {
4853               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4854               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4855               ret2->setArray(aaa);
4856               *self*=*ret2;
4857               Py_XINCREF(trueSelf);
4858               return trueSelf;
4859             }
4860           case 4:
4861             {
4862               if(!self->getArray())
4863                 throw INTERP_KERNEL::Exception(msg2);
4864               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4865               self->getArray()->multiplyEqual(aaa);
4866               Py_XINCREF(trueSelf);
4867               return trueSelf;
4868             }
4869           default:
4870             { throw INTERP_KERNEL::Exception(msg); }
4871           }
4872       }
4873
4874       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4875       {
4876         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.";
4877         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4878         void *argp;
4879         //
4880         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4881           {
4882             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4883             if(other)
4884               {
4885                 *self/=*other;
4886                 Py_XINCREF(trueSelf);
4887                 return trueSelf;
4888               }
4889             else
4890               throw INTERP_KERNEL::Exception(msg);
4891           }
4892         //
4893         double val;
4894         DataArrayDouble *a;
4895         DataArrayDoubleTuple *aa;
4896         std::vector<double> bb;
4897         mcIdType sw;
4898         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4899         switch(sw)
4900           {
4901           case 1:
4902             {
4903               if(val==0.)
4904                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4905               if(!self->getArray())
4906                 throw INTERP_KERNEL::Exception(msg2);
4907               self->getArray()->applyLin(1./val,0);
4908               Py_XINCREF(trueSelf);
4909               return trueSelf;
4910             }
4911           case 2:
4912             {
4913               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4914               ret2->setArray(a);
4915               *self/=*ret2;
4916               Py_XINCREF(trueSelf);
4917               return trueSelf;
4918             }
4919           case 3:
4920             {
4921               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4922               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4923               ret2->setArray(aaa);
4924               *self/=*ret2;
4925               Py_XINCREF(trueSelf);
4926               return trueSelf;
4927             }
4928           case 4:
4929             {
4930               if(!self->getArray())
4931                 throw INTERP_KERNEL::Exception(msg2);
4932               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4933               self->getArray()->divideEqual(aaa);
4934               Py_XINCREF(trueSelf);
4935               return trueSelf;
4936             }
4937           default:
4938             { throw INTERP_KERNEL::Exception(msg); }
4939           }
4940       }
4941
4942       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4943       {
4944         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.";
4945         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4946         void *argp;
4947         //
4948         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4949           {
4950             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4951             if(other)
4952               {
4953                 *self^=*other;
4954                 Py_XINCREF(trueSelf);
4955                 return trueSelf;
4956               }
4957             else
4958               throw INTERP_KERNEL::Exception(msg);
4959           }
4960         //
4961         double val;
4962         DataArrayDouble *a;
4963         DataArrayDoubleTuple *aa;
4964         std::vector<double> bb;
4965         mcIdType sw;
4966         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4967         switch(sw)
4968           {
4969           case 1:
4970             {
4971               if(!self->getArray())
4972                 throw INTERP_KERNEL::Exception(msg2);
4973               self->getArray()->applyPow(val);
4974               Py_XINCREF(trueSelf);
4975               return trueSelf;
4976             }
4977           case 2:
4978             {
4979               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4980               ret2->setArray(a);
4981               *self^=*ret2;
4982               Py_XINCREF(trueSelf);
4983               return trueSelf;
4984             }
4985           case 3:
4986             {
4987               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4988               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4989               ret2->setArray(aaa);
4990               *self^=*ret2;
4991               Py_XINCREF(trueSelf);
4992               return trueSelf;
4993             }
4994           case 4:
4995             {
4996               if(!self->getArray())
4997                 throw INTERP_KERNEL::Exception(msg2);
4998               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4999               self->getArray()->powEqual(aaa);
5000               Py_XINCREF(trueSelf);
5001               return trueSelf;
5002             }
5003           default:
5004             { throw INTERP_KERNEL::Exception(msg); }
5005           }
5006       }
5007
5008       static MEDCouplingFieldDouble *MergeFields(PyObject *li)
5009       {
5010         std::vector<const MEDCouplingFieldDouble *> tmp;
5011         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5012         return MEDCouplingFieldDouble::MergeFields(tmp);
5013       }
5014
5015       static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
5016       {
5017         std::vector<const MEDCouplingFieldDouble *> tmp;
5018         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5019         return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5020       }
5021
5022       PyObject *getTinySerializationInformation() const
5023       {
5024         return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5025       }
5026       
5027       PyObject *serialize() const
5028       {
5029         return field_serialize<double>(self);
5030       }
5031
5032       PyObject *__getstate__() const
5033       {
5034         return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5035       }
5036       
5037       void __setstate__(PyObject *inp)
5038       {
5039         field__setstate__<double>(self,inp);
5040       }
5041     }
5042   };
5043
5044   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5045   {
5046   public:
5047     int getNumberOfFields() const;
5048     MEDCouplingMultiFields *deepCopy() const;
5049     virtual std::string simpleRepr() const;
5050     virtual std::string advancedRepr() const;
5051     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5052     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5053     virtual void checkConsistencyLight() const;
5054     %extend
5055        {
5056          std::string __str__() const
5057          {
5058            return self->simpleRepr();
5059          }
5060          static MEDCouplingMultiFields *New(PyObject *li)
5061          {
5062            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5063            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5064            std::size_t sz=tmp.size();
5065            std::vector<MEDCouplingFieldDouble *> fs(sz);
5066            for(std::size_t i=0;i<sz;i++)
5067              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5068            return MEDCouplingMultiFields::New(fs);
5069          }
5070          MEDCouplingMultiFields(PyObject *li)
5071          {
5072            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5073            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5074            std::size_t sz=tmp.size();
5075            std::vector<MEDCouplingFieldDouble *> fs(sz);
5076            for(std::size_t i=0;i<sz;i++)
5077              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5078            return MEDCouplingMultiFields::New(fs);
5079          }
5080          PyObject *getFields() const
5081          {
5082            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5083            std::size_t sz=fields.size();
5084            PyObject *res = PyList_New(sz);
5085            for(std::size_t i=0;i<sz;i++)
5086              {
5087                if(fields[i])
5088                  {
5089                    fields[i]->incrRef();
5090                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5091                  }
5092                else
5093                  {
5094                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5095                  }
5096              }
5097            return res;
5098          }
5099          PyObject *getFieldAtPos(int id) const
5100          {
5101            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5102            if(ret)
5103              {
5104                ret->incrRef();
5105                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5106              }
5107            else
5108              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5109          }
5110          PyObject *getMeshes() const
5111          {
5112            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5113            std::size_t sz=ms.size();
5114            PyObject *res = PyList_New(sz);
5115            for(std::size_t i=0;i<sz;i++)
5116              {
5117                if(ms[i])
5118                  {
5119                    ms[i]->incrRef();
5120                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5121                  }
5122                else
5123                  {
5124                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5125                  }
5126              }
5127            return res;
5128          }
5129          PyObject *getDifferentMeshes() const
5130          {
5131            std::vector<int> refs;
5132            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5133            std::size_t sz=ms.size();
5134            PyObject *res = PyList_New(sz);
5135            for(std::size_t i=0;i<sz;i++)
5136              {
5137                if(ms[i])
5138                  {
5139                    ms[i]->incrRef();
5140                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5141                  }
5142                else
5143                  {
5144                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5145                  }
5146              }
5147            //
5148            PyObject *ret=PyTuple_New(2);
5149            PyTuple_SetItem(ret,0,res);
5150            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5151            return ret;
5152          }
5153          PyObject *getArrays() const
5154          {
5155            std::vector<DataArrayDouble *> ms=self->getArrays();
5156            std::size_t sz=ms.size();
5157            PyObject *res = PyList_New(sz);
5158            for(std::size_t i=0;i<sz;i++)
5159              {
5160                if(ms[i])
5161                  {
5162                    ms[i]->incrRef();
5163                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5164                  }
5165                else
5166                  {
5167                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5168                  }
5169              }
5170            return res;
5171          }
5172          PyObject *getDifferentArrays() const
5173          {
5174            std::vector< std::vector<int> > refs;
5175            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5176            std::size_t sz=ms.size();
5177            PyObject *res = PyList_New(sz);
5178            PyObject *res2 = PyList_New(sz);
5179            for(std::size_t i=0;i<sz;i++)
5180              {
5181                if(ms[i])
5182                  {
5183                    ms[i]->incrRef();
5184                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5185                  }
5186                else
5187                  {
5188                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5189                  }
5190                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5191              }
5192            //
5193            PyObject *ret=PyTuple_New(2);
5194            PyTuple_SetItem(ret,0,res);
5195            PyTuple_SetItem(ret,1,res2);
5196            return ret;
5197          }
5198        }
5199   };
5200
5201   class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
5202   {
5203   public:
5204     static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5205     static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5206     bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5207     bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5208     void setTimeUnit(const std::string& unit);
5209     std::string getTimeUnit() const;
5210     void setTime(double val, int iteration, int order);
5211     void setArray(DataArrayInt32 *array);
5212     MEDCouplingFieldInt32 *deepCopy() const;
5213     MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
5214     MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
5215     MEDCouplingFieldDouble *convertToDblField() const;
5216     MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
5217     %extend {
5218       MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5219       {
5220         return MEDCouplingFieldInt32::New(type,td);
5221       }
5222
5223       MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5224       {
5225         return MEDCouplingFieldInt32::New(ft,td);
5226       }
5227
5228       PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
5229       {
5230         std::string ret1;
5231         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5232         PyObject *ret=PyTuple_New(2);
5233         PyObject *ret0Py=ret0?Py_True:Py_False;
5234         Py_XINCREF(ret0Py);
5235         PyTuple_SetItem(ret,0,ret0Py);
5236         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5237         return ret;
5238       }
5239       
5240       std::string __str__() const
5241       {
5242         return self->simpleRepr();
5243       }
5244
5245       std::string __repr__() const
5246       {
5247         std::ostringstream oss;
5248         self->reprQuickOverview(oss);
5249         return oss.str();
5250       }
5251
5252       MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
5253       {
5254         return fieldT_buildSubPart(self,li);
5255       }
5256
5257       MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
5258       {
5259         return fieldT__getitem__(self,li);
5260       }
5261
5262       DataArrayInt32 *getArray()
5263       {
5264         DataArrayInt32 *ret=self->getArray();
5265         if(ret)
5266           ret->incrRef();
5267         return ret;
5268       }
5269       
5270       PyObject *getTime()
5271         {
5272         int tmp1,tmp2;
5273         double tmp0=self->getTime(tmp1,tmp2);
5274         PyObject *res = PyList_New(3);
5275         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5276         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5277         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5278         return res;
5279         }
5280
5281       PyObject *getTinySerializationInformation() const
5282       {
5283         return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
5284       }
5285       
5286       PyObject *serialize() const
5287       {
5288         return field_serialize<int>(self);
5289       }
5290
5291       PyObject *__getstate__() const
5292       {
5293         return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
5294       }
5295       
5296       void __setstate__(PyObject *inp)
5297       {
5298         field__setstate__<int>(self,inp);
5299       }
5300     }
5301   };
5302
5303   class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
5304   {
5305   public:
5306     static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5307     static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5308     bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5309     bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5310     void setTimeUnit(const std::string& unit);
5311     std::string getTimeUnit() const;
5312     void setTime(double val, int iteration, int order);
5313     void setArray(DataArrayInt64 *array);
5314     MEDCouplingFieldInt64 *deepCopy() const;
5315     MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
5316     MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
5317     MEDCouplingFieldDouble *convertToDblField() const;
5318     MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
5319     %extend {
5320       MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5321       {
5322         return MEDCouplingFieldInt64::New(type,td);
5323       }
5324
5325       MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5326       {
5327         return MEDCouplingFieldInt64::New(ft,td);
5328       }
5329
5330       PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
5331       {
5332         std::string ret1;
5333         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5334         PyObject *ret=PyTuple_New(2);
5335         PyObject *ret0Py=ret0?Py_True:Py_False;
5336         Py_XINCREF(ret0Py);
5337         PyTuple_SetItem(ret,0,ret0Py);
5338         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5339         return ret;
5340       }
5341       
5342       std::string __str__() const
5343       {
5344         return self->simpleRepr();
5345       }
5346
5347       std::string __repr__() const
5348       {
5349         std::ostringstream oss;
5350         self->reprQuickOverview(oss);
5351         return oss.str();
5352       }
5353
5354       MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
5355       {
5356         return fieldT_buildSubPart(self,li);
5357       }
5358
5359       MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
5360       {
5361         return fieldT__getitem__(self,li);
5362       }
5363
5364       DataArrayInt64 *getArray()
5365       {
5366         DataArrayInt64 *ret=self->getArray();
5367         if(ret)
5368           ret->incrRef();
5369         return ret;
5370       }
5371       
5372       PyObject *getTime()
5373         {
5374         int tmp1,tmp2;
5375         double tmp0=self->getTime(tmp1,tmp2);
5376         PyObject *res = PyList_New(3);
5377         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5378         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5379         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5380         return res;
5381         }
5382
5383       PyObject *getTinySerializationInformation() const
5384       {
5385         return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
5386       }
5387       
5388       PyObject *serialize() const
5389       {
5390         return field_serialize<Int64>(self);
5391       }
5392
5393       PyObject *__getstate__() const
5394       {
5395         return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
5396       }
5397       
5398       void __setstate__(PyObject *inp)
5399       {
5400         field__setstate__<Int64>(self,inp);
5401       }
5402     }
5403   };
5404
5405   class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5406   {
5407   public:
5408     static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5409     static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5410     bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5411     bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5412     void setTimeUnit(const std::string& unit);
5413     std::string getTimeUnit() const;
5414     void setTime(double val, int iteration, int order);
5415     void setArray(DataArrayFloat *array);
5416     MEDCouplingFieldFloat *deepCopy() const;
5417     MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5418     MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5419     MEDCouplingFieldDouble *convertToDblField() const;
5420     MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5421     %extend {
5422       MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5423       {
5424         return MEDCouplingFieldFloat::New(type,td);
5425       }
5426
5427       MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5428       {
5429         return MEDCouplingFieldFloat::New(ft,td);
5430       }
5431
5432       PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5433       {
5434         std::string ret1;
5435         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5436         PyObject *ret=PyTuple_New(2);
5437         PyObject *ret0Py=ret0?Py_True:Py_False;
5438         Py_XINCREF(ret0Py);
5439         PyTuple_SetItem(ret,0,ret0Py);
5440         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5441         return ret;
5442       }
5443
5444       std::string __str__() const
5445       {
5446         return self->simpleRepr();
5447       }
5448
5449       std::string __repr__() const
5450       {
5451         std::ostringstream oss;
5452         self->reprQuickOverview(oss);
5453         return oss.str();
5454       }
5455
5456       MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5457       {
5458         return fieldT_buildSubPart(self,li);
5459       }
5460
5461       MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5462       {
5463         return fieldT__getitem__(self,li);
5464       }
5465
5466       DataArrayFloat *getArray()
5467       {
5468         DataArrayFloat *ret=self->getArray();
5469         if(ret)
5470           ret->incrRef();
5471         return ret;
5472       }
5473       
5474       PyObject *getTime()
5475       {
5476         int tmp1,tmp2;
5477         double tmp0=self->getTime(tmp1,tmp2);
5478         PyObject *res = PyList_New(3);
5479         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5480         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5481         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5482         return res;
5483       }
5484
5485       PyObject *getTinySerializationInformation() const
5486       {
5487         return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5488       }
5489       
5490       PyObject *serialize() const
5491       {
5492         return field_serialize<float>(self);
5493       }
5494       
5495       PyObject *__getstate__() const
5496       {
5497         return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5498       }
5499         
5500       void __setstate__(PyObject *inp)
5501       {
5502         field__setstate__<float>(self,inp);
5503       }
5504     }
5505   };
5506   
5507   class MEDCouplingDefinitionTime
5508   {
5509   public:
5510     MEDCouplingDefinitionTime();
5511     void assign(const MEDCouplingDefinitionTime& other);
5512     bool isEqual(const MEDCouplingDefinitionTime& other) const;
5513     double getTimeResolution() const;
5514     std::vector<double> getHotSpotsTime() const;
5515     %extend
5516       {
5517         std::string __str__() const
5518           {
5519             std::ostringstream oss;
5520             self->appendRepr(oss);
5521             return oss.str();
5522           }
5523
5524         PyObject *getIdsOnTimeRight(double tm) const
5525         {
5526           int meshId,arrId,arrIdInField,fieldId;
5527           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5528           PyObject *res=PyList_New(4);
5529           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5530           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5531           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5532           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5533           return res;
5534         }
5535
5536         PyObject *getIdsOnTimeLeft(double tm) const
5537         {
5538           int meshId,arrId,arrIdInField,fieldId;
5539           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5540           PyObject *res=PyList_New(4);
5541           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5542           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5543           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5544           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5545           return res;
5546         }
5547       }
5548   };
5549
5550   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5551   {
5552   public:
5553     double getTimeTolerance() const;
5554     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5555     
5556     %extend
5557       {
5558         MEDCouplingFieldOverTime(PyObject *li)
5559           {
5560             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5561             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5562             std::size_t sz=tmp.size();
5563             std::vector<MEDCouplingFieldDouble *> fs(sz);
5564             for(std::size_t i=0;i<sz;i++)
5565               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5566             return MEDCouplingFieldOverTime::New(fs);
5567           }
5568         std::string __str__() const
5569           {
5570             return self->simpleRepr();
5571           }
5572         static MEDCouplingFieldOverTime *New(PyObject *li)
5573           {
5574             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5575             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5576             std::size_t sz=tmp.size();
5577             std::vector<MEDCouplingFieldDouble *> fs(sz);
5578             for(std::size_t i=0;i<sz;i++)
5579               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5580             return MEDCouplingFieldOverTime::New(fs);
5581           }
5582       }
5583   };
5584
5585   class MEDCouplingCartesianAMRMesh;
5586   
5587   class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5588   {
5589   public:
5590     int getNumberOfCellsRecursiveWithOverlap() const;
5591     int getNumberOfCellsRecursiveWithoutOverlap() const;
5592     int getMaxNumberOfLevelsRelativeToThis() const;
5593     %extend
5594     {
5595       MEDCouplingCartesianAMRMeshGen *getMesh() const
5596       {
5597         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5598         if(ret)
5599           ret->incrRef();
5600         return ret;
5601       }
5602     }
5603   };
5604
5605   class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5606   {
5607   public:
5608     int getNumberOfOverlapedCellsForFather() const;
5609     bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5610     std::vector<mcIdType> computeCellGridSt() const;
5611     %extend
5612     {
5613       PyObject *getBLTRRange() const
5614       {
5615         const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
5616         return convertFromVectorPairInt(ret);
5617       }
5618
5619       PyObject *getBLTRRangeRelativeToGF() const
5620       {
5621         std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
5622         return convertFromVectorPairInt(ret);
5623       }
5624
5625       void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5626       {
5627         std::vector< std::pair<mcIdType,mcIdType> > inp;
5628         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5629         self->addPatch(inp,factors);
5630       }
5631
5632       MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5633       {
5634         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5635         if(!mesh)
5636           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5637         if(patchId==mesh->getNumberOfPatches())
5638           {
5639             std::ostringstream oss;
5640             oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5641             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5642             return 0;
5643           }
5644         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5645         if(ret)
5646           ret->incrRef();
5647         return ret;
5648       }
5649
5650       void __delitem__(mcIdType patchId)
5651       {
5652         MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5653         if(!mesh)
5654           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5655         mesh->removePatch(patchId);
5656       }
5657
5658       mcIdType __len__() const
5659       {
5660         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5661         if(!mesh)
5662           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5663         return mesh->getNumberOfPatches();
5664       }
5665     }
5666   };
5667
5668   class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5669   {
5670   };
5671   
5672   class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5673   {
5674   public:
5675     mcIdType getAbsoluteLevel() const;
5676     mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5677     std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5678     int getSpaceDimension() const;
5679     const std::vector<mcIdType>& getFactors() const;
5680     void setFactors(const std::vector<mcIdType>& newFactors);
5681     mcIdType getMaxNumberOfLevelsRelativeToThis() const;
5682     mcIdType getNumberOfCellsAtCurrentLevel() const;
5683     mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
5684     mcIdType getNumberOfCellsRecursiveWithOverlap() const;
5685     mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
5686     bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
5687    virtual void detachFromFather();
5688     //
5689     mcIdType getNumberOfPatches() const;
5690     mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5691     MEDCouplingUMesh *buildUnstructured() const;
5692     DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
5693     std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5694     MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5695     MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5696     void removeAllPatches();
5697     void removePatch(mcIdType patchId);
5698     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
5699     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
5700     DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
5701     void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5702     void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
5703     void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
5704     void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5705     void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5706     void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
5707     DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5708     std::string buildPythonDumpOfThis() const;
5709     %extend
5710     {
5711       void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5712       {
5713         std::vector< std::pair<mcIdType,mcIdType> > inp;
5714         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5715         self->addPatch(inp,factors);
5716       }
5717
5718       PyObject *getPatches() const
5719       {
5720         std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5721         std::size_t sz(ps.size());
5722         PyObject *ret = PyList_New(sz);
5723         for(std::size_t i=0;i<sz;i++)
5724           {
5725             MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5726             if(elt)
5727               elt->incrRef();
5728             PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5729           }
5730         return ret;
5731       }
5732
5733       // agy : don't know why typemap fails here ??? let it in the extend section
5734       PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5735       {
5736         return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5737       }
5738
5739       MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
5740       {
5741         const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5742         MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5743         if(ret2)
5744           ret2->incrRef();
5745         return ret2;
5746       }
5747
5748       MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
5749       {
5750         const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5751         MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5752         if(ret2)
5753           ret2->incrRef();
5754         return ret2;
5755       }
5756
5757       virtual PyObject *positionRelativeToGodFather() const
5758       {
5759         std::vector<mcIdType> out1;
5760         std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
5761         PyObject *ret(PyTuple_New(2));
5762         PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5763         PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5764         return ret;
5765       }
5766
5767       virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
5768       {
5769         std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5770         std::size_t sz(ps.size());
5771         PyObject *ret = PyList_New(sz);
5772         for(std::size_t i=0;i<sz;i++)
5773           PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5774         return ret;
5775       }
5776
5777       MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
5778       {
5779         std::vector<const DataArrayDouble *> inp;
5780         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5781         return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5782       }
5783
5784       virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5785       {
5786         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5787         if(ret)
5788           ret->incrRef();
5789         return ret;
5790       }
5791       
5792       virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5793       {
5794         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5795         if(ret)
5796           ret->incrRef();
5797         return ret;
5798       }
5799
5800       MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
5801       {
5802         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5803         if(ret)
5804           ret->incrRef();
5805         return ret;
5806       }
5807
5808       MEDCouplingIMesh *getImageMesh() const
5809       {
5810         const MEDCouplingIMesh *ret(self->getImageMesh());
5811         if(ret)
5812           ret->incrRef();
5813         return const_cast<MEDCouplingIMesh *>(ret);
5814       }
5815
5816       MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5817       {
5818         if(patchId==self->getNumberOfPatches())
5819           {
5820             std::ostringstream oss;
5821             oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5822             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5823             return 0;
5824           }
5825         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5826         if(ret)
5827           ret->incrRef();
5828         return ret;
5829       }
5830
5831       void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5832       {
5833         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5834         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5835         self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5836       }
5837
5838       void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
5839       {
5840         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5841         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5842         self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5843       }
5844
5845       void __delitem__(mcIdType patchId)
5846       {
5847         self->removePatch(patchId);
5848       }
5849
5850       mcIdType __len__() const
5851       {
5852         return self->getNumberOfPatches();
5853       }
5854     }
5855   };
5856
5857   class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5858   {
5859   };
5860
5861   class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5862   {
5863   public:
5864     static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5865     %extend
5866     {
5867       static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5868       {
5869         static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5870         static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5871         const mcIdType *nodeStrctPtr(0);
5872         const double *originPtr(0),*dxyzPtr(0);
5873         mcIdType sw,sz,val0;
5874         std::vector<mcIdType> bb0;
5875         nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5876         //
5877         double val,val2;
5878         std::vector<double> bb,bb2;
5879         mcIdType sz1,sz2;
5880         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5881         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5882         //
5883         return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5884       }
5885
5886       void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5887       {
5888         std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5889         convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5890         std::vector< std::vector<mcIdType> > inp2;
5891         convertPyToVectorOfVectorOfInt(factors,inp2);
5892         self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5893       }
5894
5895       MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5896       {
5897         return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5898       }
5899
5900       MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5901       {
5902         return MEDCouplingCartesianAMRMesh::New(mesh);
5903       }
5904     }
5905   };
5906
5907   class MEDCouplingDataForGodFather : public RefCountObject
5908   {
5909   public:
5910     virtual void synchronizeFineToCoarse();
5911     virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
5912     virtual void synchronizeCoarseToFine();
5913     virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
5914     virtual void synchronizeAllGhostZones();
5915     virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5916     virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
5917     virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
5918     virtual void alloc();
5919     virtual void dealloc();
5920     %extend
5921     {
5922       MEDCouplingCartesianAMRMesh *getMyGodFather()
5923       {
5924         MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5925         if(ret)
5926           ret->incrRef();
5927         return ret;
5928       }
5929     }
5930   };
5931   
5932   class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5933   {
5934   public:
5935     mcIdType getNumberOfLevels() const;
5936     MEDCouplingAMRAttribute *deepCopy() const;
5937     MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5938     MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5939     MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5940     MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5941     bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5942     MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5943     std::string writeVTHB(const std::string& fileName) const;
5944     %extend
5945     {
5946       static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5947       {
5948         std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5949         std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5950         MEDCouplingAMRAttribute *ret(0);
5951         try
5952           {
5953             convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5954             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5955           }
5956         catch(INTERP_KERNEL::Exception&)
5957           {
5958             convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5959             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5960           }
5961         return ret;
5962       }
5963
5964       MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5965       {
5966         return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5967       }
5968
5969       DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5970       {
5971         const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5972         DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5973         if(ret2)
5974           ret2->incrRef();
5975         return ret2;
5976       }
5977
5978       void spillInfoOnComponents(PyObject *compNames)
5979       {
5980         std::vector< std::vector<std::string> > compNamesCpp;
5981         convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5982         self->spillInfoOnComponents(compNamesCpp);
5983       }
5984
5985       void spillNatures(PyObject *nfs)
5986       {
5987         std::vector<mcIdType> inp0;
5988         if(!fillIntVector(nfs,inp0))
5989           throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5990         std::size_t sz(inp0.size());
5991         std::vector<NatureOfField> inp00(sz);
5992         for(std::size_t i=0;i<sz;i++)
5993           inp00[i]=(NatureOfField)inp0[i];
5994         self->spillNatures(inp00);
5995       }
5996       
5997       PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
5998       {
5999         std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
6000         std::size_t sz(ret.size());
6001         PyObject *retPy(PyList_New(sz));
6002         for(std::size_t i=0;i<sz;i++)
6003           PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
6004         return retPy;
6005       }
6006     }
6007   };
6008
6009   class DenseMatrix : public RefCountObject, public TimeLabel
6010   {
6011   public:
6012     static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
6013     static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
6014     DenseMatrix *deepCopy() const;
6015     DenseMatrix *shallowCpy() const;
6016     //
6017     mcIdType getNumberOfRows() const;
6018     mcIdType getNumberOfCols() const;
6019     mcIdType getNbOfElems() const;
6020     void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
6021     void reShape(mcIdType nbRows, mcIdType nbCols);
6022     void transpose();
6023     //
6024     bool isEqual(const DenseMatrix& other, double eps) const;
6025     DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
6026     static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
6027     %extend
6028     {
6029       DenseMatrix(mcIdType nbRows, mcIdType nbCols)
6030       {
6031         return DenseMatrix::New(nbRows,nbCols);
6032       }
6033
6034       DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
6035       {
6036         return DenseMatrix::New(array,nbRows,nbCols);
6037       }
6038
6039       PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
6040       {
6041         std::string ret1;
6042         bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
6043         PyObject *ret=PyTuple_New(2);
6044         PyObject *ret0Py=ret0?Py_True:Py_False;
6045         Py_XINCREF(ret0Py);
6046         PyTuple_SetItem(ret,0,ret0Py);
6047         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6048         return ret;
6049       }
6050
6051       DataArrayDouble *getData()
6052       {
6053         DataArrayDouble *ret(self->getData());
6054         if(ret)
6055           ret->incrRef();
6056         return ret;
6057       }
6058
6059       DenseMatrix *__add__(const DenseMatrix *other)
6060       {
6061         return MEDCoupling::DenseMatrix::Add(self,other);
6062       }
6063
6064       DenseMatrix *__sub__(const DenseMatrix *other)
6065       {
6066         return MEDCoupling::DenseMatrix::Substract(self,other);
6067       }
6068
6069       DenseMatrix *__mul__(const DenseMatrix *other)
6070       {
6071         return MEDCoupling::DenseMatrix::Multiply(self,other);
6072       }
6073
6074       DenseMatrix *__mul__(const DataArrayDouble *other)
6075       {
6076         return MEDCoupling::DenseMatrix::Multiply(self,other);
6077       }
6078
6079       PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
6080       {
6081         self->addEqual(other);
6082         Py_XINCREF(trueSelf);
6083         return trueSelf;
6084       }
6085
6086       PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
6087       {
6088         self->substractEqual(other);
6089         Py_XINCREF(trueSelf);
6090         return trueSelf;
6091       }
6092 #ifdef WITH_NUMPY
6093       PyObject *toNumPyMatrix() // not const. It is not a bug !
6094       {
6095         PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6096         return obj;
6097       }
6098 #endif
6099     }
6100   };
6101 }
6102
6103 %pythoncode %{
6104 def MEDCouplingUMeshReduce(self):
6105     return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6106 def MEDCouplingCMeshReduce(self):
6107     return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6108 def MEDCouplingIMeshReduce(self):
6109     return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6110 def MEDCouplingMappedExtrudedMeshReduce(self):
6111     return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6112 def MEDCouplingCurveLinearMeshReduce(self):
6113     return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6114 def MEDCoupling1SGTUMeshReduce(self):
6115     return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6116 def MEDCoupling1DGTUMeshReduce(self):
6117     return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6118 def MEDCouplingFieldDoubleReduce(self):
6119     self.checkConsistencyLight()
6120     d=(self.getTypeOfField(),self.getTimeDiscretization())
6121     return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6122 def MEDCouplingFieldInt32Reduce(self):
6123     self.checkConsistencyLight()
6124     d=(self.getTypeOfField(),self.getTimeDiscretization())
6125     return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
6126 def MEDCouplingFieldInt64Reduce(self):
6127     self.checkConsistencyLight()
6128     d=(self.getTypeOfField(),self.getTimeDiscretization())
6129     return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
6130 def MEDCouplingFieldFloatReduce(self):
6131     self.checkConsistencyLight()
6132     d=(self.getTypeOfField(),self.getTimeDiscretization())
6133     return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6134 def MEDCouplingFTReduceFunct(cls,params):
6135     a,b=params
6136     ret=object.__new__(cls)
6137     ret.__init__(*a)
6138     return ret
6139     
6140 def MEDCouplingFieldTemplateReduce(self):
6141     ret = MEDCouplingFieldDouble(self)
6142     nbTuples = self.getNumberOfTuplesExpected()
6143     arr = DataArrayDouble(nbTuples) ; arr[:] = 0.
6144     ret.setArray(arr)
6145     return MEDCouplingFTReduceFunct,(MEDCouplingFieldTemplate,((ret,),()))
6146 #
6147 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
6148 #
6149 MEDCouplingUMesh.ExtractFromIndexedArrays           = DataArrayInt.ExtractFromIndexedArrays
6150 MEDCouplingUMesh.ExtractFromIndexedArraysSlice      = DataArrayInt.ExtractFromIndexedArraysSlice
6151 MEDCouplingUMesh.SetPartOfIndexedArrays             = DataArrayInt.SetPartOfIndexedArrays
6152 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx      = DataArrayInt.SetPartOfIndexedArraysSameIdx
6153 MEDCouplingUMesh.RemoveIdsFromIndexedArrays         = DataArrayInt.RemoveIdsFromIndexedArrays
6154 MEDCouplingFieldInt = MEDCouplingFieldInt32
6155
6156 if MEDCouplingUse64BitIDs():
6157   MEDCouplingFieldID = MEDCouplingFieldInt64
6158 else:
6159   MEDCouplingFieldID = MEDCouplingFieldInt32
6160
6161 %}
6162
6163 %pythoncode %{
6164 import os
6165 __filename=os.environ.get('PYTHONSTARTUP')
6166 if __filename and os.path.isfile(__filename):
6167     with open(__filename) as __fp:
6168         exec(__fp.read())
6169 %}