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