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