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