Salome HOME
Copyright update 2021
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2017-2021  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (EDF R&D)
20
21 #ifdef WITH_DOCSTRINGS
22 %include MEDCoupling_doc.i
23 #endif
24
25 %include std_vector.i
26 %include std_string.i
27
28 %{
29 #include "MEDCouplingMemArray.hxx"
30 #include "MEDCouplingMemArray.txx"
31 #include "MEDCouplingUMesh.hxx"
32 #include "MEDCouplingMappedExtrudedMesh.hxx"
33 #include "MEDCouplingCMesh.hxx"
34 #include "MEDCouplingIMesh.hxx"
35 #include "MEDCouplingMap.txx"
36 #include "MEDCouplingCurveLinearMesh.hxx"
37 #include "MEDCoupling1GTUMesh.hxx"
38 #include "MEDCouplingField.hxx"
39 #include "MEDCouplingFieldDouble.hxx"
40 #include "MEDCouplingFieldInt32.hxx"
41 #include "MEDCouplingFieldInt64.hxx"
42 #include "MEDCouplingFieldFloat.hxx"
43 #include "MEDCouplingFieldTemplate.hxx"
44 #include "MEDCouplingGaussLocalization.hxx"
45 #include "MCAuto.hxx"
46 #include "MEDCouplingMultiFields.hxx"
47 #include "MEDCouplingFieldOverTime.hxx"
48 #include "MEDCouplingDefinitionTime.hxx"
49 #include "MEDCouplingFieldDiscretization.hxx"
50 #include "MEDCouplingCartesianAMRMesh.hxx"
51 #include "MEDCouplingAMRAttribute.hxx"
52 #include "MEDCouplingMatrix.hxx"
53 #include "MEDCouplingPartDefinition.hxx"
54 #include "MEDCouplingSkyLineArray.hxx"
55 #include "MEDCouplingTypemaps.i"
56
57 #include "InterpKernelAutoPtr.hxx"
58 #include "BoxSplittingOptions.hxx"
59
60 using namespace MEDCoupling;
61 using namespace INTERP_KERNEL;
62
63 %}
64
65 %template(dvec) std::vector<double>;
66 %template(svec) std::vector<std::string>;
67
68 //%include stdint.i
69
70 #ifndef MEDCOUPLING_USE_64BIT_IDS
71 //typedef std::int32_t mcIdType;
72 typedef int mcIdType;
73 typedef DataArrayInt32 DataArrayIdType;
74 %template(ivec) std::vector<int>;
75 %template(i64vec) std::vector<long>;
76 #else
77 //typedef std::int64_t mcIdType;
78 typedef DataArrayInt64 DataArrayIdType;
79 #ifdef WIN32
80 %template(ivec) std::vector<long long>;
81 typedef long long mcIdType;
82 #else 
83 %template(ivec) std::vector<long>;
84 typedef long int mcIdType;
85 #endif
86 %template(i32vec) std::vector<int>;
87 #endif
88
89
90 ////////////////////
91 %typemap(out) MEDCoupling::MEDCouplingMesh*
92 {
93   $result=convertMesh($1,$owner);
94 }
95
96 %typemap(out) MEDCouplingMesh*
97 {
98   $result=convertMesh($1,$owner);
99 }
100 //$$$$$$$$$$$$$$$$$$
101
102 ////////////////////
103 %typemap(out) MEDCoupling::MEDCouplingPointSet*
104 {
105   $result=convertMesh($1,$owner);
106 }
107
108 %typemap(out) MEDCouplingPointSet*
109 {
110   $result=convertMesh($1,$owner);
111 }
112 //$$$$$$$$$$$$$$$$$$
113
114 ////////////////////
115 %typemap(out) MEDCouplingCartesianAMRPatchGen*
116 {
117   $result=convertCartesianAMRPatch($1,$owner);
118 }
119 //$$$$$$$$$$$$$$$$$$
120
121 ////////////////////
122 %typemap(out) MEDCouplingCartesianAMRMeshGen*
123 {
124   $result=convertCartesianAMRMesh($1,$owner);
125 }
126 //$$$$$$$$$$$$$$$$$$
127
128 ////////////////////
129 %typemap(out) MEDCouplingDataForGodFather*
130 {
131   $result=convertDataForGodFather($1,$owner);
132 }
133 //$$$$$$$$$$$$$$$$$$
134
135 ////////////////////
136 %typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
137 {
138   $result=convertMesh($1,$owner);
139 }
140
141 %typemap(out) MEDCoupling1GTUMesh*
142 {
143   $result=convertMesh($1,$owner);
144 }
145 //$$$$$$$$$$$$$$$$$$
146
147 ////////////////////
148 %typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
149 {
150   $result=convertMesh($1,$owner);
151 }
152
153 %typemap(out) MEDCouplingStructuredMesh*
154 {
155   $result=convertMesh($1,$owner);
156 }
157 //$$$$$$$$$$$$$$$$$$
158
159 ////////////////////
160 %typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
161 {
162   $result=convertFieldDiscretization($1,$owner);
163 }
164
165 %typemap(out) MEDCouplingFieldDiscretization*
166 {
167   $result=convertFieldDiscretization($1,$owner);
168 }
169 //$$$$$$$$$$$$$$$$$$
170
171 ////////////////////
172 %typemap(out) MEDCoupling::MEDCouplingField*
173 {
174   $result=convertField($1,$owner);
175 }
176
177 %typemap(out) MEDCouplingField*
178 {
179   $result=convertField($1,$owner);
180 }
181 //$$$$$$$$$$$$$$$$$$
182
183 ////////////////////
184 %typemap(out) MEDCoupling::MEDCouplingMultiFields*
185 {
186   $result=convertMultiFields($1,$owner);
187 }
188
189 %typemap(out) MEDCouplingMultiFields*
190 {
191   $result=convertMultiFields($1,$owner);
192 }
193 //$$$$$$$$$$$$$$$$$$
194
195 ////////////////////
196 %typemap(out) MEDCoupling::PartDefinition*
197 {
198   $result=convertPartDefinition($1,$owner);
199 }
200
201 %typemap(out) PartDefinition*
202 {
203   $result=convertPartDefinition($1,$owner);
204 }
205 //$$$$$$$$$$$$$$$$$$
206
207 #ifdef WITH_NUMPY
208 %init %{ import_array(); %}
209 #endif
210
211 %init %{ initializeMe(); %}
212
213 %feature("autodoc", "1");
214 %feature("docstring");
215
216 %newobject MEDCoupling::MEDCouplingField::buildMeasureField;
217 %newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
218 %newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
219 %newobject MEDCoupling::MEDCouplingFieldDouble::New;
220 %newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
221 %newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
222 %newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
223 %newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
224 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToIntField;
225 %newobject MEDCoupling::MEDCouplingFieldDouble::convertToFloatField;
226 %newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
227 %newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
228 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
229 %newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
230 %newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
231 %newobject MEDCoupling::MEDCouplingFieldDouble::trace;
232 %newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
233 %newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
234 %newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
235 %newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
236 %newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
237 %newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
238 %newobject MEDCoupling::MEDCouplingFieldDouble::dot;
239 %newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
240 %newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
241 %newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
242 %newobject MEDCoupling::MEDCouplingFieldDouble::max;
243 %newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
244 %newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
245 %newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
246 %newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
247 %newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
248 %newobject MEDCoupling::MEDCouplingFieldDouble::min;
249 %newobject MEDCoupling::MEDCouplingFieldDouble::negate;
250 %newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
251 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
252 %newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
253 %newobject MEDCoupling::MEDCouplingFieldDouble::voronoize;
254 %newobject MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear;
255 %newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
256 %newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
257 %newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
258 %newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
259 %newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
260 %newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
261 %newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
262 %newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
263 %newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
264 %newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
265 %newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
266 %newobject MEDCoupling::MEDCouplingFieldDouble::clone;
267 %newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
268 %newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
269 %newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
270 %newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
271 %newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
272 %newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
273 %newobject MEDCoupling::MEDCouplingFieldDouble::computeVectorFieldCyl;
274 %newobject MEDCoupling::MEDCouplingFieldInt32::New;
275 %newobject MEDCoupling::MEDCouplingFieldInt32::convertToDblField;
276 %newobject MEDCoupling::MEDCouplingFieldInt32::getArray;
277 %newobject MEDCoupling::MEDCouplingFieldInt32::deepCopy;
278 %newobject MEDCoupling::MEDCouplingFieldInt32::clone;
279 %newobject MEDCoupling::MEDCouplingFieldInt32::cloneWithMesh;
280 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPart;
281 %newobject MEDCoupling::MEDCouplingFieldInt32::buildSubPartRange;
282 %newobject MEDCoupling::MEDCouplingFieldInt32::__getitem__;
283 %newobject MEDCoupling::MEDCouplingFieldInt64::New;
284 %newobject MEDCoupling::MEDCouplingFieldInt64::convertToDblField;
285 %newobject MEDCoupling::MEDCouplingFieldInt64::getArray;
286 %newobject MEDCoupling::MEDCouplingFieldInt64::deepCopy;
287 %newobject MEDCoupling::MEDCouplingFieldInt64::clone;
288 %newobject MEDCoupling::MEDCouplingFieldInt64::cloneWithMesh;
289 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPart;
290 %newobject MEDCoupling::MEDCouplingFieldInt64::buildSubPartRange;
291 %newobject MEDCoupling::MEDCouplingFieldInt64::__getitem__;
292 %newobject MEDCoupling::MEDCouplingFieldFloat::New;
293 %newobject MEDCoupling::MEDCouplingFieldFloat::convertToDblField;
294 %newobject MEDCoupling::MEDCouplingFieldFloat::getArray;
295 %newobject MEDCoupling::MEDCouplingFieldFloat::deepCopy;
296 %newobject MEDCoupling::MEDCouplingFieldFloat::clone;
297 %newobject MEDCoupling::MEDCouplingFieldFloat::cloneWithMesh;
298 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPart;
299 %newobject MEDCoupling::MEDCouplingFieldFloat::buildSubPartRange;
300 %newobject MEDCoupling::MEDCouplingFieldFloat::__getitem__;
301 %newobject MEDCoupling::MEDCouplingFieldTemplate::New;
302 %newobject MEDCoupling::MEDCouplingMesh::deepCopy;
303 %newobject MEDCoupling::MEDCouplingMesh::clone;
304 %newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
305 %newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
306 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
307 %newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
308 %newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
309 %newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
310 %newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
311 %newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
312 %newobject MEDCoupling::MEDCouplingMesh::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 checkGeomConsistency(double eps=1e-12) const;
2052     void setMeshDimension(int meshDim);
2053     void allocateCells(int nbOfCells=0);
2054     void finishInsertingCells();
2055     MEDCouplingUMeshCellByTypeEntry *cellsByType();
2056     void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
2057     INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
2058     void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
2059     int getNodalConnectivityArrayLen() const;
2060     void computeTypes();
2061     std::string reprConnectivityOfThis() const;
2062     MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const;
2063     //tools
2064     DataArrayIdType *conformize2D(double eps);
2065     DataArrayIdType *conformize3D(double eps);
2066     DataArrayIdType *colinearize2D(double eps);
2067     DataArrayIdType *colinearizeKeepingConform2D(double eps);
2068     void shiftNodeNumbersInConn(int delta);
2069     std::vector<bool> getQuadraticStatus() const;
2070     DataArrayIdType *findCellIdsOnBoundary() const;
2071     MEDCouplingUMesh *computeSkin() const;
2072     bool checkConsecutiveCellTypes() const;
2073     bool checkConsecutiveCellTypesForMEDFileFrmt() const;
2074     DataArrayIdType *rearrange2ConsecutiveCellTypes();
2075     DataArrayIdType *sortCellsInMEDFileFrmt();
2076     DataArrayIdType *getRenumArrForMEDFileFrmt() const;
2077     DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
2078     MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2079     MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2080     MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2081     MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
2082     void orientCorrectlyPolyhedrons();
2083     bool isPresenceOfQuadratic() const;
2084     bool isFullyQuadratic() const;
2085     MEDCouplingFieldDouble *buildDirectionVectorField() const;
2086     bool isContiguous1D() const;
2087     void tessellate2D(double eps);
2088     void convertQuadraticCellsToLinear();
2089     DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
2090     void convertDegeneratedCells();
2091     DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
2092     bool removeDegenerated1DCells();
2093     bool areOnlySimplexCells() const;
2094     MEDCouplingFieldDouble *getEdgeRatioField() const;
2095     MEDCouplingFieldDouble *getAspectRatioField() const;
2096     MEDCouplingFieldDouble *getWarpField() const;
2097     MEDCouplingFieldDouble *getSkewField() const;
2098     DataArrayDouble *computePlaneEquationOf3DFaces() const;
2099     DataArrayIdType *convexEnvelop2D();
2100     std::string cppRepr() const;
2101     DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
2102     DataArrayIdType *findAndCorrectBadOriented3DCells();
2103     MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
2104     MEDCouplingSkyLineArray *generateGraph() const;
2105     DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
2106     DataArrayIdType *buildUnionOf2DMesh() const;
2107     DataArrayIdType *buildUnionOf3DMesh() const;
2108     DataArrayIdType *orderConsecutiveCells1D() const;
2109     DataArrayDouble *getBoundingBoxForBBTreeFast() const;
2110     DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
2111     DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
2112     void changeOrientationOfCells();
2113     DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps);
2114     int split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
2115     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
2116     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2117     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
2118     static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
2119     static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
2120     %extend {
2121       MEDCouplingUMesh()
2122       {
2123         return MEDCouplingUMesh::New();
2124       }
2125       
2126       MEDCouplingUMesh(const char *meshName, int meshDim)
2127       {
2128         return MEDCouplingUMesh::New(meshName,meshDim);
2129       }
2130
2131       std::string __str__() const
2132       {
2133         return self->simpleRepr();
2134       }
2135       
2136       std::string __repr__() const
2137       {
2138         std::ostringstream oss;
2139         self->reprQuickOverview(oss);
2140         return oss.str();
2141       }
2142       
2143       MEDCouplingUMeshCellIterator *__iter__()
2144       {
2145         return self->cellIterator();
2146       }
2147
2148       static MEDCouplingUMesh *Build1DMeshFromCoords(DataArrayDouble *da)
2149       {
2150         MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::Build1DMeshFromCoords(da));
2151         return ret.retn();
2152       }
2153       
2154       PyObject *getAllGeoTypesSorted() const
2155       {
2156         std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
2157         std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2158         PyObject *res=PyList_New(result.size());
2159         for(int i=0;iL!=result.end(); i++, iL++)
2160           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2161         return res;
2162       }
2163       
2164       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2165       {
2166         mcIdType sw;
2167         mcIdType singleVal;
2168         std::vector<mcIdType> multiVal;
2169         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2170         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2171         mcIdType nbc=self->getNumberOfCells();
2172         convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2173         switch(sw)
2174           {
2175           case 1:
2176             {
2177               if(singleVal>=nbc)
2178                 {
2179                   std::ostringstream oss;
2180                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2181                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2182                 }
2183               if(singleVal>=0)
2184                 {
2185                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2186                   break;
2187                 }
2188               else
2189                 {
2190                   if(nbc+singleVal>0)
2191                     {
2192                       mcIdType tmp=nbc+singleVal;
2193                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2194                       break;
2195                     }
2196                   else
2197                     {
2198                       std::ostringstream oss;
2199                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2200                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2201                     }
2202                 }
2203             }
2204           case 2:
2205             {
2206               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2207               break;
2208             }
2209           case 4:
2210             {
2211               if(!daIntTyypp)
2212                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
2213               daIntTyypp->checkAllocated();
2214               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2215               break;
2216             }
2217           default:
2218             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayIdType instance !");
2219           }
2220       }
2221
2222       void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
2223       {
2224         mcIdType sw;
2225         mcIdType singleVal;
2226         std::vector<mcIdType> multiVal;
2227         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2228         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2229         mcIdType nbc=self->getNumberOfCells();
2230         convertIntStarOrSliceLikePyObjToCpp(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
2231         switch(sw)
2232           {
2233           case 1:
2234             {
2235               if(singleVal>=nbc)
2236                 {
2237                   std::ostringstream oss;
2238                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2239                   throw INTERP_KERNEL::Exception(oss.str().c_str());
2240                 }
2241               if(singleVal>=0)
2242                 {
2243                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
2244                   break;
2245                 }
2246               else
2247                 {
2248                   if(nbc+singleVal>0)
2249                     {
2250                       mcIdType tmp=nbc+singleVal;
2251                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
2252                       break;
2253                     }
2254                   else
2255                     {
2256                       std::ostringstream oss;
2257                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
2258                       throw INTERP_KERNEL::Exception(oss.str().c_str());
2259                     }
2260                 }
2261             }
2262           case 2:
2263             {
2264               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
2265               break;
2266             }
2267           case 3:
2268             {
2269               self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
2270               break;
2271             }
2272           case 4:
2273             {
2274               if(!daIntTyypp)
2275                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
2276               daIntTyypp->checkAllocated();
2277               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
2278               break;
2279             }
2280           default:
2281             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayIdType instance !");
2282           }
2283       }
2284
2285       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, PyObject *li)
2286       {
2287         mcIdType szArr,sw,iTypppArr;
2288         std::vector<mcIdType> stdvecTyyppArr;
2289         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2290         if(size>szArr)
2291           {
2292             std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
2293             throw INTERP_KERNEL::Exception(oss.str().c_str());
2294           }
2295         self->insertNextCell(type,size,tmp);
2296       }
2297
2298       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li)
2299       {
2300         mcIdType szArr,sw,iTypppArr;
2301         std::vector<mcIdType> stdvecTyyppArr;
2302         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2303         self->insertNextCell(type,szArr,tmp);
2304       }
2305       
2306       DataArrayIdType *getNodalConnectivity()
2307       {
2308         DataArrayIdType *ret=self->getNodalConnectivity();
2309         if(ret)
2310           ret->incrRef();
2311         return ret;
2312       }
2313       DataArrayIdType *getNodalConnectivityIndex()
2314       {
2315         DataArrayIdType *ret=self->getNodalConnectivityIndex();
2316         if(ret)
2317           ret->incrRef();
2318         return ret;
2319       }
2320       
2321       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling=-1)
2322       {
2323         mcIdType szArr,sw,iTypppArr;
2324         std::vector<mcIdType> stdvecTyyppArr;
2325         const mcIdType *seedPtr=convertIntStarLikePyObjToCppIntStar(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
2326         mcIdType nbOfDepthPeelingPerformed=0;
2327         DataArrayIdType *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
2328         PyObject *res=PyTuple_New(2);
2329         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2330         PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
2331         return res;
2332       }
2333
2334       static PyObject *FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI)
2335       {
2336         DataArrayIdType *v0=0,*v1=0;
2337         MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
2338         PyObject *res = PyList_New(2);
2339         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2340         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2341         return res;
2342       }
2343       
2344       PyObject *distanceToPoint(PyObject *point) const
2345       {
2346         double val;
2347         DataArrayDouble *a;
2348         DataArrayDoubleTuple *aa;
2349         std::vector<double> bb;
2350         mcIdType sw;
2351         int nbOfCompo=self->getSpaceDimension();
2352         const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
2353         //
2354         mcIdType cellId=-1;
2355         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
2356         PyObject *ret=PyTuple_New(2);
2357         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
2358         PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
2359         return ret;
2360       }
2361
2362       PyObject *distanceToPoints(const DataArrayDouble *pts) const
2363       {
2364         DataArrayIdType *ret1=0;
2365         DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
2366         PyObject *ret=PyTuple_New(2);
2367         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
2368         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2369         return ret;
2370       }
2371
2372       PyObject *tetrahedrize(int policy)
2373       {
2374         mcIdType ret2(-1);
2375         DataArrayIdType *ret1(0);
2376         MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
2377         PyObject *ret=PyTuple_New(3);
2378         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
2379         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2380         PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
2381         return ret;
2382       }
2383       
2384       PyObject *checkButterflyCells(double eps=1e-12)
2385       {
2386         std::vector<mcIdType> cells;
2387         self->checkButterflyCells(cells,eps);
2388         DataArrayIdType *ret=DataArrayIdType::New();
2389         ret->alloc(cells.size(),1);
2390         std::copy(cells.begin(),cells.end(),ret->getPointer());
2391         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2392       }
2393
2394       PyObject *splitByType() const
2395       {
2396         std::vector<MEDCouplingUMesh *> ms=self->splitByType();
2397         std::size_t sz=ms.size();
2398         PyObject *ret = PyList_New(sz);
2399         for(std::size_t i=0;i<sz;i++)
2400           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2401         return ret;
2402       }
2403
2404       PyObject *partitionBySpreadZone() const
2405       {
2406         std::vector<DataArrayIdType *> retCpp=self->partitionBySpreadZone();
2407         std::size_t sz=retCpp.size();
2408         PyObject *ret=PyList_New(sz);
2409         for(std::size_t i=0;i<sz;i++)
2410           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2411         return ret;
2412       }
2413
2414       static PyObject *PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
2415       {
2416         std::vector<DataArrayIdType *> retCpp(MEDCouplingUMesh::PartitionBySpreadZone(arrIn,arrIndxIn));
2417         std::size_t sz=retCpp.size();
2418         PyObject *ret=PyList_New(sz);
2419         for(std::size_t i=0;i<sz;i++)
2420           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2421         return ret;
2422       }
2423
2424       PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const
2425       {
2426         mcIdType size;
2427         INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(ids,&size);
2428         MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
2429         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
2430       }
2431
2432       bool checkConsecutiveCellTypesAndOrder(PyObject *li) const
2433       {
2434         mcIdType sz;
2435         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2436         bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
2437         return ret;
2438       }
2439
2440       DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const
2441       {
2442         mcIdType sz;
2443         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2444         DataArrayIdType *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
2445         return ret;
2446       }
2447
2448       PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2449       {
2450         DataArrayIdType *tmp0=0,*tmp1=0,*tmp2=0;
2451         self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
2452         PyObject *ret=PyTuple_New(3);
2453         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2454         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2455         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2456         return ret;
2457       }
2458
2459       PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const
2460       {
2461         DataArrayIdType *tmp0=0,*tmp1=0;
2462         self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
2463         PyObject *ret=PyTuple_New(2);
2464         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2465         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2466         return ret;
2467       }
2468
2469       void duplicateNodes(PyObject *li)
2470       {
2471         mcIdType sw;
2472         mcIdType singleVal;
2473         std::vector<mcIdType> multiVal;
2474         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2475         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2476         convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2477         switch(sw)
2478           {
2479           case 1:
2480             return self->duplicateNodes(&singleVal,&singleVal+1);
2481           case 2:
2482             return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
2483           case 4:
2484             return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
2485           default:
2486             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2487           }
2488       }
2489
2490       void duplicateNodesInConn(PyObject *li, mcIdType offset)
2491       {
2492         mcIdType sw;
2493         mcIdType singleVal;
2494         std::vector<mcIdType> multiVal;
2495         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
2496         MEDCoupling::DataArrayIdType *daIntTyypp=0;
2497         convertIntStarOrSliceLikePyObjToCpp(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
2498         switch(sw)
2499           {
2500           case 1:
2501             return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
2502           case 2:
2503             return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
2504           case 4:
2505             return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
2506           default:
2507             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayIdType !");
2508           }
2509       }
2510
2511       void attractSeg3MidPtsAroundNodes(double ratio, PyObject *nodeIds)
2512       {
2513         mcIdType szArr,sw,iTypppArr;
2514         std::vector<mcIdType> stdvecTyyppArr;
2515         const mcIdType *nodeIdsPtr(convertIntStarLikePyObjToCppIntStar(nodeIds,sw,szArr,iTypppArr,stdvecTyyppArr));
2516         self->attractSeg3MidPtsAroundNodes(ratio,nodeIdsPtr,nodeIdsPtr+szArr);
2517       }
2518
2519       PyObject *getLevArrPerCellTypes(PyObject *li) const
2520       {
2521         mcIdType sz;
2522         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=convertPyToNewIntArr2<INTERP_KERNEL::NormalizedCellType>(li,&sz);
2523         DataArrayIdType *tmp0,*tmp1=0;
2524         tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
2525         PyObject *ret=PyTuple_New(2);
2526         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2527         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2528         return ret;
2529       }
2530
2531       PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const
2532       {
2533         DataArrayIdType *ret0=0,*ret1=0;
2534         self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
2535         PyObject *ret=PyTuple_New(2);
2536         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2537         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2538         return ret;
2539       }
2540
2541       static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms)
2542       {
2543         std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2544         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2545         DataArrayIdType *ret1=0,*ret2=0;
2546         MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
2547         PyObject *ret=PyTuple_New(3);
2548         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2549         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2550         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2551         return ret;
2552       }
2553
2554       static PyObject *MergeUMeshesOnSameCoords(PyObject *ms)
2555       {
2556         std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
2557         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2558         MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
2559         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2560       }
2561
2562       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
2563       {
2564         std::size_t sz;
2565         std::vector<const MEDCouplingUMesh *> meshes;
2566         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2567         std::vector<DataArrayIdType *> corr;
2568         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
2569         sz=corr.size();
2570         PyObject *ret1=PyList_New(sz);
2571         for(std::size_t i=0;i<sz;i++)
2572           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2573         PyObject *ret=PyList_New(2);
2574         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2575         PyList_SetItem(ret,1,ret1);
2576         return ret;
2577       }
2578
2579       static void PutUMeshesOnSameAggregatedCoords(PyObject *ms)
2580       {
2581         std::vector<MEDCouplingUMesh *> meshes;
2582         convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2583         MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2584       }
2585
2586       static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps)
2587       {
2588         std::vector<MEDCouplingUMesh *> meshes;
2589         convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2590         MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2591       }
2592
2593       PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const
2594       {
2595         double val;
2596         DataArrayDouble *a;
2597         DataArrayDoubleTuple *aa;
2598         std::vector<double> bb;
2599         mcIdType sw;
2600         int spaceDim=self->getSpaceDimension();
2601         const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2602         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2603         //
2604         std::vector<mcIdType> cells;
2605         self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2606         DataArrayIdType *ret=DataArrayIdType::New();
2607         ret->alloc(cells.size(),1);
2608         std::copy(cells.begin(),cells.end(),ret->getPointer());
2609         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2610       }
2611
2612       void orientCorrectly2DCells(PyObject *vec, bool polyOnly)
2613       {
2614         double val;
2615         DataArrayDouble *a;
2616         DataArrayDoubleTuple *aa;
2617         std::vector<double> bb;
2618         mcIdType sw;
2619         int spaceDim=self->getSpaceDimension();
2620         const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2621         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2622         self->orientCorrectly2DCells(v,polyOnly);
2623       }
2624       
2625       PyObject *arePolyhedronsNotCorrectlyOriented() const
2626       {
2627         std::vector<mcIdType> cells;
2628         self->arePolyhedronsNotCorrectlyOriented(cells);
2629         DataArrayIdType *ret=DataArrayIdType::New();
2630         ret->alloc(cells.size(),1);
2631         std::copy(cells.begin(),cells.end(),ret->getPointer());
2632         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
2633       }
2634
2635       PyObject *getFastAveragePlaneOfThis() const
2636       {
2637         double vec[3];
2638         double pos[3];
2639         self->getFastAveragePlaneOfThis(vec,pos);
2640         double vals[6];
2641         std::copy(vec,vec+3,vals);
2642         std::copy(pos,pos+3,vals+3);
2643         return convertDblArrToPyListOfTuple<double>(vals,3,2);
2644       }
2645       
2646       static MEDCouplingUMesh *MergeUMeshes(PyObject *li)
2647       {
2648         std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
2649         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2650         return MEDCouplingUMesh::MergeUMeshes(tmp);
2651       }
2652
2653       PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const
2654       {
2655         DataArrayIdType *ret1;
2656         bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2657         PyObject *ret=PyTuple_New(2);
2658         PyObject *ret0Py=ret0?Py_True:Py_False;
2659         Py_XINCREF(ret0Py);
2660         PyTuple_SetItem(ret,0,ret0Py);
2661         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2662         return ret;
2663       }
2664
2665       PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const
2666       {
2667         DataArrayIdType *ret1;
2668         bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
2669         PyObject *ret=PyTuple_New(2);
2670         PyObject *ret0Py=ret0?Py_True:Py_False;
2671         Py_XINCREF(ret0Py);
2672         PyTuple_SetItem(ret,0,ret0Py);
2673         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2674         return ret;
2675       }
2676
2677       PyObject *explode3DMeshTo1D() const
2678       {
2679         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2680         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2681         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2682         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2683         MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2684         PyObject *ret=PyTuple_New(5);
2685         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2686         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2687         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2688         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2689         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2690         return ret;
2691       }
2692
2693       PyObject *explodeIntoEdges() const
2694       {
2695         MCAuto<DataArrayIdType> desc,descIndex,revDesc,revDescIndx;
2696         MCAuto<MEDCouplingUMesh> m(self->explodeIntoEdges(desc,descIndex,revDesc,revDescIndx));
2697         PyObject *ret=PyTuple_New(5);
2698         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2699         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(desc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2700         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(descIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2701         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(revDesc.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2702         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(revDescIndx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2703         return ret;
2704       }
2705
2706       PyObject *explodeMeshIntoMicroEdges() const
2707       {
2708         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2709         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2710         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2711         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2712         MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2713         PyObject *ret=PyTuple_New(5);
2714         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2715         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2716         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2717         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2718         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2719         return ret;
2720       }
2721
2722       PyObject *buildDescendingConnectivity() const
2723       {
2724         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2725         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2726         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2727         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2728         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2729         PyObject *ret=PyTuple_New(5);
2730         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2731         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2732         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2733         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2734         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2735         return ret;
2736       }
2737
2738       PyObject *buildDescendingConnectivity2() const
2739       {
2740         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2741         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2742         MCAuto<DataArrayIdType> d2=DataArrayIdType::New();
2743         MCAuto<DataArrayIdType> d3=DataArrayIdType::New();
2744         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2745         PyObject *ret=PyTuple_New(5);
2746         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2747         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2748         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2749         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2750         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2751         return ret;
2752       }
2753       
2754       PyObject *computeNeighborsOfCells() const
2755       {
2756         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2757         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2758         PyObject *ret=PyTuple_New(2);
2759         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2760         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2761         return ret;
2762       }
2763
2764       PyObject *computeNeighborsOfNodes() const
2765       {
2766         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2767         self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2768         PyObject *ret=PyTuple_New(2);
2769         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2770         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2771         return ret;
2772       }
2773
2774       PyObject *computeEnlargedNeighborsOfNodes() const
2775       {
2776         MCAuto<DataArrayIdType> neighbors,neighborsIdx;
2777         self->computeEnlargedNeighborsOfNodes(neighbors,neighborsIdx);
2778         PyObject *ret=PyTuple_New(2);
2779         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2780         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2781         return ret;
2782       }
2783       
2784       PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI) const
2785       {
2786         MCAuto<DataArrayIdType> cellNeigh,cellNeighIndex;
2787         self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2788         PyObject *ret=PyTuple_New(2);
2789         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2790         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2791         return ret;
2792       }
2793       
2794       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI)
2795       {
2796         DataArrayIdType *neighbors=0,*neighborsIdx=0;
2797         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2798         PyObject *ret=PyTuple_New(2);
2799         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2800         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2801         return ret;
2802       }
2803
2804       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2805       {
2806         MCAuto<DataArrayIdType> d0=DataArrayIdType::New();
2807         MCAuto<DataArrayIdType> d1=DataArrayIdType::New();
2808         DataArrayIdType *d2,*d3,*d4,*dd5;
2809         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2810         PyObject *ret=PyTuple_New(7);
2811         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2812         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2813         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2814         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2815         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2816         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2817         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2818         return ret;
2819       }
2820
2821       DataArrayDouble *getPartBarycenterAndOwner(DataArrayIdType *da) const
2822       {
2823         if(!da)
2824           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2825         da->checkAllocated();
2826         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2827       }
2828
2829       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayIdType *da) const
2830       {
2831         if(!da)
2832           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2833         da->checkAllocated();
2834         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2835       }
2836
2837       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayIdType *da) const
2838       {
2839         if(!da)
2840           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2841         da->checkAllocated();
2842         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2843       }
2844
2845       PyObject *getTypesOfPart(DataArrayIdType *da) const
2846       {
2847         if(!da)
2848           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2849         da->checkAllocated();
2850         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2851         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2852         PyObject *res = PyList_New(result.size());
2853         for (int i=0;iL!=result.end(); i++, iL++)
2854           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2855         return res;
2856       }
2857
2858       DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayIdType *da) const
2859       {
2860         if(!da)
2861           throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
2862         da->checkAllocated();
2863         DataArrayIdType *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2864         ret->setName(da->getName().c_str());
2865         return ret;
2866       }
2867
2868       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps)
2869       {
2870         DataArrayIdType *cellNb1=0,*cellNb2=0;
2871         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2872         PyObject *ret=PyTuple_New(3);
2873         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2874         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2875         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2876         return ret;
2877       }
2878
2879       static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps)
2880       {
2881         MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2882         DataArrayIdType *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2883         MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2884         PyObject *ret(PyTuple_New(4));
2885         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2886         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2887         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2888         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2889         return ret;
2890       }
2891
2892       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const
2893       {
2894         int spaceDim=self->getSpaceDimension();
2895         if(spaceDim!=3)
2896           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2897         double val,val2;
2898         DataArrayDouble *a,*a2;
2899         DataArrayDoubleTuple *aa,*aa2;
2900         std::vector<double> bb,bb2;
2901         mcIdType sw;
2902         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st parameter for origin.";
2903         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd parameter for vector.";
2904         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2905         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2906         //
2907         DataArrayIdType *cellIds=0;
2908         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2909         PyObject *ret=PyTuple_New(2);
2910         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2911         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2912         return ret;
2913       }
2914
2915       PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const
2916       {
2917         int spaceDim=self->getSpaceDimension();
2918         if(spaceDim!=3)
2919           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2920         double val,val2;
2921         DataArrayDouble *a,*a2;
2922         DataArrayDoubleTuple *aa,*aa2;
2923         std::vector<double> bb,bb2;
2924         mcIdType sw;
2925         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st parameter for origin.";
2926         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd parameter for vector.";
2927         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2928         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2929         //
2930         DataArrayIdType *cellIds=0;
2931         MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2932         PyObject *ret=PyTuple_New(2);
2933         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2934         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
2935         return ret;
2936       }
2937
2938       MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const
2939       {
2940         double val,val2;
2941         DataArrayDouble *a,*a2;
2942         DataArrayDoubleTuple *aa,*aa2;
2943         std::vector<double> bb,bb2;
2944         mcIdType sw;
2945         const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st parameter for origin.";
2946         const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd parameter for vector.";
2947         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2948         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2949         MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2950         return ret.retn();
2951       }
2952
2953       DataArrayIdType *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const
2954       {
2955         int spaceDim=self->getSpaceDimension();
2956         if(spaceDim!=3)
2957           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2958         double val,val2;
2959         DataArrayDouble *a,*a2;
2960         DataArrayDoubleTuple *aa,*aa2;
2961         std::vector<double> bb,bb2;
2962         mcIdType sw;
2963         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st parameter for origin.";
2964         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd parameter for vector.";
2965         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2966         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2967         return self->getCellIdsCrossingPlane(orig,vect,eps);
2968       }
2969
2970       void convertToPolyTypes(PyObject *li)
2971       {
2972         mcIdType sw;
2973         mcIdType pos1;
2974         std::vector<mcIdType> pos2;
2975         DataArrayIdType *pos3=0;
2976         DataArrayIdTypeTuple *pos4=0;
2977         convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
2978         switch(sw)
2979           {
2980           case 1:
2981             {
2982               self->convertToPolyTypes(&pos1,&pos1+1);
2983               return;
2984             }
2985           case 2:
2986             {
2987               if(pos2.empty())
2988                 return;
2989               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2990               return ;
2991             }
2992           case 3:
2993             {
2994               self->convertToPolyTypes(pos3->begin(),pos3->end());
2995               return ;
2996             }
2997           default:
2998             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2999           }
3000       }      
3001     }
3002     void convertAllToPoly();
3003     void convertExtrudedPolyhedra();
3004     bool unPolyze();
3005     void simplifyPolyhedra(double eps);
3006     MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
3007     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
3008   };
3009
3010   //== MEDCouplingUMesh End
3011
3012   //== MEDCouplingMappedExtrudedMesh
3013
3014   class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
3015   {
3016   public:
3017     static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
3018     static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
3019     MEDCouplingUMesh *build3DUnstructuredMesh() const;
3020     int get2DCellIdForExtrusion() const;
3021     %extend {
3022       MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId)
3023       {
3024         return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
3025       }
3026
3027       MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D)
3028       {
3029         return MEDCouplingMappedExtrudedMesh::New(mesh3D);
3030       }
3031
3032       MEDCouplingMappedExtrudedMesh()
3033       {
3034         return MEDCouplingMappedExtrudedMesh::New();
3035       }
3036       
3037       std::string __str__() const
3038       {
3039         return self->simpleRepr();
3040       }
3041
3042       std::string __repr__() const
3043       {
3044         std::ostringstream oss;
3045         self->reprQuickOverview(oss);
3046         return oss.str();
3047       }
3048       
3049       PyObject *getMesh2D() const
3050       {
3051         MEDCouplingUMesh *ret=self->getMesh2D();
3052         if(ret)
3053           ret->incrRef();
3054         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3055       }
3056       PyObject *getMesh1D() const
3057       {
3058         MEDCouplingUMesh *ret=self->getMesh1D();
3059         if(ret)
3060           ret->incrRef();
3061         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3062       }
3063       PyObject *getMesh3DIds() const
3064       {
3065         DataArrayIdType *ret=self->getMesh3DIds();
3066         if(ret)
3067           ret->incrRef();
3068         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3069       } 
3070     }
3071   };
3072
3073   //== MEDCouplingMappedExtrudedMesh End
3074
3075   class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3076   {
3077   public:
3078     static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3079     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m);
3080     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const;
3081     int getNodalConnectivityLength() const;
3082     virtual void allocateCells(int nbOfCells=0);
3083     virtual void checkConsistencyOfConnectivity() const;
3084     %extend
3085     {
3086       virtual void insertNextCell(PyObject *li)
3087       {
3088         mcIdType szArr,sw,iTypppArr;
3089         std::vector<mcIdType> stdvecTyyppArr;
3090         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3091         self->insertNextCell(tmp,tmp+szArr);
3092       }
3093
3094       virtual DataArrayIdType *getNodalConnectivity() const
3095       {
3096         DataArrayIdType *ret=self->getNodalConnectivity();
3097         if(ret) ret->incrRef();
3098         return ret;
3099       }
3100       
3101       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li)
3102       {
3103         std::vector< const MEDCoupling1GTUMesh *> parts;
3104         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3105         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3106       }
3107     }
3108   };
3109
3110   //== MEDCoupling1SGTUMesh
3111
3112   class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3113   {
3114   public:
3115     static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3116     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m);
3117     void setNodalConnectivity(DataArrayIdType *nodalConn);
3118     int getNumberOfNodesPerCell() const;
3119     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2);
3120     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3121     MEDCoupling1GTUMesh *computeDualMesh() const;
3122     MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const;
3123     DataArrayIdType *sortHexa8EachOther();
3124     %extend
3125     {
3126       MEDCoupling1SGTUMesh()
3127       {
3128         return MEDCoupling1SGTUMesh::New();
3129       }
3130
3131       MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3132       {
3133         return MEDCoupling1SGTUMesh::New(name,type);
3134       }
3135
3136       MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m)
3137       {
3138         return MEDCoupling1SGTUMesh::New(m);
3139       }
3140
3141       std::string __str__() const
3142       {
3143         return self->simpleRepr();
3144       }
3145       
3146       std::string __repr__() const
3147       {
3148         std::ostringstream oss;
3149         self->reprQuickOverview(oss);
3150         return oss.str();
3151       }
3152
3153       PyObject *structurizeMe(double eps=1e-12) const
3154       {
3155         DataArrayIdType *cellPerm(0),*nodePerm(0);
3156         MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3157         PyObject *ret(PyTuple_New(3));
3158         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3159         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3160         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3161         return ret;
3162       }
3163
3164       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li)
3165       {
3166         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3167         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3168         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3169       }
3170       
3171       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li)
3172       {
3173         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3174         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3175         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3176       }
3177     }
3178   };
3179   
3180   //== MEDCoupling1SGTUMesh End
3181
3182   //== MEDCoupling1DGTUMesh
3183
3184   class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3185   {
3186   public:
3187     static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type);
3188     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m);
3189     void setNodalConnectivity(DataArrayIdType *nodalConn, DataArrayIdType *nodalConnIndex);
3190     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const;
3191     bool isPacked() const;
3192     %extend
3193     {
3194       MEDCoupling1DGTUMesh()
3195       {
3196         return MEDCoupling1DGTUMesh::New();
3197       }
3198       MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type)
3199       {
3200         return MEDCoupling1DGTUMesh::New(name,type);
3201       }
3202
3203       MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m)
3204       {
3205         return MEDCoupling1DGTUMesh::New(m);
3206       }
3207
3208       std::string __str__() const
3209       {
3210         return self->simpleRepr();
3211       }
3212       
3213       std::string __repr__() const
3214       {
3215         std::ostringstream oss;
3216         self->reprQuickOverview(oss);
3217         return oss.str();
3218       }
3219
3220       DataArrayIdType *getNodalConnectivityIndex() const
3221       {
3222         DataArrayIdType *ret=self->getNodalConnectivityIndex();
3223         if(ret) ret->incrRef();
3224         return ret;
3225       }
3226
3227       PyObject *retrievePackedNodalConnectivity() const
3228       {
3229         DataArrayIdType *ret1=0,*ret2=0;
3230         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3231         PyObject *ret0Py=ret0?Py_True:Py_False;
3232         Py_XINCREF(ret0Py);
3233         PyObject *ret=PyTuple_New(3);
3234         PyTuple_SetItem(ret,0,ret0Py);
3235         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3236         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
3237         return ret;
3238       }
3239       
3240       PyObject *copyWithNodalConnectivityPacked() const
3241       {
3242         bool ret1;
3243         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3244         PyObject *ret=PyTuple_New(2);
3245         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3246         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3247         PyTuple_SetItem(ret,1,ret1Py);
3248         return ret;
3249       }
3250
3251       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li)
3252       {
3253         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3254         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3255         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3256       }
3257       
3258       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li)
3259       {
3260         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3261         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3262         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3263       }
3264       
3265       static DataArrayIdType *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<mcIdType>& offsetInNodeIdsPerElt)
3266       {
3267         std::vector<const MEDCoupling::DataArrayIdType *> tmp;
3268         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(li,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",tmp);
3269         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3270       }
3271     }
3272   };
3273
3274   //== MEDCoupling1DGTUMeshEnd
3275
3276   class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3277   {
3278   public:
3279     mcIdType getCellIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3280     mcIdType getNodeIdFromPos(mcIdType i, mcIdType j, mcIdType k) const;
3281     mcIdType getNumberOfCellsOfSubLevelMesh() const;
3282     int getSpaceDimensionOnNodeStruct() const;
3283     double computeSquareness() const;
3284     virtual std::vector<mcIdType> getNodeGridStructure() const;
3285     std::vector<mcIdType> getCellGridStructure() const;
3286     MEDCoupling1SGTUMesh *build1SGTUnstructured() const;
3287     std::vector<mcIdType> getLocationFromCellId(mcIdType cellId) const;
3288     std::vector<mcIdType> getLocationFromNodeId(mcIdType cellId) const;
3289     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
3290     MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const;
3291     static mcIdType DeduceNumberOfGivenStructure(const std::vector<mcIdType>& st);
3292     static DataArrayIdType *ComputeCornersGhost(const std::vector<mcIdType>& st, mcIdType ghostLev);
3293     static std::vector<mcIdType> GetSplitVectFromStruct(const std::vector<mcIdType>& strct);
3294     %extend
3295     {
3296       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const
3297       {
3298         mcIdType tmpp1=-1,tmpp2=-1;
3299         std::vector<mcIdType> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3300         std::vector< std::pair<mcIdType,mcIdType> > inp;
3301         if(tmpp2==2)
3302           {
3303             inp.resize(tmpp1);
3304             for(mcIdType i=0;i<tmpp1;i++)
3305               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3306           }
3307         else if(tmpp2==1)
3308           {
3309             if(tmpp1%2!=0)
3310               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3311             inp.resize(tmpp1/2);
3312             for(mcIdType i=0;i<tmpp1/2;i++)
3313               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3314           }
3315         else
3316           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3317         return self->buildStructuredSubPart(inp);
3318       }
3319
3320       static DataArrayIdType *BuildExplicitIdsFrom(PyObject *st, PyObject *part)
3321       {
3322         std::vector< std::pair<mcIdType,mcIdType> > inp;
3323         convertPyToVectorPairInt(part,inp);
3324         //
3325         mcIdType szArr,sw,iTypppArr;
3326         std::vector<mcIdType> stdvecTyyppArr;
3327         const mcIdType *tmp4=convertIntStarLikePyObjToCppIntStar(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3328         std::vector<mcIdType> tmp5(tmp4,tmp4+szArr);
3329         //
3330         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3331       }
3332
3333       static void MultiplyPartOf(const std::vector<mcIdType>& st, PyObject *part, double factor, DataArrayDouble *da)
3334       {
3335         std::vector< std::pair<mcIdType,mcIdType> > inp;
3336         convertPyToVectorPairInt(part,inp);
3337         MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3338       }
3339
3340       static void MultiplyPartOfByGhost(const std::vector<mcIdType>& st, PyObject *part, mcIdType ghostSize, double factor, DataArrayDouble *da)
3341       {
3342         std::vector< std::pair<mcIdType,mcIdType> > inp;
3343         convertPyToVectorPairInt(part,inp);
3344         MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3345       }
3346
3347       static PyObject *PutInGhostFormat(mcIdType ghostSize, const std::vector<mcIdType>& st, PyObject *part)
3348       {
3349         std::vector< std::pair<mcIdType,mcIdType> > inp;
3350         convertPyToVectorPairInt(part,inp);
3351         std::vector<mcIdType> stWithGhost;
3352         std::vector< std::pair<mcIdType,mcIdType> > partWithGhost;
3353         MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3354         PyObject *ret(PyTuple_New(2));
3355         PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3356         PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3357         return ret;
3358       }
3359
3360       static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<mcIdType>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat)
3361       {
3362         std::vector< std::pair<mcIdType,mcIdType> > inp;
3363         convertPyToVectorPairInt(partCompactFormat,inp);
3364         return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3365       }
3366
3367       static void AssignPartOfFieldOfDoubleUsing(const std::vector<mcIdType>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other)
3368       {
3369         std::vector< std::pair<mcIdType,mcIdType> > inp;
3370         convertPyToVectorPairInt(partCompactFormat,inp);
3371         MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3372       }
3373
3374       static mcIdType DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part)
3375       {
3376         std::vector< std::pair<mcIdType,mcIdType> > inp;
3377         convertPyToVectorPairInt(part,inp);
3378         return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3379       }
3380
3381       static DataArrayIdType *Build1GTNodalConnectivity(PyObject *li)
3382       {
3383         mcIdType szArr,sw,iTypppArr;
3384         std::vector<mcIdType> stdvecTyyppArr;
3385         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3386         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3387       }
3388
3389       static DataArrayIdType *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li)
3390       {
3391         mcIdType szArr,sw,iTypppArr;
3392         std::vector<mcIdType> stdvecTyyppArr;
3393         const mcIdType *tmp(convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3394         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3395       }
3396
3397       static std::vector<mcIdType> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat)
3398       {
3399         std::vector< std::pair<mcIdType,mcIdType> > inp;
3400         convertPyToVectorPairInt(partCompactFormat,inp);
3401         return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3402       }
3403
3404       static PyObject *GetCompactFrmtFromDimensions(const std::vector<mcIdType>& dims)
3405       {
3406         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3407         PyObject *retPy=PyList_New(ret.size());
3408         for(std::size_t i=0;i<ret.size();i++)
3409           {
3410             PyObject *tmp=PyTuple_New(2);
3411             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3412             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3413             PyList_SetItem(retPy,i,tmp);
3414           }
3415         return retPy;
3416       }
3417
3418       static PyObject *IntersectRanges(PyObject *r1, PyObject *r2)
3419       {
3420         std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3421         convertPyToVectorPairInt(r1,r1Cpp);
3422         convertPyToVectorPairInt(r2,r2Cpp);
3423         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3424         PyObject *retPy=PyList_New(ret.size());
3425         for(std::size_t i=0;i<ret.size();i++)
3426           {
3427             PyObject *tmp=PyTuple_New(2);
3428             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3429             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3430             PyList_SetItem(retPy,i,tmp);
3431           }
3432         return retPy;
3433       }
3434
3435       static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3436       {
3437         std::vector< std::pair<mcIdType,mcIdType> > r1Cpp,r2Cpp;
3438         convertPyToVectorPairInt(r1,r1Cpp);
3439         convertPyToVectorPairInt(r2,r2Cpp);
3440         return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3441       }
3442
3443       static PyObject *IsPartStructured(PyObject *li, PyObject *st)
3444       {
3445         mcIdType szArr,sw,iTypppArr;
3446         std::vector<mcIdType> stdvecTyyppArr;
3447         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3448         mcIdType szArr2,sw2,iTypppArr2;
3449         std::vector<mcIdType> stdvecTyyppArr2;
3450         const mcIdType *tmp2=convertIntStarLikePyObjToCppIntStar(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3451         std::vector<mcIdType> tmp3(tmp2,tmp2+szArr2);
3452         std::vector< std::pair<mcIdType,mcIdType> > partCompactFormat;
3453         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3454         PyObject *ret=PyTuple_New(2);
3455         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3456         PyTuple_SetItem(ret,0,ret0Py);
3457         PyObject *ret1Py=PyList_New(partCompactFormat.size());
3458         for(std::size_t i=0;i<partCompactFormat.size();i++)
3459           {
3460             PyObject *tmp4=PyTuple_New(2);
3461             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3462             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3463             PyList_SetItem(ret1Py,i,tmp4);
3464           }
3465         PyTuple_SetItem(ret,1,ret1Py);
3466         return ret;
3467       }
3468
3469       static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true)
3470       {
3471         std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3472         convertPyToVectorPairInt(bigInAbs,param0);
3473         convertPyToVectorPairInt(partOfBigInAbs,param1);
3474         MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3475         PyObject *retPy(PyList_New(ret.size()));
3476         for(std::size_t i=0;i<ret.size();i++)
3477           {
3478             PyObject *tmp(PyTuple_New(2));
3479             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3480             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3481             PyList_SetItem(retPy,i,tmp);
3482           }
3483         return retPy;
3484       }
3485
3486       static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<mcIdType>& translation)
3487       {
3488         std::vector< std::pair<mcIdType,mcIdType> > param0;
3489         convertPyToVectorPairInt(part,param0);
3490         std::vector< std::pair<mcIdType,mcIdType> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3491         PyObject *retPy(PyList_New(ret.size()));
3492         for(std::size_t i=0;i<ret.size();i++)
3493           {
3494             PyObject *tmp(PyTuple_New(2));
3495             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3496             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3497             PyList_SetItem(retPy,i,tmp);
3498           }
3499         return retPy;
3500       }
3501
3502       static std::vector<mcIdType> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo)
3503       {
3504         std::vector< std::pair<mcIdType,mcIdType> > param0,param1;
3505         convertPyToVectorPairInt(startingFrom,param0);
3506         convertPyToVectorPairInt(goingTo,param1);
3507         return  MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3508       }
3509
3510       static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true)
3511       {
3512         std::vector< std::pair<mcIdType,mcIdType> > param0,param1,ret;
3513         convertPyToVectorPairInt(bigInAbs,param0);
3514         convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3515         MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3516         PyObject *retPy(PyList_New(ret.size()));
3517         for(std::size_t i=0;i<ret.size();i++)
3518           {
3519             PyObject *tmp(PyTuple_New(2));
3520             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3521             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3522             PyList_SetItem(retPy,i,tmp);
3523           }
3524         return retPy;
3525       }
3526     }
3527   };
3528
3529   class MEDCouplingCurveLinearMesh;
3530
3531   //== MEDCouplingCMesh
3532   
3533   class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3534   {
3535   public:
3536     static MEDCouplingCMesh *New();
3537     static MEDCouplingCMesh *New(const std::string& meshName);
3538     void setCoords(const DataArrayDouble *coordsX,
3539                    const DataArrayDouble *coordsY=0,
3540                    const DataArrayDouble *coordsZ=0);
3541     void setCoordsAt(int i, const DataArrayDouble *arr);
3542     MEDCouplingCurveLinearMesh *buildCurveLinear() const;
3543     %extend {
3544       MEDCouplingCMesh()
3545       {
3546         return MEDCouplingCMesh::New();
3547       }
3548       MEDCouplingCMesh(const std::string& meshName)
3549       {
3550         return MEDCouplingCMesh::New(meshName);
3551       }
3552       std::string __str__() const
3553       {
3554         return self->simpleRepr();
3555       }
3556       std::string __repr__() const
3557       {
3558         std::ostringstream oss;
3559         self->reprQuickOverview(oss);
3560         return oss.str();
3561       }
3562       DataArrayDouble *getCoordsAt(int i)
3563       {
3564         DataArrayDouble *ret=self->getCoordsAt(i);
3565         if(ret)
3566           ret->incrRef();
3567         return ret;
3568       }
3569     }
3570   };
3571
3572   //== MEDCouplingCMesh End
3573
3574   //== MEDCouplingCurveLinearMesh
3575
3576   class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3577   {
3578   public:
3579     static MEDCouplingCurveLinearMesh *New();
3580     static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
3581     void setCoords(const DataArrayDouble *coords);
3582     %extend {
3583       MEDCouplingCurveLinearMesh()
3584       {
3585         return MEDCouplingCurveLinearMesh::New();
3586       }
3587       MEDCouplingCurveLinearMesh(const std::string& meshName)
3588       {
3589         return MEDCouplingCurveLinearMesh::New(meshName);
3590       }
3591       std::string __str__() const 
3592       {
3593         return self->simpleRepr();
3594       }
3595       std::string __repr__() const
3596       {
3597         std::ostringstream oss;
3598         self->reprQuickOverview(oss);
3599         return oss.str();
3600       }
3601       DataArrayDouble *getCoords()
3602       {
3603         DataArrayDouble *ret=self->getCoords();
3604         if(ret)
3605           ret->incrRef();
3606         return ret;
3607       }
3608       void setNodeGridStructure(PyObject *gridStruct)
3609       {
3610         mcIdType szArr,sw,iTypppArr;
3611         std::vector<mcIdType> stdvecTyyppArr;
3612         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3613         self->setNodeGridStructure(tmp,tmp+szArr);
3614       }
3615     }
3616   };
3617
3618   //== MEDCouplingCurveLinearMesh End
3619
3620   //== MEDCouplingIMesh
3621
3622   class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3623   {
3624   public:
3625     static MEDCouplingIMesh *New();
3626     //
3627     void setSpaceDimension(int spaceDim);
3628     std::vector<mcIdType> getNodeStruct() const;
3629     std::vector<double> getOrigin() const;
3630     std::vector<double> getDXYZ() const;
3631     void setAxisUnit(const std::string& unitName);
3632     std::string getAxisUnit() const;
3633     double getMeasureOfAnyCell() const;
3634     MEDCouplingCMesh *convertToCartesian() const;
3635     void refineWithFactor(const std::vector<mcIdType>& factors);
3636     MEDCouplingIMesh *asSingleCell() const;
3637     MEDCouplingIMesh *buildWithGhost(mcIdType ghostLev) const;
3638     %extend
3639     {
3640       MEDCouplingIMesh()
3641       {
3642         return MEDCouplingIMesh::New();
3643       }
3644       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3645       {
3646         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3647         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3648         const mcIdType *nodeStrctPtr(0);
3649         const double *originPtr(0),*dxyzPtr(0);
3650         mcIdType sw,sz,val0;
3651         std::vector<mcIdType> bb0;
3652         nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
3653         //
3654         double val,val2;
3655         std::vector<double> bb,bb2;
3656         mcIdType sz1,sz2;
3657         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3658         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3659         //
3660         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3661       }
3662
3663       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
3664       {
3665         return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3666       }
3667
3668       void setNodeStruct(PyObject *nodeStrct)
3669       {
3670         mcIdType sw,sz,val0;
3671         std::vector<mcIdType> bb0;
3672         const mcIdType *nodeStrctPtr(convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0));
3673         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3674       }
3675
3676       void setOrigin(PyObject *origin)
3677       {
3678         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3679         double val;
3680         std::vector<double> bb;
3681         mcIdType sw,nbTuples;
3682         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3683         self->setOrigin(originPtr,originPtr+nbTuples);
3684       }
3685       
3686       void setDXYZ(PyObject *dxyz)
3687       {
3688         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3689         double val;
3690         std::vector<double> bb;
3691         mcIdType sw,nbTuples;
3692         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3693         self->setDXYZ(originPtr,originPtr+nbTuples);
3694       }
3695
3696       static void CondenseFineToCoarse(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA)
3697       {
3698         std::vector< std::pair<mcIdType,mcIdType> > inp;
3699         convertPyToVectorPairInt(fineLocInCoarse,inp);
3700         MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3701       }
3702
3703       static void CondenseFineToCoarseGhost(const std::vector<mcIdType>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, DataArrayDouble *coarseDA, mcIdType ghostSize)
3704       {
3705         std::vector< std::pair<mcIdType,mcIdType> > inp;
3706         convertPyToVectorPairInt(fineLocInCoarse,inp);
3707         MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3708       }
3709
3710       static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts)
3711       {
3712         std::vector< std::pair<mcIdType,mcIdType> > inp;
3713         convertPyToVectorPairInt(fineLocInCoarse,inp);
3714         MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3715       }
3716
3717       static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3718       {
3719         std::vector< std::pair<mcIdType,mcIdType> > inp;
3720         convertPyToVectorPairInt(fineLocInCoarse,inp);
3721         MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3722       }
3723
3724       static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<mcIdType>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<mcIdType>& facts, mcIdType ghostSize)
3725       {
3726         std::vector< std::pair<mcIdType,mcIdType> > inp;
3727         convertPyToVectorPairInt(fineLocInCoarse,inp);
3728         MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3729       }
3730
3731       std::string __str__() const
3732       {
3733         return self->simpleRepr();
3734       }
3735       std::string __repr__() const
3736       {
3737         std::ostringstream oss;
3738         self->reprQuickOverview(oss);
3739         return oss.str();
3740       }
3741     }
3742   };
3743
3744   //== MEDCouplingIMesh End
3745
3746 }
3747
3748 namespace MEDCoupling
3749 {
3750   class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3751   {
3752   public:
3753     virtual void checkConsistencyLight() const;
3754     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
3755     bool areStrictlyCompatible(const MEDCouplingField *other) const;
3756     bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
3757     virtual void copyTinyStringsFrom(const MEDCouplingField *other);
3758     void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
3759     void setName(const char *name);
3760     std::string getDescription() const;
3761     void setDescription(const char *desc);
3762     std::string getName() const;
3763     TypeOfField getTypeOfField() const;
3764     NatureOfField getNature() const;
3765     virtual void setNature(NatureOfField nat);
3766     DataArrayDouble *getLocalizationOfDiscr() const;
3767     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const;
3768     mcIdType getNumberOfTuplesExpected() const;
3769     mcIdType getNumberOfMeshPlacesExpected() const;
3770     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3771                                     const std::vector<double>& gsCoo, const std::vector<double>& wg);
3772     void clearGaussLocalizations();
3773     MEDCouplingGaussLocalization& getGaussLocalization(int locId);
3774     mcIdType getNbOfGaussLocalization() const;
3775     mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
3776     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
3777     mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
3778     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3779     %extend {
3780       PyObject *getMesh() const
3781       {
3782         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3783         if(ret1)
3784           ret1->incrRef();
3785         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3786       }
3787
3788       PyObject *getDiscretization()
3789       {
3790         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3791         if(ret)
3792           ret->incrRef();
3793         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3794       }
3795
3796       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const
3797       {
3798         std::set<mcIdType> ret=self->getGaussLocalizationIdsOfOneType(type);
3799         return convertIntArrToPyList3(ret);
3800       }
3801
3802       PyObject *buildSubMeshData(PyObject *li) const
3803       {
3804         DataArrayIdType *ret1=0;
3805         MEDCouplingMesh *ret0=0;
3806         void *da=0;
3807         int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
3808         if (!SWIG_IsOK(res1))
3809           {
3810             mcIdType size;
3811             INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3812             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3813           }
3814         else
3815           {
3816             DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3817             if(!da2)
3818               throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3819             da2->checkAllocated();
3820             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3821           }
3822         PyObject *res = PyList_New(2);
3823         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3824         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3825         return res;
3826       }
3827
3828       PyObject *buildSubMeshDataRange(mcIdType begin, mcIdType end, mcIdType step) const
3829       {
3830         DataArrayIdType *ret1=0;
3831         mcIdType bb,ee,ss;
3832         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3833         PyObject *res=PyTuple_New(2);
3834         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3835         if(ret1)
3836           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTITraits<mcIdType>::TI,SWIG_POINTER_OWN | 0));
3837         else
3838           {
3839             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3840             PyTuple_SetItem(res,1,res1);
3841           }
3842         return res;
3843       }
3844
3845       DataArrayIdType *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3846       {
3847         mcIdType sw,sz(-1);
3848         mcIdType v0; std::vector<mcIdType> v1;
3849         const mcIdType *cellIdsBg(convertIntStarLikePyObjToCppIntStar(cellIds,sw,sz,v0,v1));
3850         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3851       }
3852
3853       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3854                                        const std::vector<double>& gsCoo, const std::vector<double>& wg)
3855       {
3856         void *da=0;
3857         int res1=SWIG_ConvertPtr(li,&da,SWIGTITraits<mcIdType>::TI, 0 |  0 );
3858         if (!SWIG_IsOK(res1))
3859           {
3860             mcIdType size;
3861             INTERP_KERNEL::AutoPtr<mcIdType> tmp=convertPyToNewIntArr2(li,&size);
3862             self->setGaussLocalizationOnCells(tmp,((mcIdType *)tmp)+size,refCoo,gsCoo,wg);
3863           }
3864         else
3865           {
3866             DataArrayIdType *da2=reinterpret_cast< DataArrayIdType * >(da);
3867             if(!da2)
3868               throw INTERP_KERNEL::Exception("Not null DataArrayIdType instance expected !");
3869             da2->checkAllocated();
3870             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3871           }
3872       }
3873
3874       PyObject *getCellIdsHavingGaussLocalization(int locId) const
3875       {
3876         std::vector<mcIdType> tmp;
3877         self->getCellIdsHavingGaussLocalization(locId,tmp);
3878         DataArrayIdType *ret=DataArrayIdType::New();
3879         ret->alloc((mcIdType)tmp.size(),1);
3880         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3881         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
3882       }
3883       
3884       mcIdType getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const
3885       {
3886         std::vector<mcIdType> inp0;
3887         convertPyToNewIntArr4(code,1,3,inp0);
3888         std::vector<const DataArrayIdType *> inp1;
3889         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayIdType *>(idsPerType,SWIGTITraits<mcIdType>::TI,"DataArrayIdType",inp1);
3890         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3891       }
3892     }
3893   };
3894   
3895   class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3896   {
3897   public:
3898     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f);
3899     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
3900     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt32& f);
3901     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt64& f);
3902     static MEDCouplingFieldTemplate *New(TypeOfField type);
3903     std::string simpleRepr() const;
3904     std::string advancedRepr() const;
3905     bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3906     bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const;
3907     %extend
3908        {
3909          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f)
3910          {
3911            return MEDCouplingFieldTemplate::New(f);
3912          }
3913
3914          MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f)
3915          {
3916            return MEDCouplingFieldTemplate::New(f);
3917          }
3918          
3919          MEDCouplingFieldTemplate(const MEDCouplingFieldInt32& f)
3920          {
3921            return MEDCouplingFieldTemplate::New(f);
3922          }
3923
3924          MEDCouplingFieldTemplate(const MEDCouplingFieldInt64& f)
3925          {
3926            return MEDCouplingFieldTemplate::New(f);
3927          }
3928          
3929          MEDCouplingFieldTemplate(TypeOfField type)
3930          {
3931            return MEDCouplingFieldTemplate::New(type);
3932          }
3933          
3934          std::string __str__() const
3935          {
3936            return self->simpleRepr();
3937          }
3938          
3939          std::string __repr__() const
3940          {
3941            std::ostringstream oss;
3942            self->reprQuickOverview(oss);
3943            return oss.str();
3944          }
3945
3946          PyObject *isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec) const
3947          {
3948            std::string ret1;
3949            bool ret0=self->isEqualIfNotWhy(other,meshPrec,ret1);
3950            PyObject *ret=PyTuple_New(2);
3951            PyObject *ret0Py=ret0?Py_True:Py_False;
3952            Py_XINCREF(ret0Py);
3953            PyTuple_SetItem(ret,0,ret0Py);
3954            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3955            return ret;
3956          }
3957        }
3958   };
3959
3960   template<class T>
3961  class MEDCouplingFieldT : public MEDCoupling::MEDCouplingField
3962   {
3963   public:
3964     TypeOfTimeDiscretization getTimeDiscretization() const;
3965   protected:
3966     MEDCouplingFieldT();
3967     ~MEDCouplingFieldT();
3968   };
3969
3970   %template(MEDCouplingFieldTdouble) MEDCoupling::MEDCouplingFieldT<double>;
3971   %template(MEDCouplingFieldTfloat) MEDCoupling::MEDCouplingFieldT<float>;
3972   %template(MEDCouplingFieldTint) MEDCoupling::MEDCouplingFieldT<int>;
3973   
3974   class MEDCouplingFieldInt32;
3975   class MEDCouplingFieldInt64;
3976   class MEDCouplingFieldFloat;
3977   
3978   class MEDCouplingFieldDouble : public MEDCouplingFieldT<double>
3979   {
3980   public:
3981     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3982     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3983     bool isEqual(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3984     bool isEqualWithoutConsideringStr(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const;
3985     void setTimeUnit(const std::string& unit);
3986     std::string getTimeUnit() const;
3987     void synchronizeTimeWithSupport();
3988     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other);
3989     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other);
3990     std::string simpleRepr() const;
3991     std::string advancedRepr() const;
3992     std::string  writeVTK(const std::string& fileName, bool isBinary=true) const;
3993     MEDCouplingFieldInt32 *convertToIntField() const;
3994     MEDCouplingFieldFloat *convertToFloatField() const;
3995     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3996     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3997     MEDCouplingFieldDouble *deepCopy() const;
3998     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
3999     MEDCouplingFieldDouble *nodeToCellDiscretization() const;
4000     MEDCouplingFieldDouble *cellToNodeDiscretization() const;
4001     double getIJ(int tupleId, int compoId) const;
4002     double getIJK(int cellId, int nodeIdInCell, int compoId) const;
4003     void synchronizeTimeWithMesh();
4004     void setArray(DataArrayDouble *array);
4005     void setEndArray(DataArrayDouble *array);
4006     void setTime(double val, int iteration, int order);
4007     void setStartTime(double val, int iteration, int order);
4008     void setEndTime(double val, int iteration, int order);
4009     void applyLin(double a, double b, int compoId);
4010     void applyLin(double a, double b);
4011     int getNumberOfComponents() const;
4012     int getNumberOfTuples() const;
4013     int getNumberOfValues() const;
4014     void setTimeTolerance(double val);
4015     double getTimeTolerance() const;
4016     void setIteration(int it);
4017     void setEndIteration(int it);
4018     void setOrder(int order);
4019     void setEndOrder(int order);
4020     void setTimeValue(double val);
4021     void setEndTimeValue(double val);
4022     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
4023     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
4024     bool mergeNodes(double eps, double epsOnVals=1e-15);
4025     bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
4026     bool zipCoords(double epsOnVals=1e-15);
4027     bool zipConnectivity(int compType,double epsOnVals=1e-15);
4028     bool simplexize(int policy);
4029     MEDCouplingFieldDouble *doublyContractedProduct() const;
4030     MEDCouplingFieldDouble *determinant() const;
4031     MEDCouplingFieldDouble *eigenValues() const;
4032     MEDCouplingFieldDouble *eigenVectors() const;
4033     MEDCouplingFieldDouble *inverse() const;
4034     MEDCouplingFieldDouble *trace() const;
4035     MEDCouplingFieldDouble *deviator() const;
4036     MEDCouplingFieldDouble *magnitude() const;
4037     MEDCouplingFieldDouble *maxPerTuple() const;
4038     void changeNbOfComponents(std::size_t newNbOfComp, double dftValue=0.);
4039     void sortPerTuple(bool asc);
4040     MEDCouplingFieldDouble &operator=(double value);
4041     void fillFromAnalytic(int nbOfComp, const std::string& func);
4042     void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
4043     void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4044     void applyFunc(int nbOfComp, const std::string& func);
4045     void applyFuncCompo(int nbOfComp, const std::string& func);
4046     void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
4047     void applyFunc(int nbOfComp, double val);
4048     void applyFunc(const std::string& func);
4049     void applyFuncFast32(const std::string& func);
4050     void applyFuncFast64(const std::string& func);
4051     double accumulate(int compId) const;
4052     double getMaxValue() const;
4053     double getMinValue() const;
4054     double getAverageValue() const;
4055     double norm2() const;
4056     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4057     double getWeightedAverageValue(int compId, bool isWAbs) const;
4058     double integral(int compId, bool isWAbs) const;
4059     double normL1(int compId) const;
4060     double normL2(int compId) const;
4061     double normMax(int compId) const;
4062     DataArrayIdType *findIdsInRange(double vmin, double vmax) const;
4063     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
4064     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4065     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4066     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4067     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const;
4068     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4069     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const;
4070     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4071     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const;
4072     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4073     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4074     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4075     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4076     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2);
4077     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const;
4078     MEDCouplingFieldDouble *negate() const;
4079     %extend {
4080       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4081       {
4082         return MEDCouplingFieldDouble::New(type,td);
4083       }
4084
4085       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4086       {
4087         return MEDCouplingFieldDouble::New(ft,td);
4088       }
4089
4090       std::string __str__() const
4091       {
4092         return self->simpleRepr();
4093       }
4094
4095       std::string __repr__() const
4096       {
4097         std::ostringstream oss;
4098         self->reprQuickOverview(oss);
4099         return oss.str();
4100       }
4101
4102       PyObject *isEqualIfNotWhy(const MEDCouplingFieldDouble *other, double meshPrec, double valsPrec) const
4103       {
4104         std::string ret1;
4105         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
4106         PyObject *ret=PyTuple_New(2);
4107         PyObject *ret0Py=ret0?Py_True:Py_False;
4108         Py_XINCREF(ret0Py);
4109         PyTuple_SetItem(ret,0,ret0Py);
4110         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
4111         return ret;
4112       }
4113       
4114       MEDCouplingFieldDouble *voronoize(double eps) const
4115       {
4116         MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4117         return ret.retn();
4118       }
4119
4120       MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const
4121       {
4122         MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4123         return ret.retn();
4124       }
4125       
4126       MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4127       {
4128         const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4129         double val,val2;
4130         DataArrayDouble *a,*a2;
4131         DataArrayDoubleTuple *aa,*aa2;
4132         std::vector<double> bb,bb2;
4133         mcIdType sw;
4134         const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4135         const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4136         return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4137       }
4138
4139       DataArrayDouble *getArray()
4140       {
4141         DataArrayDouble *ret=self->getArray();
4142         if(ret)
4143           ret->incrRef();
4144         return ret;
4145       }
4146
4147       PyObject *getArrays() const
4148       {
4149         std::vector<DataArrayDouble *> arrs=self->getArrays();
4150         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4151           if(*it)
4152             (*it)->incrRef();
4153         std::size_t sz=arrs.size();
4154         PyObject *ret=PyTuple_New(sz);
4155         for(std::size_t i=0;i<sz;i++)
4156           {
4157             if(arrs[i])
4158               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4159             else
4160               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4161           }
4162         return ret;
4163       }
4164
4165       void setArrays(PyObject *ls)
4166       {
4167         std::vector<const DataArrayDouble *> tmp;
4168         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4169         std::size_t sz=tmp.size();
4170         std::vector<DataArrayDouble *> arrs(sz);
4171         for(std::size_t i=0;i<sz;i++)
4172           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4173         self->setArrays(arrs);
4174       }
4175
4176       DataArrayDouble *getEndArray()
4177       {
4178         DataArrayDouble *ret=self->getEndArray();
4179         if(ret)
4180           ret->incrRef();
4181         return ret;
4182       }
4183
4184       PyObject *getValueOn(PyObject *sl) const
4185       {
4186         double val;
4187         DataArrayDouble *a;
4188         DataArrayDoubleTuple *aa;
4189         std::vector<double> bb;
4190         mcIdType sw;
4191         const MEDCouplingMesh *mesh=self->getMesh();
4192         if(!mesh)
4193           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4194         int spaceDim=mesh->getSpaceDimension();
4195         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4196         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4197         //
4198         mcIdType sz=ToIdType(self->getNumberOfComponents());
4199         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4200         self->getValueOn(spaceLoc,res);
4201         return convertDblArrToPyList<double>(res,sz);
4202       }
4203
4204        PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
4205        {
4206          mcIdType sz=ToIdType(self->getNumberOfComponents());
4207          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4208          self->getValueOnPos(i,j,k,res);
4209          return convertDblArrToPyList<double>(res,sz);
4210        }
4211
4212       DataArrayDouble *getValueOnMulti(PyObject *locs) const
4213       {
4214         const MEDCouplingMesh *mesh(self->getMesh());
4215         if(!mesh)
4216           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4217         //
4218         mcIdType sw,nbPts;
4219         double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4220         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4221                                                          mesh->getSpaceDimension(),true,nbPts);
4222         return self->getValueOnMulti(inp,(int)nbPts);
4223       }
4224
4225       PyObject *getValueOn(PyObject *sl, double time) const
4226       {
4227         double val;
4228         DataArrayDouble *a;
4229         DataArrayDoubleTuple *aa;
4230         std::vector<double> bb;
4231         mcIdType sw;
4232         const MEDCouplingMesh *mesh=self->getMesh();
4233         if(!mesh)
4234           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4235         int spaceDim=mesh->getSpaceDimension();
4236         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4237         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4238         //
4239         //
4240         mcIdType sz=ToIdType(self->getNumberOfComponents());
4241         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4242         self->getValueOn(spaceLoc,time,res);
4243         return convertDblArrToPyList<double>(res,sz);
4244       }
4245
4246       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0)
4247       {
4248         if(self->getArray()!=0)
4249           MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4250         else
4251           {
4252             MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4253             MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4254             self->setArray(arr);
4255           }
4256       }
4257       
4258       PyObject *getTime()
4259       {
4260         int tmp1,tmp2;
4261         double tmp0=self->getTime(tmp1,tmp2);
4262         PyObject *res = PyList_New(3);
4263         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4264         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4265         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4266         return res;
4267       }
4268
4269       PyObject *getStartTime()
4270       {
4271         int tmp1,tmp2;
4272         double tmp0=self->getStartTime(tmp1,tmp2);
4273         PyObject *res = PyList_New(3);
4274         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4275         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4276         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4277         return res;
4278       }
4279
4280       PyObject *getEndTime()
4281       {
4282         int tmp1,tmp2;
4283         double tmp0=self->getEndTime(tmp1,tmp2);
4284         PyObject *res = PyList_New(3);
4285         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4286         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4287         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4288         return res;
4289       }
4290       PyObject *accumulate() const
4291       {
4292         mcIdType sz=ToIdType(self->getNumberOfComponents());
4293         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4294         self->accumulate(tmp);
4295         return convertDblArrToPyList<double>(tmp,sz);
4296       }
4297       PyObject *integral(bool isWAbs) const
4298       {
4299         mcIdType sz=ToIdType(self->getNumberOfComponents());
4300         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4301         self->integral(isWAbs,tmp);
4302         return convertDblArrToPyList<double>(tmp,sz);
4303       }
4304       PyObject *getWeightedAverageValue(bool isWAbs=true) const
4305       {
4306         mcIdType sz=ToIdType(self->getNumberOfComponents());
4307         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4308         self->getWeightedAverageValue(tmp,isWAbs);
4309         return convertDblArrToPyList<double>(tmp,sz);
4310       }
4311       PyObject *normL1() const
4312       {
4313         mcIdType sz=ToIdType(self->getNumberOfComponents());
4314         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4315         self->normL1(tmp);
4316         return convertDblArrToPyList<double>(tmp,sz);
4317       }
4318       PyObject *normL2() const
4319       {
4320         mcIdType sz=ToIdType(self->getNumberOfComponents());
4321         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4322         self->normL2(tmp);
4323         return convertDblArrToPyList<double>(tmp,sz);
4324       }
4325       PyObject *normMax() const
4326       {
4327         mcIdType sz=ToIdType(self->getNumberOfComponents());
4328         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4329         self->normMax(tmp);
4330         return convertDblArrToPyList<double>(tmp,sz);
4331       }
4332       void renumberCells(PyObject *li, bool check=true)
4333       {
4334         mcIdType szArr,sw,iTypppArr;
4335         std::vector<mcIdType> stdvecTyyppArr;
4336         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4337         self->renumberCells(tmp,check);
4338       }
4339       
4340       void renumberCellsWithoutMesh(PyObject *li, bool check=true)
4341       {
4342         mcIdType szArr,sw,iTypppArr;
4343         std::vector<mcIdType> stdvecTyyppArr;
4344         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4345         self->renumberCellsWithoutMesh(tmp,check);
4346       }
4347       
4348       void renumberNodes(PyObject *li, double eps=1e-15)
4349       {
4350         mcIdType szArr,sw,iTypppArr;
4351         std::vector<mcIdType> stdvecTyyppArr;
4352         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4353         self->renumberNodes(tmp,eps);
4354       }
4355
4356       void renumberNodesWithoutMesh(PyObject *li, mcIdType newNbOfNodes, double eps=1e-15)
4357       {
4358         mcIdType szArr,sw,iTypppArr;
4359         std::vector<mcIdType> stdvecTyyppArr;
4360         const mcIdType *tmp=convertIntStarLikePyObjToCppIntStar(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4361         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4362       }
4363
4364       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const
4365       {
4366         return fieldT_buildSubPart(self,li);
4367       }
4368
4369       MEDCouplingFieldDouble *__getitem__(PyObject *li) const
4370       {
4371         return fieldT__getitem__(self,li);
4372       }
4373
4374       PyObject *getMaxValue2() const
4375       {
4376         DataArrayIdType *tmp;
4377         double r1=self->getMaxValue2(tmp);
4378         PyObject *ret=PyTuple_New(2);
4379         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4380         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4381         return ret;
4382       }
4383       
4384       PyObject *getMinValue2() const
4385       {
4386         DataArrayIdType *tmp;
4387         double r1=self->getMinValue2(tmp);
4388         PyObject *ret=PyTuple_New(2);
4389         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4390         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
4391         return ret;
4392       }
4393       
4394       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const
4395       {
4396         std::vector<std::size_t> tmp;
4397         convertPyToNewIntArr3(li,tmp);
4398         return self->keepSelectedComponents(tmp);
4399       }
4400
4401       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li)
4402       {
4403         std::vector<std::size_t> tmp;
4404         convertPyToNewIntArr3(li,tmp);
4405         self->setSelectedComponents(f,tmp);
4406       }
4407
4408       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const
4409       {
4410         double val,val2;
4411         DataArrayDouble *a,*a2;
4412         DataArrayDoubleTuple *aa,*aa2;
4413         std::vector<double> bb,bb2;
4414         mcIdType sw;
4415         int spaceDim=3;
4416         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
4417         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
4418         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4419         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4420         //
4421         return self->extractSlice3D(orig,vect,eps);
4422       }
4423
4424       MEDCouplingFieldDouble *__add__(PyObject *obj)
4425       {
4426         return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4427       }
4428
4429       MEDCouplingFieldDouble *__radd__(PyObject *obj)
4430       {
4431         return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4432       }
4433
4434       MEDCouplingFieldDouble *__sub__(PyObject *obj)
4435       {
4436         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.";
4437         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4438         void *argp;
4439         //
4440         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4441           {
4442             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4443             if(other)
4444               return (*self)-(*other);
4445             else
4446               throw INTERP_KERNEL::Exception(msg);
4447           }
4448         //
4449         double val;
4450         DataArrayDouble *a;
4451         DataArrayDoubleTuple *aa;
4452         std::vector<double> bb;
4453         mcIdType sw;
4454         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4455         switch(sw)
4456           {
4457           case 1:
4458             {
4459               if(!self->getArray())
4460                 throw INTERP_KERNEL::Exception(msg2);
4461               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4462               ret->applyLin(1.,-val);
4463               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4464               ret2->setArray(ret);
4465               return ret2.retn();
4466             }
4467           case 2:
4468             {
4469               if(!self->getArray())
4470                 throw INTERP_KERNEL::Exception(msg2);
4471               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4472               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4473               ret2->setArray(ret);
4474               return ret2.retn();
4475             }
4476           case 3:
4477             {
4478               if(!self->getArray())
4479                 throw INTERP_KERNEL::Exception(msg2);
4480               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4481               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4482               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4483               ret2->setArray(ret);
4484               return ret2.retn();
4485             }
4486           case 4:
4487             {
4488               if(!self->getArray())
4489                 throw INTERP_KERNEL::Exception(msg2);
4490               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4491               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4492               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4493               ret2->setArray(ret);
4494               return ret2.retn();
4495             }
4496           default:
4497             { throw INTERP_KERNEL::Exception(msg); }
4498           }
4499       }
4500
4501       MEDCouplingFieldDouble *__rsub__(PyObject *obj)
4502       {
4503         return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4504       }
4505
4506       MEDCouplingFieldDouble *__mul__(PyObject *obj)
4507       {
4508         return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4509       }
4510
4511       MEDCouplingFieldDouble *__rmul__(PyObject *obj)
4512       {
4513         return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4514       }
4515
4516       MEDCouplingFieldDouble *__div__(PyObject *obj)
4517       {
4518         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.";
4519         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4520         void *argp;
4521         //
4522         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4523           {
4524             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4525             if(other)
4526               return (*self)/(*other);
4527             else
4528               throw INTERP_KERNEL::Exception(msg);
4529           }
4530         //
4531         double val;
4532         DataArrayDouble *a;
4533         DataArrayDoubleTuple *aa;
4534         std::vector<double> bb;
4535         mcIdType sw;
4536         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4537         switch(sw)
4538           {
4539           case 1:
4540             {
4541               if(val==0.)
4542                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4543               if(!self->getArray())
4544                 throw INTERP_KERNEL::Exception(msg2);
4545               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4546               ret->applyLin(1./val,0);
4547               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4548               ret2->setArray(ret);
4549               return ret2.retn();
4550             }
4551           case 2:
4552             {
4553               if(!self->getArray())
4554                 throw INTERP_KERNEL::Exception(msg2);
4555               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4556               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4557               ret2->setArray(ret);
4558               return ret2.retn();
4559             }
4560           case 3:
4561             {
4562               if(!self->getArray())
4563                 throw INTERP_KERNEL::Exception(msg2);
4564               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4565               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4566               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4567               ret2->setArray(ret);
4568               return ret2.retn();
4569             }
4570           case 4:
4571             {
4572               if(!self->getArray())
4573                 throw INTERP_KERNEL::Exception(msg2);
4574               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4575               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4576               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4577               ret2->setArray(ret);
4578               return ret2.retn();
4579             }
4580           default:
4581             { throw INTERP_KERNEL::Exception(msg); }
4582           }
4583       }
4584
4585       MEDCouplingFieldDouble *__rdiv__(PyObject *obj)
4586       {
4587         return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4588       }
4589
4590       MEDCouplingFieldDouble *__pow__(PyObject *obj)
4591       {
4592         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.";
4593         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4594         void *argp;
4595         //
4596         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4597           {
4598             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4599             if(other)
4600               return (*self)^(*other);
4601             else
4602               throw INTERP_KERNEL::Exception(msg);
4603           }
4604         //
4605         double val;
4606         DataArrayDouble *a;
4607         DataArrayDoubleTuple *aa;
4608         std::vector<double> bb;
4609         mcIdType sw;
4610         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4611         switch(sw)
4612           {
4613           case 1:
4614             {
4615               if(!self->getArray())
4616                 throw INTERP_KERNEL::Exception(msg2);
4617               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4618               ret->applyPow(val);
4619               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4620               ret2->setArray(ret);
4621               return ret2.retn();
4622             }
4623           case 2:
4624             {
4625               if(!self->getArray())
4626                 throw INTERP_KERNEL::Exception(msg2);
4627               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4628               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4629               ret2->setArray(ret);
4630               return ret2.retn();
4631             }
4632           case 3:
4633             {
4634               if(!self->getArray())
4635                 throw INTERP_KERNEL::Exception(msg2);
4636               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4637               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4638               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4639               ret2->setArray(ret);
4640               return ret2.retn();
4641             }
4642           case 4:
4643             {
4644               if(!self->getArray())
4645                 throw INTERP_KERNEL::Exception(msg2);
4646               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4647               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4648               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4649               ret2->setArray(ret);
4650               return ret2.retn();
4651             }
4652           default:
4653             { throw INTERP_KERNEL::Exception(msg); }
4654           }
4655       }
4656
4657       MEDCouplingFieldDouble *__neg__() const
4658       {
4659         return self->negate();
4660       }
4661
4662       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj)
4663       {
4664         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.";
4665         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4666         void *argp;
4667         //
4668         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4669           {
4670             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4671             if(other)
4672               {
4673                 *self+=*other;
4674                 Py_XINCREF(trueSelf);
4675                 return trueSelf;
4676               }
4677             else
4678               throw INTERP_KERNEL::Exception(msg);
4679           }
4680         //
4681         double val;
4682         DataArrayDouble *a;
4683         DataArrayDoubleTuple *aa;
4684         std::vector<double> bb;
4685         mcIdType sw;
4686         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4687         switch(sw)
4688           {
4689           case 1:
4690             {
4691               if(!self->getArray())
4692                 throw INTERP_KERNEL::Exception(msg2);
4693               self->getArray()->applyLin(1.,val);
4694               Py_XINCREF(trueSelf);
4695               return trueSelf;
4696             }
4697           case 2:
4698             {
4699               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4700               ret2->setArray(a);
4701               *self+=*ret2;
4702               Py_XINCREF(trueSelf);
4703               return trueSelf;
4704             }
4705           case 3:
4706             {
4707               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4708               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4709               ret2->setArray(aaa);
4710               *self+=*ret2;
4711               Py_XINCREF(trueSelf);
4712               return trueSelf;
4713             }
4714           case 4:
4715             {
4716               if(!self->getArray())
4717                 throw INTERP_KERNEL::Exception(msg2);
4718               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4719               self->getArray()->addEqual(aaa);
4720               Py_XINCREF(trueSelf);
4721               return trueSelf;
4722             }
4723           default:
4724             { throw INTERP_KERNEL::Exception(msg); }
4725           }
4726       }
4727
4728       PyObject *___isub___(PyObject *trueSelf, PyObject *obj)
4729       {
4730         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.";
4731         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4732         void *argp;
4733         //
4734         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4735           {
4736             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4737             if(other)
4738               {
4739                 *self-=*other;
4740                 Py_XINCREF(trueSelf);
4741                 return trueSelf;
4742               }
4743             else
4744               throw INTERP_KERNEL::Exception(msg);
4745           }
4746         //
4747         double val;
4748         DataArrayDouble *a;
4749         DataArrayDoubleTuple *aa;
4750         std::vector<double> bb;
4751         mcIdType sw;
4752         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4753         switch(sw)
4754           {
4755           case 1:
4756             {
4757               if(!self->getArray())
4758                 throw INTERP_KERNEL::Exception(msg2);
4759               self->getArray()->applyLin(1.,-val);
4760               Py_XINCREF(trueSelf);
4761               return trueSelf;
4762             }
4763           case 2:
4764             {
4765               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4766               ret2->setArray(a);
4767               *self-=*ret2;
4768               Py_XINCREF(trueSelf);
4769               return trueSelf;
4770             }
4771           case 3:
4772             {
4773               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4774               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4775               ret2->setArray(aaa);
4776               *self-=*ret2;
4777               Py_XINCREF(trueSelf);
4778               return trueSelf;
4779             }
4780           case 4:
4781             {
4782               if(!self->getArray())
4783                 throw INTERP_KERNEL::Exception(msg2);
4784               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4785               self->getArray()->substractEqual(aaa);
4786               Py_XINCREF(trueSelf);
4787               return trueSelf;
4788             }
4789           default:
4790             { throw INTERP_KERNEL::Exception(msg); }
4791           }
4792       }
4793
4794       PyObject *___imul___(PyObject *trueSelf, PyObject *obj)
4795       {
4796         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.";
4797         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4798         void *argp;
4799         //
4800         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4801           {
4802             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4803             if(other)
4804               {
4805                 *self*=*other;
4806                 Py_XINCREF(trueSelf);
4807                 return trueSelf;
4808               }
4809             else
4810               throw INTERP_KERNEL::Exception(msg);
4811           }
4812         //
4813         double val;
4814         DataArrayDouble *a;
4815         DataArrayDoubleTuple *aa;
4816         std::vector<double> bb;
4817         mcIdType sw;
4818         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4819         switch(sw)
4820           {
4821           case 1:
4822             {
4823               if(!self->getArray())
4824                 throw INTERP_KERNEL::Exception(msg2);
4825               self->getArray()->applyLin(val,0);
4826               Py_XINCREF(trueSelf);
4827               return trueSelf;
4828             }
4829           case 2:
4830             {
4831               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4832               ret2->setArray(a);
4833               *self*=*ret2;
4834               Py_XINCREF(trueSelf);
4835               return trueSelf;
4836             }
4837           case 3:
4838             {
4839               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4840               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4841               ret2->setArray(aaa);
4842               *self*=*ret2;
4843               Py_XINCREF(trueSelf);
4844               return trueSelf;
4845             }
4846           case 4:
4847             {
4848               if(!self->getArray())
4849                 throw INTERP_KERNEL::Exception(msg2);
4850               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,(int)bb.size());
4851               self->getArray()->multiplyEqual(aaa);
4852               Py_XINCREF(trueSelf);
4853               return trueSelf;
4854             }
4855           default:
4856             { throw INTERP_KERNEL::Exception(msg); }
4857           }
4858       }
4859
4860       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj)
4861       {
4862         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.";
4863         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4864         void *argp;
4865         //
4866         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4867           {
4868             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4869             if(other)
4870               {
4871                 *self/=*other;
4872                 Py_XINCREF(trueSelf);
4873                 return trueSelf;
4874               }
4875             else
4876               throw INTERP_KERNEL::Exception(msg);
4877           }
4878         //
4879         double val;
4880         DataArrayDouble *a;
4881         DataArrayDoubleTuple *aa;
4882         std::vector<double> bb;
4883         mcIdType sw;
4884         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4885         switch(sw)
4886           {
4887           case 1:
4888             {
4889               if(val==0.)
4890                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4891               if(!self->getArray())
4892                 throw INTERP_KERNEL::Exception(msg2);
4893               self->getArray()->applyLin(1./val,0);
4894               Py_XINCREF(trueSelf);
4895               return trueSelf;
4896             }
4897           case 2:
4898             {
4899               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4900               ret2->setArray(a);
4901               *self/=*ret2;
4902               Py_XINCREF(trueSelf);
4903               return trueSelf;
4904             }
4905           case 3:
4906             {
4907               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4908               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4909               ret2->setArray(aaa);
4910               *self/=*ret2;
4911               Py_XINCREF(trueSelf);
4912               return trueSelf;
4913             }
4914           case 4:
4915             {
4916               if(!self->getArray())
4917                 throw INTERP_KERNEL::Exception(msg2);
4918               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4919               self->getArray()->divideEqual(aaa);
4920               Py_XINCREF(trueSelf);
4921               return trueSelf;
4922             }
4923           default:
4924             { throw INTERP_KERNEL::Exception(msg); }
4925           }
4926       }
4927
4928       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj)
4929       {
4930         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.";
4931         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4932         void *argp;
4933         //
4934         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4935           {
4936             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4937             if(other)
4938               {
4939                 *self^=*other;
4940                 Py_XINCREF(trueSelf);
4941                 return trueSelf;
4942               }
4943             else
4944               throw INTERP_KERNEL::Exception(msg);
4945           }
4946         //
4947         double val;
4948         DataArrayDouble *a;
4949         DataArrayDoubleTuple *aa;
4950         std::vector<double> bb;
4951         mcIdType sw;
4952         convertDoubleStarLikePyObjToCpp_2(obj,sw,val,a,aa,bb);
4953         switch(sw)
4954           {
4955           case 1:
4956             {
4957               if(!self->getArray())
4958                 throw INTERP_KERNEL::Exception(msg2);
4959               self->getArray()->applyPow(val);
4960               Py_XINCREF(trueSelf);
4961               return trueSelf;
4962             }
4963           case 2:
4964             {
4965               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4966               ret2->setArray(a);
4967               *self^=*ret2;
4968               Py_XINCREF(trueSelf);
4969               return trueSelf;
4970             }
4971           case 3:
4972             {
4973               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4974               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4975               ret2->setArray(aaa);
4976               *self^=*ret2;
4977               Py_XINCREF(trueSelf);
4978               return trueSelf;
4979             }
4980           case 4:
4981             {
4982               if(!self->getArray())
4983                 throw INTERP_KERNEL::Exception(msg2);
4984               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,DeallocType::CPP_DEALLOC,1,bb.size());
4985               self->getArray()->powEqual(aaa);
4986               Py_XINCREF(trueSelf);
4987               return trueSelf;
4988             }
4989           default:
4990             { throw INTERP_KERNEL::Exception(msg); }
4991           }
4992       }
4993
4994       static MEDCouplingFieldDouble *MergeFields(PyObject *li)
4995       {
4996         std::vector<const MEDCouplingFieldDouble *> tmp;
4997         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4998         return MEDCouplingFieldDouble::MergeFields(tmp);
4999       }
5000
5001       static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true)
5002       {
5003         std::vector<const MEDCouplingFieldDouble *> tmp;
5004         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5005         return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5006       }
5007
5008       PyObject *getTinySerializationInformation() const
5009       {
5010         return field_getTinySerializationInformation<MEDCouplingFieldDouble>(self);
5011       }
5012       
5013       PyObject *serialize() const
5014       {
5015         return field_serialize<double>(self);
5016       }
5017
5018       PyObject *__getstate__() const
5019       {
5020         return field__getstate__<MEDCouplingFieldDouble>(self,MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldDouble_serialize);
5021       }
5022       
5023       void __setstate__(PyObject *inp)
5024       {
5025         field__setstate__<double>(self,inp);
5026       }
5027     }
5028   };
5029
5030   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5031   {
5032   public:
5033     int getNumberOfFields() const;
5034     MEDCouplingMultiFields *deepCopy() const;
5035     virtual std::string simpleRepr() const;
5036     virtual std::string advancedRepr() const;
5037     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5038     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5039     virtual void checkConsistencyLight() const;
5040     %extend
5041        {
5042          std::string __str__() const
5043          {
5044            return self->simpleRepr();
5045          }
5046          static MEDCouplingMultiFields *New(PyObject *li)
5047          {
5048            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5049            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5050            std::size_t sz=tmp.size();
5051            std::vector<MEDCouplingFieldDouble *> fs(sz);
5052            for(std::size_t i=0;i<sz;i++)
5053              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5054            return MEDCouplingMultiFields::New(fs);
5055          }
5056          MEDCouplingMultiFields(PyObject *li)
5057          {
5058            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5059            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5060            std::size_t sz=tmp.size();
5061            std::vector<MEDCouplingFieldDouble *> fs(sz);
5062            for(std::size_t i=0;i<sz;i++)
5063              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5064            return MEDCouplingMultiFields::New(fs);
5065          }
5066          PyObject *getFields() const
5067          {
5068            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5069            std::size_t sz=fields.size();
5070            PyObject *res = PyList_New(sz);
5071            for(std::size_t i=0;i<sz;i++)
5072              {
5073                if(fields[i])
5074                  {
5075                    fields[i]->incrRef();
5076                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5077                  }
5078                else
5079                  {
5080                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5081                  }
5082              }
5083            return res;
5084          }
5085          PyObject *getFieldAtPos(int id) const
5086          {
5087            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5088            if(ret)
5089              {
5090                ret->incrRef();
5091                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5092              }
5093            else
5094              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5095          }
5096          PyObject *getMeshes() const
5097          {
5098            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5099            std::size_t sz=ms.size();
5100            PyObject *res = PyList_New(sz);
5101            for(std::size_t i=0;i<sz;i++)
5102              {
5103                if(ms[i])
5104                  {
5105                    ms[i]->incrRef();
5106                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5107                  }
5108                else
5109                  {
5110                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5111                  }
5112              }
5113            return res;
5114          }
5115          PyObject *getDifferentMeshes() const
5116          {
5117            std::vector<int> refs;
5118            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5119            std::size_t sz=ms.size();
5120            PyObject *res = PyList_New(sz);
5121            for(std::size_t i=0;i<sz;i++)
5122              {
5123                if(ms[i])
5124                  {
5125                    ms[i]->incrRef();
5126                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5127                  }
5128                else
5129                  {
5130                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5131                  }
5132              }
5133            //
5134            PyObject *ret=PyTuple_New(2);
5135            PyTuple_SetItem(ret,0,res);
5136            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5137            return ret;
5138          }
5139          PyObject *getArrays() const
5140          {
5141            std::vector<DataArrayDouble *> ms=self->getArrays();
5142            std::size_t sz=ms.size();
5143            PyObject *res = PyList_New(sz);
5144            for(std::size_t i=0;i<sz;i++)
5145              {
5146                if(ms[i])
5147                  {
5148                    ms[i]->incrRef();
5149                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5150                  }
5151                else
5152                  {
5153                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5154                  }
5155              }
5156            return res;
5157          }
5158          PyObject *getDifferentArrays() const
5159          {
5160            std::vector< std::vector<int> > refs;
5161            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5162            std::size_t sz=ms.size();
5163            PyObject *res = PyList_New(sz);
5164            PyObject *res2 = PyList_New(sz);
5165            for(std::size_t i=0;i<sz;i++)
5166              {
5167                if(ms[i])
5168                  {
5169                    ms[i]->incrRef();
5170                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5171                  }
5172                else
5173                  {
5174                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5175                  }
5176                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5177              }
5178            //
5179            PyObject *ret=PyTuple_New(2);
5180            PyTuple_SetItem(ret,0,res);
5181            PyTuple_SetItem(ret,1,res2);
5182            return ret;
5183          }
5184        }
5185   };
5186
5187   class MEDCouplingFieldInt32 : public MEDCouplingFieldT<int>
5188   {
5189   public:
5190     static MEDCouplingFieldInt32 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5191     static MEDCouplingFieldInt32 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5192     bool isEqual(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5193     bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const;
5194     void setTimeUnit(const std::string& unit);
5195     std::string getTimeUnit() const;
5196     void setTime(double val, int iteration, int order);
5197     void setArray(DataArrayInt32 *array);
5198     MEDCouplingFieldInt32 *deepCopy() const;
5199     MEDCouplingFieldInt32 *clone(bool recDeepCpy) const;
5200     MEDCouplingFieldInt32 *cloneWithMesh(bool recDeepCpy) const;
5201     MEDCouplingFieldDouble *convertToDblField() const;
5202     MEDCouplingFieldInt32 *buildSubPartRange(int begin, int end, int step) const;
5203     %extend {
5204       MEDCouplingFieldInt32(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5205       {
5206         return MEDCouplingFieldInt32::New(type,td);
5207       }
5208
5209       MEDCouplingFieldInt32(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5210       {
5211         return MEDCouplingFieldInt32::New(ft,td);
5212       }
5213
5214       PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt32 *other, double meshPrec, int valsPrec) const
5215       {
5216         std::string ret1;
5217         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5218         PyObject *ret=PyTuple_New(2);
5219         PyObject *ret0Py=ret0?Py_True:Py_False;
5220         Py_XINCREF(ret0Py);
5221         PyTuple_SetItem(ret,0,ret0Py);
5222         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5223         return ret;
5224       }
5225       
5226       std::string __str__() const
5227       {
5228         return self->simpleRepr();
5229       }
5230
5231       std::string __repr__() const
5232       {
5233         std::ostringstream oss;
5234         self->reprQuickOverview(oss);
5235         return oss.str();
5236       }
5237
5238       MEDCouplingFieldInt32 *buildSubPart(PyObject *li) const
5239       {
5240         return fieldT_buildSubPart(self,li);
5241       }
5242
5243       MEDCouplingFieldInt32 *__getitem__(PyObject *li) const
5244       {
5245         return fieldT__getitem__(self,li);
5246       }
5247
5248       DataArrayInt32 *getArray()
5249       {
5250         DataArrayInt32 *ret=self->getArray();
5251         if(ret)
5252           ret->incrRef();
5253         return ret;
5254       }
5255       
5256       PyObject *getTime()
5257         {
5258         int tmp1,tmp2;
5259         double tmp0=self->getTime(tmp1,tmp2);
5260         PyObject *res = PyList_New(3);
5261         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5262         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5263         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5264         return res;
5265         }
5266
5267       PyObject *getTinySerializationInformation() const
5268       {
5269         return field_getTinySerializationInformation<MEDCouplingFieldInt32>(self);
5270       }
5271       
5272       PyObject *serialize() const
5273       {
5274         return field_serialize<int>(self);
5275       }
5276
5277       PyObject *__getstate__() const
5278       {
5279         return field__getstate__<MEDCouplingFieldInt32>(self,MEDCoupling_MEDCouplingFieldInt32_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt32_serialize);
5280       }
5281       
5282       void __setstate__(PyObject *inp)
5283       {
5284         field__setstate__<int>(self,inp);
5285       }
5286     }
5287   };
5288
5289   class MEDCouplingFieldInt64 : public MEDCouplingFieldT<int>
5290   {
5291   public:
5292     static MEDCouplingFieldInt64 *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5293     static MEDCouplingFieldInt64 *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5294     bool isEqual(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5295     bool isEqualWithoutConsideringStr(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const;
5296     void setTimeUnit(const std::string& unit);
5297     std::string getTimeUnit() const;
5298     void setTime(double val, int iteration, int order);
5299     void setArray(DataArrayInt64 *array);
5300     MEDCouplingFieldInt64 *deepCopy() const;
5301     MEDCouplingFieldInt64 *clone(bool recDeepCpy) const;
5302     MEDCouplingFieldInt64 *cloneWithMesh(bool recDeepCpy) const;
5303     MEDCouplingFieldDouble *convertToDblField() const;
5304     MEDCouplingFieldInt64 *buildSubPartRange(int begin, int end, int step) const;
5305     %extend {
5306       MEDCouplingFieldInt64(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5307       {
5308         return MEDCouplingFieldInt64::New(type,td);
5309       }
5310
5311       MEDCouplingFieldInt64(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5312       {
5313         return MEDCouplingFieldInt64::New(ft,td);
5314       }
5315
5316       PyObject *isEqualIfNotWhy(const MEDCouplingFieldInt64 *other, double meshPrec, int valsPrec) const
5317       {
5318         std::string ret1;
5319         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5320         PyObject *ret=PyTuple_New(2);
5321         PyObject *ret0Py=ret0?Py_True:Py_False;
5322         Py_XINCREF(ret0Py);
5323         PyTuple_SetItem(ret,0,ret0Py);
5324         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5325         return ret;
5326       }
5327       
5328       std::string __str__() const
5329       {
5330         return self->simpleRepr();
5331       }
5332
5333       std::string __repr__() const
5334       {
5335         std::ostringstream oss;
5336         self->reprQuickOverview(oss);
5337         return oss.str();
5338       }
5339
5340       MEDCouplingFieldInt64 *buildSubPart(PyObject *li) const
5341       {
5342         return fieldT_buildSubPart(self,li);
5343       }
5344
5345       MEDCouplingFieldInt64 *__getitem__(PyObject *li) const
5346       {
5347         return fieldT__getitem__(self,li);
5348       }
5349
5350       DataArrayInt64 *getArray()
5351       {
5352         DataArrayInt64 *ret=self->getArray();
5353         if(ret)
5354           ret->incrRef();
5355         return ret;
5356       }
5357       
5358       PyObject *getTime()
5359         {
5360         int tmp1,tmp2;
5361         double tmp0=self->getTime(tmp1,tmp2);
5362         PyObject *res = PyList_New(3);
5363         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5364         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5365         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5366         return res;
5367         }
5368
5369       PyObject *getTinySerializationInformation() const
5370       {
5371         return field_getTinySerializationInformation<MEDCouplingFieldInt64>(self);
5372       }
5373       
5374       PyObject *serialize() const
5375       {
5376         return field_serialize<Int64>(self);
5377       }
5378
5379       PyObject *__getstate__() const
5380       {
5381         return field__getstate__<MEDCouplingFieldInt64>(self,MEDCoupling_MEDCouplingFieldInt64_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldInt64_serialize);
5382       }
5383       
5384       void __setstate__(PyObject *inp)
5385       {
5386         field__setstate__<Int64>(self,inp);
5387       }
5388     }
5389   };
5390
5391   class MEDCouplingFieldFloat : public MEDCouplingFieldT<float>
5392   {
5393   public:
5394     static MEDCouplingFieldFloat *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5395     static MEDCouplingFieldFloat *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5396     bool isEqual(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5397     bool isEqualWithoutConsideringStr(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const;
5398     void setTimeUnit(const std::string& unit);
5399     std::string getTimeUnit() const;
5400     void setTime(double val, int iteration, int order);
5401     void setArray(DataArrayFloat *array);
5402     MEDCouplingFieldFloat *deepCopy() const;
5403     MEDCouplingFieldFloat *clone(bool recDeepCpy) const;
5404     MEDCouplingFieldFloat *cloneWithMesh(bool recDeepCpy) const;
5405     MEDCouplingFieldDouble *convertToDblField() const;
5406     MEDCouplingFieldFloat *buildSubPartRange(int begin, int end, int step) const;
5407     %extend {
5408       MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5409       {
5410         return MEDCouplingFieldFloat::New(type,td);
5411       }
5412
5413       MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5414       {
5415         return MEDCouplingFieldFloat::New(ft,td);
5416       }
5417
5418       PyObject *isEqualIfNotWhy(const MEDCouplingFieldFloat *other, double meshPrec, float valsPrec) const
5419       {
5420         std::string ret1;
5421         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
5422         PyObject *ret=PyTuple_New(2);
5423         PyObject *ret0Py=ret0?Py_True:Py_False;
5424         Py_XINCREF(ret0Py);
5425         PyTuple_SetItem(ret,0,ret0Py);
5426         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5427         return ret;
5428       }
5429
5430       std::string __str__() const
5431       {
5432         return self->simpleRepr();
5433       }
5434
5435       std::string __repr__() const
5436       {
5437         std::ostringstream oss;
5438         self->reprQuickOverview(oss);
5439         return oss.str();
5440       }
5441
5442       MEDCouplingFieldFloat *buildSubPart(PyObject *li) const
5443       {
5444         return fieldT_buildSubPart(self,li);
5445       }
5446
5447       MEDCouplingFieldFloat *__getitem__(PyObject *li) const
5448       {
5449         return fieldT__getitem__(self,li);
5450       }
5451
5452       DataArrayFloat *getArray()
5453       {
5454         DataArrayFloat *ret=self->getArray();
5455         if(ret)
5456           ret->incrRef();
5457         return ret;
5458       }
5459       
5460       PyObject *getTime()
5461       {
5462         int tmp1,tmp2;
5463         double tmp0=self->getTime(tmp1,tmp2);
5464         PyObject *res = PyList_New(3);
5465         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5466         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5467         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5468         return res;
5469       }
5470
5471       PyObject *getTinySerializationInformation() const
5472       {
5473         return field_getTinySerializationInformation<MEDCouplingFieldFloat>(self);
5474       }
5475       
5476       PyObject *serialize() const
5477       {
5478         return field_serialize<float>(self);
5479       }
5480       
5481       PyObject *__getstate__() const
5482       {
5483         return field__getstate__<MEDCouplingFieldFloat>(self,MEDCoupling_MEDCouplingFieldFloat_getTinySerializationInformation,MEDCoupling_MEDCouplingFieldFloat_serialize);
5484       }
5485         
5486       void __setstate__(PyObject *inp)
5487       {
5488         field__setstate__<float>(self,inp);
5489       }
5490     }
5491   };
5492   
5493   class MEDCouplingDefinitionTime
5494   {
5495   public:
5496     MEDCouplingDefinitionTime();
5497     void assign(const MEDCouplingDefinitionTime& other);
5498     bool isEqual(const MEDCouplingDefinitionTime& other) const;
5499     double getTimeResolution() const;
5500     std::vector<double> getHotSpotsTime() const;
5501     %extend
5502       {
5503         std::string __str__() const
5504           {
5505             std::ostringstream oss;
5506             self->appendRepr(oss);
5507             return oss.str();
5508           }
5509
5510         PyObject *getIdsOnTimeRight(double tm) const
5511         {
5512           int meshId,arrId,arrIdInField,fieldId;
5513           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5514           PyObject *res=PyList_New(4);
5515           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5516           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5517           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5518           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5519           return res;
5520         }
5521
5522         PyObject *getIdsOnTimeLeft(double tm) const
5523         {
5524           int meshId,arrId,arrIdInField,fieldId;
5525           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5526           PyObject *res=PyList_New(4);
5527           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5528           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5529           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5530           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5531           return res;
5532         }
5533       }
5534   };
5535
5536   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5537   {
5538   public:
5539     double getTimeTolerance() const;
5540     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5541     
5542     %extend
5543       {
5544         MEDCouplingFieldOverTime(PyObject *li)
5545           {
5546             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5547             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5548             std::size_t sz=tmp.size();
5549             std::vector<MEDCouplingFieldDouble *> fs(sz);
5550             for(std::size_t i=0;i<sz;i++)
5551               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5552             return MEDCouplingFieldOverTime::New(fs);
5553           }
5554         std::string __str__() const
5555           {
5556             return self->simpleRepr();
5557           }
5558         static MEDCouplingFieldOverTime *New(PyObject *li)
5559           {
5560             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5561             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5562             std::size_t sz=tmp.size();
5563             std::vector<MEDCouplingFieldDouble *> fs(sz);
5564             for(std::size_t i=0;i<sz;i++)
5565               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5566             return MEDCouplingFieldOverTime::New(fs);
5567           }
5568       }
5569   };
5570
5571   class MEDCouplingCartesianAMRMesh;
5572   
5573   class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5574   {
5575   public:
5576     int getNumberOfCellsRecursiveWithOverlap() const;
5577     int getNumberOfCellsRecursiveWithoutOverlap() const;
5578     int getMaxNumberOfLevelsRelativeToThis() const;
5579     %extend
5580     {
5581       MEDCouplingCartesianAMRMeshGen *getMesh() const
5582       {
5583         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5584         if(ret)
5585           ret->incrRef();
5586         return ret;
5587       }
5588     }
5589   };
5590
5591   class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5592   {
5593   public:
5594     int getNumberOfOverlapedCellsForFather() const;
5595     bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const;
5596     std::vector<mcIdType> computeCellGridSt() const;
5597     %extend
5598     {
5599       PyObject *getBLTRRange() const
5600       {
5601         const std::vector< std::pair<mcIdType,mcIdType> >& ret(self->getBLTRRange());
5602         return convertFromVectorPairInt(ret);
5603       }
5604
5605       PyObject *getBLTRRangeRelativeToGF() const
5606       {
5607         std::vector< std::pair<mcIdType,mcIdType> > ret(self->getBLTRRangeRelativeToGF());
5608         return convertFromVectorPairInt(ret);
5609       }
5610
5611       void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5612       {
5613         std::vector< std::pair<mcIdType,mcIdType> > inp;
5614         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5615         self->addPatch(inp,factors);
5616       }
5617
5618       MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5619       {
5620         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5621         if(!mesh)
5622           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5623         if(patchId==mesh->getNumberOfPatches())
5624           {
5625             std::ostringstream oss;
5626             oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5627             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5628             return 0;
5629           }
5630         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5631         if(ret)
5632           ret->incrRef();
5633         return ret;
5634       }
5635
5636       void __delitem__(mcIdType patchId)
5637       {
5638         MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5639         if(!mesh)
5640           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5641         mesh->removePatch(patchId);
5642       }
5643
5644       mcIdType __len__() const
5645       {
5646         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5647         if(!mesh)
5648           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5649         return mesh->getNumberOfPatches();
5650       }
5651     }
5652   };
5653
5654   class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5655   {
5656   };
5657   
5658   class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5659   {
5660   public:
5661     mcIdType getAbsoluteLevel() const;
5662     mcIdType getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5663     std::vector<mcIdType> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
5664     int getSpaceDimension() const;
5665     const std::vector<mcIdType>& getFactors() const;
5666     void setFactors(const std::vector<mcIdType>& newFactors);
5667     mcIdType getMaxNumberOfLevelsRelativeToThis() const;
5668     mcIdType getNumberOfCellsAtCurrentLevel() const;
5669     mcIdType getNumberOfCellsAtCurrentLevelGhost(mcIdType ghostLev) const;
5670     mcIdType getNumberOfCellsRecursiveWithOverlap() const;
5671     mcIdType getNumberOfCellsRecursiveWithoutOverlap() const;
5672     bool isPatchInNeighborhoodOf(mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const;
5673    virtual void detachFromFather();
5674     //
5675     mcIdType getNumberOfPatches() const;
5676     mcIdType getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const;
5677     MEDCouplingUMesh *buildUnstructured() const;
5678     DataArrayDouble *extractGhostFrom(mcIdType ghostSz, const DataArrayDouble *arr) const;
5679     std::vector<mcIdType> getPatchIdsInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5680     MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const;
5681     MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const;
5682     void removeAllPatches();
5683     void removePatch(mcIdType patchId);
5684     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<mcIdType>& factors);
5685     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<mcIdType>& factors, double eps);
5686     DataArrayDouble *createCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const;
5687     void fillCellFieldOnPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const;
5688     void fillCellFieldOnPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const;
5689     void fillCellFieldOnPatchOnlyOnGhostZone(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const;
5690     void fillCellFieldOnPatchOnlyOnGhostZoneWith(mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5691     void fillCellFieldComingFromPatch(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const;
5692     void fillCellFieldComingFromPatchGhost(mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const;
5693     DataArrayIdType *findPatchesInTheNeighborhoodOf(mcIdType patchId, mcIdType ghostLev) const;
5694     std::string buildPythonDumpOfThis() const;
5695     %extend
5696     {
5697       void addPatch(PyObject *bottomLeftTopRight, const std::vector<mcIdType>& factors)
5698       {
5699         std::vector< std::pair<mcIdType,mcIdType> > inp;
5700         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5701         self->addPatch(inp,factors);
5702       }
5703
5704       PyObject *getPatches() const
5705       {
5706         std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5707         std::size_t sz(ps.size());
5708         PyObject *ret = PyList_New(sz);
5709         for(std::size_t i=0;i<sz;i++)
5710           {
5711             MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5712             if(elt)
5713               elt->incrRef();
5714             PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5715           }
5716         return ret;
5717       }
5718
5719       // agy : don't know why typemap fails here ??? let it in the extend section
5720       PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
5721       {
5722         return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5723       }
5724
5725       MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<mcIdType>& pos) const
5726       {
5727         const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5728         MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5729         if(ret2)
5730           ret2->incrRef();
5731         return ret2;
5732       }
5733
5734       MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<mcIdType>& pos) const
5735       {
5736         const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5737         MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5738         if(ret2)
5739           ret2->incrRef();
5740         return ret2;
5741       }
5742
5743       virtual PyObject *positionRelativeToGodFather() const
5744       {
5745         std::vector<mcIdType> out1;
5746         std::vector< std::pair<mcIdType,mcIdType> > out0(self->positionRelativeToGodFather(out1));
5747         PyObject *ret(PyTuple_New(2));
5748         PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5749         PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5750         return ret;
5751       }
5752
5753       virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
5754       {
5755         std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5756         std::size_t sz(ps.size());
5757         PyObject *ret = PyList_New(sz);
5758         for(std::size_t i=0;i<sz;i++)
5759           PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5760         return ret;
5761       }
5762
5763       MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(mcIdType ghostSz, PyObject *recurseArrs) const
5764       {
5765         std::vector<const DataArrayDouble *> inp;
5766         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5767         return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5768       }
5769
5770       virtual MEDCouplingCartesianAMRMeshGen *getFather() const
5771       {
5772         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5773         if(ret)
5774           ret->incrRef();
5775         return ret;
5776       }
5777       
5778       virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const
5779       {
5780         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5781         if(ret)
5782           ret->incrRef();
5783         return ret;
5784       }
5785
5786       MEDCouplingCartesianAMRPatch *getPatch(mcIdType patchId) const
5787       {
5788         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5789         if(ret)
5790           ret->incrRef();
5791         return ret;
5792       }
5793
5794       MEDCouplingIMesh *getImageMesh() const
5795       {
5796         const MEDCouplingIMesh *ret(self->getImageMesh());
5797         if(ret)
5798           ret->incrRef();
5799         return const_cast<MEDCouplingIMesh *>(ret);
5800       }
5801
5802       MEDCouplingCartesianAMRPatch *__getitem__(mcIdType patchId) const
5803       {
5804         if(patchId==self->getNumberOfPatches())
5805           {
5806             std::ostringstream oss;
5807             oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5808             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5809             return 0;
5810           }
5811         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5812         if(ret)
5813           ret->incrRef();
5814         return ret;
5815       }
5816
5817       void fillCellFieldOnPatchGhostAdv(mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const
5818       {
5819         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5820         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5821         self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5822       }
5823
5824       void fillCellFieldOnPatchOnlyGhostAdv(mcIdType patchId, mcIdType ghostLev, PyObject *arrsOnPatches) const
5825       {
5826         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5827         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5828         self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5829       }
5830
5831       void __delitem__(mcIdType patchId)
5832       {
5833         self->removePatch(patchId);
5834       }
5835
5836       mcIdType __len__() const
5837       {
5838         return self->getNumberOfPatches();
5839       }
5840     }
5841   };
5842
5843   class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5844   {
5845   };
5846
5847   class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5848   {
5849   public:
5850     static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh);
5851     %extend
5852     {
5853       static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5854       {
5855         static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5856         static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5857         const mcIdType *nodeStrctPtr(0);
5858         const double *originPtr(0),*dxyzPtr(0);
5859         mcIdType sw,sz,val0;
5860         std::vector<mcIdType> bb0;
5861         nodeStrctPtr=convertIntStarLikePyObjToCppIntStar(nodeStrct,sw,sz,val0,bb0);
5862         //
5863         double val,val2;
5864         std::vector<double> bb,bb2;
5865         mcIdType sz1,sz2;
5866         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5867         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5868         //
5869         return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5870       }
5871
5872       void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps)
5873       {
5874         std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5875         convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5876         std::vector< std::vector<mcIdType> > inp2;
5877         convertPyToVectorOfVectorOfInt(factors,inp2);
5878         self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5879       }
5880
5881       MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
5882       {
5883         return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5884       }
5885
5886       MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
5887       {
5888         return MEDCouplingCartesianAMRMesh::New(mesh);
5889       }
5890     }
5891   };
5892
5893   class MEDCouplingDataForGodFather : public RefCountObject
5894   {
5895   public:
5896     virtual void synchronizeFineToCoarse();
5897     virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev);
5898     virtual void synchronizeCoarseToFine();
5899     virtual void synchronizeCoarseToFineBetween(mcIdType fromLev, mcIdType toLev);
5900     virtual void synchronizeAllGhostZones();
5901     virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh);
5902     virtual void synchronizeAllGhostZonesAtASpecifiedLevel(mcIdType level);
5903     virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(mcIdType level);
5904     virtual void alloc();
5905     virtual void dealloc();
5906     %extend
5907     {
5908       MEDCouplingCartesianAMRMesh *getMyGodFather()
5909       {
5910         MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5911         if(ret)
5912           ret->incrRef();
5913         return ret;
5914       }
5915     }
5916   };
5917   
5918   class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5919   {
5920   public:
5921     mcIdType getNumberOfLevels() const;
5922     MEDCouplingAMRAttribute *deepCopy() const;
5923     MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
5924     MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5925     MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5926     MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const;
5927     bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
5928     MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const;
5929     std::string writeVTHB(const std::string& fileName) const;
5930     %extend
5931     {
5932       static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5933       {
5934         std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5935         std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5936         MEDCouplingAMRAttribute *ret(0);
5937         try
5938           {
5939             convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5940             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5941           }
5942         catch(INTERP_KERNEL::Exception&)
5943           {
5944             convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5945             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5946           }
5947         return ret;
5948       }
5949
5950       MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, mcIdType ghostLev)
5951       {
5952         return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5953       }
5954
5955       DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
5956       {
5957         const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5958         DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5959         if(ret2)
5960           ret2->incrRef();
5961         return ret2;
5962       }
5963
5964       void spillInfoOnComponents(PyObject *compNames)
5965       {
5966         std::vector< std::vector<std::string> > compNamesCpp;
5967         convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5968         self->spillInfoOnComponents(compNamesCpp);
5969       }
5970
5971       void spillNatures(PyObject *nfs)
5972       {
5973         std::vector<mcIdType> inp0;
5974         if(!fillIntVector(nfs,inp0))
5975           throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5976         std::size_t sz(inp0.size());
5977         std::vector<NatureOfField> inp00(sz);
5978         for(std::size_t i=0;i<sz;i++)
5979           inp00[i]=(NatureOfField)inp0[i];
5980         self->spillNatures(inp00);
5981       }
5982       
5983       PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
5984       {
5985         std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5986         std::size_t sz(ret.size());
5987         PyObject *retPy(PyList_New(sz));
5988         for(std::size_t i=0;i<sz;i++)
5989           PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5990         return retPy;
5991       }
5992     }
5993   };
5994
5995   class DenseMatrix : public RefCountObject, public TimeLabel
5996   {
5997   public:
5998     static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols);
5999     static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols);
6000     DenseMatrix *deepCopy() const;
6001     DenseMatrix *shallowCpy() const;
6002     //
6003     mcIdType getNumberOfRows() const;
6004     mcIdType getNumberOfCols() const;
6005     mcIdType getNbOfElems() const;
6006     void reBuild(DataArrayDouble *array, mcIdType nbRows=-1, mcIdType nbCols=-1);
6007     void reShape(mcIdType nbRows, mcIdType nbCols);
6008     void transpose();
6009     //
6010     bool isEqual(const DenseMatrix& other, double eps) const;
6011     DataArrayDouble *matVecMult(const DataArrayDouble *vec) const;
6012     static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec);
6013     %extend
6014     {
6015       DenseMatrix(mcIdType nbRows, mcIdType nbCols)
6016       {
6017         return DenseMatrix::New(nbRows,nbCols);
6018       }
6019
6020       DenseMatrix(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols)
6021       {
6022         return DenseMatrix::New(array,nbRows,nbCols);
6023       }
6024
6025       PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const
6026       {
6027         std::string ret1;
6028         bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
6029         PyObject *ret=PyTuple_New(2);
6030         PyObject *ret0Py=ret0?Py_True:Py_False;
6031         Py_XINCREF(ret0Py);
6032         PyTuple_SetItem(ret,0,ret0Py);
6033         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
6034         return ret;
6035       }
6036
6037       DataArrayDouble *getData()
6038       {
6039         DataArrayDouble *ret(self->getData());
6040         if(ret)
6041           ret->incrRef();
6042         return ret;
6043       }
6044
6045       DenseMatrix *__add__(const DenseMatrix *other)
6046       {
6047         return MEDCoupling::DenseMatrix::Add(self,other);
6048       }
6049
6050       DenseMatrix *__sub__(const DenseMatrix *other)
6051       {
6052         return MEDCoupling::DenseMatrix::Substract(self,other);
6053       }
6054
6055       DenseMatrix *__mul__(const DenseMatrix *other)
6056       {
6057         return MEDCoupling::DenseMatrix::Multiply(self,other);
6058       }
6059
6060       DenseMatrix *__mul__(const DataArrayDouble *other)
6061       {
6062         return MEDCoupling::DenseMatrix::Multiply(self,other);
6063       }
6064
6065       PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other)
6066       {
6067         self->addEqual(other);
6068         Py_XINCREF(trueSelf);
6069         return trueSelf;
6070       }
6071
6072       PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other)
6073       {
6074         self->substractEqual(other);
6075         Py_XINCREF(trueSelf);
6076         return trueSelf;
6077       }
6078 #ifdef WITH_NUMPY
6079       PyObject *toNumPyMatrix() // not const. It is not a bug !
6080       {
6081         PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6082         return obj;
6083       }
6084 #endif
6085     }
6086   };
6087 }
6088
6089 %pythoncode %{
6090 def MEDCouplingUMeshReduce(self):
6091     return MEDCouplingStdReduceFunct,(MEDCouplingUMesh,((),(self.__getstate__()),))
6092 def MEDCouplingCMeshReduce(self):
6093     return MEDCouplingStdReduceFunct,(MEDCouplingCMesh,((),(self.__getstate__()),))
6094 def MEDCouplingIMeshReduce(self):
6095     return MEDCouplingStdReduceFunct,(MEDCouplingIMesh,((),(self.__getstate__()),))
6096 def MEDCouplingMappedExtrudedMeshReduce(self):
6097     return MEDCouplingStdReduceFunct,(MEDCouplingMappedExtrudedMesh,((),(self.__getstate__()),))
6098 def MEDCouplingCurveLinearMeshReduce(self):
6099     return MEDCouplingStdReduceFunct,(MEDCouplingCurveLinearMesh,((),(self.__getstate__()),))
6100 def MEDCoupling1SGTUMeshReduce(self):
6101     return MEDCouplingStdReduceFunct,(MEDCoupling1SGTUMesh,((),(self.__getstate__()),))
6102 def MEDCoupling1DGTUMeshReduce(self):
6103     return MEDCouplingStdReduceFunct,(MEDCoupling1DGTUMesh,((),(self.__getstate__()),))
6104 def MEDCouplingFieldDoubleReduce(self):
6105     self.checkConsistencyLight()
6106     d=(self.getTypeOfField(),self.getTimeDiscretization())
6107     return MEDCouplingStdReduceFunct,(MEDCouplingFieldDouble,(d,(self.__getstate__()),))
6108 def MEDCouplingFieldInt32Reduce(self):
6109     self.checkConsistencyLight()
6110     d=(self.getTypeOfField(),self.getTimeDiscretization())
6111     return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt32,(d,(self.__getstate__()),))
6112 def MEDCouplingFieldInt64Reduce(self):
6113     self.checkConsistencyLight()
6114     d=(self.getTypeOfField(),self.getTimeDiscretization())
6115     return MEDCouplingStdReduceFunct,(MEDCouplingFieldInt64,(d,(self.__getstate__()),))
6116 def MEDCouplingFieldFloatReduce(self):
6117     self.checkConsistencyLight()
6118     d=(self.getTypeOfField(),self.getTimeDiscretization())
6119     return MEDCouplingStdReduceFunct,(MEDCouplingFieldFloat,(d,(self.__getstate__()),))
6120 def MEDCouplingFTReduceFunct(cls,params):
6121     a,b=params
6122     ret=object.__new__(cls)
6123     ret.__init__(*a)
6124     return ret
6125     
6126 def MEDCouplingFieldTemplateReduce(self):
6127     ret = MEDCouplingFieldDouble(self)
6128     nbTuples = self.getNumberOfTuplesExpected()
6129     arr = DataArrayDouble(nbTuples) ; arr[:] = 0.
6130     ret.setArray(arr)
6131     return MEDCouplingFTReduceFunct,(MEDCouplingFieldTemplate,((ret,),()))
6132 #
6133 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
6134 #
6135 MEDCouplingUMesh.ExtractFromIndexedArrays           = DataArrayInt.ExtractFromIndexedArrays
6136 MEDCouplingUMesh.ExtractFromIndexedArraysSlice      = DataArrayInt.ExtractFromIndexedArraysSlice
6137 MEDCouplingUMesh.SetPartOfIndexedArrays             = DataArrayInt.SetPartOfIndexedArrays
6138 MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx      = DataArrayInt.SetPartOfIndexedArraysSameIdx
6139 MEDCouplingUMesh.RemoveIdsFromIndexedArrays         = DataArrayInt.RemoveIdsFromIndexedArrays
6140 MEDCouplingFieldInt = MEDCouplingFieldInt32
6141
6142 if MEDCouplingUse64BitIDs():
6143   MEDCouplingFieldID = MEDCouplingFieldInt64
6144 else:
6145   MEDCouplingFieldID = MEDCouplingFieldInt32
6146
6147 %}
6148
6149 %pythoncode %{
6150 import os
6151 __filename=os.environ.get('PYTHONSTARTUP')
6152 if __filename and os.path.isfile(__filename):
6153     with open(__filename) as __fp:
6154         exec(__fp.read())
6155 %}