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