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