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