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