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