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