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