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