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