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