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