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