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