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