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