Salome HOME
Add structured image grid meshes into MEDCoupling.
[modules/med.git] / src / MEDCoupling_Swig / MEDCouplingCommon.i
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 %module MEDCoupling
22
23 %include std_vector.i
24 %include std_string.i
25
26 %{
27 #include "MEDCouplingMemArray.hxx"
28 #include "MEDCouplingUMesh.hxx"
29 #include "MEDCouplingExtrudedMesh.hxx"
30 #include "MEDCouplingCMesh.hxx"
31 #include "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 DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
2814       {
2815         int szArr,sw,iTypppArr;
2816         std::vector<int> stdvecTyyppArr;
2817         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2818         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
2819       }
2820
2821       static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2822       {
2823         int szArr,sw,iTypppArr;
2824         std::vector<int> stdvecTyyppArr;
2825         const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
2826         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
2827       }
2828
2829       static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
2830       {
2831         int szArr,sw,iTypppArr;
2832         std::vector<int> stdvecTyyppArr;
2833         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2834         int szArr2,sw2,iTypppArr2;
2835         std::vector<int> stdvecTyyppArr2;
2836         const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
2837         std::vector<int> tmp3(tmp2,tmp2+szArr2);
2838         std::vector< std::pair<int,int> > partCompactFormat;
2839         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
2840         PyObject *ret=PyTuple_New(2);
2841         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
2842         PyTuple_SetItem(ret,0,ret0Py);
2843         PyObject *ret1Py=PyList_New(partCompactFormat.size());
2844         for(std::size_t i=0;i<partCompactFormat.size();i++)
2845           {
2846             PyObject *tmp4=PyTuple_New(2);
2847             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
2848             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
2849             PyList_SetItem(ret1Py,i,tmp4);
2850           }
2851         PyTuple_SetItem(ret,1,ret1Py);
2852         return ret;
2853       }
2854     }
2855   };
2856
2857   //== MEDCouplingCMesh
2858   
2859   class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2860   {
2861   public:
2862     static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
2863     static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
2864     MEDCouplingCMesh *clone(bool recDeepCpy) const;
2865     void setCoords(const DataArrayDouble *coordsX,
2866                    const DataArrayDouble *coordsY=0,
2867                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
2868     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
2869     %extend {
2870       MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
2871       {
2872         return MEDCouplingCMesh::New();
2873       }
2874       MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
2875       {
2876         return MEDCouplingCMesh::New(meshName);
2877       }
2878       std::string __str__() const throw(INTERP_KERNEL::Exception)
2879       {
2880         return self->simpleRepr();
2881       }
2882       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2883       {
2884         std::ostringstream oss;
2885         self->reprQuickOverview(oss);
2886         return oss.str();
2887       }
2888       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
2889       {
2890         DataArrayDouble *ret=self->getCoordsAt(i);
2891         if(ret)
2892           ret->incrRef();
2893         return ret;
2894       }
2895     }
2896   };
2897
2898   //== MEDCouplingCMesh End
2899
2900   //== MEDCouplingCurveLinearMesh
2901
2902   class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2903   {
2904   public:
2905     static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
2906     static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
2907     MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
2908     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
2909     %extend {
2910       MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
2911       {
2912         return MEDCouplingCurveLinearMesh::New();
2913       }
2914       MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
2915       {
2916         return MEDCouplingCurveLinearMesh::New(meshName);
2917       }
2918       std::string __str__() const throw(INTERP_KERNEL::Exception) 
2919       {
2920         return self->simpleRepr();
2921       }
2922       std::string __repr__() const throw(INTERP_KERNEL::Exception)
2923       {
2924         std::ostringstream oss;
2925         self->reprQuickOverview(oss);
2926         return oss.str();
2927       }
2928       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
2929       {
2930         DataArrayDouble *ret=self->getCoords();
2931         if(ret)
2932           ret->incrRef();
2933         return ret;
2934       }
2935       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
2936       {
2937         int szArr,sw,iTypppArr;
2938         std::vector<int> stdvecTyyppArr;
2939         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
2940         self->setNodeGridStructure(tmp,tmp+szArr);
2941       }
2942     }
2943   };
2944
2945   //== MEDCouplingCurveLinearMesh End
2946
2947   //== MEDCouplingIMesh
2948
2949   class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
2950   {
2951   public:
2952     static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
2953     //
2954     void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
2955     std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
2956     std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
2957     std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
2958     void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
2959     std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
2960     double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
2961     MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
2962     %extend
2963     {
2964       MEDCouplingIMesh()
2965       {
2966         return MEDCouplingIMesh::New();
2967       }
2968       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
2969       {
2970         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
2971         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
2972         const int *nodeStrctPtr(0);
2973         const double *originPtr(0),*dxyzPtr(0);
2974         int sw,sz,val0;
2975         std::vector<int> bb0;
2976         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
2977         //
2978         double val,val2;
2979         std::vector<double> bb,bb2;
2980         int sz1,sz2;
2981         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
2982         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
2983         //
2984         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
2985       }
2986
2987       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
2988       {
2989         return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
2990       }
2991
2992       void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
2993       {
2994         int sw,sz,val0;
2995         std::vector<int> bb0;
2996         const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
2997         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
2998       }
2999
3000       void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3001       {
3002         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3003         double val;
3004         DataArrayDouble *a;
3005         DataArrayDoubleTuple *aa;
3006         std::vector<double> bb;
3007         int sw,nbTuples;
3008         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3009         self->setOrigin(originPtr,originPtr+nbTuples);
3010       }
3011       
3012       void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3013       {
3014         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3015         double val;
3016         DataArrayDouble *a;
3017         DataArrayDoubleTuple *aa;
3018         std::vector<double> bb;
3019         int sw,nbTuples;
3020         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3021         self->setDXYZ(originPtr,originPtr+nbTuples);
3022       }
3023
3024       std::string __str__() const throw(INTERP_KERNEL::Exception)
3025       {
3026         return self->simpleRepr();
3027       }
3028       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3029       {
3030         std::ostringstream oss;
3031         self->reprQuickOverview(oss);
3032         return oss.str();
3033       }
3034     }
3035   };
3036
3037   //== MEDCouplingIMesh End
3038
3039 }
3040
3041 namespace ParaMEDMEM
3042 {
3043   class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3044   {
3045   public:
3046     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3047     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3048     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3049     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3050     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3051     void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3052     void setName(const char *name) throw(INTERP_KERNEL::Exception);
3053     std::string getDescription() const throw(INTERP_KERNEL::Exception);
3054     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3055     std::string getName() const throw(INTERP_KERNEL::Exception);
3056     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3057     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3058     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3059     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3060     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3061     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3062     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3063     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3064                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3065     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3066     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3067     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3068     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3069     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3070     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3071     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3072     %extend {
3073       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3074       {
3075         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3076         if(ret1)
3077           ret1->incrRef();
3078         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3079       }
3080
3081       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3082       {
3083         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3084         if(ret)
3085           ret->incrRef();
3086         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3087       }
3088
3089       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3090       {
3091         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3092         return convertIntArrToPyList3(ret);
3093       }
3094
3095       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3096       {
3097         std::string ret1;
3098         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3099         PyObject *ret=PyTuple_New(2);
3100         PyObject *ret0Py=ret0?Py_True:Py_False;
3101         Py_XINCREF(ret0Py);
3102         PyTuple_SetItem(ret,0,ret0Py);
3103         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3104         return ret;
3105       }
3106
3107       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3108       {
3109         DataArrayInt *ret1=0;
3110         MEDCouplingMesh *ret0=0;
3111         void *da=0;
3112         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3113         if (!SWIG_IsOK(res1))
3114           {
3115             int size;
3116             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3117             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3118           }
3119         else
3120           {
3121             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3122             if(!da2)
3123               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3124             da2->checkAllocated();
3125             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3126           }
3127         PyObject *res = PyList_New(2);
3128         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3129         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3130         return res;
3131       }
3132
3133       PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3134       {
3135         DataArrayInt *ret1=0;
3136         int bb,ee,ss;
3137         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3138         PyObject *res=PyTuple_New(2);
3139         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3140         if(ret1)
3141           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3142         else
3143           {
3144             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3145             PyTuple_SetItem(res,1,res1);
3146           }
3147         return res;
3148       }
3149
3150       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3151       {
3152         int sw,sz(-1);
3153         int v0; std::vector<int> v1;
3154         const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3155         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3156       }
3157
3158       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3159                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3160       {
3161         void *da=0;
3162         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3163         if (!SWIG_IsOK(res1))
3164           {
3165             int size;
3166             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3167             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3168           }
3169         else
3170           {
3171             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3172             if(!da2)
3173               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3174             da2->checkAllocated();
3175             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3176           }
3177       }
3178
3179       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3180       {
3181         std::vector<int> tmp;
3182         self->getCellIdsHavingGaussLocalization(locId,tmp);
3183         DataArrayInt *ret=DataArrayInt::New();
3184         ret->alloc((int)tmp.size(),1);
3185         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3186         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3187       }
3188       
3189       int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3190       {
3191         std::vector<int> inp0;
3192         convertPyToNewIntArr4(code,1,3,inp0);
3193         std::vector<const DataArrayInt *> inp1;
3194         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3195         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3196       }
3197     }
3198   };
3199   
3200   class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3201   {
3202   public:
3203     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3204     static MEDCouplingFieldTemplate *New(TypeOfField type);
3205     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3206     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3207     %extend
3208        {
3209          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3210          {
3211            return MEDCouplingFieldTemplate::New(f);
3212          }
3213          
3214          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3215          {
3216            return MEDCouplingFieldTemplate::New(type);
3217          }
3218          
3219          std::string __str__() const throw(INTERP_KERNEL::Exception)
3220          {
3221            return self->simpleRepr();
3222          }
3223          
3224          std::string __repr__() const throw(INTERP_KERNEL::Exception)
3225          {
3226            std::ostringstream oss;
3227            self->reprQuickOverview(oss);
3228            return oss.str();
3229          }
3230        }
3231   };
3232   
3233   class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3234   {
3235   public:
3236     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3237     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3238     void setTimeUnit(const std::string& unit);
3239     std::string getTimeUnit() const;
3240     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3241     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3242     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3243     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3244     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3245     void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3246     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3247     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3248     MEDCouplingFieldDouble *deepCpy() const;
3249     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3250     MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3251     MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3252     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3253     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3254     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3255     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3256     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3257     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3258     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3259     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3260     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3261     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3262     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3263     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3264     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3265     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3266     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3267     void setIteration(int it) throw(INTERP_KERNEL::Exception);
3268     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3269     void setOrder(int order) throw(INTERP_KERNEL::Exception);
3270     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3271     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3272     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3273     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3274     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3275     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3276     bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3277     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3278     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3279     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3280     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3281     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3282     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3283     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3284     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3285     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3286     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3287     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3288     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3289     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3290     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3291     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3292     void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3293     void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3294     void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3295     void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3296     void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3297     void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3298     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3299     void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3300     void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3301     void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3302     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3303     double getMaxValue() const throw(INTERP_KERNEL::Exception);
3304     double getMinValue() const throw(INTERP_KERNEL::Exception);
3305     double getAverageValue() const throw(INTERP_KERNEL::Exception);
3306     double norm2() const throw(INTERP_KERNEL::Exception);
3307     double normMax() const throw(INTERP_KERNEL::Exception);
3308     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3309     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3310     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3311     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3312     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3313     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3314     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3315     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3316     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3317     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3318     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3319     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3320     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3321     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3322     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3323     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3324     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3325     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3326     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3327     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3328     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3329     MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3330     %extend {
3331       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3332       {
3333         return MEDCouplingFieldDouble::New(type,td);
3334       }
3335
3336       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3337       {
3338         return MEDCouplingFieldDouble::New(ft,td);
3339       }
3340
3341       std::string __str__() const throw(INTERP_KERNEL::Exception)
3342       {
3343         return self->simpleRepr();
3344       }
3345
3346       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3347       {
3348         std::ostringstream oss;
3349         self->reprQuickOverview(oss);
3350         return oss.str();
3351       }
3352
3353       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3354       {
3355         DataArrayDouble *ret=self->getArray();
3356         if(ret)
3357           ret->incrRef();
3358         return ret;
3359       }
3360
3361       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3362       {
3363         std::vector<DataArrayDouble *> arrs=self->getArrays();
3364         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3365           if(*it)
3366             (*it)->incrRef();
3367         int sz=arrs.size();
3368         PyObject *ret=PyTuple_New(sz);
3369         for(int i=0;i<sz;i++)
3370           {
3371             if(arrs[i])
3372               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3373             else
3374               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3375           }
3376         return ret;
3377       }
3378
3379       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3380       {
3381         std::vector<const DataArrayDouble *> tmp;
3382         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3383         int sz=tmp.size();
3384         std::vector<DataArrayDouble *> arrs(sz);
3385         for(int i=0;i<sz;i++)
3386           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3387         self->setArrays(arrs);
3388       }
3389
3390       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3391       {
3392         DataArrayDouble *ret=self->getEndArray();
3393         if(ret)
3394           ret->incrRef();
3395         return ret;
3396       }
3397
3398       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3399       {
3400         double val;
3401         DataArrayDouble *a;
3402         DataArrayDoubleTuple *aa;
3403         std::vector<double> bb;
3404         int sw;
3405         const MEDCouplingMesh *mesh=self->getMesh();
3406         if(!mesh)
3407           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3408         int spaceDim=mesh->getSpaceDimension();
3409         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3410         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3411         //
3412         int sz=self->getNumberOfComponents();
3413         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3414         self->getValueOn(spaceLoc,res);
3415         return convertDblArrToPyList(res,sz);
3416       }
3417
3418        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3419        {
3420          int sz=self->getNumberOfComponents();
3421          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3422          self->getValueOnPos(i,j,k,res);
3423          return convertDblArrToPyList(res,sz);
3424        }
3425
3426       DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3427       {
3428         const MEDCouplingMesh *mesh(self->getMesh());
3429         if(!mesh)
3430           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3431         //
3432         int sw,nbPts;
3433         double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3434         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3435                                                          mesh->getSpaceDimension(),true,nbPts);
3436         return self->getValueOnMulti(inp,nbPts);
3437       }
3438
3439       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3440       {
3441         double val;
3442         DataArrayDouble *a;
3443         DataArrayDoubleTuple *aa;
3444         std::vector<double> bb;
3445         int sw;
3446         const MEDCouplingMesh *mesh=self->getMesh();
3447         if(!mesh)
3448           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3449         int spaceDim=mesh->getSpaceDimension();
3450         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3451         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3452         //
3453         //
3454         int sz=self->getNumberOfComponents();
3455         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3456         self->getValueOn(spaceLoc,time,res);
3457         return convertDblArrToPyList(res,sz);
3458       }
3459
3460       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3461       {
3462         if(self->getArray()!=0)
3463           ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3464         else
3465           {
3466             MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3467             ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3468             self->setArray(arr);
3469           }
3470       }
3471       
3472       PyObject *getTime() throw(INTERP_KERNEL::Exception)
3473       {
3474         int tmp1,tmp2;
3475         double tmp0=self->getTime(tmp1,tmp2);
3476         PyObject *res = PyList_New(3);
3477         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3478         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3479         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3480         return res;
3481       }
3482
3483       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3484       {
3485         int tmp1,tmp2;
3486         double tmp0=self->getStartTime(tmp1,tmp2);
3487         PyObject *res = PyList_New(3);
3488         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3489         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3490         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3491         return res;
3492       }
3493
3494       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3495       {
3496         int tmp1,tmp2;
3497         double tmp0=self->getEndTime(tmp1,tmp2);
3498         PyObject *res = PyList_New(3);
3499         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3500         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3501         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3502         return res;
3503       }
3504       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3505       {
3506         int sz=self->getNumberOfComponents();
3507         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3508         self->accumulate(tmp);
3509         return convertDblArrToPyList(tmp,sz);
3510       }
3511       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3512       {
3513         int sz=self->getNumberOfComponents();
3514         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3515         self->integral(isWAbs,tmp);
3516         return convertDblArrToPyList(tmp,sz);
3517       }
3518       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3519       {
3520         int sz=self->getNumberOfComponents();
3521         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3522         self->getWeightedAverageValue(tmp,isWAbs);
3523         return convertDblArrToPyList(tmp,sz);
3524       }
3525       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3526       {
3527         int sz=self->getNumberOfComponents();
3528         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3529         self->normL1(tmp);
3530         return convertDblArrToPyList(tmp,sz);
3531       }
3532       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3533       {
3534         int sz=self->getNumberOfComponents();
3535         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3536         self->normL2(tmp);
3537         return convertDblArrToPyList(tmp,sz);
3538       }
3539       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3540       {
3541         int szArr,sw,iTypppArr;
3542         std::vector<int> stdvecTyyppArr;
3543         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3544         self->renumberCells(tmp,check);
3545       }
3546       
3547       void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3548       {
3549         int szArr,sw,iTypppArr;
3550         std::vector<int> stdvecTyyppArr;
3551         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3552         self->renumberCellsWithoutMesh(tmp,check);
3553       }
3554       
3555       void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3556       {
3557         int szArr,sw,iTypppArr;
3558         std::vector<int> stdvecTyyppArr;
3559         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3560         self->renumberNodes(tmp,eps);
3561       }
3562
3563       void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) 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->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3569       }
3570
3571       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3572       {
3573         int sw;
3574         int singleVal;
3575         std::vector<int> multiVal;
3576         std::pair<int, std::pair<int,int> > slic;
3577         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3578         const MEDCouplingMesh *mesh=self->getMesh();
3579         if(!mesh)
3580           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3581         int nbc=mesh->getNumberOfCells();
3582         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3583         switch(sw)
3584           {
3585           case 1:
3586             {
3587               if(singleVal>=nbc)
3588                 {
3589                   std::ostringstream oss;
3590                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3591                   throw INTERP_KERNEL::Exception(oss.str().c_str());
3592                 }
3593               if(singleVal>=0)
3594                 return self->buildSubPart(&singleVal,&singleVal+1);
3595               else
3596                 {
3597                   if(nbc+singleVal>0)
3598                     {
3599                       int tmp=nbc+singleVal;
3600                       return self->buildSubPart(&tmp,&tmp+1);
3601                     }
3602                   else
3603                     {
3604                       std::ostringstream oss;
3605                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3606                       throw INTERP_KERNEL::Exception(oss.str().c_str());
3607                     }
3608                 }
3609             }
3610           case 2:
3611             {
3612               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3613             }
3614           case 3:
3615             {
3616               return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3617             }
3618           case 4:
3619             {
3620               if(!daIntTyypp)
3621                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3622               daIntTyypp->checkAllocated();
3623               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3624             }
3625           default:
3626             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3627           }
3628       }
3629
3630       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3631       {
3632         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";
3633         if(PyTuple_Check(li))
3634           {
3635             Py_ssize_t sz=PyTuple_Size(li);
3636             if(sz!=2)
3637               throw INTERP_KERNEL::Exception(msg);
3638             PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3639             int sw;
3640             int singleVal;
3641             std::vector<int> multiVal;
3642             std::pair<int, std::pair<int,int> > slic;
3643             ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3644             if(!self->getArray())
3645               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3646             try
3647               { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3648             catch(INTERP_KERNEL::Exception& e)
3649               { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3650             MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3651             DataArrayDouble *ret0Arr=ret0->getArray();
3652             if(!ret0Arr)
3653               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3654             switch(sw)
3655               {
3656               case 1:
3657                 {
3658                   std::vector<int> v2(1,singleVal);
3659                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3660                   ret0->setArray(aarr);
3661                   return ret0.retn();
3662                 }
3663               case 2:
3664                 {
3665                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3666                   ret0->setArray(aarr);
3667                   return ret0.retn();
3668                 }
3669               case 3:
3670                 {
3671                   int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3672                   std::vector<int> v2(nbOfComp);
3673                   for(int i=0;i<nbOfComp;i++)
3674                     v2[i]=slic.first+i*slic.second.second;
3675                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3676                   ret0->setArray(aarr);
3677                   return ret0.retn();
3678                 }
3679               default:
3680                 throw INTERP_KERNEL::Exception(msg);
3681               }
3682             
3683           }
3684         else
3685           return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3686       }
3687
3688       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3689       {
3690         DataArrayInt *tmp;
3691         double r1=self->getMaxValue2(tmp);
3692         PyObject *ret=PyTuple_New(2);
3693         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3694         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3695         return ret;
3696       }
3697       
3698       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3699       {
3700         DataArrayInt *tmp;
3701         double r1=self->getMinValue2(tmp);
3702         PyObject *ret=PyTuple_New(2);
3703         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3704         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3705         return ret;
3706       }
3707       
3708       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3709       {
3710         std::vector<int> tmp;
3711         convertPyToNewIntArr3(li,tmp);
3712         return self->keepSelectedComponents(tmp);
3713       }
3714
3715       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3716       {
3717         std::vector<int> tmp;
3718         convertPyToNewIntArr3(li,tmp);
3719         self->setSelectedComponents(f,tmp);
3720       }
3721
3722       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
3723       {
3724         double val,val2;
3725         DataArrayDouble *a,*a2;
3726         DataArrayDoubleTuple *aa,*aa2;
3727         std::vector<double> bb,bb2;
3728         int sw;
3729         int spaceDim=3;
3730         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
3731         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
3732         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
3733         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
3734         //
3735         return self->extractSlice3D(orig,vect,eps);
3736       }
3737
3738       MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3739       {
3740         return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
3741       }
3742
3743       MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3744       {
3745         return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
3746       }
3747
3748       MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3749       {
3750         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.";
3751         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
3752         void *argp;
3753         //
3754         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3755           {
3756             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3757             if(other)
3758               return (*self)-(*other);
3759             else
3760               throw INTERP_KERNEL::Exception(msg);
3761           }
3762         //
3763         double val;
3764         DataArrayDouble *a;
3765         DataArrayDoubleTuple *aa;
3766         std::vector<double> bb;
3767         int sw;
3768         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3769         switch(sw)
3770           {
3771           case 1:
3772             {
3773               if(!self->getArray())
3774                 throw INTERP_KERNEL::Exception(msg2);
3775               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3776               ret->applyLin(1.,-val);
3777               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3778               ret2->setArray(ret);
3779               return ret2.retn();
3780             }
3781           case 2:
3782             {
3783               if(!self->getArray())
3784                 throw INTERP_KERNEL::Exception(msg2);
3785               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
3786               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3787               ret2->setArray(ret);
3788               return ret2.retn();
3789             }
3790           case 3:
3791             {
3792               if(!self->getArray())
3793                 throw INTERP_KERNEL::Exception(msg2);
3794               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3795               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3796               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3797               ret2->setArray(ret);
3798               return ret2.retn();
3799             }
3800           case 4:
3801             {
3802               if(!self->getArray())
3803                 throw INTERP_KERNEL::Exception(msg2);
3804               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3805               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
3806               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3807               ret2->setArray(ret);
3808               return ret2.retn();
3809             }
3810           default:
3811             { throw INTERP_KERNEL::Exception(msg); }
3812           }
3813       }
3814
3815       MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3816       {
3817         return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
3818       }
3819
3820       MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3821       {
3822         return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
3823       }
3824
3825       MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3826       {
3827         return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
3828       }
3829
3830       MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3831       {
3832         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.";
3833         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
3834         void *argp;
3835         //
3836         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3837           {
3838             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3839             if(other)
3840               return (*self)/(*other);
3841             else
3842               throw INTERP_KERNEL::Exception(msg);
3843           }
3844         //
3845         double val;
3846         DataArrayDouble *a;
3847         DataArrayDoubleTuple *aa;
3848         std::vector<double> bb;
3849         int sw;
3850         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3851         switch(sw)
3852           {
3853           case 1:
3854             {
3855               if(val==0.)
3856                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
3857               if(!self->getArray())
3858                 throw INTERP_KERNEL::Exception(msg2);
3859               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3860               ret->applyLin(1./val,0);
3861               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3862               ret2->setArray(ret);
3863               return ret2.retn();
3864             }
3865           case 2:
3866             {
3867               if(!self->getArray())
3868                 throw INTERP_KERNEL::Exception(msg2);
3869               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
3870               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3871               ret2->setArray(ret);
3872               return ret2.retn();
3873             }
3874           case 3:
3875             {
3876               if(!self->getArray())
3877                 throw INTERP_KERNEL::Exception(msg2);
3878               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3879               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3880               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3881               ret2->setArray(ret);
3882               return ret2.retn();
3883             }
3884           case 4:
3885             {
3886               if(!self->getArray())
3887                 throw INTERP_KERNEL::Exception(msg2);
3888               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3889               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
3890               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3891               ret2->setArray(ret);
3892               return ret2.retn();
3893             }
3894           default:
3895             { throw INTERP_KERNEL::Exception(msg); }
3896           }
3897       }
3898
3899       MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3900       {
3901         return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
3902       }
3903
3904       MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
3905       {
3906         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.";
3907         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
3908         void *argp;
3909         //
3910         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3911           {
3912             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3913             if(other)
3914               return (*self)^(*other);
3915             else
3916               throw INTERP_KERNEL::Exception(msg);
3917           }
3918         //
3919         double val;
3920         DataArrayDouble *a;
3921         DataArrayDoubleTuple *aa;
3922         std::vector<double> bb;
3923         int sw;
3924         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
3925         switch(sw)
3926           {
3927           case 1:
3928             {
3929               if(!self->getArray())
3930                 throw INTERP_KERNEL::Exception(msg2);
3931               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
3932               ret->applyPow(val);
3933               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3934               ret2->setArray(ret);
3935               return ret2.retn();
3936             }
3937           case 2:
3938             {
3939               if(!self->getArray())
3940                 throw INTERP_KERNEL::Exception(msg2);
3941               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
3942               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3943               ret2->setArray(ret);
3944               return ret2.retn();
3945             }
3946           case 3:
3947             {
3948               if(!self->getArray())
3949                 throw INTERP_KERNEL::Exception(msg2);
3950               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
3951               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3952               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3953               ret2->setArray(ret);
3954               return ret2.retn();
3955             }
3956           case 4:
3957             {
3958               if(!self->getArray())
3959                 throw INTERP_KERNEL::Exception(msg2);
3960               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
3961               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
3962               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
3963               ret2->setArray(ret);
3964               return ret2.retn();
3965             }
3966           default:
3967             { throw INTERP_KERNEL::Exception(msg); }
3968           }
3969       }
3970
3971       MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
3972       {
3973         return self->negate();
3974       }
3975
3976       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
3977       {
3978         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.";
3979         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
3980         void *argp;
3981         //
3982         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
3983           {
3984             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
3985             if(other)
3986               {
3987                 *self+=*other;
3988                 Py_XINCREF(trueSelf);
3989                 return trueSelf;
3990               }
3991             else
3992               throw INTERP_KERNEL::Exception(msg);
3993           }
3994         //
3995         double val;
3996         DataArrayDouble *a;
3997         DataArrayDoubleTuple *aa;
3998         std::vector<double> bb;
3999         int sw;
4000         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4001         switch(sw)
4002           {
4003           case 1:
4004             {
4005               if(!self->getArray())
4006                 throw INTERP_KERNEL::Exception(msg2);
4007               self->getArray()->applyLin(1.,val);
4008               Py_XINCREF(trueSelf);
4009               return trueSelf;
4010             }
4011           case 2:
4012             {
4013               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4014               ret2->setArray(a);
4015               *self+=*ret2;
4016               Py_XINCREF(trueSelf);
4017               return trueSelf;
4018             }
4019           case 3:
4020             {
4021               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4022               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4023               ret2->setArray(aaa);
4024               *self+=*ret2;
4025               Py_XINCREF(trueSelf);
4026               return trueSelf;
4027             }
4028           case 4:
4029             {
4030               if(!self->getArray())
4031                 throw INTERP_KERNEL::Exception(msg2);
4032               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4033               self->getArray()->addEqual(aaa);
4034               Py_XINCREF(trueSelf);
4035               return trueSelf;
4036             }
4037           default:
4038             { throw INTERP_KERNEL::Exception(msg); }
4039           }
4040       }
4041
4042       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4043       {
4044         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.";
4045         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4046         void *argp;
4047         //
4048         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4049           {
4050             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4051             if(other)
4052               {
4053                 *self-=*other;
4054                 Py_XINCREF(trueSelf);
4055                 return trueSelf;
4056               }
4057             else
4058               throw INTERP_KERNEL::Exception(msg);
4059           }
4060         //
4061         double val;
4062         DataArrayDouble *a;
4063         DataArrayDoubleTuple *aa;
4064         std::vector<double> bb;
4065         int sw;
4066         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4067         switch(sw)
4068           {
4069           case 1:
4070             {
4071               if(!self->getArray())
4072                 throw INTERP_KERNEL::Exception(msg2);
4073               self->getArray()->applyLin(1.,-val);
4074               Py_XINCREF(trueSelf);
4075               return trueSelf;
4076             }
4077           case 2:
4078             {
4079               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4080               ret2->setArray(a);
4081               *self-=*ret2;
4082               Py_XINCREF(trueSelf);
4083               return trueSelf;
4084             }
4085           case 3:
4086             {
4087               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4088               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4089               ret2->setArray(aaa);
4090               *self-=*ret2;
4091               Py_XINCREF(trueSelf);
4092               return trueSelf;
4093             }
4094           case 4:
4095             {
4096               if(!self->getArray())
4097                 throw INTERP_KERNEL::Exception(msg2);
4098               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4099               self->getArray()->substractEqual(aaa);
4100               Py_XINCREF(trueSelf);
4101               return trueSelf;
4102             }
4103           default:
4104             { throw INTERP_KERNEL::Exception(msg); }
4105           }
4106       }
4107
4108       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4109       {
4110         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.";
4111         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4112         void *argp;
4113         //
4114         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4115           {
4116             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4117             if(other)
4118               {
4119                 *self*=*other;
4120                 Py_XINCREF(trueSelf);
4121                 return trueSelf;
4122               }
4123             else
4124               throw INTERP_KERNEL::Exception(msg);
4125           }
4126         //
4127         double val;
4128         DataArrayDouble *a;
4129         DataArrayDoubleTuple *aa;
4130         std::vector<double> bb;
4131         int sw;
4132         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4133         switch(sw)
4134           {
4135           case 1:
4136             {
4137               if(!self->getArray())
4138                 throw INTERP_KERNEL::Exception(msg2);
4139               self->getArray()->applyLin(val,0);
4140               Py_XINCREF(trueSelf);
4141               return trueSelf;
4142             }
4143           case 2:
4144             {
4145               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4146               ret2->setArray(a);
4147               *self*=*ret2;
4148               Py_XINCREF(trueSelf);
4149               return trueSelf;
4150             }
4151           case 3:
4152             {
4153               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4154               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4155               ret2->setArray(aaa);
4156               *self*=*ret2;
4157               Py_XINCREF(trueSelf);
4158               return trueSelf;
4159             }
4160           case 4:
4161             {
4162               if(!self->getArray())
4163                 throw INTERP_KERNEL::Exception(msg2);
4164               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4165               self->getArray()->multiplyEqual(aaa);
4166               Py_XINCREF(trueSelf);
4167               return trueSelf;
4168             }
4169           default:
4170             { throw INTERP_KERNEL::Exception(msg); }
4171           }
4172       }
4173
4174       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4175       {
4176         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.";
4177         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4178         void *argp;
4179         //
4180         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4181           {
4182             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4183             if(other)
4184               {
4185                 *self/=*other;
4186                 Py_XINCREF(trueSelf);
4187                 return trueSelf;
4188               }
4189             else
4190               throw INTERP_KERNEL::Exception(msg);
4191           }
4192         //
4193         double val;
4194         DataArrayDouble *a;
4195         DataArrayDoubleTuple *aa;
4196         std::vector<double> bb;
4197         int sw;
4198         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4199         switch(sw)
4200           {
4201           case 1:
4202             {
4203               if(val==0.)
4204                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4205               if(!self->getArray())
4206                 throw INTERP_KERNEL::Exception(msg2);
4207               self->getArray()->applyLin(1./val,0);
4208               Py_XINCREF(trueSelf);
4209               return trueSelf;
4210             }
4211           case 2:
4212             {
4213               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4214               ret2->setArray(a);
4215               *self/=*ret2;
4216               Py_XINCREF(trueSelf);
4217               return trueSelf;
4218             }
4219           case 3:
4220             {
4221               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4222               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4223               ret2->setArray(aaa);
4224               *self/=*ret2;
4225               Py_XINCREF(trueSelf);
4226               return trueSelf;
4227             }
4228           case 4:
4229             {
4230               if(!self->getArray())
4231                 throw INTERP_KERNEL::Exception(msg2);
4232               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4233               self->getArray()->divideEqual(aaa);
4234               Py_XINCREF(trueSelf);
4235               return trueSelf;
4236             }
4237           default:
4238             { throw INTERP_KERNEL::Exception(msg); }
4239           }
4240       }
4241
4242       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4243       {
4244         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.";
4245         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4246         void *argp;
4247         //
4248         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4249           {
4250             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4251             if(other)
4252               {
4253                 *self^=*other;
4254                 Py_XINCREF(trueSelf);
4255                 return trueSelf;
4256               }
4257             else
4258               throw INTERP_KERNEL::Exception(msg);
4259           }
4260         //
4261         double val;
4262         DataArrayDouble *a;
4263         DataArrayDoubleTuple *aa;
4264         std::vector<double> bb;
4265         int sw;
4266         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4267         switch(sw)
4268           {
4269           case 1:
4270             {
4271               if(!self->getArray())
4272                 throw INTERP_KERNEL::Exception(msg2);
4273               self->getArray()->applyPow(val);
4274               Py_XINCREF(trueSelf);
4275               return trueSelf;
4276             }
4277           case 2:
4278             {
4279               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4280               ret2->setArray(a);
4281               *self^=*ret2;
4282               Py_XINCREF(trueSelf);
4283               return trueSelf;
4284             }
4285           case 3:
4286             {
4287               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4288               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4289               ret2->setArray(aaa);
4290               *self^=*ret2;
4291               Py_XINCREF(trueSelf);
4292               return trueSelf;
4293             }
4294           case 4:
4295             {
4296               if(!self->getArray())
4297                 throw INTERP_KERNEL::Exception(msg2);
4298               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4299               self->getArray()->powEqual(aaa);
4300               Py_XINCREF(trueSelf);
4301               return trueSelf;
4302             }
4303           default:
4304             { throw INTERP_KERNEL::Exception(msg); }
4305           }
4306       }
4307
4308       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4309       {
4310         std::vector<const MEDCouplingFieldDouble *> tmp;
4311         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4312         return MEDCouplingFieldDouble::MergeFields(tmp);
4313       }
4314
4315       static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4316       {
4317         std::vector<const MEDCouplingFieldDouble *> tmp;
4318         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4319         MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4320       }
4321     }
4322   };
4323
4324   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4325   {
4326   public:
4327     int getNumberOfFields() const;
4328     MEDCouplingMultiFields *deepCpy() const;
4329     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4330     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4331     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4332     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4333     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4334     %extend
4335        {
4336          std::string __str__() const throw(INTERP_KERNEL::Exception)
4337          {
4338            return self->simpleRepr();
4339          }
4340          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4341          {
4342            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4343            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4344            int sz=tmp.size();
4345            std::vector<MEDCouplingFieldDouble *> fs(sz);
4346            for(int i=0;i<sz;i++)
4347              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4348            return MEDCouplingMultiFields::New(fs);
4349          }
4350          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4351          {
4352            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4353            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4354            int sz=tmp.size();
4355            std::vector<MEDCouplingFieldDouble *> fs(sz);
4356            for(int i=0;i<sz;i++)
4357              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4358            return MEDCouplingMultiFields::New(fs);
4359          }
4360          PyObject *getFields() const
4361          {
4362            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4363            int sz=fields.size();
4364            PyObject *res = PyList_New(sz);
4365            for(int i=0;i<sz;i++)
4366              {
4367                if(fields[i])
4368                  {
4369                    fields[i]->incrRef();
4370                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4371                  }
4372                else
4373                  {
4374                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4375                  }
4376              }
4377            return res;
4378          }
4379          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4380          {
4381            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4382            if(ret)
4383              {
4384                ret->incrRef();
4385                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4386              }
4387            else
4388              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4389          }
4390          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4391          {
4392            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4393            int sz=ms.size();
4394            PyObject *res = PyList_New(sz);
4395            for(int i=0;i<sz;i++)
4396              {
4397                if(ms[i])
4398                  {
4399                    ms[i]->incrRef();
4400                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4401                  }
4402                else
4403                  {
4404                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4405                  }
4406              }
4407            return res;
4408          }
4409          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4410          {
4411            std::vector<int> refs;
4412            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4413            int sz=ms.size();
4414            PyObject *res = PyList_New(sz);
4415            for(int i=0;i<sz;i++)
4416              {
4417                if(ms[i])
4418                  {
4419                    ms[i]->incrRef();
4420                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4421                  }
4422                else
4423                  {
4424                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4425                  }
4426              }
4427            //
4428            PyObject *ret=PyTuple_New(2);
4429            PyTuple_SetItem(ret,0,res);
4430            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4431            return ret;
4432          }
4433          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4434          {
4435            std::vector<DataArrayDouble *> ms=self->getArrays();
4436            int sz=ms.size();
4437            PyObject *res = PyList_New(sz);
4438            for(int i=0;i<sz;i++)
4439              {
4440                if(ms[i])
4441                  {
4442                    ms[i]->incrRef();
4443                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4444                  }
4445                else
4446                  {
4447                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4448                  }
4449              }
4450            return res;
4451          }
4452          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4453          {
4454            std::vector< std::vector<int> > refs;
4455            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4456            int sz=ms.size();
4457            PyObject *res = PyList_New(sz);
4458            PyObject *res2 = PyList_New(sz);
4459            for(int i=0;i<sz;i++)
4460              {
4461                if(ms[i])
4462                  {
4463                    ms[i]->incrRef();
4464                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4465                  }
4466                else
4467                  {
4468                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4469                  }
4470                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4471              }
4472            //
4473            PyObject *ret=PyTuple_New(2);
4474            PyTuple_SetItem(ret,0,res);
4475            PyTuple_SetItem(ret,1,res2);
4476            return ret;
4477          }
4478        }
4479   };
4480   
4481   class MEDCouplingDefinitionTime
4482   {
4483   public:
4484     MEDCouplingDefinitionTime();
4485     void assign(const MEDCouplingDefinitionTime& other);
4486     bool isEqual(const MEDCouplingDefinitionTime& other) const;
4487     double getTimeResolution() const;
4488     std::vector<double> getHotSpotsTime() const;
4489     %extend
4490       {
4491         std::string __str__() const throw(INTERP_KERNEL::Exception)
4492           {
4493             std::ostringstream oss;
4494             self->appendRepr(oss);
4495             return oss.str();
4496           }
4497
4498         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4499         {
4500           int meshId,arrId,arrIdInField,fieldId;
4501           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4502           PyObject *res=PyList_New(4);
4503           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4504           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4505           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4506           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4507           return res;
4508         }
4509
4510         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4511         {
4512           int meshId,arrId,arrIdInField,fieldId;
4513           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4514           PyObject *res=PyList_New(4);
4515           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4516           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4517           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4518           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4519           return res;
4520         }
4521       }
4522   };
4523
4524   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4525   {
4526   public:
4527     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4528     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4529     
4530     %extend
4531       {
4532         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4533           {
4534             std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4535             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4536             int sz=tmp.size();
4537             std::vector<MEDCouplingFieldDouble *> fs(sz);
4538             for(int i=0;i<sz;i++)
4539               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4540             return MEDCouplingFieldOverTime::New(fs);
4541           }
4542         std::string __str__() const throw(INTERP_KERNEL::Exception)
4543           {
4544             return self->simpleRepr();
4545           }
4546         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4547         {
4548           std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4549           convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4550            int sz=tmp.size();
4551            std::vector<MEDCouplingFieldDouble *> fs(sz);
4552            for(int i=0;i<sz;i++)
4553              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4554            return MEDCouplingFieldOverTime::New(fs);
4555          }
4556       }
4557   };
4558 }
4559
4560 %pythoncode %{
4561 import os
4562 __filename=os.environ.get('PYTHONSTARTUP')
4563 if __filename and os.path.isfile(__filename):
4564   execfile(__filename)
4565   pass
4566 %}