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