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