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