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