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