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