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