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