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