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