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