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