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