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