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