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