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