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