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