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