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