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