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