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