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