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