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