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