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