Salome HOME
0ebb72521b532e395baf959a317624098ffa1fd7
[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     %extend {
2831       MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2832       {
2833         return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2834       }
2835
2836       MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2837       {
2838         return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2839       }
2840
2841       MEDCouplingMappedExtrudedMesh()
2842       {
2843         return MEDCouplingMappedExtrudedMesh::New();
2844       }
2845
2846       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2847       {
2848         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2849       }
2850       
2851       std::string __str__() const throw(INTERP_KERNEL::Exception)
2852       {
2853         return self->simpleRepr();
2854       }
2855
2856       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2857       {
2858         std::ostringstream oss;
2859         self->reprQuickOverview(oss);
2860         return oss.str();
2861       }
2862       
2863       PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2864       {
2865         MEDCouplingUMesh *ret=self->getMesh2D();
2866         if(ret)
2867           ret->incrRef();
2868         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2869       }
2870       PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2871       {
2872         MEDCouplingUMesh *ret=self->getMesh1D();
2873         if(ret)
2874           ret->incrRef();
2875         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2876       }
2877       PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2878       {
2879         DataArrayInt *ret=self->getMesh3DIds();
2880         if(ret)
2881           ret->incrRef();
2882         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
2883       } 
2884     }
2885   };
2886
2887   //== MEDCouplingMappedExtrudedMesh End
2888
2889   class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
2890   {
2891   public:
2892     static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2893     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2894     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2895     int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2896     virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2897     virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2898     %extend
2899     {
2900       virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2901       {
2902         int szArr,sw,iTypppArr;
2903         std::vector<int> stdvecTyyppArr;
2904         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2905         self->insertNextCell(tmp,tmp+szArr);
2906       }
2907
2908       virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2909       {
2910         DataArrayInt *ret=self->getNodalConnectivity();
2911         if(ret) ret->incrRef();
2912         return ret;
2913       }
2914       
2915       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2916       {
2917         std::vector< const MEDCoupling1GTUMesh *> parts;
2918         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2919         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2920       }
2921     }
2922   };
2923
2924   //== MEDCoupling1SGTUMesh
2925
2926   class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
2927   {
2928   public:
2929     static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2930     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2931     void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2932     int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2933     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2934     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2935     MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2936     MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2937     DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2938     %extend
2939     {
2940       MEDCoupling1SGTUMesh()
2941       {
2942         return MEDCoupling1SGTUMesh::New();
2943       }
2944
2945       MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2946       {
2947         return MEDCoupling1SGTUMesh::New(name,type);
2948       }
2949
2950       MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2951       {
2952         return MEDCoupling1SGTUMesh::New(m);
2953       }
2954
2955       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2956       {
2957         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
2958       }
2959
2960       std::string __str__() const throw(INTERP_KERNEL::Exception)
2961       {
2962         return self->simpleRepr();
2963       }
2964       
2965       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2966       {
2967         std::ostringstream oss;
2968         self->reprQuickOverview(oss);
2969         return oss.str();
2970       }
2971
2972       PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
2973       {
2974         DataArrayInt *cellPerm(0),*nodePerm(0);
2975         MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
2976         PyObject *ret(PyTuple_New(3));
2977         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
2978         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2979         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2980         return ret;
2981       }
2982
2983       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2984       {
2985         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2986         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2987         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2988       }
2989       
2990       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2991       {
2992         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
2993         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2994         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2995       }
2996     }
2997   };
2998   
2999   //== MEDCoupling1SGTUMesh End
3000
3001   //== MEDCoupling1DGTUMesh
3002
3003   class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3004   {
3005   public:
3006     static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3007     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3008     void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3009     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3010     bool isPacked() const throw(INTERP_KERNEL::Exception);
3011     %extend
3012     {
3013       MEDCoupling1DGTUMesh()
3014       {
3015         return MEDCoupling1DGTUMesh::New();
3016       }
3017       MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3018       {
3019         return MEDCoupling1DGTUMesh::New(name,type);
3020       }
3021
3022       MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3023       {
3024         return MEDCoupling1DGTUMesh::New(m);
3025       }
3026
3027       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3028       {
3029         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3030       }
3031
3032       std::string __str__() const throw(INTERP_KERNEL::Exception)
3033       {
3034         return self->simpleRepr();
3035       }
3036       
3037       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3038       {
3039         std::ostringstream oss;
3040         self->reprQuickOverview(oss);
3041         return oss.str();
3042       }
3043
3044       DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3045       {
3046         DataArrayInt *ret=self->getNodalConnectivityIndex();
3047         if(ret) ret->incrRef();
3048         return ret;
3049       }
3050
3051       PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3052       {
3053         DataArrayInt *ret1=0,*ret2=0;
3054         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3055         PyObject *ret0Py=ret0?Py_True:Py_False;
3056         Py_XINCREF(ret0Py);
3057         PyObject *ret=PyTuple_New(3);
3058         PyTuple_SetItem(ret,0,ret0Py);
3059         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3060         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3061         return ret;
3062       }
3063       
3064       PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3065       {
3066         bool ret1;
3067         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3068         PyObject *ret=PyTuple_New(2);
3069         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3070         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3071         PyTuple_SetItem(ret,1,ret1Py);
3072         return ret;
3073       }
3074
3075       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3076       {
3077         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3078         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3079         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3080       }
3081       
3082       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3083       {
3084         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3085         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3086         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3087       }
3088       
3089       static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3090       {
3091         std::vector<const MEDCoupling::DataArrayInt *> tmp;
3092         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3093         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3094       }
3095     }
3096   };
3097
3098   //== MEDCoupling1DGTUMeshEnd
3099
3100   class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3101   {
3102   public:
3103     int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3104     int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3105     int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3106     int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3107     double computeSquareness() const throw(INTERP_KERNEL::Exception);
3108     virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3109     std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3110     MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3111     std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3112     std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3113     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3114     MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3115     static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3116     static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3117     static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3118     %extend
3119     {
3120       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3121       {
3122         int tmpp1=-1,tmpp2=-1;
3123         std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3124         std::vector< std::pair<int,int> > inp;
3125         if(tmpp2==2)
3126           {
3127             inp.resize(tmpp1);
3128             for(int i=0;i<tmpp1;i++)
3129               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3130           }
3131         else if(tmpp2==1)
3132           {
3133             if(tmpp1%2!=0)
3134               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3135             inp.resize(tmpp1/2);
3136             for(int i=0;i<tmpp1/2;i++)
3137               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3138           }
3139         else
3140           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3141         return self->buildStructuredSubPart(inp);
3142       }
3143
3144       static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3145       {
3146         std::vector< std::pair<int,int> > inp;
3147         convertPyToVectorPairInt(part,inp);
3148         //
3149         int szArr,sw,iTypppArr;
3150         std::vector<int> stdvecTyyppArr;
3151         const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3152         std::vector<int> tmp5(tmp4,tmp4+szArr);
3153         //
3154         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3155       }
3156
3157       static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3158       {
3159         std::vector< std::pair<int,int> > inp;
3160         convertPyToVectorPairInt(part,inp);
3161         MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3162       }
3163
3164       static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3165       {
3166         std::vector< std::pair<int,int> > inp;
3167         convertPyToVectorPairInt(part,inp);
3168         MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3169       }
3170
3171       static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3172       {
3173         std::vector< std::pair<int,int> > inp;
3174         convertPyToVectorPairInt(part,inp);
3175         std::vector<int> stWithGhost;
3176         std::vector< std::pair<int,int> > partWithGhost;
3177         MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3178         PyObject *ret(PyTuple_New(2));
3179         PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3180         PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3181         return ret;
3182       }
3183
3184       static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3185       {
3186         std::vector< std::pair<int,int> > inp;
3187         convertPyToVectorPairInt(partCompactFormat,inp);
3188         return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3189       }
3190
3191       static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3192       {
3193         std::vector< std::pair<int,int> > inp;
3194         convertPyToVectorPairInt(partCompactFormat,inp);
3195         MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3196       }
3197
3198       static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3199       {
3200         std::vector< std::pair<int,int> > inp;
3201         convertPyToVectorPairInt(part,inp);
3202         return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3203       }
3204
3205       static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3206       {
3207         int szArr,sw,iTypppArr;
3208         std::vector<int> stdvecTyyppArr;
3209         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3210         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3211       }
3212
3213       static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3214       {
3215         int szArr,sw,iTypppArr;
3216         std::vector<int> stdvecTyyppArr;
3217         const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3218         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3219       }
3220
3221       static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3222       {
3223         std::vector< std::pair<int,int> > inp;
3224         convertPyToVectorPairInt(partCompactFormat,inp);
3225         return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3226       }
3227
3228       static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3229       {
3230         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3231         PyObject *retPy=PyList_New(ret.size());
3232         for(std::size_t i=0;i<ret.size();i++)
3233           {
3234             PyObject *tmp=PyTuple_New(2);
3235             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3236             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3237             PyList_SetItem(retPy,i,tmp);
3238           }
3239         return retPy;
3240       }
3241
3242       static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3243       {
3244         std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3245         convertPyToVectorPairInt(r1,r1Cpp);
3246         convertPyToVectorPairInt(r2,r2Cpp);
3247         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3248         PyObject *retPy=PyList_New(ret.size());
3249         for(std::size_t i=0;i<ret.size();i++)
3250           {
3251             PyObject *tmp=PyTuple_New(2);
3252             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3253             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3254             PyList_SetItem(retPy,i,tmp);
3255           }
3256         return retPy;
3257       }
3258
3259       static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3260       {
3261         std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3262         convertPyToVectorPairInt(r1,r1Cpp);
3263         convertPyToVectorPairInt(r2,r2Cpp);
3264         return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3265       }
3266
3267       static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3268       {
3269         int szArr,sw,iTypppArr;
3270         std::vector<int> stdvecTyyppArr;
3271         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3272         int szArr2,sw2,iTypppArr2;
3273         std::vector<int> stdvecTyyppArr2;
3274         const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3275         std::vector<int> tmp3(tmp2,tmp2+szArr2);
3276         std::vector< std::pair<int,int> > partCompactFormat;
3277         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3278         PyObject *ret=PyTuple_New(2);
3279         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3280         PyTuple_SetItem(ret,0,ret0Py);
3281         PyObject *ret1Py=PyList_New(partCompactFormat.size());
3282         for(std::size_t i=0;i<partCompactFormat.size();i++)
3283           {
3284             PyObject *tmp4=PyTuple_New(2);
3285             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3286             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3287             PyList_SetItem(ret1Py,i,tmp4);
3288           }
3289         PyTuple_SetItem(ret,1,ret1Py);
3290         return ret;
3291       }
3292
3293       static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3294       {
3295         std::vector< std::pair<int,int> > param0,param1,ret;
3296         convertPyToVectorPairInt(bigInAbs,param0);
3297         convertPyToVectorPairInt(partOfBigInAbs,param1);
3298         MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3299         PyObject *retPy(PyList_New(ret.size()));
3300         for(std::size_t i=0;i<ret.size();i++)
3301           {
3302             PyObject *tmp(PyTuple_New(2));
3303             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3304             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3305             PyList_SetItem(retPy,i,tmp);
3306           }
3307         return retPy;
3308       }
3309
3310       static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3311       {
3312         std::vector< std::pair<int,int> > param0;
3313         convertPyToVectorPairInt(part,param0);
3314         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3315         PyObject *retPy(PyList_New(ret.size()));
3316         for(std::size_t i=0;i<ret.size();i++)
3317           {
3318             PyObject *tmp(PyTuple_New(2));
3319             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3320             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3321             PyList_SetItem(retPy,i,tmp);
3322           }
3323         return retPy;
3324       }
3325
3326       static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3327       {
3328         std::vector< std::pair<int,int> > param0,param1;
3329         convertPyToVectorPairInt(startingFrom,param0);
3330         convertPyToVectorPairInt(goingTo,param1);
3331         return  MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3332       }
3333
3334       static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3335       {
3336         std::vector< std::pair<int,int> > param0,param1,ret;
3337         convertPyToVectorPairInt(bigInAbs,param0);
3338         convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3339         MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3340         PyObject *retPy(PyList_New(ret.size()));
3341         for(std::size_t i=0;i<ret.size();i++)
3342           {
3343             PyObject *tmp(PyTuple_New(2));
3344             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3345             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3346             PyList_SetItem(retPy,i,tmp);
3347           }
3348         return retPy;
3349       }
3350     }
3351   };
3352
3353   class MEDCouplingCurveLinearMesh;
3354
3355   //== MEDCouplingCMesh
3356   
3357   class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3358   {
3359   public:
3360     static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3361     static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3362     void setCoords(const DataArrayDouble *coordsX,
3363                    const DataArrayDouble *coordsY=0,
3364                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3365     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3366     MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3367     %extend {
3368       MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3369       {
3370         return MEDCouplingCMesh::New();
3371       }
3372       MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3373       {
3374         return MEDCouplingCMesh::New(meshName);
3375       }
3376       // serialization
3377       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3378       {
3379         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3380       }
3381       std::string __str__() const throw(INTERP_KERNEL::Exception)
3382       {
3383         return self->simpleRepr();
3384       }
3385       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3386       {
3387         std::ostringstream oss;
3388         self->reprQuickOverview(oss);
3389         return oss.str();
3390       }
3391       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3392       {
3393         DataArrayDouble *ret=self->getCoordsAt(i);
3394         if(ret)
3395           ret->incrRef();
3396         return ret;
3397       }
3398     }
3399   };
3400
3401   //== MEDCouplingCMesh End
3402
3403   //== MEDCouplingCurveLinearMesh
3404
3405   class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3406   {
3407   public:
3408     static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3409     static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3410     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3411     %extend {
3412       MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3413       {
3414         return MEDCouplingCurveLinearMesh::New();
3415       }
3416       MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3417       {
3418         return MEDCouplingCurveLinearMesh::New(meshName);
3419       }
3420       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3421       {
3422         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3423       }
3424       std::string __str__() const throw(INTERP_KERNEL::Exception) 
3425       {
3426         return self->simpleRepr();
3427       }
3428       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3429       {
3430         std::ostringstream oss;
3431         self->reprQuickOverview(oss);
3432         return oss.str();
3433       }
3434       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3435       {
3436         DataArrayDouble *ret=self->getCoords();
3437         if(ret)
3438           ret->incrRef();
3439         return ret;
3440       }
3441       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3442       {
3443         int szArr,sw,iTypppArr;
3444         std::vector<int> stdvecTyyppArr;
3445         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3446         self->setNodeGridStructure(tmp,tmp+szArr);
3447       }
3448     }
3449   };
3450
3451   //== MEDCouplingCurveLinearMesh End
3452
3453   //== MEDCouplingIMesh
3454
3455   class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3456   {
3457   public:
3458     static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3459     //
3460     void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3461     std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3462     std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3463     std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3464     void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3465     std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3466     double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3467     MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3468     void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3469     MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3470     MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3471     %extend
3472     {
3473       MEDCouplingIMesh()
3474       {
3475         return MEDCouplingIMesh::New();
3476       }
3477       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3478       {
3479         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3480         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3481         const int *nodeStrctPtr(0);
3482         const double *originPtr(0),*dxyzPtr(0);
3483         int sw,sz,val0;
3484         std::vector<int> bb0;
3485         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3486         //
3487         double val,val2;
3488         std::vector<double> bb,bb2;
3489         int sz1,sz2;
3490         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3491         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3492         //
3493         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3494       }
3495
3496       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3497       {
3498         return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3499       }
3500
3501       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3502       {
3503         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3504       }
3505
3506       void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3507       {
3508         int sw,sz,val0;
3509         std::vector<int> bb0;
3510         const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3511         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3512       }
3513
3514       void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3515       {
3516         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3517         double val;
3518         DataArrayDouble *a;
3519         DataArrayDoubleTuple *aa;
3520         std::vector<double> bb;
3521         int sw,nbTuples;
3522         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3523         self->setOrigin(originPtr,originPtr+nbTuples);
3524       }
3525       
3526       void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3527       {
3528         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3529         double val;
3530         DataArrayDouble *a;
3531         DataArrayDoubleTuple *aa;
3532         std::vector<double> bb;
3533         int sw,nbTuples;
3534         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3535         self->setDXYZ(originPtr,originPtr+nbTuples);
3536       }
3537
3538       static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3539       {
3540         std::vector< std::pair<int,int> > inp;
3541         convertPyToVectorPairInt(fineLocInCoarse,inp);
3542         MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3543       }
3544
3545       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)
3546       {
3547         std::vector< std::pair<int,int> > inp;
3548         convertPyToVectorPairInt(fineLocInCoarse,inp);
3549         MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3550       }
3551
3552       static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3553       {
3554         std::vector< std::pair<int,int> > inp;
3555         convertPyToVectorPairInt(fineLocInCoarse,inp);
3556         MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3557       }
3558
3559       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)
3560       {
3561         std::vector< std::pair<int,int> > inp;
3562         convertPyToVectorPairInt(fineLocInCoarse,inp);
3563         MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3564       }
3565
3566       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)
3567       {
3568         std::vector< std::pair<int,int> > inp;
3569         convertPyToVectorPairInt(fineLocInCoarse,inp);
3570         MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3571       }
3572
3573       std::string __str__() const throw(INTERP_KERNEL::Exception)
3574       {
3575         return self->simpleRepr();
3576       }
3577       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3578       {
3579         std::ostringstream oss;
3580         self->reprQuickOverview(oss);
3581         return oss.str();
3582       }
3583     }
3584   };
3585
3586   //== MEDCouplingIMesh End
3587
3588 }
3589
3590 namespace MEDCoupling
3591 {
3592   class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3593   {
3594   public:
3595     virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3596     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3597     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3598     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3599     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3600     void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3601     void setName(const char *name) throw(INTERP_KERNEL::Exception);
3602     std::string getDescription() const throw(INTERP_KERNEL::Exception);
3603     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3604     std::string getName() const throw(INTERP_KERNEL::Exception);
3605     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3606     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3607     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3608     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3609     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3610     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3611     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3612     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3613                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3614     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3615     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3616     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3617     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3618     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3619     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3620     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3621     %extend {
3622       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3623       {
3624         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3625         if(ret1)
3626           ret1->incrRef();
3627         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3628       }
3629
3630       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3631       {
3632         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3633         if(ret)
3634           ret->incrRef();
3635         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3636       }
3637
3638       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3639       {
3640         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3641         return convertIntArrToPyList3(ret);
3642       }
3643
3644       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3645       {
3646         std::string ret1;
3647         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3648         PyObject *ret=PyTuple_New(2);
3649         PyObject *ret0Py=ret0?Py_True:Py_False;
3650         Py_XINCREF(ret0Py);
3651         PyTuple_SetItem(ret,0,ret0Py);
3652         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3653         return ret;
3654       }
3655
3656       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3657       {
3658         DataArrayInt *ret1=0;
3659         MEDCouplingMesh *ret0=0;
3660         void *da=0;
3661         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3662         if (!SWIG_IsOK(res1))
3663           {
3664             int size;
3665             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3666             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3667           }
3668         else
3669           {
3670             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3671             if(!da2)
3672               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3673             da2->checkAllocated();
3674             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3675           }
3676         PyObject *res = PyList_New(2);
3677         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3678         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3679         return res;
3680       }
3681
3682       PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3683       {
3684         DataArrayInt *ret1=0;
3685         int bb,ee,ss;
3686         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3687         PyObject *res=PyTuple_New(2);
3688         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3689         if(ret1)
3690           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3691         else
3692           {
3693             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3694             PyTuple_SetItem(res,1,res1);
3695           }
3696         return res;
3697       }
3698
3699       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3700       {
3701         int sw,sz(-1);
3702         int v0; std::vector<int> v1;
3703         const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3704         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3705       }
3706
3707       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3708                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3709       {
3710         void *da=0;
3711         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3712         if (!SWIG_IsOK(res1))
3713           {
3714             int size;
3715             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3716             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3717           }
3718         else
3719           {
3720             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3721             if(!da2)
3722               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3723             da2->checkAllocated();
3724             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3725           }
3726       }
3727
3728       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3729       {
3730         std::vector<int> tmp;
3731         self->getCellIdsHavingGaussLocalization(locId,tmp);
3732         DataArrayInt *ret=DataArrayInt::New();
3733         ret->alloc((int)tmp.size(),1);
3734         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3735         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3736       }
3737       
3738       int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3739       {
3740         std::vector<int> inp0;
3741         convertPyToNewIntArr4(code,1,3,inp0);
3742         std::vector<const DataArrayInt *> inp1;
3743         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3744         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3745       }
3746     }
3747   };
3748   
3749   class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3750   {
3751   public:
3752     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3753     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3754     static MEDCouplingFieldTemplate *New(TypeOfField type);
3755     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3756     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3757     %extend
3758        {
3759          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3760          {
3761            return MEDCouplingFieldTemplate::New(f);
3762          }
3763
3764          MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3765          {
3766            return MEDCouplingFieldTemplate::New(f);
3767          }
3768          
3769          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3770          {
3771            return MEDCouplingFieldTemplate::New(type);
3772          }
3773          
3774          std::string __str__() const throw(INTERP_KERNEL::Exception)
3775          {
3776            return self->simpleRepr();
3777          }
3778          
3779          std::string __repr__() const throw(INTERP_KERNEL::Exception)
3780          {
3781            std::ostringstream oss;
3782            self->reprQuickOverview(oss);
3783            return oss.str();
3784          }
3785        }
3786   };
3787   
3788   class MEDCouplingFieldInt;
3789   
3790   class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3791   {
3792   public:
3793     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3794     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3795     void setTimeUnit(const std::string& unit);
3796     std::string getTimeUnit() const;
3797     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3798     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3799     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3800     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3801     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3802     std::string  writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3803     MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3804     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3805     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3806     MEDCouplingFieldDouble *deepCopy() const;
3807     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3808     MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3809     MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3810     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3811     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3812     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3813     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3814     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3815     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3816     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3817     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3818     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3819     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3820     void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3821     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3822     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3823     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3824     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3825     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3826     void setIteration(int it) throw(INTERP_KERNEL::Exception);
3827     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3828     void setOrder(int order) throw(INTERP_KERNEL::Exception);
3829     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3830     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3831     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3832     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3833     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3834     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3835     bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3836     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3837     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3838     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3839     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3840     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3841     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3842     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3843     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3844     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3845     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3846     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3847     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3848     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3849     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3850     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3851     void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3852     void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3853     void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3854     void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3855     void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3856     void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3857     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3858     void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3859     void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3860     void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3861     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3862     double getMaxValue() const throw(INTERP_KERNEL::Exception);
3863     double getMinValue() const throw(INTERP_KERNEL::Exception);
3864     double getAverageValue() const throw(INTERP_KERNEL::Exception);
3865     double norm2() const throw(INTERP_KERNEL::Exception);
3866     double normMax() const throw(INTERP_KERNEL::Exception);
3867     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3868     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3869     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3870     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3871     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3872     DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3873     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3874     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3875     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3876     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3877     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3878     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3879     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3880     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3881     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3882     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3883     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3884     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3885     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3886     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3887     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3888     MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3889     %extend {
3890       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3891       {
3892         return MEDCouplingFieldDouble::New(type,td);
3893       }
3894
3895       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3896       {
3897         return MEDCouplingFieldDouble::New(ft,td);
3898       }
3899
3900       std::string __str__() const throw(INTERP_KERNEL::Exception)
3901       {
3902         return self->simpleRepr();
3903       }
3904
3905       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3906       {
3907         std::ostringstream oss;
3908         self->reprQuickOverview(oss);
3909         return oss.str();
3910       }
3911
3912       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3913       {
3914         DataArrayDouble *ret=self->getArray();
3915         if(ret)
3916           ret->incrRef();
3917         return ret;
3918       }
3919
3920       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3921       {
3922         std::vector<DataArrayDouble *> arrs=self->getArrays();
3923         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3924           if(*it)
3925             (*it)->incrRef();
3926         int sz=arrs.size();
3927         PyObject *ret=PyTuple_New(sz);
3928         for(int i=0;i<sz;i++)
3929           {
3930             if(arrs[i])
3931               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3932             else
3933               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
3934           }
3935         return ret;
3936       }
3937
3938       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3939       {
3940         std::vector<const DataArrayDouble *> tmp;
3941         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
3942         int sz=tmp.size();
3943         std::vector<DataArrayDouble *> arrs(sz);
3944         for(int i=0;i<sz;i++)
3945           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3946         self->setArrays(arrs);
3947       }
3948
3949       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3950       {
3951         DataArrayDouble *ret=self->getEndArray();
3952         if(ret)
3953           ret->incrRef();
3954         return ret;
3955       }
3956
3957       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3958       {
3959         double val;
3960         DataArrayDouble *a;
3961         DataArrayDoubleTuple *aa;
3962         std::vector<double> bb;
3963         int sw;
3964         const MEDCouplingMesh *mesh=self->getMesh();
3965         if(!mesh)
3966           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3967         int spaceDim=mesh->getSpaceDimension();
3968         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3969         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3970         //
3971         int sz=self->getNumberOfComponents();
3972         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3973         self->getValueOn(spaceLoc,res);
3974         return convertDblArrToPyList(res,sz);
3975       }
3976
3977        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3978        {
3979          int sz=self->getNumberOfComponents();
3980          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3981          self->getValueOnPos(i,j,k,res);
3982          return convertDblArrToPyList(res,sz);
3983        }
3984
3985       DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3986       {
3987         const MEDCouplingMesh *mesh(self->getMesh());
3988         if(!mesh)
3989           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3990         //
3991         int sw,nbPts;
3992         double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3993         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3994                                                          mesh->getSpaceDimension(),true,nbPts);
3995         return self->getValueOnMulti(inp,nbPts);
3996       }
3997
3998       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3999       {
4000         double val;
4001         DataArrayDouble *a;
4002         DataArrayDoubleTuple *aa;
4003         std::vector<double> bb;
4004         int sw;
4005         const MEDCouplingMesh *mesh=self->getMesh();
4006         if(!mesh)
4007           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4008         int spaceDim=mesh->getSpaceDimension();
4009         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4010         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4011         //
4012         //
4013         int sz=self->getNumberOfComponents();
4014         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4015         self->getValueOn(spaceLoc,time,res);
4016         return convertDblArrToPyList(res,sz);
4017       }
4018
4019       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4020       {
4021         if(self->getArray()!=0)
4022           MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4023         else
4024           {
4025             MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4026             MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4027             self->setArray(arr);
4028           }
4029       }
4030       
4031       PyObject *getTime() throw(INTERP_KERNEL::Exception)
4032       {
4033         int tmp1,tmp2;
4034         double tmp0=self->getTime(tmp1,tmp2);
4035         PyObject *res = PyList_New(3);
4036         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4037         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4038         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4039         return res;
4040       }
4041
4042       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4043       {
4044         int tmp1,tmp2;
4045         double tmp0=self->getStartTime(tmp1,tmp2);
4046         PyObject *res = PyList_New(3);
4047         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4048         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4049         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4050         return res;
4051       }
4052
4053       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4054       {
4055         int tmp1,tmp2;
4056         double tmp0=self->getEndTime(tmp1,tmp2);
4057         PyObject *res = PyList_New(3);
4058         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4059         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4060         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4061         return res;
4062       }
4063       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4064       {
4065         int sz=self->getNumberOfComponents();
4066         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4067         self->accumulate(tmp);
4068         return convertDblArrToPyList(tmp,sz);
4069       }
4070       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4071       {
4072         int sz=self->getNumberOfComponents();
4073         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4074         self->integral(isWAbs,tmp);
4075         return convertDblArrToPyList(tmp,sz);
4076       }
4077       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4078       {
4079         int sz=self->getNumberOfComponents();
4080         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4081         self->getWeightedAverageValue(tmp,isWAbs);
4082         return convertDblArrToPyList(tmp,sz);
4083       }
4084       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4085       {
4086         int sz=self->getNumberOfComponents();
4087         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4088         self->normL1(tmp);
4089         return convertDblArrToPyList(tmp,sz);
4090       }
4091       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4092       {
4093         int sz=self->getNumberOfComponents();
4094         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4095         self->normL2(tmp);
4096         return convertDblArrToPyList(tmp,sz);
4097       }
4098       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4099       {
4100         int szArr,sw,iTypppArr;
4101         std::vector<int> stdvecTyyppArr;
4102         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4103         self->renumberCells(tmp,check);
4104       }
4105       
4106       void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4107       {
4108         int szArr,sw,iTypppArr;
4109         std::vector<int> stdvecTyyppArr;
4110         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4111         self->renumberCellsWithoutMesh(tmp,check);
4112       }
4113       
4114       void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4115       {
4116         int szArr,sw,iTypppArr;
4117         std::vector<int> stdvecTyyppArr;
4118         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4119         self->renumberNodes(tmp,eps);
4120       }
4121
4122       void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4123       {
4124         int szArr,sw,iTypppArr;
4125         std::vector<int> stdvecTyyppArr;
4126         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4127         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4128       }
4129
4130       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4131       {
4132         int sw;
4133         int singleVal;
4134         std::vector<int> multiVal;
4135         std::pair<int, std::pair<int,int> > slic;
4136         MEDCoupling::DataArrayInt *daIntTyypp=0;
4137         const MEDCouplingMesh *mesh=self->getMesh();
4138         if(!mesh)
4139           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4140         int nbc=mesh->getNumberOfCells();
4141         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4142         switch(sw)
4143           {
4144           case 1:
4145             {
4146               if(singleVal>=nbc)
4147                 {
4148                   std::ostringstream oss;
4149                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4150                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4151                 }
4152               if(singleVal>=0)
4153                 return self->buildSubPart(&singleVal,&singleVal+1);
4154               else
4155                 {
4156                   if(nbc+singleVal>0)
4157                     {
4158                       int tmp=nbc+singleVal;
4159                       return self->buildSubPart(&tmp,&tmp+1);
4160                     }
4161                   else
4162                     {
4163                       std::ostringstream oss;
4164                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4165                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4166                     }
4167                 }
4168             }
4169           case 2:
4170             {
4171               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4172             }
4173           case 3:
4174             {
4175               return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4176             }
4177           case 4:
4178             {
4179               if(!daIntTyypp)
4180                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4181               daIntTyypp->checkAllocated();
4182               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4183             }
4184           default:
4185             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4186           }
4187       }
4188
4189       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4190       {
4191         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";
4192         if(PyTuple_Check(li))
4193           {
4194             Py_ssize_t sz=PyTuple_Size(li);
4195             if(sz!=2)
4196               throw INTERP_KERNEL::Exception(msg);
4197             PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4198             int sw;
4199             int singleVal;
4200             std::vector<int> multiVal;
4201             std::pair<int, std::pair<int,int> > slic;
4202             MEDCoupling::DataArrayInt *daIntTyypp=0;
4203             if(!self->getArray())
4204               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4205             try
4206               { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4207             catch(INTERP_KERNEL::Exception& e)
4208               { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4209             MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4210             DataArrayDouble *ret0Arr=ret0->getArray();
4211             if(!ret0Arr)
4212               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4213             switch(sw)
4214               {
4215               case 1:
4216                 {
4217                   std::vector<int> v2(1,singleVal);
4218                   MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4219                   ret0->setArray(aarr);
4220                   return ret0.retn();
4221                 }
4222               case 2:
4223                 {
4224                   MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4225                   ret0->setArray(aarr);
4226                   return ret0.retn();
4227                 }
4228               case 3:
4229                 {
4230                   int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4231                   std::vector<int> v2(nbOfComp);
4232                   for(int i=0;i<nbOfComp;i++)
4233                     v2[i]=slic.first+i*slic.second.second;
4234                   MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4235                   ret0->setArray(aarr);
4236                   return ret0.retn();
4237                 }
4238               default:
4239                 throw INTERP_KERNEL::Exception(msg);
4240               }
4241             
4242           }
4243         else
4244           return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4245       }
4246
4247       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4248       {
4249         DataArrayInt *tmp;
4250         double r1=self->getMaxValue2(tmp);
4251         PyObject *ret=PyTuple_New(2);
4252         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4253         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4254         return ret;
4255       }
4256       
4257       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4258       {
4259         DataArrayInt *tmp;
4260         double r1=self->getMinValue2(tmp);
4261         PyObject *ret=PyTuple_New(2);
4262         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4263         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4264         return ret;
4265       }
4266       
4267       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4268       {
4269         std::vector<int> tmp;
4270         convertPyToNewIntArr3(li,tmp);
4271         return self->keepSelectedComponents(tmp);
4272       }
4273
4274       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4275       {
4276         std::vector<int> tmp;
4277         convertPyToNewIntArr3(li,tmp);
4278         self->setSelectedComponents(f,tmp);
4279       }
4280
4281       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4282       {
4283         double val,val2;
4284         DataArrayDouble *a,*a2;
4285         DataArrayDoubleTuple *aa,*aa2;
4286         std::vector<double> bb,bb2;
4287         int sw;
4288         int spaceDim=3;
4289         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4290         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4291         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4292         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4293         //
4294         return self->extractSlice3D(orig,vect,eps);
4295       }
4296
4297       MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4298       {
4299         return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4300       }
4301
4302       MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4303       {
4304         return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4305       }
4306
4307       MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4308       {
4309         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.";
4310         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4311         void *argp;
4312         //
4313         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4314           {
4315             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4316             if(other)
4317               return (*self)-(*other);
4318             else
4319               throw INTERP_KERNEL::Exception(msg);
4320           }
4321         //
4322         double val;
4323         DataArrayDouble *a;
4324         DataArrayDoubleTuple *aa;
4325         std::vector<double> bb;
4326         int sw;
4327         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4328         switch(sw)
4329           {
4330           case 1:
4331             {
4332               if(!self->getArray())
4333                 throw INTERP_KERNEL::Exception(msg2);
4334               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4335               ret->applyLin(1.,-val);
4336               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4337               ret2->setArray(ret);
4338               return ret2.retn();
4339             }
4340           case 2:
4341             {
4342               if(!self->getArray())
4343                 throw INTERP_KERNEL::Exception(msg2);
4344               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4345               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4346               ret2->setArray(ret);
4347               return ret2.retn();
4348             }
4349           case 3:
4350             {
4351               if(!self->getArray())
4352                 throw INTERP_KERNEL::Exception(msg2);
4353               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4354               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4355               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4356               ret2->setArray(ret);
4357               return ret2.retn();
4358             }
4359           case 4:
4360             {
4361               if(!self->getArray())
4362                 throw INTERP_KERNEL::Exception(msg2);
4363               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4364               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4365               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4366               ret2->setArray(ret);
4367               return ret2.retn();
4368             }
4369           default:
4370             { throw INTERP_KERNEL::Exception(msg); }
4371           }
4372       }
4373
4374       MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4375       {
4376         return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4377       }
4378
4379       MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4380       {
4381         return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4382       }
4383
4384       MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4385       {
4386         return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4387       }
4388
4389       MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4390       {
4391         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.";
4392         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4393         void *argp;
4394         //
4395         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4396           {
4397             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4398             if(other)
4399               return (*self)/(*other);
4400             else
4401               throw INTERP_KERNEL::Exception(msg);
4402           }
4403         //
4404         double val;
4405         DataArrayDouble *a;
4406         DataArrayDoubleTuple *aa;
4407         std::vector<double> bb;
4408         int sw;
4409         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4410         switch(sw)
4411           {
4412           case 1:
4413             {
4414               if(val==0.)
4415                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4416               if(!self->getArray())
4417                 throw INTERP_KERNEL::Exception(msg2);
4418               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4419               ret->applyLin(1./val,0);
4420               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4421               ret2->setArray(ret);
4422               return ret2.retn();
4423             }
4424           case 2:
4425             {
4426               if(!self->getArray())
4427                 throw INTERP_KERNEL::Exception(msg2);
4428               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4429               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4430               ret2->setArray(ret);
4431               return ret2.retn();
4432             }
4433           case 3:
4434             {
4435               if(!self->getArray())
4436                 throw INTERP_KERNEL::Exception(msg2);
4437               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4438               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4439               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4440               ret2->setArray(ret);
4441               return ret2.retn();
4442             }
4443           case 4:
4444             {
4445               if(!self->getArray())
4446                 throw INTERP_KERNEL::Exception(msg2);
4447               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4448               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4449               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4450               ret2->setArray(ret);
4451               return ret2.retn();
4452             }
4453           default:
4454             { throw INTERP_KERNEL::Exception(msg); }
4455           }
4456       }
4457
4458       MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4459       {
4460         return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4461       }
4462
4463       MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4464       {
4465         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.";
4466         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4467         void *argp;
4468         //
4469         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4470           {
4471             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4472             if(other)
4473               return (*self)^(*other);
4474             else
4475               throw INTERP_KERNEL::Exception(msg);
4476           }
4477         //
4478         double val;
4479         DataArrayDouble *a;
4480         DataArrayDoubleTuple *aa;
4481         std::vector<double> bb;
4482         int sw;
4483         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4484         switch(sw)
4485           {
4486           case 1:
4487             {
4488               if(!self->getArray())
4489                 throw INTERP_KERNEL::Exception(msg2);
4490               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4491               ret->applyPow(val);
4492               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4493               ret2->setArray(ret);
4494               return ret2.retn();
4495             }
4496           case 2:
4497             {
4498               if(!self->getArray())
4499                 throw INTERP_KERNEL::Exception(msg2);
4500               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4501               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4502               ret2->setArray(ret);
4503               return ret2.retn();
4504             }
4505           case 3:
4506             {
4507               if(!self->getArray())
4508                 throw INTERP_KERNEL::Exception(msg2);
4509               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4510               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4511               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4512               ret2->setArray(ret);
4513               return ret2.retn();
4514             }
4515           case 4:
4516             {
4517               if(!self->getArray())
4518                 throw INTERP_KERNEL::Exception(msg2);
4519               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4520               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4521               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4522               ret2->setArray(ret);
4523               return ret2.retn();
4524             }
4525           default:
4526             { throw INTERP_KERNEL::Exception(msg); }
4527           }
4528       }
4529
4530       MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4531       {
4532         return self->negate();
4533       }
4534
4535       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4536       {
4537         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.";
4538         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4539         void *argp;
4540         //
4541         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4542           {
4543             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4544             if(other)
4545               {
4546                 *self+=*other;
4547                 Py_XINCREF(trueSelf);
4548                 return trueSelf;
4549               }
4550             else
4551               throw INTERP_KERNEL::Exception(msg);
4552           }
4553         //
4554         double val;
4555         DataArrayDouble *a;
4556         DataArrayDoubleTuple *aa;
4557         std::vector<double> bb;
4558         int sw;
4559         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4560         switch(sw)
4561           {
4562           case 1:
4563             {
4564               if(!self->getArray())
4565                 throw INTERP_KERNEL::Exception(msg2);
4566               self->getArray()->applyLin(1.,val);
4567               Py_XINCREF(trueSelf);
4568               return trueSelf;
4569             }
4570           case 2:
4571             {
4572               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4573               ret2->setArray(a);
4574               *self+=*ret2;
4575               Py_XINCREF(trueSelf);
4576               return trueSelf;
4577             }
4578           case 3:
4579             {
4580               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4581               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4582               ret2->setArray(aaa);
4583               *self+=*ret2;
4584               Py_XINCREF(trueSelf);
4585               return trueSelf;
4586             }
4587           case 4:
4588             {
4589               if(!self->getArray())
4590                 throw INTERP_KERNEL::Exception(msg2);
4591               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4592               self->getArray()->addEqual(aaa);
4593               Py_XINCREF(trueSelf);
4594               return trueSelf;
4595             }
4596           default:
4597             { throw INTERP_KERNEL::Exception(msg); }
4598           }
4599       }
4600
4601       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4602       {
4603         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.";
4604         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4605         void *argp;
4606         //
4607         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4608           {
4609             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4610             if(other)
4611               {
4612                 *self-=*other;
4613                 Py_XINCREF(trueSelf);
4614                 return trueSelf;
4615               }
4616             else
4617               throw INTERP_KERNEL::Exception(msg);
4618           }
4619         //
4620         double val;
4621         DataArrayDouble *a;
4622         DataArrayDoubleTuple *aa;
4623         std::vector<double> bb;
4624         int sw;
4625         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4626         switch(sw)
4627           {
4628           case 1:
4629             {
4630               if(!self->getArray())
4631                 throw INTERP_KERNEL::Exception(msg2);
4632               self->getArray()->applyLin(1.,-val);
4633               Py_XINCREF(trueSelf);
4634               return trueSelf;
4635             }
4636           case 2:
4637             {
4638               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4639               ret2->setArray(a);
4640               *self-=*ret2;
4641               Py_XINCREF(trueSelf);
4642               return trueSelf;
4643             }
4644           case 3:
4645             {
4646               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4647               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4648               ret2->setArray(aaa);
4649               *self-=*ret2;
4650               Py_XINCREF(trueSelf);
4651               return trueSelf;
4652             }
4653           case 4:
4654             {
4655               if(!self->getArray())
4656                 throw INTERP_KERNEL::Exception(msg2);
4657               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4658               self->getArray()->substractEqual(aaa);
4659               Py_XINCREF(trueSelf);
4660               return trueSelf;
4661             }
4662           default:
4663             { throw INTERP_KERNEL::Exception(msg); }
4664           }
4665       }
4666
4667       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4668       {
4669         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.";
4670         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4671         void *argp;
4672         //
4673         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4674           {
4675             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4676             if(other)
4677               {
4678                 *self*=*other;
4679                 Py_XINCREF(trueSelf);
4680                 return trueSelf;
4681               }
4682             else
4683               throw INTERP_KERNEL::Exception(msg);
4684           }
4685         //
4686         double val;
4687         DataArrayDouble *a;
4688         DataArrayDoubleTuple *aa;
4689         std::vector<double> bb;
4690         int sw;
4691         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4692         switch(sw)
4693           {
4694           case 1:
4695             {
4696               if(!self->getArray())
4697                 throw INTERP_KERNEL::Exception(msg2);
4698               self->getArray()->applyLin(val,0);
4699               Py_XINCREF(trueSelf);
4700               return trueSelf;
4701             }
4702           case 2:
4703             {
4704               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4705               ret2->setArray(a);
4706               *self*=*ret2;
4707               Py_XINCREF(trueSelf);
4708               return trueSelf;
4709             }
4710           case 3:
4711             {
4712               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4713               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4714               ret2->setArray(aaa);
4715               *self*=*ret2;
4716               Py_XINCREF(trueSelf);
4717               return trueSelf;
4718             }
4719           case 4:
4720             {
4721               if(!self->getArray())
4722                 throw INTERP_KERNEL::Exception(msg2);
4723               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4724               self->getArray()->multiplyEqual(aaa);
4725               Py_XINCREF(trueSelf);
4726               return trueSelf;
4727             }
4728           default:
4729             { throw INTERP_KERNEL::Exception(msg); }
4730           }
4731       }
4732
4733       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4734       {
4735         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.";
4736         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4737         void *argp;
4738         //
4739         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4740           {
4741             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4742             if(other)
4743               {
4744                 *self/=*other;
4745                 Py_XINCREF(trueSelf);
4746                 return trueSelf;
4747               }
4748             else
4749               throw INTERP_KERNEL::Exception(msg);
4750           }
4751         //
4752         double val;
4753         DataArrayDouble *a;
4754         DataArrayDoubleTuple *aa;
4755         std::vector<double> bb;
4756         int sw;
4757         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4758         switch(sw)
4759           {
4760           case 1:
4761             {
4762               if(val==0.)
4763                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4764               if(!self->getArray())
4765                 throw INTERP_KERNEL::Exception(msg2);
4766               self->getArray()->applyLin(1./val,0);
4767               Py_XINCREF(trueSelf);
4768               return trueSelf;
4769             }
4770           case 2:
4771             {
4772               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4773               ret2->setArray(a);
4774               *self/=*ret2;
4775               Py_XINCREF(trueSelf);
4776               return trueSelf;
4777             }
4778           case 3:
4779             {
4780               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4781               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4782               ret2->setArray(aaa);
4783               *self/=*ret2;
4784               Py_XINCREF(trueSelf);
4785               return trueSelf;
4786             }
4787           case 4:
4788             {
4789               if(!self->getArray())
4790                 throw INTERP_KERNEL::Exception(msg2);
4791               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4792               self->getArray()->divideEqual(aaa);
4793               Py_XINCREF(trueSelf);
4794               return trueSelf;
4795             }
4796           default:
4797             { throw INTERP_KERNEL::Exception(msg); }
4798           }
4799       }
4800
4801       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4802       {
4803         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.";
4804         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4805         void *argp;
4806         //
4807         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4808           {
4809             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4810             if(other)
4811               {
4812                 *self^=*other;
4813                 Py_XINCREF(trueSelf);
4814                 return trueSelf;
4815               }
4816             else
4817               throw INTERP_KERNEL::Exception(msg);
4818           }
4819         //
4820         double val;
4821         DataArrayDouble *a;
4822         DataArrayDoubleTuple *aa;
4823         std::vector<double> bb;
4824         int sw;
4825         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4826         switch(sw)
4827           {
4828           case 1:
4829             {
4830               if(!self->getArray())
4831                 throw INTERP_KERNEL::Exception(msg2);
4832               self->getArray()->applyPow(val);
4833               Py_XINCREF(trueSelf);
4834               return trueSelf;
4835             }
4836           case 2:
4837             {
4838               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4839               ret2->setArray(a);
4840               *self^=*ret2;
4841               Py_XINCREF(trueSelf);
4842               return trueSelf;
4843             }
4844           case 3:
4845             {
4846               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4847               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4848               ret2->setArray(aaa);
4849               *self^=*ret2;
4850               Py_XINCREF(trueSelf);
4851               return trueSelf;
4852             }
4853           case 4:
4854             {
4855               if(!self->getArray())
4856                 throw INTERP_KERNEL::Exception(msg2);
4857               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4858               self->getArray()->powEqual(aaa);
4859               Py_XINCREF(trueSelf);
4860               return trueSelf;
4861             }
4862           default:
4863             { throw INTERP_KERNEL::Exception(msg); }
4864           }
4865       }
4866
4867       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4868       {
4869         std::vector<const MEDCouplingFieldDouble *> tmp;
4870         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4871         return MEDCouplingFieldDouble::MergeFields(tmp);
4872       }
4873
4874       static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4875       {
4876         std::vector<const MEDCouplingFieldDouble *> tmp;
4877         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4878         return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4879       }
4880
4881       PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
4882       {
4883         std::vector<double> a0;
4884         std::vector<int> a1;
4885         std::vector<std::string> a2;
4886         self->getTinySerializationDbleInformation(a0);
4887         self->getTinySerializationIntInformation(a1);
4888         self->getTinySerializationStrInformation(a2);
4889         //
4890         PyObject *ret(PyTuple_New(3));
4891         PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
4892         PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
4893         int sz(a2.size());
4894         PyObject *ret2(PyList_New(sz));
4895         {
4896           for(int i=0;i<sz;i++)
4897             PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
4898         }
4899         PyTuple_SetItem(ret,2,ret2);
4900         return ret;
4901       }
4902       
4903       PyObject *serialize() const throw(INTERP_KERNEL::Exception)
4904       {
4905         DataArrayInt *ret0(0);
4906         std::vector<DataArrayDouble *> ret1;
4907         self->serialize(ret0,ret1);
4908         if(ret0)
4909           ret0->incrRef();
4910         std::size_t sz(ret1.size());
4911         PyObject *ret(PyTuple_New(2));
4912         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4913         PyObject *ret1Py(PyList_New(sz));
4914         for(std::size_t i=0;i<sz;i++)
4915           {
4916             if(ret1[i])
4917               ret1[i]->incrRef();
4918             PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4919           }
4920         PyTuple_SetItem(ret,1,ret1Py);
4921         return ret;
4922       }
4923
4924       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
4925       {
4926         static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
4927         if(!PyTuple_Check(args))
4928           throw INTERP_KERNEL::Exception(MSG);
4929         PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
4930         PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
4931         PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
4932         //
4933         PyObject *tmp0(PyTuple_New(1));
4934         PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
4935         PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
4936         Py_DECREF(tmp0);
4937         Py_DECREF(selfMeth);
4938         if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
4939           {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
4940             PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
4941             ////
4942             PyObject *a(PyInt_FromLong(0));
4943             PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
4944             Py_DECREF(a);
4945             if(!uniqueElt)
4946               throw INTERP_KERNEL::Exception(MSG);
4947             if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
4948               throw INTERP_KERNEL::Exception(MSG);
4949             PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
4950             Py_XDECREF(tmp2);
4951             ////
4952             Py_DECREF(initMeth);
4953           }
4954         return instance;
4955       }
4956
4957       PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
4958       {// put an empty dict in input to say to __new__ to call __init__...
4959         self->checkConsistencyLight();
4960         PyObject *ret(PyTuple_New(1));
4961         PyObject *ret0(PyDict_New());
4962         {
4963           PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
4964           PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
4965           PyDict_SetItem(ret0,a,d);
4966           Py_DECREF(a); Py_DECREF(d);
4967         }
4968         PyTuple_SetItem(ret,0,ret0);
4969         return ret;
4970       }
4971
4972       PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
4973       {
4974         self->checkConsistencyLight();
4975         PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
4976         PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
4977         const MEDCouplingMesh *mesh(self->getMesh());
4978         if(mesh)
4979           mesh->incrRef();
4980         PyObject *ret(PyTuple_New(3));
4981         PyTuple_SetItem(ret,0,ret0);
4982         PyTuple_SetItem(ret,1,ret1);
4983         PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
4984         return ret;
4985       }
4986       
4987       void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
4988       {
4989         static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
4990         if(!PyTuple_Check(inp))
4991           throw INTERP_KERNEL::Exception(MSG);
4992         int sz(PyTuple_Size(inp));
4993         if(sz!=3)
4994           throw INTERP_KERNEL::Exception(MSG);
4995         // mesh
4996         PyObject *elt2(PyTuple_GetItem(inp,2));
4997         void *argp=0;
4998         int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
4999         if(!SWIG_IsOK(status))
5000           throw INTERP_KERNEL::Exception(MSG);
5001         self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5002         //
5003         PyObject *elt0(PyTuple_GetItem(inp,0));
5004         PyObject *elt1(PyTuple_GetItem(inp,1));
5005         std::vector<double> a0;
5006         std::vector<int> a1;
5007         std::vector<std::string> a2;
5008         DataArrayInt *b0(0);
5009         std::vector<DataArrayDouble *>b1;
5010         {
5011           if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5012             throw INTERP_KERNEL::Exception(MSG);
5013           PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5014           int tmp(-1);
5015           fillArrayWithPyListDbl3(a0py,tmp,a0);
5016           convertPyToNewIntArr3(a1py,a1);
5017           fillStringVector(a2py,a2);
5018         }
5019         {
5020           if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5021             throw INTERP_KERNEL::Exception(MSG);
5022           PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5023           void *argp(0);
5024           int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5025           if(!SWIG_IsOK(status))
5026             throw INTERP_KERNEL::Exception(MSG);
5027           b0=reinterpret_cast<DataArrayInt *>(argp);
5028           convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5029         }
5030         self->checkForUnserialization(a1,b0,b1);
5031         // useless here to call resizeForUnserialization because arrays are well resized.
5032         self->finishUnserialization(a1,a0,a2);
5033       }
5034     }
5035   };
5036
5037   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5038   {
5039   public:
5040     int getNumberOfFields() const;
5041     MEDCouplingMultiFields *deepCopy() const;
5042     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5043     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5044     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5045     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5046     virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5047     %extend
5048        {
5049          std::string __str__() const throw(INTERP_KERNEL::Exception)
5050          {
5051            return self->simpleRepr();
5052          }
5053          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5054          {
5055            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5056            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5057            int sz=tmp.size();
5058            std::vector<MEDCouplingFieldDouble *> fs(sz);
5059            for(int i=0;i<sz;i++)
5060              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5061            return MEDCouplingMultiFields::New(fs);
5062          }
5063          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5064          {
5065            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5066            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5067            int sz=tmp.size();
5068            std::vector<MEDCouplingFieldDouble *> fs(sz);
5069            for(int i=0;i<sz;i++)
5070              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5071            return MEDCouplingMultiFields::New(fs);
5072          }
5073          PyObject *getFields() const
5074          {
5075            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5076            int sz=fields.size();
5077            PyObject *res = PyList_New(sz);
5078            for(int i=0;i<sz;i++)
5079              {
5080                if(fields[i])
5081                  {
5082                    fields[i]->incrRef();
5083                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5084                  }
5085                else
5086                  {
5087                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5088                  }
5089              }
5090            return res;
5091          }
5092          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5093          {
5094            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5095            if(ret)
5096              {
5097                ret->incrRef();
5098                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5099              }
5100            else
5101              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5102          }
5103          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5104          {
5105            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5106            int sz=ms.size();
5107            PyObject *res = PyList_New(sz);
5108            for(int i=0;i<sz;i++)
5109              {
5110                if(ms[i])
5111                  {
5112                    ms[i]->incrRef();
5113                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5114                  }
5115                else
5116                  {
5117                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5118                  }
5119              }
5120            return res;
5121          }
5122          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5123          {
5124            std::vector<int> refs;
5125            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5126            int sz=ms.size();
5127            PyObject *res = PyList_New(sz);
5128            for(int i=0;i<sz;i++)
5129              {
5130                if(ms[i])
5131                  {
5132                    ms[i]->incrRef();
5133                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5134                  }
5135                else
5136                  {
5137                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5138                  }
5139              }
5140            //
5141            PyObject *ret=PyTuple_New(2);
5142            PyTuple_SetItem(ret,0,res);
5143            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5144            return ret;
5145          }
5146          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5147          {
5148            std::vector<DataArrayDouble *> ms=self->getArrays();
5149            int sz=ms.size();
5150            PyObject *res = PyList_New(sz);
5151            for(int i=0;i<sz;i++)
5152              {
5153                if(ms[i])
5154                  {
5155                    ms[i]->incrRef();
5156                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5157                  }
5158                else
5159                  {
5160                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5161                  }
5162              }
5163            return res;
5164          }
5165          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5166          {
5167            std::vector< std::vector<int> > refs;
5168            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5169            int sz=ms.size();
5170            PyObject *res = PyList_New(sz);
5171            PyObject *res2 = PyList_New(sz);
5172            for(int i=0;i<sz;i++)
5173              {
5174                if(ms[i])
5175                  {
5176                    ms[i]->incrRef();
5177                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5178                  }
5179                else
5180                  {
5181                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5182                  }
5183                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5184              }
5185            //
5186            PyObject *ret=PyTuple_New(2);
5187            PyTuple_SetItem(ret,0,res);
5188            PyTuple_SetItem(ret,1,res2);
5189            return ret;
5190          }
5191        }
5192   };
5193
5194   class MEDCouplingFieldInt : public MEDCouplingField
5195   {
5196   public:
5197     static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5198     static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5199     void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5200     std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5201     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5202     void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5203     MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5204     MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5205     MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5206     MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5207     %extend {
5208       MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5209       {
5210         return MEDCouplingFieldInt::New(type,td);
5211       }
5212
5213       MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5214       {
5215         return MEDCouplingFieldInt::New(ft,td);
5216       }
5217
5218       std::string __str__() const throw(INTERP_KERNEL::Exception)
5219       {
5220         return self->simpleRepr();
5221       }
5222
5223       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5224       {
5225         std::ostringstream oss;
5226         self->reprQuickOverview(oss);
5227         return oss.str();
5228       }
5229
5230       DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5231         {
5232           DataArrayInt *ret=self->getArray();
5233           if(ret)
5234             ret->incrRef();
5235           return ret;
5236         }
5237       
5238       PyObject *getTime() throw(INTERP_KERNEL::Exception)
5239         {
5240         int tmp1,tmp2;
5241         double tmp0=self->getTime(tmp1,tmp2);
5242         PyObject *res = PyList_New(3);
5243         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5244         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5245         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5246         return res;
5247         }
5248     }
5249   };
5250   
5251   class MEDCouplingDefinitionTime
5252   {
5253   public:
5254     MEDCouplingDefinitionTime();
5255     void assign(const MEDCouplingDefinitionTime& other);
5256     bool isEqual(const MEDCouplingDefinitionTime& other) const;
5257     double getTimeResolution() const;
5258     std::vector<double> getHotSpotsTime() const;
5259     %extend
5260       {
5261         std::string __str__() const throw(INTERP_KERNEL::Exception)
5262           {
5263             std::ostringstream oss;
5264             self->appendRepr(oss);
5265             return oss.str();
5266           }
5267
5268         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5269         {
5270           int meshId,arrId,arrIdInField,fieldId;
5271           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5272           PyObject *res=PyList_New(4);
5273           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5274           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5275           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5276           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5277           return res;
5278         }
5279
5280         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5281         {
5282           int meshId,arrId,arrIdInField,fieldId;
5283           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5284           PyObject *res=PyList_New(4);
5285           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5286           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5287           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5288           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5289           return res;
5290         }
5291       }
5292   };
5293
5294   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5295   {
5296   public:
5297     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5298     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5299     
5300     %extend
5301       {
5302         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5303           {
5304             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5305             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5306             int sz=tmp.size();
5307             std::vector<MEDCouplingFieldDouble *> fs(sz);
5308             for(int i=0;i<sz;i++)
5309               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5310             return MEDCouplingFieldOverTime::New(fs);
5311           }
5312         std::string __str__() const throw(INTERP_KERNEL::Exception)
5313           {
5314             return self->simpleRepr();
5315           }
5316         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5317         {
5318           std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5319           convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5320            int sz=tmp.size();
5321            std::vector<MEDCouplingFieldDouble *> fs(sz);
5322            for(int i=0;i<sz;i++)
5323              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5324            return MEDCouplingFieldOverTime::New(fs);
5325          }
5326       }
5327   };
5328
5329   class MEDCouplingCartesianAMRMesh;
5330   
5331   class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5332   {
5333   public:
5334     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5335     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5336     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5337     %extend
5338     {
5339       MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5340       {
5341         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5342         if(ret)
5343           ret->incrRef();
5344         return ret;
5345       }
5346     }
5347   };
5348
5349   class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5350   {
5351   public:
5352     int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5353     bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5354     std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5355     %extend
5356     {
5357       PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5358       {
5359         const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5360         return convertFromVectorPairInt(ret);
5361       }
5362
5363       PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5364       {
5365         std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5366         return convertFromVectorPairInt(ret);
5367       }
5368
5369       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5370       {
5371         std::vector< std::pair<int,int> > inp;
5372         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5373         self->addPatch(inp,factors);
5374       }
5375
5376       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5377       {
5378         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5379         if(!mesh)
5380           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5381         if(patchId==mesh->getNumberOfPatches())
5382           {
5383             std::ostringstream oss;
5384             oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5385             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5386             return 0;
5387           }
5388         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5389         if(ret)
5390           ret->incrRef();
5391         return ret;
5392       }
5393
5394       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5395       {
5396         MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5397         if(!mesh)
5398           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5399         mesh->removePatch(patchId);
5400       }
5401
5402       int __len__() const throw(INTERP_KERNEL::Exception)
5403       {
5404         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5405         if(!mesh)
5406           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5407         return mesh->getNumberOfPatches();
5408       }
5409     }
5410   };
5411
5412   class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5413   {
5414   };
5415   
5416   class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5417   {
5418   public:
5419     int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5420     int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5421     std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5422     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5423     const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5424     void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5425     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5426     int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5427     int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5428     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5429     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5430     bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5431    virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5432     //
5433     int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5434     int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5435     MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5436     DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5437     std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5438     MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5439     MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5440     void removeAllPatches() throw(INTERP_KERNEL::Exception);
5441     void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5442     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5443     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5444     DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5445     void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5446     void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5447     void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5448     void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5449     void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5450     void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5451     DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5452     std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5453     %extend
5454     {
5455       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5456       {
5457         std::vector< std::pair<int,int> > inp;
5458         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5459         self->addPatch(inp,factors);
5460       }
5461
5462       PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5463       {
5464         std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5465         int sz(ps.size());
5466         PyObject *ret = PyList_New(sz);
5467         for(int i=0;i<sz;i++)
5468           {
5469             MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5470             if(elt)
5471               elt->incrRef();
5472             PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5473           }
5474         return ret;
5475       }
5476
5477       // agy : don't know why typemap fails here ??? let it in the extend section
5478       PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5479       {
5480         return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5481       }
5482
5483       MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5484       {
5485         const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5486         MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5487         if(ret2)
5488           ret2->incrRef();
5489         return ret2;
5490       }
5491
5492       MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5493       {
5494         const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5495         MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5496         if(ret2)
5497           ret2->incrRef();
5498         return ret2;
5499       }
5500
5501       virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5502       {
5503         std::vector<int> out1;
5504         std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5505         PyObject *ret(PyTuple_New(2));
5506         PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5507         PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5508         return ret;
5509       }
5510
5511       virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5512       {
5513         std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5514         int sz(ps.size());
5515         PyObject *ret = PyList_New(sz);
5516         for(int i=0;i<sz;i++)
5517           PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5518         return ret;
5519       }
5520
5521       MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5522       {
5523         std::vector<const DataArrayDouble *> inp;
5524         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5525         return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5526       }
5527
5528       virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5529       {
5530         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5531         if(ret)
5532           ret->incrRef();
5533         return ret;
5534       }
5535       
5536       virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5537       {
5538         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5539         if(ret)
5540           ret->incrRef();
5541         return ret;
5542       }
5543
5544       MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5545       {
5546         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5547         if(ret)
5548           ret->incrRef();
5549         return ret;
5550       }
5551
5552       MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5553       {
5554         const MEDCouplingIMesh *ret(self->getImageMesh());
5555         if(ret)
5556           ret->incrRef();
5557         return const_cast<MEDCouplingIMesh *>(ret);
5558       }
5559
5560       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5561       {
5562         if(patchId==self->getNumberOfPatches())
5563           {
5564             std::ostringstream oss;
5565             oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5566             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5567             return 0;
5568           }
5569         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5570         if(ret)
5571           ret->incrRef();
5572         return ret;
5573       }
5574
5575       void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5576       {
5577         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5578         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5579         self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5580       }
5581
5582       void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5583       {
5584         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5585         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5586         self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5587       }
5588
5589       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5590       {
5591         self->removePatch(patchId);
5592       }
5593
5594       int __len__() const throw(INTERP_KERNEL::Exception)
5595       {
5596         return self->getNumberOfPatches();
5597       }
5598     }
5599   };
5600
5601   class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5602   {
5603   };
5604
5605   class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5606   {
5607   public:
5608     static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5609     %extend
5610     {
5611       static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5612       {
5613         static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5614         static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5615         const int *nodeStrctPtr(0);
5616         const double *originPtr(0),*dxyzPtr(0);
5617         int sw,sz,val0;
5618         std::vector<int> bb0;
5619         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5620         //
5621         double val,val2;
5622         std::vector<double> bb,bb2;
5623         int sz1,sz2;
5624         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5625         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5626         //
5627         return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5628       }
5629
5630       void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5631       {
5632         std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5633         convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5634         std::vector< std::vector<int> > inp2;
5635         convertPyToVectorOfVectorOfInt(factors,inp2);
5636         self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5637       }
5638
5639       MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5640       {
5641         return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5642       }
5643
5644       MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5645       {
5646         return MEDCouplingCartesianAMRMesh::New(mesh);
5647       }
5648     }
5649   };
5650
5651   class MEDCouplingDataForGodFather : public RefCountObject
5652   {
5653   public:
5654     virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5655     virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5656     virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5657     virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5658     virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5659     virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5660     virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5661     virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5662     virtual void alloc() throw(INTERP_KERNEL::Exception);
5663     virtual void dealloc() throw(INTERP_KERNEL::Exception);
5664     %extend
5665     {
5666       MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5667       {
5668         MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5669         if(ret)
5670           ret->incrRef();
5671         return ret;
5672       }
5673     }
5674   };
5675   
5676   class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5677   {
5678   public:
5679     int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5680     MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5681     MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5682     MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5683     MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5684     MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5685     bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5686     MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5687     std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5688     %extend
5689     {
5690       static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5691       {
5692         std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5693         std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5694         MEDCouplingAMRAttribute *ret(0);
5695         try
5696           {
5697             convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5698             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5699           }
5700         catch(INTERP_KERNEL::Exception&)
5701           {
5702             convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5703             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5704           }
5705         return ret;
5706       }
5707
5708       MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5709       {
5710         return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5711       }
5712
5713       DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5714       {
5715         const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5716         DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5717         if(ret2)
5718           ret2->incrRef();
5719         return ret2;
5720       }
5721
5722       void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5723       {
5724         std::vector< std::vector<std::string> > compNamesCpp;
5725         convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5726         self->spillInfoOnComponents(compNamesCpp);
5727       }
5728
5729       void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5730       {
5731         std::vector<int> inp0;
5732         if(!fillIntVector(nfs,inp0))
5733           throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5734         std::size_t sz(inp0.size());
5735         std::vector<NatureOfField> inp00(sz);
5736         for(std::size_t i=0;i<sz;i++)
5737           inp00[i]=(NatureOfField)inp0[i];
5738         self->spillNatures(inp00);
5739       }
5740       
5741       PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5742       {
5743         std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5744         int sz((int)ret.size());
5745         PyObject *retPy(PyList_New(sz));
5746         for(int i=0;i<sz;i++)
5747           PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5748         return retPy;
5749       }
5750     }
5751   };
5752
5753   class DenseMatrix : public RefCountObject, public TimeLabel
5754   {
5755   public:
5756     static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5757     static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5758     DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5759     DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5760     //
5761     int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5762     int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5763     int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5764     void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5765     void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5766     void transpose() throw(INTERP_KERNEL::Exception);
5767     //
5768     bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5769     DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5770     static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5771     %extend
5772     {
5773       DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5774       {
5775         return DenseMatrix::New(nbRows,nbCols);
5776       }
5777
5778       DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5779       {
5780         return DenseMatrix::New(array,nbRows,nbCols);
5781       }
5782
5783       PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5784       {
5785         std::string ret1;
5786         bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5787         PyObject *ret=PyTuple_New(2);
5788         PyObject *ret0Py=ret0?Py_True:Py_False;
5789         Py_XINCREF(ret0Py);
5790         PyTuple_SetItem(ret,0,ret0Py);
5791         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5792         return ret;
5793       }
5794
5795       DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5796       {
5797         DataArrayDouble *ret(self->getData());
5798         if(ret)
5799           ret->incrRef();
5800         return ret;
5801       }
5802
5803       DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5804       {
5805         return MEDCoupling::DenseMatrix::Add(self,other);
5806       }
5807
5808       DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5809       {
5810         return MEDCoupling::DenseMatrix::Substract(self,other);
5811       }
5812
5813       DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5814       {
5815         return MEDCoupling::DenseMatrix::Multiply(self,other);
5816       }
5817
5818       DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5819       {
5820         return MEDCoupling::DenseMatrix::Multiply(self,other);
5821       }
5822
5823       PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5824       {
5825         self->addEqual(other);
5826         Py_XINCREF(trueSelf);
5827         return trueSelf;
5828       }
5829
5830       PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5831       {
5832         self->substractEqual(other);
5833         Py_XINCREF(trueSelf);
5834         return trueSelf;
5835       }
5836 #ifdef WITH_NUMPY
5837       PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5838       {
5839         PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5840         return obj;
5841       }
5842 #endif
5843     }
5844   };
5845   
5846   class PartDefinition : public RefCountObject, public TimeLabel
5847   {
5848   public:
5849     static PartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5850     static PartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5851     virtual DataArrayInt *toDAI() const throw(INTERP_KERNEL::Exception);
5852     virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
5853     virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
5854     virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
5855     virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5856     virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
5857     %extend
5858     {
5859       virtual PartDefinition *__add__(const PartDefinition& other) const throw(INTERP_KERNEL::Exception)
5860       {
5861         return (*self)+other;
5862       }
5863
5864       virtual PyObject *isEqual(const PartDefinition *other) const throw(INTERP_KERNEL::Exception)
5865       {
5866         std::string ret1;
5867         bool ret0(self->isEqual(other,ret1));
5868         PyObject *ret=PyTuple_New(2);
5869         PyObject *ret0Py=ret0?Py_True:Py_False;
5870         Py_XINCREF(ret0Py);
5871         PyTuple_SetItem(ret,0,ret0Py);
5872         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5873         return ret;
5874       }
5875
5876       virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
5877       {
5878         return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
5879       }
5880     }
5881   protected:
5882     virtual ~PartDefinition();
5883   };
5884
5885   class DataArrayPartDefinition : public PartDefinition
5886   {
5887   public:
5888     static DataArrayPartDefinition *New(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception);
5889     %extend
5890     {
5891       DataArrayPartDefinition(DataArrayInt *listOfIds) throw(INTERP_KERNEL::Exception)
5892       {
5893         return DataArrayPartDefinition::New(listOfIds);
5894       }
5895
5896       std::string __str__() const throw(INTERP_KERNEL::Exception)
5897       {
5898         return self->getRepr();
5899       }
5900       
5901       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5902       {
5903         std::ostringstream oss; oss << "DataArrayPartDefinition C++ instance at " << self << "." << std::endl;
5904         oss << self->getRepr();
5905         return oss.str();
5906       }
5907     }
5908   protected:
5909     virtual ~DataArrayPartDefinition();
5910   };
5911
5912   class SlicePartDefinition : public PartDefinition
5913   {
5914   public:
5915     static SlicePartDefinition *New(int start, int stop, int step) throw(INTERP_KERNEL::Exception);
5916     int getEffectiveStop() const throw(INTERP_KERNEL::Exception);
5917     %extend
5918     {
5919       SlicePartDefinition(int start, int stop, int step) throw(INTERP_KERNEL::Exception)
5920       {
5921         return SlicePartDefinition::New(start,stop,step);
5922       }
5923
5924       PyObject *getSlice() const throw(INTERP_KERNEL::Exception)
5925       {
5926         int a,b,c;
5927         self->getSlice(a,b,c);
5928         return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
5929       }
5930       
5931       std::string __str__() const throw(INTERP_KERNEL::Exception)
5932       {
5933         return self->getRepr();
5934       }
5935       
5936       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5937       {
5938         std::ostringstream oss; oss << "SlicePartDefinition C++ instance at " << self << "." << std::endl;
5939         oss << self->getRepr();
5940         return oss.str();
5941       }
5942     }
5943   protected:
5944     virtual ~SlicePartDefinition();
5945   };
5946 }
5947
5948 %pythoncode %{
5949 import os
5950 __filename=os.environ.get('PYTHONSTARTUP')
5951 if __filename and os.path.isfile(__filename):
5952   execfile(__filename)
5953   pass
5954 %}