]> SALOME platform Git repositories - modules/med.git/blob - src/MEDCoupling_Swig/MEDCouplingCommon.i
Salome HOME
Addition of first AMR concepts.
[modules/med.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2007-2014  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 %include std_vector.i
24 %include std_string.i
25
26 %{
27 #include "MEDCouplingMemArray.hxx"
28 #include "MEDCouplingUMesh.hxx"
29 #include "MEDCouplingExtrudedMesh.hxx"
30 #include "MEDCouplingCMesh.hxx"
31 #include "MEDCouplingIMesh.hxx"
32 #include "MEDCouplingCurveLinearMesh.hxx"
33 #include "MEDCoupling1GTUMesh.hxx"
34 #include "MEDCouplingField.hxx"
35 #include "MEDCouplingFieldDouble.hxx"
36 #include "MEDCouplingFieldTemplate.hxx"
37 #include "MEDCouplingGaussLocalization.hxx"
38 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
39 #include "MEDCouplingMultiFields.hxx"
40 #include "MEDCouplingFieldOverTime.hxx"
41 #include "MEDCouplingDefinitionTime.hxx"
42 #include "MEDCouplingFieldDiscretization.hxx"
43 #include "MEDCouplingAHOGMesh.hxx"
44 #include "MEDCouplingTypemaps.i"
45
46 #include "InterpKernelAutoPtr.hxx"
47
48 using namespace ParaMEDMEM;
49 using namespace INTERP_KERNEL;
50
51 %}
52
53 %template(ivec) std::vector<int>;
54 %template(dvec) std::vector<double>;
55 %template(svec) std::vector<std::string>;
56
57 ////////////////////
58 %typemap(out) ParaMEDMEM::MEDCouplingMesh*
59 {
60   $result=convertMesh($1,$owner);
61 }
62
63 %typemap(out) MEDCouplingMesh*
64 {
65   $result=convertMesh($1,$owner);
66 }
67 //$$$$$$$$$$$$$$$$$$
68
69 ////////////////////
70 %typemap(out) ParaMEDMEM::MEDCouplingPointSet*
71 {
72   $result=convertMesh($1,$owner);
73 }
74
75 %typemap(out) MEDCouplingPointSet*
76 {
77   $result=convertMesh($1,$owner);
78 }
79 //$$$$$$$$$$$$$$$$$$
80
81
82 ////////////////////
83 %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
84 {
85   $result=convertMesh($1,$owner);
86 }
87
88 %typemap(out) MEDCoupling1GTUMesh*
89 {
90   $result=convertMesh($1,$owner);
91 }
92 //$$$$$$$$$$$$$$$$$$
93
94 ////////////////////
95 %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
96 {
97   $result=convertMesh($1,$owner);
98 }
99
100 %typemap(out) MEDCouplingStructuredMesh*
101 {
102   $result=convertMesh($1,$owner);
103 }
104 //$$$$$$$$$$$$$$$$$$
105
106 ////////////////////
107 %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
108 {
109   $result=convertFieldDiscretization($1,$owner);
110 }
111
112 %typemap(out) MEDCouplingFieldDiscretization*
113 {
114   $result=convertFieldDiscretization($1,$owner);
115 }
116 //$$$$$$$$$$$$$$$$$$
117
118 ////////////////////
119 %typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
120 {
121   $result=convertMultiFields($1,$owner);
122 }
123
124 %typemap(out) MEDCouplingMultiFields*
125 {
126   $result=convertMultiFields($1,$owner);
127 }
128 //$$$$$$$$$$$$$$$$$$
129
130 #ifdef WITH_NUMPY
131 %init %{ import_array(); %}
132 #endif
133
134 %feature("autodoc", "1");
135 %feature("docstring");
136
137 %newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
138 %newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
139 %newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
140 %newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
141 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
142 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
143 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
144 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
145 %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
146 %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
147 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
148 %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
149 %newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
150 %newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
151 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
152 %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
153 %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
154 %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
155 %newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
156 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
157 %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
158 %newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
159 %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
160 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
161 %newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
162 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
163 %newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
164 %newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
165 %newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
166 %newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
167 %newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
168 %newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
169 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
170 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
171 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
172 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
173 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
174 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
175 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
176 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
177 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
178 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
179 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
180 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
181 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
182 %newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
183 %newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
184 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
185 %newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
186 %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
187 %newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
188 %newobject ParaMEDMEM::MEDCouplingFieldDouble::cellToNodeDiscretization;
189 %newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
190 %newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
191 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
192 %newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
193 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
194 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
195 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
196 %newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
197 %newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
198 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
199 %newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
200 %newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
201 %newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
202 %newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
203 %newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
204 %newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
205 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
206 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
207 %newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
208 %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
209 %newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
210 %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
211 %newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
212 %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
213 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
214 %newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
215 %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
216 %newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
217 %newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
218 %newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
219 %newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
220 %newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
221 %newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
222 %newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
223 %newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
224 %newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
225 %newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
226 %newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
227 %newobject ParaMEDMEM::MEDCouplingUMesh::New;
228 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
229 %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
230 %newobject ParaMEDMEM::MEDCouplingUMesh::clone;
231 %newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
232 %newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
233 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
234 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
235 %newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
236 %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
237 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
238 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
239 %newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
240 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
241 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
242 %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
243 %newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
244 %newobject ParaMEDMEM::MEDCouplingUMesh::colinearize2D;
245 %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
246 %newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
247 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
248 %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
249 %newobject ParaMEDMEM::MEDCouplingUMesh::computeFetchedNodeIds;
250 %newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
251 %newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
252 %newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
253 %newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
254 %newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
255 %newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
256 %newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
257 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
258 %newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
259 %newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
260 %newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
261 %newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
262 %newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
263 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
264 %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
265 %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
266 %newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
267 %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
268 %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
269 %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
270 %newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
271 %newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
272 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
273 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
274 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
275 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
276 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
277 %newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
278 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
279 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
280 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
281 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
282 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
283 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
284 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
285 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
286 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
287 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
288 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
289 %newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
290 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
291 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
292 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
293 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
294 %newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
295 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
296 %newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
297 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
298 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
299 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
300 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
301 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
302 %newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
303 %newobject ParaMEDMEM::MEDCouplingCMesh::New;
304 %newobject ParaMEDMEM::MEDCouplingCMesh::clone;
305 %newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
306 %newobject ParaMEDMEM::MEDCouplingIMesh::New;
307 %newobject ParaMEDMEM::MEDCouplingIMesh::convertToCartesian;
308 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
309 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::clone;
310 %newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
311 %newobject ParaMEDMEM::MEDCouplingMultiFields::New;
312 %newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
313 %newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
314 %newobject ParaMEDMEM::MEDCouplingAHOGPatch::getMesh;
315 %newobject ParaMEDMEM::MEDCouplingAHOGPatch::__getitem__;
316 %newobject ParaMEDMEM::MEDCouplingAHOGMesh::New;
317 %newobject ParaMEDMEM::MEDCouplingAHOGMesh::buildUnstructured;
318 %newobject ParaMEDMEM::MEDCouplingAHOGMesh::getGodFather;
319 %newobject ParaMEDMEM::MEDCouplingAHOGMesh::getFather;
320 %newobject ParaMEDMEM::MEDCouplingAHOGMesh::getPatch;
321 %newobject ParaMEDMEM::MEDCouplingAHOGMesh::__getitem__;
322
323 %feature("unref") MEDCouplingPointSet "$this->decrRef();"
324 %feature("unref") MEDCouplingMesh "$this->decrRef();"
325 %feature("unref") MEDCouplingUMesh "$this->decrRef();"
326 %feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
327 %feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
328 %feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
329 %feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
330 %feature("unref") MEDCouplingCMesh "$this->decrRef();"
331 %feature("unref") MEDCouplingIMesh "$this->decrRef();"
332 %feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
333 %feature("unref") MEDCouplingField "$this->decrRef();"
334 %feature("unref") MEDCouplingFieldDiscretizationP0 "$this->decrRef();"
335 %feature("unref") MEDCouplingFieldDiscretizationP1 "$this->decrRef();"
336 %feature("unref") MEDCouplingFieldDiscretizationGauss "$this->decrRef();"
337 %feature("unref") MEDCouplingFieldDiscretizationGaussNE "$this->decrRef();"
338 %feature("unref") MEDCouplingFieldDiscretizationKriging "$this->decrRef();"
339 %feature("unref") MEDCouplingFieldDouble "$this->decrRef();"
340 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
341 %feature("unref") MEDCouplingFieldTemplate "$this->decrRef();"
342 %feature("unref") MEDCouplingMultiFields "$this->decrRef();"
343 %feature("unref") MEDCouplingAHOGMesh "$this->decrRef();"
344 %feature("unref") MEDCouplingAHOGPatch "$this->decrRef();"
345
346 %rename(assign) *::operator=;
347 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
348 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
349 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
350 %ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
351
352 %nodefaultctor;
353
354 %rename (InterpKernelException) INTERP_KERNEL::Exception;
355
356 %include "MEDCouplingRefCountObject.i"
357 %include "MEDCouplingMemArray.i"
358
359 namespace ParaMEDMEM
360 {
361   typedef enum
362     {
363       ON_CELLS = 0,
364       ON_NODES = 1,
365       ON_GAUSS_PT = 2,
366       ON_GAUSS_NE = 3,
367       ON_NODES_KR = 4
368     } TypeOfField;
369
370   typedef enum
371     {
372       NO_TIME = 4,
373       ONE_TIME = 5,
374       LINEAR_TIME = 6,
375       CONST_ON_TIME_INTERVAL = 7
376     } TypeOfTimeDiscretization;
377
378   typedef enum
379     {
380       UNSTRUCTURED = 5,
381       CARTESIAN = 7,
382       EXTRUDED = 8,
383       CURVE_LINEAR = 9,
384       SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
385       SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
386       IMAGE_GRID = 12
387     } MEDCouplingMeshType;
388
389   class DataArrayInt;
390   class DataArrayDouble;
391   class MEDCouplingUMesh;
392   class MEDCouplingFieldDouble;
393
394   %extend RefCountObject
395   {
396     std::string getHiddenCppPointer() const
397     {
398       std::ostringstream oss; oss << "C++ Pointer address is : " << self;
399       return oss.str();
400     }
401   }
402
403   %extend MEDCouplingGaussLocalization
404   {
405     std::string __str__() const throw(INTERP_KERNEL::Exception)
406     {
407       return self->getStringRepr();
408     }
409
410     std::string __repr__() const throw(INTERP_KERNEL::Exception)
411     {
412       std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
413       oss << self->getStringRepr();
414       return oss.str();
415     }
416   }
417
418   //== MEDCouplingMesh
419   
420   class MEDCouplingMesh : public RefCountObject, public TimeLabel
421   {
422   public:
423     void setName(const std::string& name);
424     std::string getName() const;
425     void setDescription(const std::string& descr);
426     std::string getDescription() const;
427     void setTime(double val, int iteration, int order);
428     void setTimeUnit(const std::string& unit);
429     std::string getTimeUnit() const;
430     virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
431     bool isStructured() const throw(INTERP_KERNEL::Exception);
432     virtual MEDCouplingMesh *deepCpy() const;
433     virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
434     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
435     virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
436     virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
437     virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
438     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
439     virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
440     virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
441     virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
442     virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
443     virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
444     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
445     virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
446     virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
447     virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
448     virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
449     virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
450     virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
451     virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
452     virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
453     virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
454     virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
455     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
456     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
457     void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
458     // tools
459     virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
460     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
461     virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
462     virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
463     virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
464     virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
465     virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
466     virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
467     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
468     virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
469     static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception);
470     static bool IsStaticGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
471     static bool IsLinearGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
472     static INTERP_KERNEL::NormalizedCellType GetCorrespondingPolyType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
473     static int GetNumberOfNodesOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
474     static int GetDimensionOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
475     static const char *GetReprOfGeometricType(INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
476     %extend
477        {
478          std::string __str__() const throw(INTERP_KERNEL::Exception)
479          {
480            return self->simpleRepr();
481          }
482
483          PyObject *getTime() throw(INTERP_KERNEL::Exception)
484          {
485            int tmp1,tmp2;
486            double tmp0=self->getTime(tmp1,tmp2);
487            PyObject *res = PyList_New(3);
488            PyList_SetItem(res,0,SWIG_From_double(tmp0));
489            PyList_SetItem(res,1,SWIG_From_int(tmp1));
490            PyList_SetItem(res,2,SWIG_From_int(tmp2));
491            return res;
492          }
493
494          int getCellContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
495          {
496            double val;
497            DataArrayDouble *a;
498            DataArrayDoubleTuple *aa;
499            std::vector<double> bb;
500            int sw;
501            int spaceDim=self->getSpaceDimension();
502            const char msg[]="Python wrap of MEDCouplingMesh::getCellContainingPoint : ";
503            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
504            return self->getCellContainingPoint(pos,eps);
505          }
506
507          PyObject *getCellsContainingPoints(PyObject *p, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
508          {
509            double val;
510            DataArrayDouble *a;
511            DataArrayDoubleTuple *aa;
512            std::vector<double> bb;
513            int sw;
514            int spaceDim=self->getSpaceDimension();
515            const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
516            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
517            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
518            self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
519            PyObject *ret=PyTuple_New(2);
520            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
521            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
522            return ret;
523          }
524
525          PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
526          {
527            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
528            int spaceDim=self->getSpaceDimension();
529            void *da=0;
530            int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 |  0 );
531            if (!SWIG_IsOK(res1))
532              {
533                int size;
534                INTERP_KERNEL::AutoCPtr<double> tmp=convertPyToNewDblArr2(p,&size);
535                int nbOfPoints=size/spaceDim;
536                if(size%spaceDim!=0)
537                  {
538                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid list length ! Must be a multiple of self.getSpaceDimension() !");
539                  }
540                self->getCellsContainingPoints(tmp,nbOfPoints,eps,elts,eltsIndex);
541              }
542            else
543              {
544                DataArrayDouble *da2=reinterpret_cast< DataArrayDouble * >(da);
545                if(!da2)
546                  throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
547                da2->checkAllocated();
548                int size=da2->getNumberOfTuples();
549                int nbOfCompo=da2->getNumberOfComponents();
550                if(nbOfCompo!=spaceDim)
551                  {
552                    throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
553                  }
554                self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
555              }
556            PyObject *ret=PyTuple_New(2);
557            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
558            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
559            return ret;
560          }
561
562          PyObject *getCellsContainingPoint(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
563          {
564            double val;
565            DataArrayDouble *a;
566            DataArrayDoubleTuple *aa;
567            std::vector<double> bb;
568            int sw;
569            int spaceDim=self->getSpaceDimension();
570            const char msg[]="Python wrap of MEDCouplingUMesh::getCellsContainingPoint : ";
571            const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,1,spaceDim,true);
572            std::vector<int> elts;
573            self->getCellsContainingPoint(pos,eps,elts);
574            DataArrayInt *ret=DataArrayInt::New();
575            ret->alloc((int)elts.size(),1);
576            std::copy(elts.begin(),elts.end(),ret->getPointer());
577            return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
578          }
579          
580          virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
581          {
582            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
583            MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
584            self->getReverseNodalConnectivity(d0,d1);
585            PyObject *ret=PyTuple_New(2);
586            PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
587            PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
588            return ret;
589          }
590          
591          void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
592          {
593            int sw,sz(-1);
594            int v0; std::vector<int> v1;
595            const int *ids(convertObjToPossibleCpp1_Safe(li,sw,sz,v0,v1));
596            self->renumberCells(ids,check);
597          }
598
599          PyObject *checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec) const throw(INTERP_KERNEL::Exception)
600          {
601            DataArrayInt *cellCor, *nodeCor;
602            self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
603            PyObject *res = PyList_New(2);
604            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
605            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
606            return res;
607          }
608
609          PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
610          {
611            DataArrayInt *cellCor=0,*nodeCor=0;
612            self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
613            PyObject *res = PyList_New(2);
614            PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
615            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
616            return res;
617          }
618          
619          DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
620          {
621            DataArrayInt *cellCor=0;
622            self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
623            return cellCor;
624          }
625
626          DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
627          {
628            void *da=0;
629            int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
630            if (!SWIG_IsOK(res1))
631              {
632                int size;
633                INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
634                return self->getCellIdsFullyIncludedInNodeIds(tmp,((const int *)tmp)+size);
635              }
636            else
637              {
638                DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
639                if(!da2)
640                  throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
641                da2->checkAllocated();
642                return self->getCellIdsFullyIncludedInNodeIds(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems());
643              }
644          }
645          PyObject *getNodeIdsOfCell(int cellId) const throw(INTERP_KERNEL::Exception)
646          {
647            std::vector<int> conn;
648            self->getNodeIdsOfCell(cellId,conn);
649            return convertIntArrToPyList2(conn);
650          }
651
652          PyObject *getCoordinatesOfNode(int nodeId) const throw(INTERP_KERNEL::Exception)
653          {
654            std::vector<double> coo;
655            self->getCoordinatesOfNode(nodeId,coo);
656            return convertDblArrToPyList2(coo);
657          }
658
659          void scale(PyObject *point, double factor) throw(INTERP_KERNEL::Exception)
660          {
661            double val;
662            DataArrayDouble *a;
663            DataArrayDoubleTuple *aa;
664            std::vector<double> bb;
665            int sw;
666            int spaceDim=self->getSpaceDimension();
667            const char msg[]="Python wrap of MEDCouplingPointSet::scale : ";
668            const double *pointPtr=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,spaceDim,true);
669            self->scale(pointPtr,factor);
670          }
671
672          PyObject *getBoundingBox() const throw(INTERP_KERNEL::Exception)
673          {
674            int spaceDim=self->getSpaceDimension();
675            INTERP_KERNEL::AutoPtr<double> tmp=new double[2*spaceDim];
676            self->getBoundingBox(tmp);
677            PyObject *ret=convertDblArrToPyListOfTuple(tmp,2,spaceDim);
678            return ret;
679          }
680
681          PyObject *isEqualIfNotWhy(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception)
682          {
683            std::string ret1;
684            bool ret0=self->isEqualIfNotWhy(other,prec,ret1);
685            PyObject *ret=PyTuple_New(2);
686            PyObject *ret0Py=ret0?Py_True:Py_False;
687            Py_XINCREF(ret0Py);
688            PyTuple_SetItem(ret,0,ret0Py);
689            PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
690            return ret;
691          }
692
693          PyObject *buildPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
694          {
695            int szArr,sw,iTypppArr;
696            std::vector<int> stdvecTyyppArr;
697            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
698            MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
699            if(sw==3)//DataArrayInt
700              { 
701                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
702                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
703                std::string name=argpt->getName();
704                if(!name.empty())
705                  ret->setName(name.c_str());
706              }
707            return convertMesh(ret, SWIG_POINTER_OWN | 0 );
708          }
709         
710          PyObject *buildPartAndReduceNodes(PyObject *li) const throw(INTERP_KERNEL::Exception)
711          {
712            int szArr,sw,iTypppArr;
713            std::vector<int> stdvecTyyppArr;
714            DataArrayInt *arr=0;
715            const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
716            MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
717            if(sw==3)//DataArrayInt
718              { 
719                void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
720                DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
721                std::string name=argpt->getName();
722                if(!name.empty())
723                  ret->setName(name.c_str());
724              }
725            //
726            PyObject *res = PyList_New(2);
727            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
728            PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
729            PyList_SetItem(res,0,obj0);
730            PyList_SetItem(res,1,obj1);
731            return res;
732          }
733
734          PyObject *buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception)
735          {
736            int a,b,c;
737            DataArrayInt *arr=0;
738            MEDCouplingMesh *ret=self->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,a,b,c,arr);
739            PyObject *res = PyTuple_New(2);
740            PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
741            PyObject *obj1=0;
742            if(arr)
743              obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
744            else
745              obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
746            PyTuple_SetItem(res,0,obj0);
747            PyTuple_SetItem(res,1,obj1);
748            return res;
749          }
750
751         PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
752         {
753           std::vector<int> vals=self->getDistributionOfTypes();
754           if(vals.size()%3!=0)
755             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
756           PyObject *ret=PyList_New((int)vals.size()/3);
757           for(int j=0;j<(int)vals.size()/3;j++)
758              {
759                PyObject *ret1=PyList_New(3);
760                PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
761                PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
762                PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
763                PyList_SetItem(ret,j,ret1);
764              }
765           return ret;
766         }
767
768         DataArrayInt *checkTypeConsistencyAndContig(PyObject *li, PyObject *li2) const throw(INTERP_KERNEL::Exception)
769         {
770           std::vector<int> code;
771           std::vector<const DataArrayInt *> idsPerType;
772           convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
773           convertPyToNewIntArr4(li,1,3,code);
774           return self->checkTypeConsistencyAndContig(code,idsPerType);
775         }
776
777         PyObject *splitProfilePerType(const DataArrayInt *profile) const throw(INTERP_KERNEL::Exception)
778         {
779           std::vector<int> code;
780           std::vector<DataArrayInt *> idsInPflPerType;
781           std::vector<DataArrayInt *> idsPerType;
782           self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
783           PyObject *ret=PyTuple_New(3);
784           //
785           if(code.size()%3!=0)
786             throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
787           PyObject *ret0=PyList_New((int)code.size()/3);
788           for(int j=0;j<(int)code.size()/3;j++)
789              {
790                PyObject *ret00=PyList_New(3);
791                PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
792                PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
793                PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
794                PyList_SetItem(ret0,j,ret00);
795              }
796           PyTuple_SetItem(ret,0,ret0);
797           //
798           PyObject *ret1=PyList_New(idsInPflPerType.size());
799           for(std::size_t j=0;j<idsInPflPerType.size();j++)
800             PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
801           PyTuple_SetItem(ret,1,ret1);
802           int n=idsPerType.size();
803           PyObject *ret2=PyList_New(n);
804           for(int i=0;i<n;i++)
805             PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
806           PyTuple_SetItem(ret,2,ret2);
807           return ret;
808         }
809
810         void translate(PyObject *vector) throw(INTERP_KERNEL::Exception)
811         {
812           double val;
813           DataArrayDouble *a;
814           DataArrayDoubleTuple *aa;
815           std::vector<double> bb;
816           int sw;
817           int spaceDim=self->getSpaceDimension();
818           const char msg[]="Python wrap of MEDCouplingPointSet::translate : ";
819           const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val,a,aa,bb,msg,1,spaceDim,true);
820           self->translate(vectorPtr);
821         }
822
823          void rotate(PyObject *center, double alpha) throw(INTERP_KERNEL::Exception)
824          {
825            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
826            double val;
827            DataArrayDouble *a;
828            DataArrayDoubleTuple *aa;
829            std::vector<double> bb;
830            int sw;
831            int spaceDim=self->getSpaceDimension();
832            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
833            self->rotate(centerPtr,0,alpha);
834          }
835
836          void rotate(PyObject *center, PyObject *vector, double alpha) throw(INTERP_KERNEL::Exception)
837          {
838            const char msg[]="Python wrap of MEDCouplingPointSet::rotate : ";
839            double val,val2;
840            DataArrayDouble *a,*a2;
841            DataArrayDoubleTuple *aa,*aa2;
842            std::vector<double> bb,bb2;
843            int sw;
844            int spaceDim=self->getSpaceDimension();
845            const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,spaceDim,true);
846            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
847            self->rotate(centerPtr,vectorPtr,alpha);
848          }
849
850          PyObject *getAllGeoTypes() const throw(INTERP_KERNEL::Exception)
851          {
852            std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypes();
853            std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
854            PyObject *res=PyList_New(result.size());
855            for(int i=0;iL!=result.end(); i++, iL++)
856              PyList_SetItem(res,i,PyInt_FromLong(*iL));
857            return res;
858          }
859          
860          static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
861          {
862             std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
863             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
864             return MEDCouplingMesh::MergeMeshes(tmp);
865          }
866        }
867   };
868 }
869
870 //== MEDCouplingMesh End
871
872 %include "NormalizedGeometricTypes"
873 %include "MEDCouplingNatureOfFieldEnum"
874 //
875 namespace ParaMEDMEM
876 {
877   class MEDCouplingNatureOfField
878   {
879   public:
880     static const char *GetRepr(NatureOfField nat) throw(INTERP_KERNEL::Exception);
881     static std::string GetReprNoThrow(NatureOfField nat);
882     static std::string GetAllPossibilitiesStr();
883   };
884 }
885
886 // the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
887 // include "MEDCouplingTimeDiscretization.i"
888
889 namespace ParaMEDMEM
890 {
891   class MEDCouplingGaussLocalization
892   {
893   public:
894     MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
895                                  const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
896     MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
897     INTERP_KERNEL::NormalizedCellType getType() const throw(INTERP_KERNEL::Exception);
898     void setType(INTERP_KERNEL::NormalizedCellType typ) throw(INTERP_KERNEL::Exception);
899     int getNumberOfGaussPt() const throw(INTERP_KERNEL::Exception);
900     int getDimension() const throw(INTERP_KERNEL::Exception);
901     int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
902     std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
903     void checkCoherency() const throw(INTERP_KERNEL::Exception);
904     bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
905     //
906     const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
907     double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
908     const std::vector<double>& getGaussCoords() const throw(INTERP_KERNEL::Exception);
909     double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
910     const std::vector<double>& getWeights() const throw(INTERP_KERNEL::Exception);
911     double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
912     void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
913     void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
914     void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
915     void setRefCoords(const std::vector<double>& refCoo) throw(INTERP_KERNEL::Exception);
916     void setGaussCoords(const std::vector<double>& gsCoo) throw(INTERP_KERNEL::Exception);
917     void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
918     //
919     static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
920   };
921 }
922
923 %include "MEDCouplingFieldDiscretization.i"
924
925 //== MEDCouplingPointSet
926
927 namespace ParaMEDMEM
928 {
929   class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
930     {
931     public:
932       void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
933       DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
934       bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const throw(INTERP_KERNEL::Exception);
935       void zipCoords() throw(INTERP_KERNEL::Exception);
936       double getCaracteristicDimension() const throw(INTERP_KERNEL::Exception);
937       void recenterForMaxPrecision(double eps) throw(INTERP_KERNEL::Exception);
938       void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
939       void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
940       virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
941       virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
942       virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
943       static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
944       static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
945       static DataArrayInt *ComputeNbOfInteractionsWithSrcCells(const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps) throw(INTERP_KERNEL::Exception);
946       virtual int getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception);
947       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception);
948       virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) throw(INTERP_KERNEL::Exception);
949       virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
950       virtual DataArrayInt *findBoundaryNodes() const;
951       virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
952       virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
953       virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
954       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
955       virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
956       virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
957       %extend 
958          {
959            std::string __str__() const throw(INTERP_KERNEL::Exception)
960            {
961              return self->simpleRepr();
962            }
963            
964            PyObject *buildNewNumberingFromCommonNodesFormat(const DataArrayInt *comm, const DataArrayInt *commIndex) const throw(INTERP_KERNEL::Exception)
965            {
966              int newNbOfNodes;
967              DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
968              PyObject *res = PyList_New(2);
969              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
970              PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
971              return res;
972            }
973            
974            PyObject *findCommonNodes(double prec, int limitTupleId=-1) const throw(INTERP_KERNEL::Exception)
975            {
976              DataArrayInt *comm, *commIndex;
977              self->findCommonNodes(prec,limitTupleId,comm,commIndex);
978              PyObject *res = PyList_New(2);
979              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
980              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
981              return res;
982            }
983            
984            PyObject *getCoords() throw(INTERP_KERNEL::Exception)
985            {
986              DataArrayDouble *ret1=self->getCoords();
987              if (ret1)
988                 ret1->incrRef();
989              return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
990            }
991            
992            PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
993            {
994              int szArr,sw,iTypppArr;
995              std::vector<int> stdvecTyyppArr;
996              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
997              MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
998              if(sw==3)//DataArrayInt
999                { 
1000                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1001                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1002                  std::string name=argpt->getName();
1003                  if(!name.empty())
1004                    ret->setName(name.c_str());
1005                }
1006              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1007            }
1008            
1009            PyObject *buildPartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1010            {
1011              int szArr,sw,iTypppArr;
1012              std::vector<int> stdvecTyyppArr;
1013              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1014              MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1015              if(sw==3)//DataArrayInt
1016                { 
1017                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1018                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1019                  std::string name=argpt->getName();
1020                  if(!name.empty())
1021                    ret->setName(name.c_str());
1022                }
1023              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1024            }
1025
1026            virtual PyObject *buildPartOfMySelfKeepCoords(PyObject *li) const throw(INTERP_KERNEL::Exception)
1027            {
1028              int szArr,sw,iTypppArr;
1029              std::vector<int> stdvecTyyppArr;
1030              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1031              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
1032              if(sw==3)//DataArrayInt
1033                { 
1034                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1035                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1036                  std::string name=argpt->getName();
1037                  if(!name.empty())
1038                    ret->setName(name.c_str());
1039                }
1040              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1041            }
1042
1043            virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
1044            {
1045              MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
1046              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1047            }
1048
1049            PyObject *buildFacePartOfMySelfNode(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1050            {
1051              int szArr,sw,iTypppArr;
1052              std::vector<int> stdvecTyyppArr;
1053              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1054              MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
1055              if(sw==3)//DataArrayInt
1056                { 
1057                  void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
1058                  DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
1059                  std::string name=argpt->getName();
1060                  if(!name.empty())
1061                    ret->setName(name.c_str());
1062                }
1063              return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1064            }
1065
1066            void renumberNodes(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1067            {
1068              int szArr,sw,iTypppArr;
1069              std::vector<int> stdvecTyyppArr;
1070              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1071              self->renumberNodes(tmp,newNbOfNodes);
1072            }
1073
1074            void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
1075            {
1076              int szArr,sw,iTypppArr;
1077              std::vector<int> stdvecTyyppArr;
1078              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1079              self->renumberNodes2(tmp,newNbOfNodes);
1080            }
1081
1082            PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1083              {
1084                int spaceDim=self->getSpaceDimension();
1085                double val,val2;
1086                DataArrayDouble *a,*a2;
1087                DataArrayDoubleTuple *aa,*aa2;
1088                std::vector<double> bb,bb2;
1089                int sw;
1090                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 1st paramater for point.";
1091                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnLine : 2nd paramater for vector.";
1092                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1093                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1094                std::vector<int> nodes;
1095                self->findNodesOnLine(p,v,eps,nodes);
1096                DataArrayInt *ret=DataArrayInt::New();
1097                ret->alloc((int)nodes.size(),1);
1098                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1099                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1100              }
1101            PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
1102              {
1103                int spaceDim=self->getSpaceDimension();
1104                double val,val2;
1105                DataArrayDouble *a,*a2;
1106                DataArrayDoubleTuple *aa,*aa2;
1107                std::vector<double> bb,bb2;
1108                int sw;
1109                const char msg[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 1st paramater for point.";
1110                const char msg2[]="Python wrap of MEDCouplingPointSet::findNodesOnPlane : 2nd paramater for vector.";
1111                const double *p=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1112                const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
1113                std::vector<int> nodes;
1114                self->findNodesOnPlane(p,v,eps,nodes);
1115                DataArrayInt *ret=DataArrayInt::New();
1116                ret->alloc((int)nodes.size(),1);
1117                std::copy(nodes.begin(),nodes.end(),ret->getPointer());
1118                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1119              }
1120            
1121            PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1122            {
1123              double val;
1124              DataArrayDouble *a;
1125              DataArrayDoubleTuple *aa;
1126              std::vector<double> bb;
1127              int sw;
1128              int spaceDim=self->getSpaceDimension();
1129              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
1130              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
1131              DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
1132              return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1133            }
1134
1135            PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
1136            {
1137              DataArrayInt *c=0,*cI=0;
1138              //
1139              double val;
1140              DataArrayDouble *a;
1141              DataArrayDoubleTuple *aa;
1142              std::vector<double> bb;
1143              int sw;
1144              int spaceDim=self->getSpaceDimension();
1145              const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoints : ";
1146              const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
1147              self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
1148              PyObject *ret=PyTuple_New(2);
1149              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1150              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1151              return ret;
1152            }
1153
1154            PyObject *getNodeIdsNearPoints(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
1155            {
1156              DataArrayInt *c=0,*cI=0;
1157              int spaceDim=self->getSpaceDimension();
1158              double val;
1159              DataArrayDouble *a;
1160              DataArrayDoubleTuple *aa;
1161              std::vector<double> bb;
1162              int sw;
1163              int nbOfTuples=-1;
1164              const double *ptPtr=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::getNodeIdsNearPoints",spaceDim,true,nbOfTuples);
1165              self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
1166              //
1167              PyObject *ret=PyTuple_New(2);
1168              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1169              PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1170              return ret;
1171            }
1172
1173            PyObject *getCellsInBoundingBox(PyObject *bbox, double eps) const throw(INTERP_KERNEL::Exception)
1174            {
1175              double val;
1176              DataArrayDouble *a;
1177              DataArrayDoubleTuple *aa;
1178              std::vector<double> bb;
1179              int sw;
1180              int spaceDim=self->getSpaceDimension();
1181              const char msg[]="Python wrap of MEDCouplingPointSet::getCellsInBoundingBox : ";
1182              const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
1183              //
1184              DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
1185              return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1186            }
1187
1188            void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
1189            {
1190              int sw;
1191              int singleVal;
1192              std::vector<int> multiVal;
1193              std::pair<int, std::pair<int,int> > slic;
1194              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1195              convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1196              switch(sw)
1197                {
1198                case 1:
1199                  return self->duplicateNodesInCoords(&singleVal,&singleVal+1);
1200                case 2:
1201                  return self->duplicateNodesInCoords(&multiVal[0],&multiVal[0]+multiVal.size());
1202                case 4:
1203                  return self->duplicateNodesInCoords(daIntTyypp->begin(),daIntTyypp->end());
1204                default:
1205                  throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1206                }
1207            }
1208
1209            virtual PyObject *findCommonCells(int compType, int startCellId=0) const throw(INTERP_KERNEL::Exception)
1210            {
1211              DataArrayInt *v0=0,*v1=0;
1212              self->findCommonCells(compType,startCellId,v0,v1);
1213              PyObject *res = PyList_New(2);
1214              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1215              PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1216              return res;
1217            }
1218
1219       
1220            virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
1221            {
1222              void *da=0;
1223              int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
1224              if (!SWIG_IsOK(res1))
1225                {
1226                  int size;
1227                  INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1228                  self->renumberNodesInConn(tmp);
1229                }
1230              else
1231                {
1232                  DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1233                  if(!da2)
1234                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1235                  da2->checkAllocated();
1236                  self->renumberNodesInConn(da2->getConstPointer());
1237                }
1238            }
1239
1240            virtual PyObject *getNodeIdsInUse() const throw(INTERP_KERNEL::Exception)
1241            {
1242              int ret1=-1;
1243              DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
1244              PyObject *ret=PyTuple_New(2);
1245              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1246              PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
1247              return ret;
1248            }
1249
1250            virtual DataArrayInt *fillCellIdsToKeepFromNodeIds(PyObject *li, bool fullyIn) const
1251            {
1252              DataArrayInt *ret=0;
1253              //
1254              int szArr,sw,iTypppArr;
1255              std::vector<int> stdvecTyyppArr;
1256              const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1257              self->fillCellIdsToKeepFromNodeIds(tmp,tmp+szArr,fullyIn,ret);
1258              return ret;
1259            }
1260
1261            virtual PyObject *mergeNodes(double precision) throw(INTERP_KERNEL::Exception)
1262            {
1263              bool ret1;
1264              int ret2;
1265              DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
1266              PyObject *res = PyList_New(3);
1267              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1268              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1269              PyList_SetItem(res,2,SWIG_From_int(ret2));
1270              return res;
1271            }
1272            
1273            virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
1274            {
1275              bool ret1;
1276              int ret2;
1277              DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
1278              PyObject *res = PyList_New(3);
1279              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1280              PyList_SetItem(res,1,SWIG_From_bool(ret1));
1281              PyList_SetItem(res,2,SWIG_From_int(ret2));
1282              return res;
1283            }
1284            
1285            DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
1286            {
1287              void *da=0;
1288              int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
1289              if (!SWIG_IsOK(res1))
1290                {
1291                  int size;
1292                  INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
1293                  return self->getCellIdsLyingOnNodes(tmp,((const int *)tmp)+size,fullyIn);
1294                }
1295              else
1296                {
1297                  DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
1298                  if(!da2)
1299                    throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
1300                  da2->checkAllocated();
1301                  return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
1302                }
1303            }
1304
1305            MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
1306            {
1307              int sw;
1308              int singleVal;
1309              std::vector<int> multiVal;
1310              std::pair<int, std::pair<int,int> > slic;
1311              ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1312              int nbc=self->getNumberOfCells();
1313              convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1314              switch(sw)
1315                {
1316                case 1:
1317                  {
1318                    if(singleVal>=nbc)
1319                      {
1320                        std::ostringstream oss;
1321                        oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1322                        throw INTERP_KERNEL::Exception(oss.str().c_str());
1323                      }
1324                    if(singleVal>=0)
1325                      return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
1326                    else
1327                      {
1328                        if(nbc+singleVal>0)
1329                          {
1330                            int tmp=nbc+singleVal;
1331                            return self->buildPartOfMySelf(&tmp,&tmp+1,true);
1332                          }
1333                        else
1334                          {
1335                            std::ostringstream oss;
1336                            oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1337                            throw INTERP_KERNEL::Exception(oss.str().c_str());
1338                          }
1339                      }
1340                  }
1341                case 2:
1342                  {
1343                    return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
1344                  }
1345                case 3:
1346                  {
1347                    return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
1348                  }
1349                case 4:
1350                  {
1351                    if(!daIntTyypp)
1352                      throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
1353                    daIntTyypp->checkAllocated();
1354                    return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
1355                  }
1356                default:
1357                  throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1358                }
1359            }
1360            
1361            static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1362            {
1363              int sz;
1364              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1365              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1366              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
1367              for(int i=0;i<sz;i++)
1368                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1369            }
1370            
1371            static void Rotate2DAlg(PyObject *center, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1372            {
1373              int sz;
1374              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1375              int sw,nbNodes=0;
1376              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1377              std::vector<double> val3;
1378              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1379                                                             "Rotate2DAlg",2,true,nbNodes);
1380              if(sw!=2 && sw!=3)
1381                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
1382              ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
1383            }
1384            
1385            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
1386            {
1387              int sz,sz2;
1388              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1389              INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
1390              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1391              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
1392              for(int i=0;i<sz;i++)
1393                PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
1394            }
1395            
1396            static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, PyObject *coords) throw(INTERP_KERNEL::Exception)
1397            {
1398              int sz,sz2;
1399              INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
1400              int sw,nbNodes=0;
1401              double val0;  ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
1402              std::vector<double> val3;
1403              const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
1404                                                             "Rotate3DAlg",3,true,nbNodes);
1405              if(sw!=2 && sw!=3)
1406                throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
1407              INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
1408              ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
1409            }
1410          }
1411     };
1412
1413   //== MEDCouplingPointSet End
1414
1415   class MEDCouplingUMeshCell
1416   {
1417   public:
1418     INTERP_KERNEL::NormalizedCellType getType() const;
1419     %extend
1420       {
1421         std::string __str__() const throw(INTERP_KERNEL::Exception)
1422         {
1423           return self->repr();
1424         }
1425
1426         PyObject *getAllConn() const throw(INTERP_KERNEL::Exception)
1427         {
1428           int ret2;
1429           const int *r=self->getAllConn(ret2);
1430           PyObject *ret=PyTuple_New(ret2);
1431           for(int i=0;i<ret2;i++)
1432             PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
1433           return ret;
1434         }
1435       }
1436   };
1437
1438   class MEDCouplingUMeshCellIterator
1439   {
1440   public:
1441     %extend
1442       {
1443         PyObject *next()
1444         {
1445           MEDCouplingUMeshCell *ret=self->nextt();
1446           if(ret)
1447             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
1448           else
1449             {
1450               PyErr_SetString(PyExc_StopIteration,"No more data.");
1451               return 0;
1452             }
1453         }
1454       }
1455   };
1456
1457   class MEDCouplingUMeshCellByTypeIterator
1458   {
1459   public:
1460     ~MEDCouplingUMeshCellByTypeIterator();
1461     %extend
1462       {
1463         PyObject *next()
1464         {
1465           MEDCouplingUMeshCellEntry *ret=self->nextt();
1466           if(ret)
1467             return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
1468           else
1469             {
1470               PyErr_SetString(PyExc_StopIteration,"No more data.");
1471               return 0;
1472             }
1473         }
1474       }
1475   };
1476
1477   class MEDCouplingUMeshCellByTypeEntry
1478   {
1479   public:
1480     ~MEDCouplingUMeshCellByTypeEntry();
1481     %extend
1482       {
1483         MEDCouplingUMeshCellByTypeIterator *__iter__()
1484         {
1485           return self->iterator();
1486         }
1487       }
1488   };
1489
1490   class MEDCouplingUMeshCellEntry
1491   {
1492   public:
1493     INTERP_KERNEL::NormalizedCellType getType() const;
1494     int getNumberOfElems() const;
1495     %extend
1496       {
1497         MEDCouplingUMeshCellIterator *__iter__()
1498         {
1499           return self->iterator();
1500         }
1501       }
1502   };
1503   
1504   //== MEDCouplingUMesh
1505
1506   class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
1507   {
1508   public:
1509     static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
1510     static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
1511     MEDCouplingUMesh *clone(bool recDeepCpy) const;
1512     void checkCoherency() const throw(INTERP_KERNEL::Exception);
1513     void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
1514     void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
1515     void finishInsertingCells() throw(INTERP_KERNEL::Exception);
1516     MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
1517     void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
1518     INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
1519     void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
1520     int getMeshLength() const throw(INTERP_KERNEL::Exception);
1521     void computeTypes() throw(INTERP_KERNEL::Exception);
1522     std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
1523     MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
1524     //tools
1525     DataArrayInt *conformize2D(double eps) throw(INTERP_KERNEL::Exception);
1526     DataArrayInt *colinearize2D(double eps) throw(INTERP_KERNEL::Exception);
1527     void shiftNodeNumbersInConn(int delta) throw(INTERP_KERNEL::Exception);
1528     std::vector<bool> getQuadraticStatus() const throw(INTERP_KERNEL::Exception);
1529     DataArrayInt *findCellIdsOnBoundary() const throw(INTERP_KERNEL::Exception);
1530     MEDCouplingUMesh *computeSkin() const throw(INTERP_KERNEL::Exception);
1531     bool checkConsecutiveCellTypes() const throw(INTERP_KERNEL::Exception);
1532     bool checkConsecutiveCellTypesForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1533     DataArrayInt *rearrange2ConsecutiveCellTypes() throw(INTERP_KERNEL::Exception);
1534     DataArrayInt *sortCellsInMEDFileFrmt() throw(INTERP_KERNEL::Exception);
1535     DataArrayInt *getRenumArrForMEDFileFrmt() const throw(INTERP_KERNEL::Exception);
1536     DataArrayInt *convertCellArrayPerGeoType(const DataArrayInt *da) const throw(INTERP_KERNEL::Exception);
1537     DataArrayInt *computeFetchedNodeIds() const throw(INTERP_KERNEL::Exception);
1538     MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1539     MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1540     MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw(INTERP_KERNEL::Exception);
1541     void orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Exception);
1542     bool isPresenceOfQuadratic() const throw(INTERP_KERNEL::Exception);
1543     bool isFullyQuadratic() const throw(INTERP_KERNEL::Exception);
1544     MEDCouplingFieldDouble *buildDirectionVectorField() const throw(INTERP_KERNEL::Exception);
1545     bool isContiguous1D() const throw(INTERP_KERNEL::Exception);
1546     void tessellate2D(double eps) throw(INTERP_KERNEL::Exception);
1547     void tessellate2DCurve(double eps) throw(INTERP_KERNEL::Exception);
1548     void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
1549     DataArrayInt *convertLinearCellsToQuadratic(int conversionType=0) throw(INTERP_KERNEL::Exception);
1550     void convertDegeneratedCells() throw(INTERP_KERNEL::Exception);
1551     bool areOnlySimplexCells() const throw(INTERP_KERNEL::Exception);
1552     MEDCouplingFieldDouble *getEdgeRatioField() const throw(INTERP_KERNEL::Exception);
1553     MEDCouplingFieldDouble *getAspectRatioField() const throw(INTERP_KERNEL::Exception);
1554     MEDCouplingFieldDouble *getWarpField() const throw(INTERP_KERNEL::Exception);
1555     MEDCouplingFieldDouble *getSkewField() const throw(INTERP_KERNEL::Exception);
1556     DataArrayDouble *computePlaneEquationOf3DFaces() const throw(INTERP_KERNEL::Exception);
1557     DataArrayInt *convexEnvelop2D() throw(INTERP_KERNEL::Exception);
1558     std::string cppRepr() const throw(INTERP_KERNEL::Exception);
1559     DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
1560     DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
1561     ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1562     DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
1563     DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
1564     DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
1565     DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
1566     DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1567     DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
1568     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);
1569     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
1570     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1571     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
1572     static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception);
1573     static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector<int>& code) throw(INTERP_KERNEL::Exception);
1574     %extend {
1575       MEDCouplingUMesh() throw(INTERP_KERNEL::Exception)
1576       {
1577         return MEDCouplingUMesh::New();
1578       }
1579       
1580       MEDCouplingUMesh(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception)
1581       {
1582         return MEDCouplingUMesh::New(meshName,meshDim);
1583       }
1584       
1585       std::string __str__() const throw(INTERP_KERNEL::Exception)
1586       {
1587         return self->simpleRepr();
1588       }
1589       
1590       std::string __repr__() const throw(INTERP_KERNEL::Exception)
1591       {
1592         std::ostringstream oss;
1593         self->reprQuickOverview(oss);
1594         return oss.str();
1595       }
1596       
1597       MEDCouplingUMeshCellIterator *__iter__() throw(INTERP_KERNEL::Exception)
1598       {
1599         return self->cellIterator();
1600       }
1601
1602       PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
1603       {
1604         std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
1605         std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
1606         PyObject *res=PyList_New(result.size());
1607         for(int i=0;iL!=result.end(); i++, iL++)
1608           PyList_SetItem(res,i,PyInt_FromLong(*iL));
1609         return res;
1610       }
1611       
1612       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1613       {
1614         int sw;
1615         int singleVal;
1616         std::vector<int> multiVal;
1617         std::pair<int, std::pair<int,int> > slic;
1618         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1619         int nbc=self->getNumberOfCells();
1620         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1621         switch(sw)
1622           {
1623           case 1:
1624             {
1625               if(singleVal>=nbc)
1626                 {
1627                   std::ostringstream oss;
1628                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1629                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1630                 }
1631               if(singleVal>=0)
1632                 {
1633                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1634                   break;
1635                 }
1636               else
1637                 {
1638                   if(nbc+singleVal>0)
1639                     {
1640                       int tmp=nbc+singleVal;
1641                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1642                       break;
1643                     }
1644                   else
1645                     {
1646                       std::ostringstream oss;
1647                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1648                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1649                     }
1650                 }
1651             }
1652           case 2:
1653             {
1654               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1655               break;
1656             }
1657           case 4:
1658             {
1659               if(!daIntTyypp)
1660                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : null instance has been given in input !");
1661               daIntTyypp->checkAllocated();
1662               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1663               break;
1664             }
1665           default:
1666             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
1667           }
1668       }
1669
1670       void __setitem__(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
1671       {
1672         int sw;
1673         int singleVal;
1674         std::vector<int> multiVal;
1675         std::pair<int, std::pair<int,int> > slic;
1676         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1677         int nbc=self->getNumberOfCells();
1678         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
1679         switch(sw)
1680           {
1681           case 1:
1682             {
1683               if(singleVal>=nbc)
1684                 {
1685                   std::ostringstream oss;
1686                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1687                   throw INTERP_KERNEL::Exception(oss.str().c_str());
1688                 }
1689               if(singleVal>=0)
1690                 {
1691                   self->setPartOfMySelf(&singleVal,&singleVal+1,otherOnSameCoordsThanThis);
1692                   break;
1693                 }
1694               else
1695                 {
1696                   if(nbc+singleVal>0)
1697                     {
1698                       int tmp=nbc+singleVal;
1699                       self->setPartOfMySelf(&tmp,&tmp+1,otherOnSameCoordsThanThis);
1700                       break;
1701                     }
1702                   else
1703                     {
1704                       std::ostringstream oss;
1705                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
1706                       throw INTERP_KERNEL::Exception(oss.str().c_str());
1707                     }
1708                 }
1709             }
1710           case 2:
1711             {
1712               self->setPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),otherOnSameCoordsThanThis);
1713               break;
1714             }
1715           case 3:
1716             {
1717               self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
1718               break;
1719             }
1720           case 4:
1721             {
1722               if(!daIntTyypp)
1723                 throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : null instance has been given in input !");
1724               daIntTyypp->checkAllocated();
1725               self->setPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),otherOnSameCoordsThanThis);
1726               break;
1727             }
1728           default:
1729             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__setitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int, slice, DataArrayInt instance !");
1730           }
1731       }
1732
1733       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, PyObject *li) throw(INTERP_KERNEL::Exception)
1734       {
1735         int szArr,sw,iTypppArr;
1736         std::vector<int> stdvecTyyppArr;
1737         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1738         if(size>szArr)
1739           {
1740             std::ostringstream oss; oss << "Wrap of MEDCouplingUMesh::insertNextCell : request of connectivity with length " << size << " whereas the length of input is " << szArr << " !";
1741             throw INTERP_KERNEL::Exception(oss.str().c_str());
1742           }
1743         self->insertNextCell(type,size,tmp);
1744       }
1745
1746       void insertNextCell(INTERP_KERNEL::NormalizedCellType type, PyObject *li) throw(INTERP_KERNEL::Exception)
1747       {
1748         int szArr,sw,iTypppArr;
1749         std::vector<int> stdvecTyyppArr;
1750         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
1751         self->insertNextCell(type,szArr,tmp);
1752       }
1753       
1754       DataArrayInt *getNodalConnectivity() throw(INTERP_KERNEL::Exception)
1755       {
1756         DataArrayInt *ret=self->getNodalConnectivity();
1757         if(ret)
1758           ret->incrRef();
1759         return ret;
1760       }
1761       DataArrayInt *getNodalConnectivityIndex() throw(INTERP_KERNEL::Exception)
1762       {
1763         DataArrayInt *ret=self->getNodalConnectivityIndex();
1764         if(ret)
1765           ret->incrRef();
1766         return ret;
1767       }
1768       
1769       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
1770       {
1771         int szArr,sw,iTypppArr;
1772         std::vector<int> stdvecTyyppArr;
1773         const int *seedPtr=convertObjToPossibleCpp1_Safe(seed,sw,szArr,iTypppArr,stdvecTyyppArr);
1774         int nbOfDepthPeelingPerformed=0;
1775         DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
1776         PyObject *res=PyTuple_New(2);
1777         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1778         PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
1779         return res;
1780       }
1781
1782       static PyObject *FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI) throw(INTERP_KERNEL::Exception)
1783       {
1784         DataArrayInt *v0=0,*v1=0;
1785         MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
1786         PyObject *res = PyList_New(2);
1787         PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1788         PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1789         return res;
1790       }
1791       
1792       PyObject *distanceToPoint(PyObject *point) const throw(INTERP_KERNEL::Exception)
1793       {
1794         double val;
1795         DataArrayDouble *a;
1796         DataArrayDoubleTuple *aa;
1797         std::vector<double> bb;
1798         int sw;
1799         int nbOfCompo=self->getSpaceDimension();
1800         const double *pt=convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,"Python wrap of MEDCouplingUMesh::distanceToPoint",1,nbOfCompo,true);
1801         //
1802         int cellId=-1;
1803         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
1804         PyObject *ret=PyTuple_New(2);
1805         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
1806         PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
1807         return ret;
1808       }
1809
1810       PyObject *distanceToPoints(const DataArrayDouble *pts) const throw(INTERP_KERNEL::Exception)
1811       {
1812         DataArrayInt *ret1=0;
1813         DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
1814         PyObject *ret=PyTuple_New(2);
1815         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
1816         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1817         return ret;
1818       }
1819
1820       PyObject *tetrahedrize(int policy) throw(INTERP_KERNEL::Exception)
1821       {
1822         int ret2(-1);
1823         DataArrayInt *ret1(0);
1824         MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
1825         PyObject *ret=PyTuple_New(3);
1826         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
1827         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1828         PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
1829         return ret;
1830       }
1831       
1832       PyObject *checkButterflyCells(double eps=1e-12) throw(INTERP_KERNEL::Exception)
1833       {
1834         std::vector<int> cells;
1835         self->checkButterflyCells(cells,eps);
1836         DataArrayInt *ret=DataArrayInt::New();
1837         ret->alloc((int)cells.size(),1);
1838         std::copy(cells.begin(),cells.end(),ret->getPointer());
1839         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
1840       }
1841
1842       PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
1843       {
1844         std::vector<MEDCouplingUMesh *> ms=self->splitByType();
1845         int sz=ms.size();
1846         PyObject *ret = PyList_New(sz);
1847         for(int i=0;i<sz;i++)
1848           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1849         return ret;
1850       }
1851
1852       PyObject *partitionBySpreadZone() const throw(INTERP_KERNEL::Exception)
1853       {
1854         std::vector<DataArrayInt *> retCpp=self->partitionBySpreadZone();
1855         int sz=retCpp.size();
1856         PyObject *ret=PyList_New(sz);
1857         for(int i=0;i<sz;i++)
1858           PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1859         return ret;
1860       }
1861
1862       PyObject *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, PyObject *ids) const throw(INTERP_KERNEL::Exception)
1863       {
1864         int size;
1865         INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
1866         MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
1867         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
1868       }
1869
1870       bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
1871       {
1872         int sz;
1873         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1874         bool ret=self->checkConsecutiveCellTypesAndOrder(order,order+sz);
1875         return ret;
1876       }
1877
1878       DataArrayInt *getRenumArrForConsecutiveCellTypesSpec(PyObject *li) const throw(INTERP_KERNEL::Exception)
1879       {
1880         int sz;
1881         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1882         DataArrayInt *ret=self->getRenumArrForConsecutiveCellTypesSpec(order,(INTERP_KERNEL::NormalizedCellType *)order+sz);
1883         return ret;
1884       }
1885
1886       PyObject *findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1887       {
1888         DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
1889         self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
1890         PyObject *ret=PyTuple_New(3);
1891         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1892         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1893         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1894         return ret;
1895       }
1896
1897       PyObject *findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords) const throw(INTERP_KERNEL::Exception)
1898       {
1899         DataArrayInt *tmp0=0,*tmp1=0;
1900         self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
1901         PyObject *ret=PyTuple_New(2);
1902         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1903         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1904         return ret;
1905       }
1906
1907       void duplicateNodes(PyObject *li) throw(INTERP_KERNEL::Exception)
1908       {
1909         int sw;
1910         int singleVal;
1911         std::vector<int> multiVal;
1912         std::pair<int, std::pair<int,int> > slic;
1913         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1914         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1915         switch(sw)
1916           {
1917           case 1:
1918             return self->duplicateNodes(&singleVal,&singleVal+1);
1919           case 2:
1920             return self->duplicateNodes(&multiVal[0],&multiVal[0]+multiVal.size());
1921           case 4:
1922             return self->duplicateNodes(daIntTyypp->begin(),daIntTyypp->end());
1923           default:
1924             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodes : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1925           }
1926       }
1927
1928       void duplicateNodesInConn(PyObject *li, int offset) throw(INTERP_KERNEL::Exception)
1929       {
1930         int sw;
1931         int singleVal;
1932         std::vector<int> multiVal;
1933         std::pair<int, std::pair<int,int> > slic;
1934         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
1935         convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
1936         switch(sw)
1937           {
1938           case 1:
1939             return self->duplicateNodesInConn(&singleVal,&singleVal+1,offset);
1940           case 2:
1941             return self->duplicateNodesInConn(&multiVal[0],&multiVal[0]+multiVal.size(),offset);
1942           case 4:
1943             return self->duplicateNodesInConn(daIntTyypp->begin(),daIntTyypp->end(),offset);
1944           default:
1945             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::duplicateNodesInConn : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
1946           }
1947       }
1948
1949       PyObject *getLevArrPerCellTypes(PyObject *li) const throw(INTERP_KERNEL::Exception)
1950       {
1951         int sz;
1952         INTERP_KERNEL::AutoPtr<INTERP_KERNEL::NormalizedCellType> order=(INTERP_KERNEL::NormalizedCellType *)convertPyToNewIntArr2(li,&sz);
1953         DataArrayInt *tmp0,*tmp1=0;
1954         tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
1955         PyObject *ret=PyTuple_New(2);
1956         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1957         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1958         return ret;
1959       }
1960
1961       PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception)
1962       {
1963         DataArrayInt *ret0=0,*ret1=0;
1964         self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
1965         PyObject *ret=PyTuple_New(2);
1966         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1967         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1968         return ret;
1969       }
1970
1971       static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1972       {
1973         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1974         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1975         DataArrayInt *ret1=0,*ret2=0;
1976         MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
1977         PyObject *ret=PyTuple_New(3);
1978         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
1979         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1980         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
1981         return ret;
1982       }
1983
1984       static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
1985       {
1986         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
1987         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1988         MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
1989         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
1990       }
1991
1992       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
1993       {
1994         int sz;
1995         std::vector<const MEDCouplingUMesh *> meshes;
1996         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
1997         std::vector<DataArrayInt *> corr;
1998         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
1999         sz=corr.size();
2000         PyObject *ret1=PyList_New(sz);
2001         for(int i=0;i<sz;i++)
2002           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2003         PyObject *ret=PyList_New(2);
2004         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2005         PyList_SetItem(ret,1,ret1);
2006         return ret;
2007       }
2008
2009       static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
2010       {
2011         std::vector<MEDCouplingUMesh *> meshes;
2012         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2013         MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
2014       }
2015
2016       static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
2017       {
2018         std::vector<MEDCouplingUMesh *> meshes;
2019         convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
2020         MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
2021       }
2022
2023       static bool RemoveIdsFromIndexedArrays(PyObject *li, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0) throw(INTERP_KERNEL::Exception)
2024       {
2025         int sw;
2026         int singleVal;
2027         std::vector<int> multiVal;
2028         std::pair<int, std::pair<int,int> > slic;
2029         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2030         if(!arrIndx)
2031           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
2032         convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2033         switch(sw)
2034           {
2035           case 1:
2036             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&singleVal,&singleVal+1,arr,arrIndx,offsetForRemoval);
2037           case 2:
2038             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arr,arrIndx,offsetForRemoval);
2039           case 4:
2040             return MEDCouplingUMesh::RemoveIdsFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arr,arrIndx,offsetForRemoval);
2041           default:
2042             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2043           }
2044       }
2045       
2046       static PyObject *ExtractFromIndexedArrays(PyObject *li, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2047       {
2048         DataArrayInt *arrOut=0,*arrIndexOut=0;
2049         int sw;
2050         int singleVal;
2051         std::vector<int> multiVal;
2052         std::pair<int, std::pair<int,int> > slic;
2053         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2054         if(!arrIndxIn)
2055           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
2056         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2057         switch(sw)
2058           {
2059           case 1:
2060             {
2061               MEDCouplingUMesh::ExtractFromIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,arrOut,arrIndexOut);
2062               break;
2063             }
2064           case 2:
2065             {
2066               MEDCouplingUMesh::ExtractFromIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2067               break;
2068             }
2069           case 4:
2070             {
2071               MEDCouplingUMesh::ExtractFromIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,arrOut,arrIndexOut);
2072               break;
2073             }
2074           default:
2075             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2076           }
2077         PyObject *ret=PyTuple_New(2);
2078         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2079         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2080         return ret;
2081       }
2082
2083       static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2084       {
2085         DataArrayInt *arrOut=0,*arrIndexOut=0;
2086         MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2087         PyObject *ret=PyTuple_New(2);
2088         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2089         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2090         return ret;
2091       }
2092
2093       static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
2094       {
2095         if(!PySlice_Check(slic))
2096           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
2097         Py_ssize_t strt=2,stp=2,step=2;
2098         PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
2099         if(!arrIndxIn)
2100           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
2101         arrIndxIn->checkAllocated();
2102         if(arrIndxIn->getNumberOfComponents()!=1)
2103           throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
2104         GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
2105         DataArrayInt *arrOut=0,*arrIndexOut=0;
2106         MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
2107         PyObject *ret=PyTuple_New(2);
2108         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2109         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2110         return ret;
2111       }
2112
2113       static PyObject *SetPartOfIndexedArrays(PyObject *li,
2114                                               const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2115                                               const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2116       {
2117         DataArrayInt *arrOut=0,*arrIndexOut=0;
2118         int sw;
2119         int singleVal;
2120         std::vector<int> multiVal;
2121         std::pair<int, std::pair<int,int> > slic;
2122         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2123         if(!arrIndxIn)
2124           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
2125         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2126         switch(sw)
2127           {
2128           case 1:
2129             {
2130               MEDCouplingUMesh::SetPartOfIndexedArrays(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2131               break;
2132             }
2133           case 2:
2134             {
2135               MEDCouplingUMesh::SetPartOfIndexedArrays(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2136               break;
2137             }
2138           case 4:
2139             {
2140               MEDCouplingUMesh::SetPartOfIndexedArrays(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex,arrOut,arrIndexOut);
2141               break;
2142             }
2143           default:
2144             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2145           }
2146         PyObject *ret=PyTuple_New(2);
2147         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2148         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2149         return ret;
2150       }
2151
2152       static void SetPartOfIndexedArraysSameIdx(PyObject *li, DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
2153                                                 const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex) throw(INTERP_KERNEL::Exception)
2154       {
2155         int sw;
2156         int singleVal;
2157         std::vector<int> multiVal;
2158         std::pair<int, std::pair<int,int> > slic;
2159         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
2160         if(!arrIndxIn)
2161           throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
2162         convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
2163         switch(sw)
2164           {
2165           case 1:
2166             {
2167               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&singleVal,&singleVal+1,arrIn,arrIndxIn,srcArr,srcArrIndex);
2168               break;
2169             }
2170           case 2:
2171             {
2172               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(&multiVal[0],&multiVal[0]+multiVal.size(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2173               break;
2174             }
2175           case 4:
2176             {
2177               MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx(daIntTyypp->begin(),daIntTyypp->end(),arrIn,arrIndxIn,srcArr,srcArrIndex);
2178               break;
2179             }
2180           default:
2181             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
2182           }
2183       }
2184
2185       PyObject *are2DCellsNotCorrectlyOriented(PyObject *vec, bool polyOnly) const throw(INTERP_KERNEL::Exception)
2186       {
2187         double val;
2188         DataArrayDouble *a;
2189         DataArrayDoubleTuple *aa;
2190         std::vector<double> bb;
2191         int sw;
2192         int spaceDim=self->getSpaceDimension();
2193         const char msg[]="Python wrap of MEDCouplingUMesh::are2DCellsNotCorrectlyOriented : ";
2194         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2195         //
2196         std::vector<int> cells;
2197         self->are2DCellsNotCorrectlyOriented(v,polyOnly,cells);
2198         DataArrayInt *ret=DataArrayInt::New();
2199         ret->alloc((int)cells.size(),1);
2200         std::copy(cells.begin(),cells.end(),ret->getPointer());
2201         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2202       }
2203
2204       void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
2205       {
2206         double val;
2207         DataArrayDouble *a;
2208         DataArrayDoubleTuple *aa;
2209         std::vector<double> bb;
2210         int sw;
2211         int spaceDim=self->getSpaceDimension();
2212         const char msg[]="Python wrap of MEDCouplingUMesh::orientCorrectly2DCells : ";
2213         const double *v=convertObjToPossibleCpp5_Safe(vec,sw,val,a,aa,bb,msg,1,spaceDim,true);
2214         self->orientCorrectly2DCells(v,polyOnly);
2215       }
2216       
2217       PyObject *arePolyhedronsNotCorrectlyOriented() const throw(INTERP_KERNEL::Exception)
2218       {
2219         std::vector<int> cells;
2220         self->arePolyhedronsNotCorrectlyOriented(cells);
2221         DataArrayInt *ret=DataArrayInt::New();
2222         ret->alloc((int)cells.size(),1);
2223         std::copy(cells.begin(),cells.end(),ret->getPointer());
2224         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2225       }
2226
2227       PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
2228       {
2229         double vec[3];
2230         double pos[3];
2231         self->getFastAveragePlaneOfThis(vec,pos);
2232         double vals[6];
2233         std::copy(vec,vec+3,vals);
2234         std::copy(pos,pos+3,vals+3);
2235         return convertDblArrToPyListOfTuple(vals,3,2);
2236       }
2237       
2238       static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2239       {
2240         std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
2241         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
2242         return MEDCouplingUMesh::MergeUMeshes(tmp);
2243       }
2244
2245       PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception)
2246       {
2247         DataArrayInt *ret1;
2248         bool ret0=self->areCellsIncludedIn(other,compType,ret1);
2249         PyObject *ret=PyTuple_New(2);
2250         PyObject *ret0Py=ret0?Py_True:Py_False;
2251         Py_XINCREF(ret0Py);
2252         PyTuple_SetItem(ret,0,ret0Py);
2253         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2254         return ret;
2255       }
2256
2257       PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
2258       {
2259         DataArrayInt *ret1;
2260         bool ret0=self->areCellsIncludedIn2(other,ret1);
2261         PyObject *ret=PyTuple_New(2);
2262         PyObject *ret0Py=ret0?Py_True:Py_False;
2263         Py_XINCREF(ret0Py);
2264         PyTuple_SetItem(ret,0,ret0Py);
2265         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2266         return ret;
2267       }
2268
2269       PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
2270       {
2271         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2272         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2273         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2274         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2275         MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
2276         PyObject *ret=PyTuple_New(5);
2277         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2278         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2279         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2280         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2281         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2282         return ret;
2283       }
2284
2285       PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2286       {
2287         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2288         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2289         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2290         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2291         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2292         PyObject *ret=PyTuple_New(5);
2293         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2294         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2295         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2296         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2297         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2298         return ret;
2299       }
2300
2301       PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2302       {
2303         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2304         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2305         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
2306         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
2307         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2308         PyObject *ret=PyTuple_New(5);
2309         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2310         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2311         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2312         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2313         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2314         return ret;
2315       }
2316       
2317       PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2318       {
2319         DataArrayInt *neighbors=0,*neighborsIdx=0;
2320         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2321         PyObject *ret=PyTuple_New(2);
2322         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2323         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2324         return ret;
2325       }
2326
2327       PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2328       {
2329         DataArrayInt *neighbors=0,*neighborsIdx=0;
2330         self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2331         PyObject *ret=PyTuple_New(2);
2332         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2333         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2334         return ret;
2335       }
2336
2337       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2338       {
2339         DataArrayInt *neighbors=0,*neighborsIdx=0;
2340         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2341         PyObject *ret=PyTuple_New(2);
2342         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2343         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2344         return ret;
2345       }
2346
2347       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2348       {
2349         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
2350         MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
2351         DataArrayInt *d2,*d3,*d4,*dd5;
2352         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2353         PyObject *ret=PyTuple_New(7);
2354         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2355         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2356         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2357         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2358         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2359         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2360         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2361         return ret;
2362       }
2363
2364       DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2365       {
2366         if(!da)
2367           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2368         da->checkAllocated();
2369         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2370       }
2371
2372       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2373       {
2374         if(!da)
2375           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2376         da->checkAllocated();
2377         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2378       }
2379
2380       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2381       {
2382         if(!da)
2383           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2384         da->checkAllocated();
2385         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2386       }
2387
2388       PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2389       {
2390         if(!da)
2391           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2392         da->checkAllocated();
2393         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2394         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2395         PyObject *res = PyList_New(result.size());
2396         for (int i=0;iL!=result.end(); i++, iL++)
2397           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2398         return res;
2399       }
2400
2401       DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2402       {
2403         if(!da)
2404           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2405         da->checkAllocated();
2406         DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2407         ret->setName(da->getName().c_str());
2408         return ret;
2409       }
2410
2411       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2412       {
2413         DataArrayInt *cellNb1=0,*cellNb2=0;
2414         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2415         PyObject *ret=PyTuple_New(3);
2416         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2417         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2418         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2419         return ret;
2420       }
2421
2422       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2423       {
2424         int spaceDim=self->getSpaceDimension();
2425         if(spaceDim!=3)
2426           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2427         double val,val2;
2428         DataArrayDouble *a,*a2;
2429         DataArrayDoubleTuple *aa,*aa2;
2430         std::vector<double> bb,bb2;
2431         int sw;
2432         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2433         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2434         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2435         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2436         //
2437         DataArrayInt *cellIds=0;
2438         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2439         PyObject *ret=PyTuple_New(2);
2440         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2441         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2442         return ret;
2443       }
2444
2445       PyObject *buildSlice3DSurf(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2446       {
2447         int spaceDim=self->getSpaceDimension();
2448         if(spaceDim!=3)
2449           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3DSurf : works only for spaceDim 3 !");
2450         double val,val2;
2451         DataArrayDouble *a,*a2;
2452         DataArrayDoubleTuple *aa,*aa2;
2453         std::vector<double> bb,bb2;
2454         int sw;
2455         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 1st paramater for origin.";
2456         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 2nd paramater for vector.";
2457         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2458         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2459         //
2460         DataArrayInt *cellIds=0;
2461         MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
2462         PyObject *ret=PyTuple_New(2);
2463         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2464         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2465         return ret;
2466       }
2467
2468       DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2469       {
2470         int spaceDim=self->getSpaceDimension();
2471         if(spaceDim!=3)
2472           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2473         double val,val2;
2474         DataArrayDouble *a,*a2;
2475         DataArrayDoubleTuple *aa,*aa2;
2476         std::vector<double> bb,bb2;
2477         int sw;
2478         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2479         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2480         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2481         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2482         return self->getCellIdsCrossingPlane(orig,vect,eps);
2483       }
2484
2485       void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2486       {
2487         int sw;
2488         int pos1;
2489         std::vector<int> pos2;
2490         DataArrayInt *pos3=0;
2491         DataArrayIntTuple *pos4=0;
2492         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2493         switch(sw)
2494           {
2495           case 1:
2496             {
2497               self->convertToPolyTypes(&pos1,&pos1+1);
2498               return;
2499             }
2500           case 2:
2501             {
2502               if(pos2.empty())
2503                 return;
2504               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2505               return ;
2506             }
2507           case 3:
2508             {
2509               self->convertToPolyTypes(pos3->begin(),pos3->end());
2510               return ;
2511             }
2512           default:
2513             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2514           }
2515       }
2516     }
2517     void convertAllToPoly();
2518     void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2519     bool unPolyze() throw(INTERP_KERNEL::Exception);
2520     void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2521     MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2522     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2523   };
2524
2525   //== MEDCouplingUMesh End
2526
2527   //== MEDCouplingExtrudedMesh
2528
2529   class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
2530   {
2531   public:
2532     static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2533     MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2534     %extend {
2535       MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2536       {
2537         return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2538       }
2539       
2540       std::string __str__() const throw(INTERP_KERNEL::Exception)
2541       {
2542         return self->simpleRepr();
2543       }
2544
2545       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2546       {
2547         std::ostringstream oss;
2548         self->reprQuickOverview(oss);
2549         return oss.str();
2550       }
2551       
2552       PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
2553       {
2554         MEDCouplingUMesh *ret=self->getMesh2D();
2555         if(ret)
2556           ret->incrRef();
2557         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2558       }
2559       PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
2560       {
2561         MEDCouplingUMesh *ret=self->getMesh1D();
2562         if(ret)
2563           ret->incrRef();
2564         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
2565       }
2566       PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
2567       {
2568         DataArrayInt *ret=self->getMesh3DIds();
2569         if(ret)
2570           ret->incrRef();
2571         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
2572       } 
2573     }
2574   };
2575
2576   //== MEDCouplingExtrudedMesh End
2577
2578   class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
2579   {
2580   public:
2581     static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2582     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2583     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
2584     int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
2585     virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
2586     virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
2587     %extend
2588     {
2589       virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
2590       {
2591         int szArr,sw,iTypppArr;
2592         std::vector<int> stdvecTyyppArr;
2593         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2594         self->insertNextCell(tmp,tmp+szArr);
2595       }
2596
2597       virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2598       {
2599         DataArrayInt *ret=self->getNodalConnectivity();
2600         if(ret) ret->incrRef();
2601         return ret;
2602       }
2603       
2604       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2605       {
2606         std::vector< const MEDCoupling1GTUMesh *> parts;
2607         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
2608         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
2609       }
2610     }
2611   };
2612
2613   //== MEDCoupling1SGTUMesh
2614
2615   class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2616   {
2617   public:
2618     static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2619     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2620     void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
2621     int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
2622     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
2623     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2624     MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
2625     MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
2626     DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
2627     %extend
2628     {
2629       MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2630       {
2631         return MEDCoupling1SGTUMesh::New(name,type);
2632       }
2633
2634       MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2635       {
2636         return MEDCoupling1SGTUMesh::New(m);
2637       }
2638
2639       std::string __str__() const throw(INTERP_KERNEL::Exception)
2640       {
2641         return self->simpleRepr();
2642       }
2643       
2644       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2645       {
2646         std::ostringstream oss;
2647         self->reprQuickOverview(oss);
2648         return oss.str();
2649       }
2650
2651       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2652       {
2653         std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2654         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2655         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
2656       }
2657       
2658       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2659       {
2660         std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
2661         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
2662         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
2663       }
2664     }
2665   };
2666   
2667   //== MEDCoupling1SGTUMesh End
2668
2669   //== MEDCoupling1DGTUMesh
2670
2671   class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
2672   {
2673   public:
2674     static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
2675     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
2676     void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
2677     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
2678     bool isPacked() const throw(INTERP_KERNEL::Exception);
2679     %extend
2680     {
2681       MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
2682       {
2683         return MEDCoupling1DGTUMesh::New(name,type);
2684       }
2685
2686       MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
2687       {
2688         return MEDCoupling1DGTUMesh::New(m);
2689       }
2690
2691       std::string __str__() const throw(INTERP_KERNEL::Exception)
2692       {
2693         return self->simpleRepr();
2694       }
2695       
2696       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2697       {
2698         std::ostringstream oss;
2699         self->reprQuickOverview(oss);
2700         return oss.str();
2701       }
2702
2703       DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
2704       {
2705         DataArrayInt *ret=self->getNodalConnectivityIndex();
2706         if(ret) ret->incrRef();
2707         return ret;
2708       }
2709
2710       PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
2711       {
2712         DataArrayInt *ret1=0,*ret2=0;
2713         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
2714         PyObject *ret0Py=ret0?Py_True:Py_False;
2715         Py_XINCREF(ret0Py);
2716         PyObject *ret=PyTuple_New(3);
2717         PyTuple_SetItem(ret,0,ret0Py);
2718         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2719         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2720         return ret;
2721       }
2722       
2723       PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
2724       {
2725         bool ret1;
2726         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
2727         PyObject *ret=PyTuple_New(2);
2728         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
2729         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
2730         PyTuple_SetItem(ret,1,ret1Py);
2731         return ret;
2732       }
2733
2734       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
2735       {
2736         std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2737         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2738         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
2739       }
2740       
2741       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
2742       {
2743         std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
2744         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
2745         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
2746       }
2747       
2748       static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
2749       {
2750         std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
2751         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
2752         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
2753       }
2754     }
2755   };
2756
2757   //== MEDCoupling1DGTUMeshEnd
2758
2759   class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
2760   {
2761   public:
2762     int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2763     int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
2764     int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2765     int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
2766     virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2767     std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2768     MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2769     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2770     MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2771     static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
2772     %extend
2773     {
2774       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2775       {
2776         int tmpp1=-1,tmpp2=-1;
2777         std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2778         std::vector< std::pair<int,int> > inp;
2779         if(tmpp2==2)
2780           {
2781             inp.resize(tmpp1);
2782             for(int i=0;i<tmpp1;i++)
2783               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2784           }
2785         else if(tmpp2==1)
2786           {
2787             if(tmpp1%2!=0)
2788               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2789             inp.resize(tmpp1/2);
2790             for(int i=0;i<tmpp1/2;i++)
2791               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2792           }
2793         else
2794           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2795         return self->buildStructuredSubPart(inp);
2796       }
2797
2798       static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2799       {
2800         std::vector< std::pair<int,int> > inp;
2801         convertPyToVectorPairInt(part,inp);
2802         //
2803         int szArr,sw,iTypppArr;
2804         std::vector<int> stdvecTyyppArr;
2805         const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2806         std::vector<int> tmp5(tmp4,tmp4+szArr);
2807         //
2808         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2809       }
2810
2811       static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
2812       {
2813         std::vector< std::pair<int,int> > inp;
2814         convertPyToVectorPairInt(part,inp);
2815         return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
2816       }
2817
2818       static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
2819       {
2820         int szArr,sw,iTypppArr;
2821         std::vector<int> stdvecTyyppArr;
2822         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2823         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
2824       }
2825
2826       static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2827       {
2828         int szArr,sw,iTypppArr;
2829         std::vector<int> stdvecTyyppArr;
2830         const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
2831         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
2832       }
2833
2834       static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
2835       {
2836         int szArr,sw,iTypppArr;
2837         std::vector<int> stdvecTyyppArr;
2838         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2839         int szArr2,sw2,iTypppArr2;
2840         std::vector<int> stdvecTyyppArr2;
2841         const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
2842         std::vector<int> tmp3(tmp2,tmp2+szArr2);
2843         std::vector< std::pair<int,int> > partCompactFormat;
2844         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
2845         PyObject *ret=PyTuple_New(2);
2846         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
2847         PyTuple_SetItem(ret,0,ret0Py);
2848         PyObject *ret1Py=PyList_New(partCompactFormat.size());
2849         for(std::size_t i=0;i<partCompactFormat.size();i++)
2850           {
2851             PyObject *tmp4=PyTuple_New(2);
2852             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
2853             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
2854             PyList_SetItem(ret1Py,i,tmp4);
2855           }
2856         PyTuple_SetItem(ret,1,ret1Py);
2857         return ret;
2858       }
2859     }
2860   };
2861
2862   //== MEDCouplingCMesh
2863   
2864   class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2865   {
2866   public:
2867     static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
2868     static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
2869     MEDCouplingCMesh *clone(bool recDeepCpy) const;
2870     void setCoords(const DataArrayDouble *coordsX,
2871                    const DataArrayDouble *coordsY=0,
2872                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2873     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2874     %extend {
2875       MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
2876       {
2877         return MEDCouplingCMesh::New();
2878       }
2879       MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
2880       {
2881         return MEDCouplingCMesh::New(meshName);
2882       }
2883       std::string __str__() const throw(INTERP_KERNEL::Exception)
2884       {
2885         return self->simpleRepr();
2886       }
2887       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2888       {
2889         std::ostringstream oss;
2890         self->reprQuickOverview(oss);
2891         return oss.str();
2892       }
2893       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2894       {
2895         DataArrayDouble *ret=self->getCoordsAt(i);
2896         if(ret)
2897           ret->incrRef();
2898         return ret;
2899       }
2900     }
2901   };
2902
2903   //== MEDCouplingCMesh End
2904
2905   //== MEDCouplingCurveLinearMesh
2906
2907   class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2908   {
2909   public:
2910     static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
2911     static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
2912     MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2913     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2914     %extend {
2915       MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
2916       {
2917         return MEDCouplingCurveLinearMesh::New();
2918       }
2919       MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
2920       {
2921         return MEDCouplingCurveLinearMesh::New(meshName);
2922       }
2923       std::string __str__() const throw(INTERP_KERNEL::Exception) 
2924       {
2925         return self->simpleRepr();
2926       }
2927       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2928       {
2929         std::ostringstream oss;
2930         self->reprQuickOverview(oss);
2931         return oss.str();
2932       }
2933       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2934       {
2935         DataArrayDouble *ret=self->getCoords();
2936         if(ret)
2937           ret->incrRef();
2938         return ret;
2939       }
2940       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2941       {
2942         int szArr,sw,iTypppArr;
2943         std::vector<int> stdvecTyyppArr;
2944         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2945         self->setNodeGridStructure(tmp,tmp+szArr);
2946       }
2947     }
2948   };
2949
2950   //== MEDCouplingCurveLinearMesh End
2951
2952   //== MEDCouplingIMesh
2953
2954   class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2955   {
2956   public:
2957     static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
2958     //
2959     void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
2960     std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
2961     std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
2962     std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
2963     void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
2964     std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
2965     double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
2966     MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
2967     void refineWithFactor(int factor) throw(INTERP_KERNEL::Exception);
2968     %extend
2969     {
2970       MEDCouplingIMesh()
2971       {
2972         return MEDCouplingIMesh::New();
2973       }
2974       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
2975       {
2976         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
2977         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
2978         const int *nodeStrctPtr(0);
2979         const double *originPtr(0),*dxyzPtr(0);
2980         int sw,sz,val0;
2981         std::vector<int> bb0;
2982         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
2983         //
2984         double val,val2;
2985         std::vector<double> bb,bb2;
2986         int sz1,sz2;
2987         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
2988         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
2989         //
2990         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
2991       }
2992
2993       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
2994       {
2995         return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
2996       }
2997
2998       void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
2999       {
3000         int sw,sz,val0;
3001         std::vector<int> bb0;
3002         const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3003         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3004       }
3005
3006       void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3007       {
3008         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3009         double val;
3010         DataArrayDouble *a;
3011         DataArrayDoubleTuple *aa;
3012         std::vector<double> bb;
3013         int sw,nbTuples;
3014         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3015         self->setOrigin(originPtr,originPtr+nbTuples);
3016       }
3017       
3018       void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3019       {
3020         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3021         double val;
3022         DataArrayDouble *a;
3023         DataArrayDoubleTuple *aa;
3024         std::vector<double> bb;
3025         int sw,nbTuples;
3026         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3027         self->setDXYZ(originPtr,originPtr+nbTuples);
3028       }
3029
3030       std::string __str__() const throw(INTERP_KERNEL::Exception)
3031       {
3032         return self->simpleRepr();
3033       }
3034       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3035       {
3036         std::ostringstream oss;
3037         self->reprQuickOverview(oss);
3038         return oss.str();
3039       }
3040     }
3041   };
3042
3043   //== MEDCouplingIMesh End
3044
3045 }
3046
3047 namespace ParaMEDMEM
3048 {
3049   class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3050   {
3051   public:
3052     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3053     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3054     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3055     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3056     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3057     void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3058     void setName(const char *name) throw(INTERP_KERNEL::Exception);
3059     std::string getDescription() const throw(INTERP_KERNEL::Exception);
3060     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3061     std::string getName() const throw(INTERP_KERNEL::Exception);
3062     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3063     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3064     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3065     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3066     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3067     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3068     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3069     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3070                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3071     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3072     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3073     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3074     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3075     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3076     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3077     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3078     %extend {
3079       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3080       {
3081         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3082         if(ret1)
3083           ret1->incrRef();
3084         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3085       }
3086
3087       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3088       {
3089         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3090         if(ret)
3091           ret->incrRef();
3092         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3093       }
3094
3095       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3096       {
3097         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3098         return convertIntArrToPyList3(ret);
3099       }
3100
3101       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3102       {
3103         std::string ret1;
3104         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3105         PyObject *ret=PyTuple_New(2);
3106         PyObject *ret0Py=ret0?Py_True:Py_False;
3107         Py_XINCREF(ret0Py);
3108         PyTuple_SetItem(ret,0,ret0Py);
3109         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3110         return ret;
3111       }
3112
3113       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3114       {
3115         DataArrayInt *ret1=0;
3116         MEDCouplingMesh *ret0=0;
3117         void *da=0;
3118         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3119         if (!SWIG_IsOK(res1))
3120           {
3121             int size;
3122             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3123             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3124           }
3125         else
3126           {
3127             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3128             if(!da2)
3129               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3130             da2->checkAllocated();
3131             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3132           }
3133         PyObject *res = PyList_New(2);
3134         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3135         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3136         return res;
3137       }
3138
3139       PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3140       {
3141         DataArrayInt *ret1=0;
3142         int bb,ee,ss;
3143         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3144         PyObject *res=PyTuple_New(2);
3145         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3146         if(ret1)
3147           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3148         else
3149           {
3150             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3151             PyTuple_SetItem(res,1,res1);
3152           }
3153         return res;
3154       }
3155
3156       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3157       {
3158         int sw,sz(-1);
3159         int v0; std::vector<int> v1;
3160         const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3161         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3162       }
3163
3164       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3165                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3166       {
3167         void *da=0;
3168         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3169         if (!SWIG_IsOK(res1))
3170           {
3171             int size;
3172             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3173             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3174           }
3175         else
3176           {
3177             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3178             if(!da2)
3179               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3180             da2->checkAllocated();
3181             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3182           }
3183       }
3184
3185       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3186       {
3187         std::vector<int> tmp;
3188         self->getCellIdsHavingGaussLocalization(locId,tmp);
3189         DataArrayInt *ret=DataArrayInt::New();
3190         ret->alloc((int)tmp.size(),1);
3191         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3192         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3193       }
3194       
3195       int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3196       {
3197         std::vector<int> inp0;
3198         convertPyToNewIntArr4(code,1,3,inp0);
3199         std::vector<const DataArrayInt *> inp1;
3200         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3201         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3202       }
3203     }
3204   };
3205   
3206   class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3207   {
3208   public:
3209     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3210     static MEDCouplingFieldTemplate *New(TypeOfField type);
3211     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3212     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3213     %extend
3214        {
3215          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3216          {
3217            return MEDCouplingFieldTemplate::New(f);
3218          }
3219          
3220          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3221          {
3222            return MEDCouplingFieldTemplate::New(type);
3223          }
3224          
3225          std::string __str__() const throw(INTERP_KERNEL::Exception)
3226          {
3227            return self->simpleRepr();
3228          }
3229          
3230          std::string __repr__() const throw(INTERP_KERNEL::Exception)
3231          {
3232            std::ostringstream oss;
3233            self->reprQuickOverview(oss);
3234            return oss.str();
3235          }
3236        }
3237   };
3238   
3239   class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3240   {
3241   public:
3242     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3243     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3244     void setTimeUnit(const std::string& unit);
3245     std::string getTimeUnit() const;
3246     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3247     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3248     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3249     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3250     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3251     void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3252     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3253     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3254     MEDCouplingFieldDouble *deepCpy() const;
3255     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3256     MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3257     MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3258     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3259     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3260     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3261     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3262     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3263     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3264     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3265     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3266     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3267     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3268     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3269     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3270     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3271     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3272     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3273     void setIteration(int it) throw(INTERP_KERNEL::Exception);
3274     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3275     void setOrder(int order) throw(INTERP_KERNEL::Exception);
3276     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3277     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3278     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3279     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3280     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3281     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3282     bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3283     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3284     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3285     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3286     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3287     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3288     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3289     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3290     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3291     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3292     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3293     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3294     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3295     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3296     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3297     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3298     void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3299     void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3300     void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3301     void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3302     void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3303     void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3304     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3305     void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3306     void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3307     void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3308     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3309     double getMaxValue() const throw(INTERP_KERNEL::Exception);
3310     double getMinValue() const throw(INTERP_KERNEL::Exception);
3311     double getAverageValue() const throw(INTERP_KERNEL::Exception);
3312     double norm2() const throw(INTERP_KERNEL::Exception);
3313     double normMax() const throw(INTERP_KERNEL::Exception);
3314     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3315     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3316     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3317     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3318     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3319     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3320     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3321     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3322     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3323     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3324     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3325     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3326     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3327     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3328     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3329     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3330     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3331     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3332     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3333     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3334     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3335     MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3336     %extend {
3337       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3338       {
3339         return MEDCouplingFieldDouble::New(type,td);
3340       }
3341
3342       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3343       {
3344         return MEDCouplingFieldDouble::New(ft,td);
3345       }
3346
3347       std::string __str__() const throw(INTERP_KERNEL::Exception)
3348       {
3349         return self->simpleRepr();
3350       }
3351
3352       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3353       {
3354         std::ostringstream oss;
3355         self->reprQuickOverview(oss);
3356         return oss.str();
3357       }
3358
3359       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3360       {
3361         DataArrayDouble *ret=self->getArray();
3362         if(ret)
3363           ret->incrRef();
3364         return ret;
3365       }
3366
3367       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3368       {
3369         std::vector<DataArrayDouble *> arrs=self->getArrays();
3370         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3371           if(*it)
3372             (*it)->incrRef();
3373         int sz=arrs.size();
3374         PyObject *ret=PyTuple_New(sz);
3375         for(int i=0;i<sz;i++)
3376           {
3377             if(arrs[i])
3378               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3379             else
3380               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3381           }
3382         return ret;
3383       }
3384
3385       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3386       {
3387         std::vector<const DataArrayDouble *> tmp;
3388         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3389         int sz=tmp.size();
3390         std::vector<DataArrayDouble *> arrs(sz);
3391         for(int i=0;i<sz;i++)
3392           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3393         self->setArrays(arrs);
3394       }
3395
3396       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3397       {
3398         DataArrayDouble *ret=self->getEndArray();
3399         if(ret)
3400           ret->incrRef();
3401         return ret;
3402       }
3403
3404       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3405       {
3406         double val;
3407         DataArrayDouble *a;
3408         DataArrayDoubleTuple *aa;
3409         std::vector<double> bb;
3410         int sw;
3411         const MEDCouplingMesh *mesh=self->getMesh();
3412         if(!mesh)
3413           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3414         int spaceDim=mesh->getSpaceDimension();
3415         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3416         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3417         //
3418         int sz=self->getNumberOfComponents();
3419         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3420         self->getValueOn(spaceLoc,res);
3421         return convertDblArrToPyList(res,sz);
3422       }
3423
3424        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3425        {
3426          int sz=self->getNumberOfComponents();
3427          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3428          self->getValueOnPos(i,j,k,res);
3429          return convertDblArrToPyList(res,sz);
3430        }
3431
3432       DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3433       {
3434         const MEDCouplingMesh *mesh(self->getMesh());
3435         if(!mesh)
3436           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3437         //
3438         int sw,nbPts;
3439         double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3440         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3441                                                          mesh->getSpaceDimension(),true,nbPts);
3442         return self->getValueOnMulti(inp,nbPts);
3443       }
3444
3445       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3446       {
3447         double val;
3448         DataArrayDouble *a;
3449         DataArrayDoubleTuple *aa;
3450         std::vector<double> bb;
3451         int sw;
3452         const MEDCouplingMesh *mesh=self->getMesh();
3453         if(!mesh)
3454           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3455         int spaceDim=mesh->getSpaceDimension();
3456         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3457         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3458         //
3459         //
3460         int sz=self->getNumberOfComponents();
3461         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3462         self->getValueOn(spaceLoc,time,res);
3463         return convertDblArrToPyList(res,sz);
3464       }
3465
3466       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3467       {
3468         if(self->getArray()!=0)
3469           ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3470         else
3471           {
3472             MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3473             ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3474             self->setArray(arr);
3475           }
3476       }
3477       
3478       PyObject *getTime() throw(INTERP_KERNEL::Exception)
3479       {
3480         int tmp1,tmp2;
3481         double tmp0=self->getTime(tmp1,tmp2);
3482         PyObject *res = PyList_New(3);
3483         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3484         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3485         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3486         return res;
3487       }
3488
3489       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3490       {
3491         int tmp1,tmp2;
3492         double tmp0=self->getStartTime(tmp1,tmp2);
3493         PyObject *res = PyList_New(3);
3494         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3495         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3496         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3497         return res;
3498       }
3499
3500       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3501       {
3502         int tmp1,tmp2;
3503         double tmp0=self->getEndTime(tmp1,tmp2);
3504         PyObject *res = PyList_New(3);
3505         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3506         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3507         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3508         return res;
3509       }
3510       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3511       {
3512         int sz=self->getNumberOfComponents();
3513         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3514         self->accumulate(tmp);
3515         return convertDblArrToPyList(tmp,sz);
3516       }
3517       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3518       {
3519         int sz=self->getNumberOfComponents();
3520         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3521         self->integral(isWAbs,tmp);
3522         return convertDblArrToPyList(tmp,sz);
3523       }
3524       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3525       {
3526         int sz=self->getNumberOfComponents();
3527         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3528         self->getWeightedAverageValue(tmp,isWAbs);
3529         return convertDblArrToPyList(tmp,sz);
3530       }
3531       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3532       {
3533         int sz=self->getNumberOfComponents();
3534         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3535         self->normL1(tmp);
3536         return convertDblArrToPyList(tmp,sz);
3537       }
3538       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3539       {
3540         int sz=self->getNumberOfComponents();
3541         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3542         self->normL2(tmp);
3543         return convertDblArrToPyList(tmp,sz);
3544       }
3545       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3546       {
3547         int szArr,sw,iTypppArr;
3548         std::vector<int> stdvecTyyppArr;
3549         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3550         self->renumberCells(tmp,check);
3551       }
3552       
3553       void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3554       {
3555         int szArr,sw,iTypppArr;
3556         std::vector<int> stdvecTyyppArr;
3557         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3558         self->renumberCellsWithoutMesh(tmp,check);
3559       }
3560       
3561       void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3562       {
3563         int szArr,sw,iTypppArr;
3564         std::vector<int> stdvecTyyppArr;
3565         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3566         self->renumberNodes(tmp,eps);
3567       }
3568
3569       void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3570       {
3571         int szArr,sw,iTypppArr;
3572         std::vector<int> stdvecTyyppArr;
3573         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3574         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3575       }
3576
3577       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3578       {
3579         int sw;
3580         int singleVal;
3581         std::vector<int> multiVal;
3582         std::pair<int, std::pair<int,int> > slic;
3583         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3584         const MEDCouplingMesh *mesh=self->getMesh();
3585         if(!mesh)
3586           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3587         int nbc=mesh->getNumberOfCells();
3588         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3589         switch(sw)
3590           {
3591           case 1:
3592             {
3593               if(singleVal>=nbc)
3594                 {
3595                   std::ostringstream oss;
3596                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3597                   throw INTERP_KERNEL::Exception(oss.str().c_str());
3598                 }
3599               if(singleVal>=0)
3600                 return self->buildSubPart(&singleVal,&singleVal+1);
3601               else
3602                 {
3603                   if(nbc+singleVal>0)
3604                     {
3605                       int tmp=nbc+singleVal;
3606                       return self->buildSubPart(&tmp,&tmp+1);
3607                     }
3608                   else
3609                     {
3610                       std::ostringstream oss;
3611                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3612                       throw INTERP_KERNEL::Exception(oss.str().c_str());
3613                     }
3614                 }
3615             }
3616           case 2:
3617             {
3618               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3619             }
3620           case 3:
3621             {
3622               return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3623             }
3624           case 4:
3625             {
3626               if(!daIntTyypp)
3627                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3628               daIntTyypp->checkAllocated();
3629               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3630             }
3631           default:
3632             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3633           }
3634       }
3635
3636       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3637       {
3638         const char msg[]="MEDCouplingFieldDouble::__getitem__ : invalid call  Available API are : \n-myField[dataArrayInt]\n-myField[slice]\n-myField[pythonListOfCellIds]\n-myField[integer]\n-myField[dataArrayInt,1]\n-myField[slice,1]\n-myField[pythonListOfCellIds,1]\n-myField[integer,1]\n";
3639         if(PyTuple_Check(li))
3640           {
3641             Py_ssize_t sz=PyTuple_Size(li);
3642             if(sz!=2)
3643               throw INTERP_KERNEL::Exception(msg);
3644             PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3645             int sw;
3646             int singleVal;
3647             std::vector<int> multiVal;
3648             std::pair<int, std::pair<int,int> > slic;
3649             ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3650             if(!self->getArray())
3651               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3652             try
3653               { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3654             catch(INTERP_KERNEL::Exception& e)
3655               { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3656             MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3657             DataArrayDouble *ret0Arr=ret0->getArray();
3658             if(!ret0Arr)
3659               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3660             switch(sw)
3661               {
3662               case 1:
3663                 {
3664                   std::vector<int> v2(1,singleVal);
3665                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3666                   ret0->setArray(aarr);
3667                   return ret0.retn();
3668                 }
3669               case 2:
3670                 {
3671                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3672                   ret0->setArray(aarr);
3673                   return ret0.retn();
3674                 }
3675               case 3:
3676                 {
3677                   int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3678                   std::vector<int> v2(nbOfComp);
3679                   for(int i=0;i<nbOfComp;i++)
3680                     v2[i]=slic.first+i*slic.second.second;
3681                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3682                   ret0->setArray(aarr);
3683                   return ret0.retn();
3684                 }
3685               default:
3686                 throw INTERP_KERNEL::Exception(msg);
3687               }
3688             
3689           }
3690         else
3691           return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3692       }
3693
3694       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3695       {
3696         DataArrayInt *tmp;
3697         double r1=self->getMaxValue2(tmp);
3698         PyObject *ret=PyTuple_New(2);
3699         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3700         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3701         return ret;
3702       }
3703       
3704       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3705       {
3706         DataArrayInt *tmp;
3707         double r1=self->getMinValue2(tmp);
3708         PyObject *ret=PyTuple_New(2);
3709         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3710         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3711         return ret;
3712       }
3713       
3714       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3715       {
3716         std::vector<int> tmp;
3717         convertPyToNewIntArr3(li,tmp);
3718         return self->keepSelectedComponents(tmp);
3719       }
3720
3721       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3722       {
3723         std::vector<int> tmp;
3724         convertPyToNewIntArr3(li,tmp);
3725         self->setSelectedComponents(f,tmp);
3726       }
3727
3728       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3729       {
3730         double val,val2;
3731         DataArrayDouble *a,*a2;
3732         DataArrayDoubleTuple *aa,*aa2;
3733         std::vector<double> bb,bb2;
3734         int sw;
3735         int spaceDim=3;
3736         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3737         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3738         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3739         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3740         //
3741         return self->extractSlice3D(orig,vect,eps);
3742       }
3743
3744       MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3745       {
3746         return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3747       }
3748
3749       MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3750       {
3751         return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3752       }
3753
3754       MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3755       {
3756         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.";
3757         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3758         void *argp;
3759         //
3760         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3761           {
3762             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3763             if(other)
3764               return (*self)-(*other);
3765             else
3766               throw INTERP_KERNEL::Exception(msg);
3767           }
3768         //
3769         double val;
3770         DataArrayDouble *a;
3771         DataArrayDoubleTuple *aa;
3772         std::vector<double> bb;
3773         int sw;
3774         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3775         switch(sw)
3776           {
3777           case 1:
3778             {
3779               if(!self->getArray())
3780                 throw INTERP_KERNEL::Exception(msg2);
3781               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3782               ret->applyLin(1.,-val);
3783               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3784               ret2->setArray(ret);
3785               return ret2.retn();
3786             }
3787           case 2:
3788             {
3789               if(!self->getArray())
3790                 throw INTERP_KERNEL::Exception(msg2);
3791               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3792               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3793               ret2->setArray(ret);
3794               return ret2.retn();
3795             }
3796           case 3:
3797             {
3798               if(!self->getArray())
3799                 throw INTERP_KERNEL::Exception(msg2);
3800               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3801               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3802               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3803               ret2->setArray(ret);
3804               return ret2.retn();
3805             }
3806           case 4:
3807             {
3808               if(!self->getArray())
3809                 throw INTERP_KERNEL::Exception(msg2);
3810               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3811               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3812               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3813               ret2->setArray(ret);
3814               return ret2.retn();
3815             }
3816           default:
3817             { throw INTERP_KERNEL::Exception(msg); }
3818           }
3819       }
3820
3821       MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3822       {
3823         return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3824       }
3825
3826       MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3827       {
3828         return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3829       }
3830
3831       MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3832       {
3833         return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3834       }
3835
3836       MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3837       {
3838         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.";
3839         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3840         void *argp;
3841         //
3842         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3843           {
3844             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3845             if(other)
3846               return (*self)/(*other);
3847             else
3848               throw INTERP_KERNEL::Exception(msg);
3849           }
3850         //
3851         double val;
3852         DataArrayDouble *a;
3853         DataArrayDoubleTuple *aa;
3854         std::vector<double> bb;
3855         int sw;
3856         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3857         switch(sw)
3858           {
3859           case 1:
3860             {
3861               if(val==0.)
3862                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3863               if(!self->getArray())
3864                 throw INTERP_KERNEL::Exception(msg2);
3865               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3866               ret->applyLin(1./val,0);
3867               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3868               ret2->setArray(ret);
3869               return ret2.retn();
3870             }
3871           case 2:
3872             {
3873               if(!self->getArray())
3874                 throw INTERP_KERNEL::Exception(msg2);
3875               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3876               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3877               ret2->setArray(ret);
3878               return ret2.retn();
3879             }
3880           case 3:
3881             {
3882               if(!self->getArray())
3883                 throw INTERP_KERNEL::Exception(msg2);
3884               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3885               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3886               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3887               ret2->setArray(ret);
3888               return ret2.retn();
3889             }
3890           case 4:
3891             {
3892               if(!self->getArray())
3893                 throw INTERP_KERNEL::Exception(msg2);
3894               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3895               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3896               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3897               ret2->setArray(ret);
3898               return ret2.retn();
3899             }
3900           default:
3901             { throw INTERP_KERNEL::Exception(msg); }
3902           }
3903       }
3904
3905       MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3906       {
3907         return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
3908       }
3909
3910       MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3911       {
3912         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.";
3913         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
3914         void *argp;
3915         //
3916         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3917           {
3918             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3919             if(other)
3920               return (*self)^(*other);
3921             else
3922               throw INTERP_KERNEL::Exception(msg);
3923           }
3924         //
3925         double val;
3926         DataArrayDouble *a;
3927         DataArrayDoubleTuple *aa;
3928         std::vector<double> bb;
3929         int sw;
3930         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3931         switch(sw)
3932           {
3933           case 1:
3934             {
3935               if(!self->getArray())
3936                 throw INTERP_KERNEL::Exception(msg2);
3937               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3938               ret->applyPow(val);
3939               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3940               ret2->setArray(ret);
3941               return ret2.retn();
3942             }
3943           case 2:
3944             {
3945               if(!self->getArray())
3946                 throw INTERP_KERNEL::Exception(msg2);
3947               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
3948               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3949               ret2->setArray(ret);
3950               return ret2.retn();
3951             }
3952           case 3:
3953             {
3954               if(!self->getArray())
3955                 throw INTERP_KERNEL::Exception(msg2);
3956               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3957               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3958               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3959               ret2->setArray(ret);
3960               return ret2.retn();
3961             }
3962           case 4:
3963             {
3964               if(!self->getArray())
3965                 throw INTERP_KERNEL::Exception(msg2);
3966               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3967               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3968               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3969               ret2->setArray(ret);
3970               return ret2.retn();
3971             }
3972           default:
3973             { throw INTERP_KERNEL::Exception(msg); }
3974           }
3975       }
3976
3977       MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3978       {
3979         return self->negate();
3980       }
3981
3982       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3983       {
3984         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.";
3985         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
3986         void *argp;
3987         //
3988         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3989           {
3990             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3991             if(other)
3992               {
3993                 *self+=*other;
3994                 Py_XINCREF(trueSelf);
3995                 return trueSelf;
3996               }
3997             else
3998               throw INTERP_KERNEL::Exception(msg);
3999           }
4000         //
4001         double val;
4002         DataArrayDouble *a;
4003         DataArrayDoubleTuple *aa;
4004         std::vector<double> bb;
4005         int sw;
4006         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4007         switch(sw)
4008           {
4009           case 1:
4010             {
4011               if(!self->getArray())
4012                 throw INTERP_KERNEL::Exception(msg2);
4013               self->getArray()->applyLin(1.,val);
4014               Py_XINCREF(trueSelf);
4015               return trueSelf;
4016             }
4017           case 2:
4018             {
4019               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4020               ret2->setArray(a);
4021               *self+=*ret2;
4022               Py_XINCREF(trueSelf);
4023               return trueSelf;
4024             }
4025           case 3:
4026             {
4027               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4028               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4029               ret2->setArray(aaa);
4030               *self+=*ret2;
4031               Py_XINCREF(trueSelf);
4032               return trueSelf;
4033             }
4034           case 4:
4035             {
4036               if(!self->getArray())
4037                 throw INTERP_KERNEL::Exception(msg2);
4038               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4039               self->getArray()->addEqual(aaa);
4040               Py_XINCREF(trueSelf);
4041               return trueSelf;
4042             }
4043           default:
4044             { throw INTERP_KERNEL::Exception(msg); }
4045           }
4046       }
4047
4048       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4049       {
4050         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.";
4051         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4052         void *argp;
4053         //
4054         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4055           {
4056             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4057             if(other)
4058               {
4059                 *self-=*other;
4060                 Py_XINCREF(trueSelf);
4061                 return trueSelf;
4062               }
4063             else
4064               throw INTERP_KERNEL::Exception(msg);
4065           }
4066         //
4067         double val;
4068         DataArrayDouble *a;
4069         DataArrayDoubleTuple *aa;
4070         std::vector<double> bb;
4071         int sw;
4072         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4073         switch(sw)
4074           {
4075           case 1:
4076             {
4077               if(!self->getArray())
4078                 throw INTERP_KERNEL::Exception(msg2);
4079               self->getArray()->applyLin(1.,-val);
4080               Py_XINCREF(trueSelf);
4081               return trueSelf;
4082             }
4083           case 2:
4084             {
4085               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4086               ret2->setArray(a);
4087               *self-=*ret2;
4088               Py_XINCREF(trueSelf);
4089               return trueSelf;
4090             }
4091           case 3:
4092             {
4093               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4094               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4095               ret2->setArray(aaa);
4096               *self-=*ret2;
4097               Py_XINCREF(trueSelf);
4098               return trueSelf;
4099             }
4100           case 4:
4101             {
4102               if(!self->getArray())
4103                 throw INTERP_KERNEL::Exception(msg2);
4104               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4105               self->getArray()->substractEqual(aaa);
4106               Py_XINCREF(trueSelf);
4107               return trueSelf;
4108             }
4109           default:
4110             { throw INTERP_KERNEL::Exception(msg); }
4111           }
4112       }
4113
4114       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4115       {
4116         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.";
4117         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4118         void *argp;
4119         //
4120         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4121           {
4122             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4123             if(other)
4124               {
4125                 *self*=*other;
4126                 Py_XINCREF(trueSelf);
4127                 return trueSelf;
4128               }
4129             else
4130               throw INTERP_KERNEL::Exception(msg);
4131           }
4132         //
4133         double val;
4134         DataArrayDouble *a;
4135         DataArrayDoubleTuple *aa;
4136         std::vector<double> bb;
4137         int sw;
4138         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4139         switch(sw)
4140           {
4141           case 1:
4142             {
4143               if(!self->getArray())
4144                 throw INTERP_KERNEL::Exception(msg2);
4145               self->getArray()->applyLin(val,0);
4146               Py_XINCREF(trueSelf);
4147               return trueSelf;
4148             }
4149           case 2:
4150             {
4151               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4152               ret2->setArray(a);
4153               *self*=*ret2;
4154               Py_XINCREF(trueSelf);
4155               return trueSelf;
4156             }
4157           case 3:
4158             {
4159               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4160               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4161               ret2->setArray(aaa);
4162               *self*=*ret2;
4163               Py_XINCREF(trueSelf);
4164               return trueSelf;
4165             }
4166           case 4:
4167             {
4168               if(!self->getArray())
4169                 throw INTERP_KERNEL::Exception(msg2);
4170               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4171               self->getArray()->multiplyEqual(aaa);
4172               Py_XINCREF(trueSelf);
4173               return trueSelf;
4174             }
4175           default:
4176             { throw INTERP_KERNEL::Exception(msg); }
4177           }
4178       }
4179
4180       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4181       {
4182         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.";
4183         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4184         void *argp;
4185         //
4186         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4187           {
4188             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4189             if(other)
4190               {
4191                 *self/=*other;
4192                 Py_XINCREF(trueSelf);
4193                 return trueSelf;
4194               }
4195             else
4196               throw INTERP_KERNEL::Exception(msg);
4197           }
4198         //
4199         double val;
4200         DataArrayDouble *a;
4201         DataArrayDoubleTuple *aa;
4202         std::vector<double> bb;
4203         int sw;
4204         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4205         switch(sw)
4206           {
4207           case 1:
4208             {
4209               if(val==0.)
4210                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4211               if(!self->getArray())
4212                 throw INTERP_KERNEL::Exception(msg2);
4213               self->getArray()->applyLin(1./val,0);
4214               Py_XINCREF(trueSelf);
4215               return trueSelf;
4216             }
4217           case 2:
4218             {
4219               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4220               ret2->setArray(a);
4221               *self/=*ret2;
4222               Py_XINCREF(trueSelf);
4223               return trueSelf;
4224             }
4225           case 3:
4226             {
4227               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4228               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4229               ret2->setArray(aaa);
4230               *self/=*ret2;
4231               Py_XINCREF(trueSelf);
4232               return trueSelf;
4233             }
4234           case 4:
4235             {
4236               if(!self->getArray())
4237                 throw INTERP_KERNEL::Exception(msg2);
4238               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4239               self->getArray()->divideEqual(aaa);
4240               Py_XINCREF(trueSelf);
4241               return trueSelf;
4242             }
4243           default:
4244             { throw INTERP_KERNEL::Exception(msg); }
4245           }
4246       }
4247
4248       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4249       {
4250         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.";
4251         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4252         void *argp;
4253         //
4254         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4255           {
4256             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4257             if(other)
4258               {
4259                 *self^=*other;
4260                 Py_XINCREF(trueSelf);
4261                 return trueSelf;
4262               }
4263             else
4264               throw INTERP_KERNEL::Exception(msg);
4265           }
4266         //
4267         double val;
4268         DataArrayDouble *a;
4269         DataArrayDoubleTuple *aa;
4270         std::vector<double> bb;
4271         int sw;
4272         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4273         switch(sw)
4274           {
4275           case 1:
4276             {
4277               if(!self->getArray())
4278                 throw INTERP_KERNEL::Exception(msg2);
4279               self->getArray()->applyPow(val);
4280               Py_XINCREF(trueSelf);
4281               return trueSelf;
4282             }
4283           case 2:
4284             {
4285               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4286               ret2->setArray(a);
4287               *self^=*ret2;
4288               Py_XINCREF(trueSelf);
4289               return trueSelf;
4290             }
4291           case 3:
4292             {
4293               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4294               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4295               ret2->setArray(aaa);
4296               *self^=*ret2;
4297               Py_XINCREF(trueSelf);
4298               return trueSelf;
4299             }
4300           case 4:
4301             {
4302               if(!self->getArray())
4303                 throw INTERP_KERNEL::Exception(msg2);
4304               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4305               self->getArray()->powEqual(aaa);
4306               Py_XINCREF(trueSelf);
4307               return trueSelf;
4308             }
4309           default:
4310             { throw INTERP_KERNEL::Exception(msg); }
4311           }
4312       }
4313
4314       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4315       {
4316         std::vector<const MEDCouplingFieldDouble *> tmp;
4317         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4318         return MEDCouplingFieldDouble::MergeFields(tmp);
4319       }
4320
4321       static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4322       {
4323         std::vector<const MEDCouplingFieldDouble *> tmp;
4324         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4325         MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4326       }
4327     }
4328   };
4329
4330   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4331   {
4332   public:
4333     int getNumberOfFields() const;
4334     MEDCouplingMultiFields *deepCpy() const;
4335     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4336     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4337     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4338     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4339     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4340     %extend
4341        {
4342          std::string __str__() const throw(INTERP_KERNEL::Exception)
4343          {
4344            return self->simpleRepr();
4345          }
4346          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4347          {
4348            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4349            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4350            int sz=tmp.size();
4351            std::vector<MEDCouplingFieldDouble *> fs(sz);
4352            for(int i=0;i<sz;i++)
4353              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4354            return MEDCouplingMultiFields::New(fs);
4355          }
4356          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4357          {
4358            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4359            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4360            int sz=tmp.size();
4361            std::vector<MEDCouplingFieldDouble *> fs(sz);
4362            for(int i=0;i<sz;i++)
4363              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4364            return MEDCouplingMultiFields::New(fs);
4365          }
4366          PyObject *getFields() const
4367          {
4368            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4369            int sz=fields.size();
4370            PyObject *res = PyList_New(sz);
4371            for(int i=0;i<sz;i++)
4372              {
4373                if(fields[i])
4374                  {
4375                    fields[i]->incrRef();
4376                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4377                  }
4378                else
4379                  {
4380                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4381                  }
4382              }
4383            return res;
4384          }
4385          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4386          {
4387            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4388            if(ret)
4389              {
4390                ret->incrRef();
4391                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4392              }
4393            else
4394              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4395          }
4396          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4397          {
4398            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4399            int sz=ms.size();
4400            PyObject *res = PyList_New(sz);
4401            for(int i=0;i<sz;i++)
4402              {
4403                if(ms[i])
4404                  {
4405                    ms[i]->incrRef();
4406                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4407                  }
4408                else
4409                  {
4410                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4411                  }
4412              }
4413            return res;
4414          }
4415          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4416          {
4417            std::vector<int> refs;
4418            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4419            int sz=ms.size();
4420            PyObject *res = PyList_New(sz);
4421            for(int i=0;i<sz;i++)
4422              {
4423                if(ms[i])
4424                  {
4425                    ms[i]->incrRef();
4426                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4427                  }
4428                else
4429                  {
4430                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4431                  }
4432              }
4433            //
4434            PyObject *ret=PyTuple_New(2);
4435            PyTuple_SetItem(ret,0,res);
4436            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4437            return ret;
4438          }
4439          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4440          {
4441            std::vector<DataArrayDouble *> ms=self->getArrays();
4442            int sz=ms.size();
4443            PyObject *res = PyList_New(sz);
4444            for(int i=0;i<sz;i++)
4445              {
4446                if(ms[i])
4447                  {
4448                    ms[i]->incrRef();
4449                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4450                  }
4451                else
4452                  {
4453                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4454                  }
4455              }
4456            return res;
4457          }
4458          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4459          {
4460            std::vector< std::vector<int> > refs;
4461            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4462            int sz=ms.size();
4463            PyObject *res = PyList_New(sz);
4464            PyObject *res2 = PyList_New(sz);
4465            for(int i=0;i<sz;i++)
4466              {
4467                if(ms[i])
4468                  {
4469                    ms[i]->incrRef();
4470                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4471                  }
4472                else
4473                  {
4474                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4475                  }
4476                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4477              }
4478            //
4479            PyObject *ret=PyTuple_New(2);
4480            PyTuple_SetItem(ret,0,res);
4481            PyTuple_SetItem(ret,1,res2);
4482            return ret;
4483          }
4484        }
4485   };
4486   
4487   class MEDCouplingDefinitionTime
4488   {
4489   public:
4490     MEDCouplingDefinitionTime();
4491     void assign(const MEDCouplingDefinitionTime& other);
4492     bool isEqual(const MEDCouplingDefinitionTime& other) const;
4493     double getTimeResolution() const;
4494     std::vector<double> getHotSpotsTime() const;
4495     %extend
4496       {
4497         std::string __str__() const throw(INTERP_KERNEL::Exception)
4498           {
4499             std::ostringstream oss;
4500             self->appendRepr(oss);
4501             return oss.str();
4502           }
4503
4504         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4505         {
4506           int meshId,arrId,arrIdInField,fieldId;
4507           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4508           PyObject *res=PyList_New(4);
4509           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4510           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4511           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4512           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4513           return res;
4514         }
4515
4516         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4517         {
4518           int meshId,arrId,arrIdInField,fieldId;
4519           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4520           PyObject *res=PyList_New(4);
4521           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4522           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4523           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4524           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4525           return res;
4526         }
4527       }
4528   };
4529
4530   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4531   {
4532   public:
4533     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4534     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4535     
4536     %extend
4537       {
4538         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4539           {
4540             std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4541             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4542             int sz=tmp.size();
4543             std::vector<MEDCouplingFieldDouble *> fs(sz);
4544             for(int i=0;i<sz;i++)
4545               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4546             return MEDCouplingFieldOverTime::New(fs);
4547           }
4548         std::string __str__() const throw(INTERP_KERNEL::Exception)
4549           {
4550             return self->simpleRepr();
4551           }
4552         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4553         {
4554           std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4555           convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4556            int sz=tmp.size();
4557            std::vector<MEDCouplingFieldDouble *> fs(sz);
4558            for(int i=0;i<sz;i++)
4559              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4560            return MEDCouplingFieldOverTime::New(fs);
4561          }
4562       }
4563   };
4564
4565   class MEDCouplingAHOGPatch : public RefCountObject
4566   {
4567   public:
4568     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4569     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4570     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4571     int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
4572     %extend
4573     {
4574       PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
4575       {
4576         const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
4577         return convertFromVectorPairInt(ret);
4578       }
4579
4580       const MEDCouplingAHOGMesh *getMesh() const throw(INTERP_KERNEL::Exception)
4581       {
4582         MEDCouplingAHOGMesh *ret(const_cast<MEDCouplingAHOGMesh *>(self->getMesh()));
4583         if(ret)
4584           ret->incrRef();
4585         return ret;
4586       }
4587
4588       void addPatch(PyObject *bottomLeftTopRight, int factor) throw(INTERP_KERNEL::Exception)
4589       {
4590         std::vector< std::pair<int,int> > inp;
4591         convertPyToVectorPairInt(bottomLeftTopRight,inp);
4592         self->addPatch(inp,factor);
4593       }
4594
4595       MEDCouplingAHOGPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4596       {
4597         const MEDCouplingAHOGMesh *mesh(self->getMesh());
4598         if(!mesh)
4599           throw INTERP_KERNEL::Exception("wrap MEDCouplingAHOGPatch.__getitem__ : no underlying mesh !");
4600         if(patchId==mesh->getNumberOfPatches())
4601           {
4602             std::ostringstream oss;
4603             oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
4604             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4605             return 0;
4606           }
4607         MEDCouplingAHOGPatch *ret(const_cast<MEDCouplingAHOGPatch *>(mesh->getPatch(patchId)));
4608         if(ret)
4609           ret->incrRef();
4610         return ret;
4611       }
4612
4613       int __len__() const throw(INTERP_KERNEL::Exception)
4614       {
4615         const MEDCouplingAHOGMesh *mesh(self->getMesh());
4616         if(!mesh)
4617           throw INTERP_KERNEL::Exception("wrap MEDCouplingAHOGPatch.__len__ : no underlying mesh !");
4618         return mesh->getNumberOfPatches();
4619       }
4620     }
4621   };
4622   
4623   class MEDCouplingAHOGMesh : public RefCountObject, public TimeLabel
4624   {
4625   public:
4626     
4627     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
4628     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4629     int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
4630     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4631     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4632     //
4633     int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);    
4634     MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
4635     %extend
4636     {
4637       static MEDCouplingAHOGMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
4638       {
4639         static const char msg0[]="MEDCouplingAHOGMesh::New : error on 'origin' parameter !";
4640         static const char msg1[]="MEDCouplingAHOGMesh::New : error on 'dxyz' parameter !";
4641         const int *nodeStrctPtr(0);
4642         const double *originPtr(0),*dxyzPtr(0);
4643         int sw,sz,val0;
4644         std::vector<int> bb0;
4645         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
4646         //
4647         double val,val2;
4648         std::vector<double> bb,bb2;
4649         int sz1,sz2;
4650         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
4651         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
4652         //
4653         return MEDCouplingAHOGMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
4654       }
4655
4656       MEDCouplingAHOGMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
4657       {
4658         return ParaMEDMEM_MEDCouplingAHOGMesh_New(meshName,spaceDim,nodeStrct,origin,dxyz);
4659       }
4660
4661       void addPatch(PyObject *bottomLeftTopRight, int factor) throw(INTERP_KERNEL::Exception)
4662       {
4663         std::vector< std::pair<int,int> > inp;
4664         convertPyToVectorPairInt(bottomLeftTopRight,inp);
4665         self->addPatch(inp,factor);
4666       }
4667
4668       MEDCouplingAHOGMesh *getFather() const throw(INTERP_KERNEL::Exception)
4669       {
4670         MEDCouplingAHOGMesh *ret(const_cast<MEDCouplingAHOGMesh *>(self->getFather()));
4671         if(ret)
4672           ret->incrRef();
4673         return ret;
4674       }
4675       
4676       MEDCouplingAHOGMesh *getGodFather() const throw(INTERP_KERNEL::Exception)
4677       {
4678         MEDCouplingAHOGMesh *ret(const_cast<MEDCouplingAHOGMesh *>(self->getGodFather()));
4679         if(ret)
4680           ret->incrRef();
4681         return ret;
4682       }
4683
4684       MEDCouplingAHOGPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
4685       {
4686         MEDCouplingAHOGPatch *ret(const_cast<MEDCouplingAHOGPatch *>(self->getPatch(patchId)));
4687         if(ret)
4688           ret->incrRef();
4689         return ret;
4690       }
4691
4692       MEDCouplingAHOGPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4693       {
4694         if(patchId==self->getNumberOfPatches())
4695           {
4696             std::ostringstream oss;
4697             oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
4698             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4699             return 0;
4700           }
4701         MEDCouplingAHOGPatch *ret(const_cast<MEDCouplingAHOGPatch *>(self->getPatch(patchId)));
4702         if(ret)
4703           ret->incrRef();
4704         return ret;
4705       }
4706
4707       int __len__() const throw(INTERP_KERNEL::Exception)
4708       {
4709         return self->getNumberOfPatches();
4710       }
4711     }
4712   };
4713 }
4714
4715 %pythoncode %{
4716 import os
4717 __filename=os.environ.get('PYTHONSTARTUP')
4718 if __filename and os.path.isfile(__filename):
4719   execfile(__filename)
4720   pass
4721 %}