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