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