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