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