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