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