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