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