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