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