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