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