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