]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDCoupling_Swig/MEDCouplingCommon.i
Salome HOME
new algorithm for patch creation with additional options.
[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 getEfficiencyGoal() const throw(INTERP_KERNEL::Exception);
431     void setEfficiencyGoal(double efficiency) throw(INTERP_KERNEL::Exception);
432     double getEfficiencyThreshold() const throw(INTERP_KERNEL::Exception);
433     void setEfficiencyThreshold(double efficiencyThreshold) throw(INTERP_KERNEL::Exception);
434     int getMinimumPatchLength() const throw(INTERP_KERNEL::Exception);
435     void setMinimumPatchLength(int minPatchLength) throw(INTERP_KERNEL::Exception);
436     int getMaximumPatchLength() const throw(INTERP_KERNEL::Exception);
437     void setMaximumPatchLength(int maxPatchLength) throw(INTERP_KERNEL::Exception);
438     int getMaximumNbOfCellsInPatch() const throw(INTERP_KERNEL::Exception);
439     void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) throw(INTERP_KERNEL::Exception);
440     void copyOptions(const BoxSplittingOptions & other) throw(INTERP_KERNEL::Exception);
441     std::string printOptions() const throw(INTERP_KERNEL::Exception);
442     %extend
443     {
444       std::string __str__() const throw(INTERP_KERNEL::Exception)
445       {
446         return self->printOptions();
447       }
448     }
449   };
450 }
451
452 namespace ParaMEDMEM
453 {
454   typedef enum
455     {
456       ON_CELLS = 0,
457       ON_NODES = 1,
458       ON_GAUSS_PT = 2,
459       ON_GAUSS_NE = 3,
460       ON_NODES_KR = 4
461     } TypeOfField;
462
463   typedef enum
464     {
465       NO_TIME = 4,
466       ONE_TIME = 5,
467       LINEAR_TIME = 6,
468       CONST_ON_TIME_INTERVAL = 7
469     } TypeOfTimeDiscretization;
470
471   typedef enum
472     {
473       UNSTRUCTURED = 5,
474       CARTESIAN = 7,
475       EXTRUDED = 8,
476       CURVE_LINEAR = 9,
477       SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED = 10,
478       SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED = 11,
479       IMAGE_GRID = 12
480     } MEDCouplingMeshType;
481
482   class DataArrayInt;
483   class DataArrayDouble;
484   class MEDCouplingUMesh;
485   class MEDCouplingFieldDouble;
486
487   %extend RefCountObject
488   {
489     std::string getHiddenCppPointer() const
490     {
491       std::ostringstream oss; oss << "C++ Pointer address is : " << self;
492       return oss.str();
493     }
494   }
495
496   %extend MEDCouplingGaussLocalization
497   {
498     std::string __str__() const throw(INTERP_KERNEL::Exception)
499     {
500       return self->getStringRepr();
501     }
502
503     std::string __repr__() const throw(INTERP_KERNEL::Exception)
504     {
505       std::ostringstream oss; oss << "MEDCouplingGaussLocalization C++ instance at " << self << "." << std::endl;
506       oss << self->getStringRepr();
507       return oss.str();
508     }
509   }
510
511   //== MEDCouplingMesh
512   
513   class MEDCouplingMesh : public RefCountObject, public TimeLabel
514   {
515   public:
516     void setName(const std::string& name);
517     std::string getName() const;
518     void setDescription(const std::string& descr);
519     std::string getDescription() const;
520     void setTime(double val, int iteration, int order);
521     void setTimeUnit(const std::string& unit);
522     std::string getTimeUnit() const;
523     virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
524     bool isStructured() const throw(INTERP_KERNEL::Exception);
525     virtual MEDCouplingMesh *deepCpy() const;
526     virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
527     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
528     virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
529     virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
530     virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
531     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
532     virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
533     virtual void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
534     virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
535     virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
536     virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
537     virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
538     virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
539     virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
540     virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
541     virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
542     virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
543     virtual DataArrayInt *computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception);
544     virtual DataArrayInt *computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
545     virtual MEDCouplingMesh *buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
546     virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
547     virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
548     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
549     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
550     void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
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     double computeSquareness() const throw(INTERP_KERNEL::Exception);
2871     virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
2872     std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
2873     MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
2874     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
2875     MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
2876     static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
2877     static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
2878     static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
2879     %extend
2880     {
2881       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
2882       {
2883         int tmpp1=-1,tmpp2=-1;
2884         std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
2885         std::vector< std::pair<int,int> > inp;
2886         if(tmpp2==2)
2887           {
2888             inp.resize(tmpp1);
2889             for(int i=0;i<tmpp1;i++)
2890               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2891           }
2892         else if(tmpp2==1)
2893           {
2894             if(tmpp1%2!=0)
2895               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
2896             inp.resize(tmpp1/2);
2897             for(int i=0;i<tmpp1/2;i++)
2898               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
2899           }
2900         else
2901           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
2902         return self->buildStructuredSubPart(inp);
2903       }
2904
2905       static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
2906       {
2907         std::vector< std::pair<int,int> > inp;
2908         convertPyToVectorPairInt(part,inp);
2909         //
2910         int szArr,sw,iTypppArr;
2911         std::vector<int> stdvecTyyppArr;
2912         const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
2913         std::vector<int> tmp5(tmp4,tmp4+szArr);
2914         //
2915         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
2916       }
2917
2918       static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2919       {
2920         std::vector< std::pair<int,int> > inp;
2921         convertPyToVectorPairInt(part,inp);
2922         MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
2923       }
2924
2925       static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
2926       {
2927         std::vector< std::pair<int,int> > inp;
2928         convertPyToVectorPairInt(part,inp);
2929         MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
2930       }
2931
2932       static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
2933       {
2934         std::vector< std::pair<int,int> > inp;
2935         convertPyToVectorPairInt(part,inp);
2936         std::vector<int> stWithGhost;
2937         std::vector< std::pair<int,int> > partWithGhost;
2938         MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
2939         PyObject *ret(PyTuple_New(2));
2940         PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
2941         PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
2942         return ret;
2943       }
2944
2945       static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
2946       {
2947         std::vector< std::pair<int,int> > inp;
2948         convertPyToVectorPairInt(partCompactFormat,inp);
2949         return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
2950       }
2951
2952       static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
2953       {
2954         std::vector< std::pair<int,int> > inp;
2955         convertPyToVectorPairInt(part,inp);
2956         return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
2957       }
2958
2959       static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
2960       {
2961         int szArr,sw,iTypppArr;
2962         std::vector<int> stdvecTyyppArr;
2963         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
2964         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
2965       }
2966
2967       static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
2968       {
2969         int szArr,sw,iTypppArr;
2970         std::vector<int> stdvecTyyppArr;
2971         const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
2972         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
2973       }
2974
2975       static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
2976       {
2977         std::vector< std::pair<int,int> > inp;
2978         convertPyToVectorPairInt(partCompactFormat,inp);
2979         return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
2980       }
2981
2982       static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
2983       {
2984         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
2985         PyObject *retPy=PyList_New(ret.size());
2986         for(std::size_t i=0;i<ret.size();i++)
2987           {
2988             PyObject *tmp=PyTuple_New(2);
2989             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
2990             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
2991             PyList_SetItem(retPy,i,tmp);
2992           }
2993         return retPy;
2994       }
2995
2996       static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
2997       {
2998         std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
2999         convertPyToVectorPairInt(r1,r1Cpp);
3000         convertPyToVectorPairInt(r2,r2Cpp);
3001         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3002         PyObject *retPy=PyList_New(ret.size());
3003         for(std::size_t i=0;i<ret.size();i++)
3004           {
3005             PyObject *tmp=PyTuple_New(2);
3006             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3007             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3008             PyList_SetItem(retPy,i,tmp);
3009           }
3010         return retPy;
3011       }
3012
3013       static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3014       {
3015         int szArr,sw,iTypppArr;
3016         std::vector<int> stdvecTyyppArr;
3017         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3018         int szArr2,sw2,iTypppArr2;
3019         std::vector<int> stdvecTyyppArr2;
3020         const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3021         std::vector<int> tmp3(tmp2,tmp2+szArr2);
3022         std::vector< std::pair<int,int> > partCompactFormat;
3023         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3024         PyObject *ret=PyTuple_New(2);
3025         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3026         PyTuple_SetItem(ret,0,ret0Py);
3027         PyObject *ret1Py=PyList_New(partCompactFormat.size());
3028         for(std::size_t i=0;i<partCompactFormat.size();i++)
3029           {
3030             PyObject *tmp4=PyTuple_New(2);
3031             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3032             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3033             PyList_SetItem(ret1Py,i,tmp4);
3034           }
3035         PyTuple_SetItem(ret,1,ret1Py);
3036         return ret;
3037       }
3038
3039       static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3040       {
3041         std::vector< std::pair<int,int> > param0,param1,ret;
3042         convertPyToVectorPairInt(bigInAbs,param0);
3043         convertPyToVectorPairInt(partOfBigInAbs,param1);
3044         MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3045         PyObject *retPy(PyList_New(ret.size()));
3046         for(std::size_t i=0;i<ret.size();i++)
3047           {
3048             PyObject *tmp(PyTuple_New(2));
3049             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3050             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3051             PyList_SetItem(retPy,i,tmp);
3052           }
3053         return retPy;
3054       }
3055
3056       static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3057       {
3058         std::vector< std::pair<int,int> > param0;
3059         convertPyToVectorPairInt(part,param0);
3060         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3061         PyObject *retPy(PyList_New(ret.size()));
3062         for(std::size_t i=0;i<ret.size();i++)
3063           {
3064             PyObject *tmp(PyTuple_New(2));
3065             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3066             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3067             PyList_SetItem(retPy,i,tmp);
3068           }
3069         return retPy;
3070       }
3071
3072       static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3073       {
3074         std::vector< std::pair<int,int> > param0,param1;
3075         convertPyToVectorPairInt(startingFrom,param0);
3076         convertPyToVectorPairInt(goingTo,param1);
3077         return  MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3078       }
3079
3080       static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3081       {
3082         std::vector< std::pair<int,int> > param0,param1,ret;
3083         convertPyToVectorPairInt(bigInAbs,param0);
3084         convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3085         MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3086         PyObject *retPy(PyList_New(ret.size()));
3087         for(std::size_t i=0;i<ret.size();i++)
3088           {
3089             PyObject *tmp(PyTuple_New(2));
3090             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3091             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3092             PyList_SetItem(retPy,i,tmp);
3093           }
3094         return retPy;
3095       }
3096     }
3097   };
3098
3099   //== MEDCouplingCMesh
3100   
3101   class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3102   {
3103   public:
3104     static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3105     static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3106     MEDCouplingCMesh *clone(bool recDeepCpy) const;
3107     void setCoords(const DataArrayDouble *coordsX,
3108                    const DataArrayDouble *coordsY=0,
3109                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3110     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3111     %extend {
3112       MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3113       {
3114         return MEDCouplingCMesh::New();
3115       }
3116       MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3117       {
3118         return MEDCouplingCMesh::New(meshName);
3119       }
3120       std::string __str__() const throw(INTERP_KERNEL::Exception)
3121       {
3122         return self->simpleRepr();
3123       }
3124       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3125       {
3126         std::ostringstream oss;
3127         self->reprQuickOverview(oss);
3128         return oss.str();
3129       }
3130       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3131       {
3132         DataArrayDouble *ret=self->getCoordsAt(i);
3133         if(ret)
3134           ret->incrRef();
3135         return ret;
3136       }
3137     }
3138   };
3139
3140   //== MEDCouplingCMesh End
3141
3142   //== MEDCouplingCurveLinearMesh
3143
3144   class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3145   {
3146   public:
3147     static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3148     static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3149     MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
3150     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3151     %extend {
3152       MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3153       {
3154         return MEDCouplingCurveLinearMesh::New();
3155       }
3156       MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3157       {
3158         return MEDCouplingCurveLinearMesh::New(meshName);
3159       }
3160       std::string __str__() const throw(INTERP_KERNEL::Exception) 
3161       {
3162         return self->simpleRepr();
3163       }
3164       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3165       {
3166         std::ostringstream oss;
3167         self->reprQuickOverview(oss);
3168         return oss.str();
3169       }
3170       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3171       {
3172         DataArrayDouble *ret=self->getCoords();
3173         if(ret)
3174           ret->incrRef();
3175         return ret;
3176       }
3177       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3178       {
3179         int szArr,sw,iTypppArr;
3180         std::vector<int> stdvecTyyppArr;
3181         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3182         self->setNodeGridStructure(tmp,tmp+szArr);
3183       }
3184     }
3185   };
3186
3187   //== MEDCouplingCurveLinearMesh End
3188
3189   //== MEDCouplingIMesh
3190
3191   class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
3192   {
3193   public:
3194     static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3195     //
3196     void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3197     std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3198     std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3199     std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3200     void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3201     std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3202     double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3203     MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3204     void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3205     MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3206     MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3207     %extend
3208     {
3209       MEDCouplingIMesh()
3210       {
3211         return MEDCouplingIMesh::New();
3212       }
3213       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3214       {
3215         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3216         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3217         const int *nodeStrctPtr(0);
3218         const double *originPtr(0),*dxyzPtr(0);
3219         int sw,sz,val0;
3220         std::vector<int> bb0;
3221         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3222         //
3223         double val,val2;
3224         std::vector<double> bb,bb2;
3225         int sz1,sz2;
3226         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3227         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3228         //
3229         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3230       }
3231
3232       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3233       {
3234         return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3235       }
3236
3237       void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3238       {
3239         int sw,sz,val0;
3240         std::vector<int> bb0;
3241         const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3242         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3243       }
3244
3245       void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3246       {
3247         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3248         double val;
3249         DataArrayDouble *a;
3250         DataArrayDoubleTuple *aa;
3251         std::vector<double> bb;
3252         int sw,nbTuples;
3253         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3254         self->setOrigin(originPtr,originPtr+nbTuples);
3255       }
3256       
3257       void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3258       {
3259         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3260         double val;
3261         DataArrayDouble *a;
3262         DataArrayDoubleTuple *aa;
3263         std::vector<double> bb;
3264         int sw,nbTuples;
3265         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3266         self->setDXYZ(originPtr,originPtr+nbTuples);
3267       }
3268
3269       static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3270       {
3271         std::vector< std::pair<int,int> > inp;
3272         convertPyToVectorPairInt(fineLocInCoarse,inp);
3273         MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3274       }
3275
3276       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)
3277       {
3278         std::vector< std::pair<int,int> > inp;
3279         convertPyToVectorPairInt(fineLocInCoarse,inp);
3280         MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3281       }
3282
3283       static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3284       {
3285         std::vector< std::pair<int,int> > inp;
3286         convertPyToVectorPairInt(fineLocInCoarse,inp);
3287         MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3288       }
3289
3290       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)
3291       {
3292         std::vector< std::pair<int,int> > inp;
3293         convertPyToVectorPairInt(fineLocInCoarse,inp);
3294         MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3295       }
3296
3297       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)
3298       {
3299         std::vector< std::pair<int,int> > inp;
3300         convertPyToVectorPairInt(fineLocInCoarse,inp);
3301         MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3302       }
3303
3304       std::string __str__() const throw(INTERP_KERNEL::Exception)
3305       {
3306         return self->simpleRepr();
3307       }
3308       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3309       {
3310         std::ostringstream oss;
3311         self->reprQuickOverview(oss);
3312         return oss.str();
3313       }
3314     }
3315   };
3316
3317   //== MEDCouplingIMesh End
3318
3319 }
3320
3321 namespace ParaMEDMEM
3322 {
3323   class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
3324   {
3325   public:
3326     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
3327     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3328     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3329     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3330     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3331     void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3332     void setName(const char *name) throw(INTERP_KERNEL::Exception);
3333     std::string getDescription() const throw(INTERP_KERNEL::Exception);
3334     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3335     std::string getName() const throw(INTERP_KERNEL::Exception);
3336     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3337     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3338     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3339     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3340     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3341     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3342     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3343     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3344                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3345     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3346     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3347     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3348     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3349     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3350     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3351     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3352     %extend {
3353       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3354       {
3355         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3356         if(ret1)
3357           ret1->incrRef();
3358         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3359       }
3360
3361       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3362       {
3363         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3364         if(ret)
3365           ret->incrRef();
3366         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3367       }
3368
3369       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3370       {
3371         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3372         return convertIntArrToPyList3(ret);
3373       }
3374
3375       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3376       {
3377         std::string ret1;
3378         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3379         PyObject *ret=PyTuple_New(2);
3380         PyObject *ret0Py=ret0?Py_True:Py_False;
3381         Py_XINCREF(ret0Py);
3382         PyTuple_SetItem(ret,0,ret0Py);
3383         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3384         return ret;
3385       }
3386
3387       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3388       {
3389         DataArrayInt *ret1=0;
3390         MEDCouplingMesh *ret0=0;
3391         void *da=0;
3392         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3393         if (!SWIG_IsOK(res1))
3394           {
3395             int size;
3396             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3397             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3398           }
3399         else
3400           {
3401             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3402             if(!da2)
3403               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3404             da2->checkAllocated();
3405             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3406           }
3407         PyObject *res = PyList_New(2);
3408         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3409         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3410         return res;
3411       }
3412
3413       PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3414       {
3415         DataArrayInt *ret1=0;
3416         int bb,ee,ss;
3417         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3418         PyObject *res=PyTuple_New(2);
3419         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3420         if(ret1)
3421           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
3422         else
3423           {
3424             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3425             PyTuple_SetItem(res,1,res1);
3426           }
3427         return res;
3428       }
3429
3430       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3431       {
3432         int sw,sz(-1);
3433         int v0; std::vector<int> v1;
3434         const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3435         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3436       }
3437
3438       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3439                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3440       {
3441         void *da=0;
3442         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 |  0 );
3443         if (!SWIG_IsOK(res1))
3444           {
3445             int size;
3446             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3447             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3448           }
3449         else
3450           {
3451             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3452             if(!da2)
3453               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3454             da2->checkAllocated();
3455             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3456           }
3457       }
3458
3459       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3460       {
3461         std::vector<int> tmp;
3462         self->getCellIdsHavingGaussLocalization(locId,tmp);
3463         DataArrayInt *ret=DataArrayInt::New();
3464         ret->alloc((int)tmp.size(),1);
3465         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3466         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
3467       }
3468       
3469       int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3470       {
3471         std::vector<int> inp0;
3472         convertPyToNewIntArr4(code,1,3,inp0);
3473         std::vector<const DataArrayInt *> inp1;
3474         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
3475         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3476       }
3477     }
3478   };
3479   
3480   class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
3481   {
3482   public:
3483     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3484     static MEDCouplingFieldTemplate *New(TypeOfField type);
3485     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3486     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3487     %extend
3488        {
3489          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3490          {
3491            return MEDCouplingFieldTemplate::New(f);
3492          }
3493          
3494          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3495          {
3496            return MEDCouplingFieldTemplate::New(type);
3497          }
3498          
3499          std::string __str__() const throw(INTERP_KERNEL::Exception)
3500          {
3501            return self->simpleRepr();
3502          }
3503          
3504          std::string __repr__() const throw(INTERP_KERNEL::Exception)
3505          {
3506            std::ostringstream oss;
3507            self->reprQuickOverview(oss);
3508            return oss.str();
3509          }
3510        }
3511   };
3512   
3513   class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
3514   {
3515   public:
3516     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3517     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3518     void setTimeUnit(const std::string& unit);
3519     std::string getTimeUnit() const;
3520     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3521     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3522     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3523     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3524     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3525     void writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3526     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3527     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3528     MEDCouplingFieldDouble *deepCpy() const;
3529     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
3530     MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3531     MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3532     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3533     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3534     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3535     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3536     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3537     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3538     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3539     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3540     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3541     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3542     void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3543     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3544     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3545     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3546     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3547     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3548     void setIteration(int it) throw(INTERP_KERNEL::Exception);
3549     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3550     void setOrder(int order) throw(INTERP_KERNEL::Exception);
3551     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3552     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3553     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3554     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3555     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3556     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3557     bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3558     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3559     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3560     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3561     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3562     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3563     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3564     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3565     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3566     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3567     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3568     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3569     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3570     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3571     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3572     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3573     void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3574     void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3575     void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3576     void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3577     void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3578     void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3579     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
3580     void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
3581     void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
3582     void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
3583     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
3584     double getMaxValue() const throw(INTERP_KERNEL::Exception);
3585     double getMinValue() const throw(INTERP_KERNEL::Exception);
3586     double getAverageValue() const throw(INTERP_KERNEL::Exception);
3587     double norm2() const throw(INTERP_KERNEL::Exception);
3588     double normMax() const throw(INTERP_KERNEL::Exception);
3589     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
3590     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3591     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
3592     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
3593     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
3594     DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
3595     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
3596     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3597     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3598     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3599     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3600     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3601     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3602     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3603     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3604     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3605     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3606     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3607     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3608     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
3609     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
3610     MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
3611     %extend {
3612       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
3613       {
3614         return MEDCouplingFieldDouble::New(type,td);
3615       }
3616
3617       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
3618       {
3619         return MEDCouplingFieldDouble::New(ft,td);
3620       }
3621
3622       std::string __str__() const throw(INTERP_KERNEL::Exception)
3623       {
3624         return self->simpleRepr();
3625       }
3626
3627       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3628       {
3629         std::ostringstream oss;
3630         self->reprQuickOverview(oss);
3631         return oss.str();
3632       }
3633
3634       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
3635       {
3636         DataArrayDouble *ret=self->getArray();
3637         if(ret)
3638           ret->incrRef();
3639         return ret;
3640       }
3641
3642       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
3643       {
3644         std::vector<DataArrayDouble *> arrs=self->getArrays();
3645         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
3646           if(*it)
3647             (*it)->incrRef();
3648         int sz=arrs.size();
3649         PyObject *ret=PyTuple_New(sz);
3650         for(int i=0;i<sz;i++)
3651           {
3652             if(arrs[i])
3653               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
3654             else
3655               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
3656           }
3657         return ret;
3658       }
3659
3660       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
3661       {
3662         std::vector<const DataArrayDouble *> tmp;
3663         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
3664         int sz=tmp.size();
3665         std::vector<DataArrayDouble *> arrs(sz);
3666         for(int i=0;i<sz;i++)
3667           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
3668         self->setArrays(arrs);
3669       }
3670
3671       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
3672       {
3673         DataArrayDouble *ret=self->getEndArray();
3674         if(ret)
3675           ret->incrRef();
3676         return ret;
3677       }
3678
3679       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
3680       {
3681         double val;
3682         DataArrayDouble *a;
3683         DataArrayDoubleTuple *aa;
3684         std::vector<double> bb;
3685         int sw;
3686         const MEDCouplingMesh *mesh=self->getMesh();
3687         if(!mesh)
3688           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3689         int spaceDim=mesh->getSpaceDimension();
3690         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3691         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3692         //
3693         int sz=self->getNumberOfComponents();
3694         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3695         self->getValueOn(spaceLoc,res);
3696         return convertDblArrToPyList(res,sz);
3697       }
3698
3699        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
3700        {
3701          int sz=self->getNumberOfComponents();
3702          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3703          self->getValueOnPos(i,j,k,res);
3704          return convertDblArrToPyList(res,sz);
3705        }
3706
3707       DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
3708       {
3709         const MEDCouplingMesh *mesh(self->getMesh());
3710         if(!mesh)
3711           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
3712         //
3713         int sw,nbPts;
3714         double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
3715         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
3716                                                          mesh->getSpaceDimension(),true,nbPts);
3717         return self->getValueOnMulti(inp,nbPts);
3718       }
3719
3720       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
3721       {
3722         double val;
3723         DataArrayDouble *a;
3724         DataArrayDoubleTuple *aa;
3725         std::vector<double> bb;
3726         int sw;
3727         const MEDCouplingMesh *mesh=self->getMesh();
3728         if(!mesh)
3729           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
3730         int spaceDim=mesh->getSpaceDimension();
3731         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
3732         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
3733         //
3734         //
3735         int sz=self->getNumberOfComponents();
3736         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
3737         self->getValueOn(spaceLoc,time,res);
3738         return convertDblArrToPyList(res,sz);
3739       }
3740
3741       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
3742       {
3743         if(self->getArray()!=0)
3744           ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
3745         else
3746           {
3747             MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
3748             ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
3749             self->setArray(arr);
3750           }
3751       }
3752       
3753       PyObject *getTime() throw(INTERP_KERNEL::Exception)
3754       {
3755         int tmp1,tmp2;
3756         double tmp0=self->getTime(tmp1,tmp2);
3757         PyObject *res = PyList_New(3);
3758         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3759         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3760         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3761         return res;
3762       }
3763
3764       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
3765       {
3766         int tmp1,tmp2;
3767         double tmp0=self->getStartTime(tmp1,tmp2);
3768         PyObject *res = PyList_New(3);
3769         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3770         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3771         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3772         return res;
3773       }
3774
3775       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
3776       {
3777         int tmp1,tmp2;
3778         double tmp0=self->getEndTime(tmp1,tmp2);
3779         PyObject *res = PyList_New(3);
3780         PyList_SetItem(res,0,SWIG_From_double(tmp0));
3781         PyList_SetItem(res,1,SWIG_From_int(tmp1));
3782         PyList_SetItem(res,2,SWIG_From_int(tmp2));
3783         return res;
3784       }
3785       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
3786       {
3787         int sz=self->getNumberOfComponents();
3788         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3789         self->accumulate(tmp);
3790         return convertDblArrToPyList(tmp,sz);
3791       }
3792       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
3793       {
3794         int sz=self->getNumberOfComponents();
3795         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3796         self->integral(isWAbs,tmp);
3797         return convertDblArrToPyList(tmp,sz);
3798       }
3799       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
3800       {
3801         int sz=self->getNumberOfComponents();
3802         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3803         self->getWeightedAverageValue(tmp,isWAbs);
3804         return convertDblArrToPyList(tmp,sz);
3805       }
3806       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
3807       {
3808         int sz=self->getNumberOfComponents();
3809         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3810         self->normL1(tmp);
3811         return convertDblArrToPyList(tmp,sz);
3812       }
3813       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
3814       {
3815         int sz=self->getNumberOfComponents();
3816         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
3817         self->normL2(tmp);
3818         return convertDblArrToPyList(tmp,sz);
3819       }
3820       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3821       {
3822         int szArr,sw,iTypppArr;
3823         std::vector<int> stdvecTyyppArr;
3824         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3825         self->renumberCells(tmp,check);
3826       }
3827       
3828       void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
3829       {
3830         int szArr,sw,iTypppArr;
3831         std::vector<int> stdvecTyyppArr;
3832         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3833         self->renumberCellsWithoutMesh(tmp,check);
3834       }
3835       
3836       void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3837       {
3838         int szArr,sw,iTypppArr;
3839         std::vector<int> stdvecTyyppArr;
3840         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3841         self->renumberNodes(tmp,eps);
3842       }
3843
3844       void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
3845       {
3846         int szArr,sw,iTypppArr;
3847         std::vector<int> stdvecTyyppArr;
3848         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3849         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
3850       }
3851
3852       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
3853       {
3854         int sw;
3855         int singleVal;
3856         std::vector<int> multiVal;
3857         std::pair<int, std::pair<int,int> > slic;
3858         ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3859         const MEDCouplingMesh *mesh=self->getMesh();
3860         if(!mesh)
3861           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
3862         int nbc=mesh->getNumberOfCells();
3863         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
3864         switch(sw)
3865           {
3866           case 1:
3867             {
3868               if(singleVal>=nbc)
3869                 {
3870                   std::ostringstream oss;
3871                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3872                   throw INTERP_KERNEL::Exception(oss.str().c_str());
3873                 }
3874               if(singleVal>=0)
3875                 return self->buildSubPart(&singleVal,&singleVal+1);
3876               else
3877                 {
3878                   if(nbc+singleVal>0)
3879                     {
3880                       int tmp=nbc+singleVal;
3881                       return self->buildSubPart(&tmp,&tmp+1);
3882                     }
3883                   else
3884                     {
3885                       std::ostringstream oss;
3886                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
3887                       throw INTERP_KERNEL::Exception(oss.str().c_str());
3888                     }
3889                 }
3890             }
3891           case 2:
3892             {
3893               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
3894             }
3895           case 3:
3896             {
3897               return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
3898             }
3899           case 4:
3900             {
3901               if(!daIntTyypp)
3902                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
3903               daIntTyypp->checkAllocated();
3904               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
3905             }
3906           default:
3907             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
3908           }
3909       }
3910
3911       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
3912       {
3913         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";
3914         if(PyTuple_Check(li))
3915           {
3916             Py_ssize_t sz=PyTuple_Size(li);
3917             if(sz!=2)
3918               throw INTERP_KERNEL::Exception(msg);
3919             PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
3920             int sw;
3921             int singleVal;
3922             std::vector<int> multiVal;
3923             std::pair<int, std::pair<int,int> > slic;
3924             ParaMEDMEM::DataArrayInt *daIntTyypp=0;
3925             if(!self->getArray())
3926               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
3927             try
3928               { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
3929             catch(INTERP_KERNEL::Exception& e)
3930               { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
3931             MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
3932             DataArrayDouble *ret0Arr=ret0->getArray();
3933             if(!ret0Arr)
3934               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
3935             switch(sw)
3936               {
3937               case 1:
3938                 {
3939                   std::vector<int> v2(1,singleVal);
3940                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3941                   ret0->setArray(aarr);
3942                   return ret0.retn();
3943                 }
3944               case 2:
3945                 {
3946                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(multiVal));
3947                   ret0->setArray(aarr);
3948                   return ret0.retn();
3949                 }
3950               case 3:
3951                 {
3952                   int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
3953                   std::vector<int> v2(nbOfComp);
3954                   for(int i=0;i<nbOfComp;i++)
3955                     v2[i]=slic.first+i*slic.second.second;
3956                   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr=static_cast<DataArrayDouble *>(ret0Arr->keepSelectedComponents(v2));
3957                   ret0->setArray(aarr);
3958                   return ret0.retn();
3959                 }
3960               default:
3961                 throw INTERP_KERNEL::Exception(msg);
3962               }
3963             
3964           }
3965         else
3966           return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
3967       }
3968
3969       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
3970       {
3971         DataArrayInt *tmp;
3972         double r1=self->getMaxValue2(tmp);
3973         PyObject *ret=PyTuple_New(2);
3974         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3975         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3976         return ret;
3977       }
3978       
3979       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
3980       {
3981         DataArrayInt *tmp;
3982         double r1=self->getMinValue2(tmp);
3983         PyObject *ret=PyTuple_New(2);
3984         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
3985         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3986         return ret;
3987       }
3988       
3989       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
3990       {
3991         std::vector<int> tmp;
3992         convertPyToNewIntArr3(li,tmp);
3993         return self->keepSelectedComponents(tmp);
3994       }
3995
3996       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
3997       {
3998         std::vector<int> tmp;
3999         convertPyToNewIntArr3(li,tmp);
4000         self->setSelectedComponents(f,tmp);
4001       }
4002
4003       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4004       {
4005         double val,val2;
4006         DataArrayDouble *a,*a2;
4007         DataArrayDoubleTuple *aa,*aa2;
4008         std::vector<double> bb,bb2;
4009         int sw;
4010         int spaceDim=3;
4011         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4012         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4013         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4014         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4015         //
4016         return self->extractSlice3D(orig,vect,eps);
4017       }
4018
4019       MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4020       {
4021         return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
4022       }
4023
4024       MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4025       {
4026         return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
4027       }
4028
4029       MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4030       {
4031         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.";
4032         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4033         void *argp;
4034         //
4035         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4036           {
4037             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4038             if(other)
4039               return (*self)-(*other);
4040             else
4041               throw INTERP_KERNEL::Exception(msg);
4042           }
4043         //
4044         double val;
4045         DataArrayDouble *a;
4046         DataArrayDoubleTuple *aa;
4047         std::vector<double> bb;
4048         int sw;
4049         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4050         switch(sw)
4051           {
4052           case 1:
4053             {
4054               if(!self->getArray())
4055                 throw INTERP_KERNEL::Exception(msg2);
4056               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4057               ret->applyLin(1.,-val);
4058               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4059               ret2->setArray(ret);
4060               return ret2.retn();
4061             }
4062           case 2:
4063             {
4064               if(!self->getArray())
4065                 throw INTERP_KERNEL::Exception(msg2);
4066               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4067               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4068               ret2->setArray(ret);
4069               return ret2.retn();
4070             }
4071           case 3:
4072             {
4073               if(!self->getArray())
4074                 throw INTERP_KERNEL::Exception(msg2);
4075               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4076               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4077               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4078               ret2->setArray(ret);
4079               return ret2.retn();
4080             }
4081           case 4:
4082             {
4083               if(!self->getArray())
4084                 throw INTERP_KERNEL::Exception(msg2);
4085               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4086               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4087               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4088               ret2->setArray(ret);
4089               return ret2.retn();
4090             }
4091           default:
4092             { throw INTERP_KERNEL::Exception(msg); }
4093           }
4094       }
4095
4096       MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4097       {
4098         return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4099       }
4100
4101       MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4102       {
4103         return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
4104       }
4105
4106       MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4107       {
4108         return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4109       }
4110
4111       MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4112       {
4113         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.";
4114         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4115         void *argp;
4116         //
4117         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4118           {
4119             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4120             if(other)
4121               return (*self)/(*other);
4122             else
4123               throw INTERP_KERNEL::Exception(msg);
4124           }
4125         //
4126         double val;
4127         DataArrayDouble *a;
4128         DataArrayDoubleTuple *aa;
4129         std::vector<double> bb;
4130         int sw;
4131         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4132         switch(sw)
4133           {
4134           case 1:
4135             {
4136               if(val==0.)
4137                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4138               if(!self->getArray())
4139                 throw INTERP_KERNEL::Exception(msg2);
4140               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4141               ret->applyLin(1./val,0);
4142               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4143               ret2->setArray(ret);
4144               return ret2.retn();
4145             }
4146           case 2:
4147             {
4148               if(!self->getArray())
4149                 throw INTERP_KERNEL::Exception(msg2);
4150               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4151               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4152               ret2->setArray(ret);
4153               return ret2.retn();
4154             }
4155           case 3:
4156             {
4157               if(!self->getArray())
4158                 throw INTERP_KERNEL::Exception(msg2);
4159               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4160               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4161               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4162               ret2->setArray(ret);
4163               return ret2.retn();
4164             }
4165           case 4:
4166             {
4167               if(!self->getArray())
4168                 throw INTERP_KERNEL::Exception(msg2);
4169               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4170               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4171               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4172               ret2->setArray(ret);
4173               return ret2.retn();
4174             }
4175           default:
4176             { throw INTERP_KERNEL::Exception(msg); }
4177           }
4178       }
4179
4180       MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4181       {
4182         return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4183       }
4184
4185       MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4186       {
4187         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.";
4188         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4189         void *argp;
4190         //
4191         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4192           {
4193             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4194             if(other)
4195               return (*self)^(*other);
4196             else
4197               throw INTERP_KERNEL::Exception(msg);
4198           }
4199         //
4200         double val;
4201         DataArrayDouble *a;
4202         DataArrayDoubleTuple *aa;
4203         std::vector<double> bb;
4204         int sw;
4205         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4206         switch(sw)
4207           {
4208           case 1:
4209             {
4210               if(!self->getArray())
4211                 throw INTERP_KERNEL::Exception(msg2);
4212               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
4213               ret->applyPow(val);
4214               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4215               ret2->setArray(ret);
4216               return ret2.retn();
4217             }
4218           case 2:
4219             {
4220               if(!self->getArray())
4221                 throw INTERP_KERNEL::Exception(msg2);
4222               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4223               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4224               ret2->setArray(ret);
4225               return ret2.retn();
4226             }
4227           case 3:
4228             {
4229               if(!self->getArray())
4230                 throw INTERP_KERNEL::Exception(msg2);
4231               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4232               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4233               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4234               ret2->setArray(ret);
4235               return ret2.retn();
4236             }
4237           case 4:
4238             {
4239               if(!self->getArray())
4240                 throw INTERP_KERNEL::Exception(msg2);
4241               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4242               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4243               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4244               ret2->setArray(ret);
4245               return ret2.retn();
4246             }
4247           default:
4248             { throw INTERP_KERNEL::Exception(msg); }
4249           }
4250       }
4251
4252       MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4253       {
4254         return self->negate();
4255       }
4256
4257       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4258       {
4259         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.";
4260         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4261         void *argp;
4262         //
4263         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4264           {
4265             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4266             if(other)
4267               {
4268                 *self+=*other;
4269                 Py_XINCREF(trueSelf);
4270                 return trueSelf;
4271               }
4272             else
4273               throw INTERP_KERNEL::Exception(msg);
4274           }
4275         //
4276         double val;
4277         DataArrayDouble *a;
4278         DataArrayDoubleTuple *aa;
4279         std::vector<double> bb;
4280         int sw;
4281         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4282         switch(sw)
4283           {
4284           case 1:
4285             {
4286               if(!self->getArray())
4287                 throw INTERP_KERNEL::Exception(msg2);
4288               self->getArray()->applyLin(1.,val);
4289               Py_XINCREF(trueSelf);
4290               return trueSelf;
4291             }
4292           case 2:
4293             {
4294               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4295               ret2->setArray(a);
4296               *self+=*ret2;
4297               Py_XINCREF(trueSelf);
4298               return trueSelf;
4299             }
4300           case 3:
4301             {
4302               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4303               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4304               ret2->setArray(aaa);
4305               *self+=*ret2;
4306               Py_XINCREF(trueSelf);
4307               return trueSelf;
4308             }
4309           case 4:
4310             {
4311               if(!self->getArray())
4312                 throw INTERP_KERNEL::Exception(msg2);
4313               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4314               self->getArray()->addEqual(aaa);
4315               Py_XINCREF(trueSelf);
4316               return trueSelf;
4317             }
4318           default:
4319             { throw INTERP_KERNEL::Exception(msg); }
4320           }
4321       }
4322
4323       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4324       {
4325         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.";
4326         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4327         void *argp;
4328         //
4329         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4330           {
4331             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4332             if(other)
4333               {
4334                 *self-=*other;
4335                 Py_XINCREF(trueSelf);
4336                 return trueSelf;
4337               }
4338             else
4339               throw INTERP_KERNEL::Exception(msg);
4340           }
4341         //
4342         double val;
4343         DataArrayDouble *a;
4344         DataArrayDoubleTuple *aa;
4345         std::vector<double> bb;
4346         int sw;
4347         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4348         switch(sw)
4349           {
4350           case 1:
4351             {
4352               if(!self->getArray())
4353                 throw INTERP_KERNEL::Exception(msg2);
4354               self->getArray()->applyLin(1.,-val);
4355               Py_XINCREF(trueSelf);
4356               return trueSelf;
4357             }
4358           case 2:
4359             {
4360               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4361               ret2->setArray(a);
4362               *self-=*ret2;
4363               Py_XINCREF(trueSelf);
4364               return trueSelf;
4365             }
4366           case 3:
4367             {
4368               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4369               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4370               ret2->setArray(aaa);
4371               *self-=*ret2;
4372               Py_XINCREF(trueSelf);
4373               return trueSelf;
4374             }
4375           case 4:
4376             {
4377               if(!self->getArray())
4378                 throw INTERP_KERNEL::Exception(msg2);
4379               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4380               self->getArray()->substractEqual(aaa);
4381               Py_XINCREF(trueSelf);
4382               return trueSelf;
4383             }
4384           default:
4385             { throw INTERP_KERNEL::Exception(msg); }
4386           }
4387       }
4388
4389       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4390       {
4391         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.";
4392         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4393         void *argp;
4394         //
4395         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4396           {
4397             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4398             if(other)
4399               {
4400                 *self*=*other;
4401                 Py_XINCREF(trueSelf);
4402                 return trueSelf;
4403               }
4404             else
4405               throw INTERP_KERNEL::Exception(msg);
4406           }
4407         //
4408         double val;
4409         DataArrayDouble *a;
4410         DataArrayDoubleTuple *aa;
4411         std::vector<double> bb;
4412         int sw;
4413         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4414         switch(sw)
4415           {
4416           case 1:
4417             {
4418               if(!self->getArray())
4419                 throw INTERP_KERNEL::Exception(msg2);
4420               self->getArray()->applyLin(val,0);
4421               Py_XINCREF(trueSelf);
4422               return trueSelf;
4423             }
4424           case 2:
4425             {
4426               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4427               ret2->setArray(a);
4428               *self*=*ret2;
4429               Py_XINCREF(trueSelf);
4430               return trueSelf;
4431             }
4432           case 3:
4433             {
4434               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4435               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4436               ret2->setArray(aaa);
4437               *self*=*ret2;
4438               Py_XINCREF(trueSelf);
4439               return trueSelf;
4440             }
4441           case 4:
4442             {
4443               if(!self->getArray())
4444                 throw INTERP_KERNEL::Exception(msg2);
4445               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4446               self->getArray()->multiplyEqual(aaa);
4447               Py_XINCREF(trueSelf);
4448               return trueSelf;
4449             }
4450           default:
4451             { throw INTERP_KERNEL::Exception(msg); }
4452           }
4453       }
4454
4455       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4456       {
4457         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.";
4458         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4459         void *argp;
4460         //
4461         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4462           {
4463             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4464             if(other)
4465               {
4466                 *self/=*other;
4467                 Py_XINCREF(trueSelf);
4468                 return trueSelf;
4469               }
4470             else
4471               throw INTERP_KERNEL::Exception(msg);
4472           }
4473         //
4474         double val;
4475         DataArrayDouble *a;
4476         DataArrayDoubleTuple *aa;
4477         std::vector<double> bb;
4478         int sw;
4479         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4480         switch(sw)
4481           {
4482           case 1:
4483             {
4484               if(val==0.)
4485                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4486               if(!self->getArray())
4487                 throw INTERP_KERNEL::Exception(msg2);
4488               self->getArray()->applyLin(1./val,0);
4489               Py_XINCREF(trueSelf);
4490               return trueSelf;
4491             }
4492           case 2:
4493             {
4494               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4495               ret2->setArray(a);
4496               *self/=*ret2;
4497               Py_XINCREF(trueSelf);
4498               return trueSelf;
4499             }
4500           case 3:
4501             {
4502               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4503               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4504               ret2->setArray(aaa);
4505               *self/=*ret2;
4506               Py_XINCREF(trueSelf);
4507               return trueSelf;
4508             }
4509           case 4:
4510             {
4511               if(!self->getArray())
4512                 throw INTERP_KERNEL::Exception(msg2);
4513               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4514               self->getArray()->divideEqual(aaa);
4515               Py_XINCREF(trueSelf);
4516               return trueSelf;
4517             }
4518           default:
4519             { throw INTERP_KERNEL::Exception(msg); }
4520           }
4521       }
4522
4523       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4524       {
4525         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.";
4526         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4527         void *argp;
4528         //
4529         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
4530           {
4531             MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
4532             if(other)
4533               {
4534                 *self^=*other;
4535                 Py_XINCREF(trueSelf);
4536                 return trueSelf;
4537               }
4538             else
4539               throw INTERP_KERNEL::Exception(msg);
4540           }
4541         //
4542         double val;
4543         DataArrayDouble *a;
4544         DataArrayDoubleTuple *aa;
4545         std::vector<double> bb;
4546         int sw;
4547         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4548         switch(sw)
4549           {
4550           case 1:
4551             {
4552               if(!self->getArray())
4553                 throw INTERP_KERNEL::Exception(msg2);
4554               self->getArray()->applyPow(val);
4555               Py_XINCREF(trueSelf);
4556               return trueSelf;
4557             }
4558           case 2:
4559             {
4560               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4561               ret2->setArray(a);
4562               *self^=*ret2;
4563               Py_XINCREF(trueSelf);
4564               return trueSelf;
4565             }
4566           case 3:
4567             {
4568               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4569               MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
4570               ret2->setArray(aaa);
4571               *self^=*ret2;
4572               Py_XINCREF(trueSelf);
4573               return trueSelf;
4574             }
4575           case 4:
4576             {
4577               if(!self->getArray())
4578                 throw INTERP_KERNEL::Exception(msg2);
4579               MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4580               self->getArray()->powEqual(aaa);
4581               Py_XINCREF(trueSelf);
4582               return trueSelf;
4583             }
4584           default:
4585             { throw INTERP_KERNEL::Exception(msg); }
4586           }
4587       }
4588
4589       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4590       {
4591         std::vector<const MEDCouplingFieldDouble *> tmp;
4592         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4593         return MEDCouplingFieldDouble::MergeFields(tmp);
4594       }
4595
4596       static void WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
4597       {
4598         std::vector<const MEDCouplingFieldDouble *> tmp;
4599         convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4600         MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
4601       }
4602     }
4603   };
4604
4605   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
4606   {
4607   public:
4608     int getNumberOfFields() const;
4609     MEDCouplingMultiFields *deepCpy() const;
4610     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
4611     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
4612     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4613     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
4614     virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
4615     %extend
4616        {
4617          std::string __str__() const throw(INTERP_KERNEL::Exception)
4618          {
4619            return self->simpleRepr();
4620          }
4621          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4622          {
4623            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4624            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4625            int sz=tmp.size();
4626            std::vector<MEDCouplingFieldDouble *> fs(sz);
4627            for(int i=0;i<sz;i++)
4628              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4629            return MEDCouplingMultiFields::New(fs);
4630          }
4631          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
4632          {
4633            std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4634            convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4635            int sz=tmp.size();
4636            std::vector<MEDCouplingFieldDouble *> fs(sz);
4637            for(int i=0;i<sz;i++)
4638              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4639            return MEDCouplingMultiFields::New(fs);
4640          }
4641          PyObject *getFields() const
4642          {
4643            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
4644            int sz=fields.size();
4645            PyObject *res = PyList_New(sz);
4646            for(int i=0;i<sz;i++)
4647              {
4648                if(fields[i])
4649                  {
4650                    fields[i]->incrRef();
4651                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
4652                  }
4653                else
4654                  {
4655                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
4656                  }
4657              }
4658            return res;
4659          }
4660          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
4661          {
4662            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
4663            if(ret)
4664              {
4665                ret->incrRef();
4666                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
4667              }
4668            else
4669              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
4670          }
4671          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
4672          {
4673            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
4674            int sz=ms.size();
4675            PyObject *res = PyList_New(sz);
4676            for(int i=0;i<sz;i++)
4677              {
4678                if(ms[i])
4679                  {
4680                    ms[i]->incrRef();
4681                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4682                  }
4683                else
4684                  {
4685                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4686                  }
4687              }
4688            return res;
4689          }
4690          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
4691          {
4692            std::vector<int> refs;
4693            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
4694            int sz=ms.size();
4695            PyObject *res = PyList_New(sz);
4696            for(int i=0;i<sz;i++)
4697              {
4698                if(ms[i])
4699                  {
4700                    ms[i]->incrRef();
4701                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
4702                  }
4703                else
4704                  {
4705                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
4706                  }
4707              }
4708            //
4709            PyObject *ret=PyTuple_New(2);
4710            PyTuple_SetItem(ret,0,res);
4711            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
4712            return ret;
4713          }
4714          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4715          {
4716            std::vector<DataArrayDouble *> ms=self->getArrays();
4717            int sz=ms.size();
4718            PyObject *res = PyList_New(sz);
4719            for(int i=0;i<sz;i++)
4720              {
4721                if(ms[i])
4722                  {
4723                    ms[i]->incrRef();
4724                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4725                  }
4726                else
4727                  {
4728                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4729                  }
4730              }
4731            return res;
4732          }
4733          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
4734          {
4735            std::vector< std::vector<int> > refs;
4736            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
4737            int sz=ms.size();
4738            PyObject *res = PyList_New(sz);
4739            PyObject *res2 = PyList_New(sz);
4740            for(int i=0;i<sz;i++)
4741              {
4742                if(ms[i])
4743                  {
4744                    ms[i]->incrRef();
4745                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4746                  }
4747                else
4748                  {
4749                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
4750                  }
4751                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
4752              }
4753            //
4754            PyObject *ret=PyTuple_New(2);
4755            PyTuple_SetItem(ret,0,res);
4756            PyTuple_SetItem(ret,1,res2);
4757            return ret;
4758          }
4759        }
4760   };
4761   
4762   class MEDCouplingDefinitionTime
4763   {
4764   public:
4765     MEDCouplingDefinitionTime();
4766     void assign(const MEDCouplingDefinitionTime& other);
4767     bool isEqual(const MEDCouplingDefinitionTime& other) const;
4768     double getTimeResolution() const;
4769     std::vector<double> getHotSpotsTime() const;
4770     %extend
4771       {
4772         std::string __str__() const throw(INTERP_KERNEL::Exception)
4773           {
4774             std::ostringstream oss;
4775             self->appendRepr(oss);
4776             return oss.str();
4777           }
4778
4779         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
4780         {
4781           int meshId,arrId,arrIdInField,fieldId;
4782           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
4783           PyObject *res=PyList_New(4);
4784           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4785           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4786           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4787           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4788           return res;
4789         }
4790
4791         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
4792         {
4793           int meshId,arrId,arrIdInField,fieldId;
4794           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
4795           PyObject *res=PyList_New(4);
4796           PyList_SetItem(res,0,PyInt_FromLong(meshId));
4797           PyList_SetItem(res,1,PyInt_FromLong(arrId));
4798           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
4799           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
4800           return res;
4801         }
4802       }
4803   };
4804
4805   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
4806   {
4807   public:
4808     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
4809     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
4810     
4811     %extend
4812       {
4813         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
4814           {
4815             std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4816             convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4817             int sz=tmp.size();
4818             std::vector<MEDCouplingFieldDouble *> fs(sz);
4819             for(int i=0;i<sz;i++)
4820               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4821             return MEDCouplingFieldOverTime::New(fs);
4822           }
4823         std::string __str__() const throw(INTERP_KERNEL::Exception)
4824           {
4825             return self->simpleRepr();
4826           }
4827         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
4828         {
4829           std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
4830           convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
4831            int sz=tmp.size();
4832            std::vector<MEDCouplingFieldDouble *> fs(sz);
4833            for(int i=0;i<sz;i++)
4834              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
4835            return MEDCouplingFieldOverTime::New(fs);
4836          }
4837       }
4838   };
4839
4840   class MEDCouplingCartesianAMRMesh;
4841   
4842   class MEDCouplingCartesianAMRPatchGen : public RefCountObject
4843   {
4844   public:
4845     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4846     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4847     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4848     %extend
4849     {
4850       MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
4851       {
4852         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
4853         if(ret)
4854           ret->incrRef();
4855         return ret;
4856       }
4857     }
4858   };
4859
4860   class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
4861   {
4862   public:
4863     int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
4864     bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
4865     std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
4866     %extend
4867     {
4868       PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
4869       {
4870         const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
4871         return convertFromVectorPairInt(ret);
4872       }
4873
4874       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
4875       {
4876         std::vector< std::pair<int,int> > inp;
4877         convertPyToVectorPairInt(bottomLeftTopRight,inp);
4878         self->addPatch(inp,factors);
4879       }
4880
4881       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
4882       {
4883         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
4884         if(!mesh)
4885           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
4886         if(patchId==mesh->getNumberOfPatches())
4887           {
4888             std::ostringstream oss;
4889             oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
4890             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
4891             return 0;
4892           }
4893         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
4894         if(ret)
4895           ret->incrRef();
4896         return ret;
4897       }
4898
4899       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
4900       {
4901         MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
4902         if(!mesh)
4903           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
4904         mesh->removePatch(patchId);
4905       }
4906
4907       int __len__() const throw(INTERP_KERNEL::Exception)
4908       {
4909         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
4910         if(!mesh)
4911           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
4912         return mesh->getNumberOfPatches();
4913       }
4914     }
4915   };
4916
4917   class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
4918   {
4919   };
4920   
4921   class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
4922   {
4923   public:
4924     virtual MEDCouplingCartesianAMRMeshGen *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception);
4925     int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
4926     int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
4927     std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
4928     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
4929     const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
4930     void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
4931     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
4932     int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
4933     int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
4934     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
4935     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
4936     bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
4937    virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
4938     //
4939     int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
4940     int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
4941     MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
4942     DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
4943     std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
4944     MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
4945     MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
4946     void removeAllPatches() throw(INTERP_KERNEL::Exception);
4947     void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
4948     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
4949     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
4950     DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
4951     void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
4952     void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
4953     void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
4954     void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
4955     void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
4956     void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
4957     DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
4958     std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
4959     %extend
4960     {
4961       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
4962       {
4963         std::vector< std::pair<int,int> > inp;
4964         convertPyToVectorPairInt(bottomLeftTopRight,inp);
4965         self->addPatch(inp,factors);
4966       }
4967
4968       PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
4969       {
4970         std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
4971         int sz(ps.size());
4972         PyObject *ret = PyList_New(sz);
4973         for(int i=0;i<sz;i++)
4974           {
4975             MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
4976             if(elt)
4977               elt->incrRef();
4978             PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
4979           }
4980         return ret;
4981       }
4982
4983       MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
4984       {
4985         const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
4986         MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
4987         if(ret2)
4988           ret2->incrRef();
4989         return ret2;
4990       }
4991
4992       MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
4993       {
4994         const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
4995         MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
4996         if(ret2)
4997           ret2->incrRef();
4998         return ret2;
4999       }
5000
5001       virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5002       {
5003         std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5004         int sz(ps.size());
5005         PyObject *ret = PyList_New(sz);
5006         for(int i=0;i<sz;i++)
5007           PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5008         return ret;
5009       }
5010
5011       MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5012       {
5013         std::vector<const DataArrayDouble *> inp;
5014         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
5015         return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5016       }
5017
5018       virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5019       {
5020         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5021         if(ret)
5022           ret->incrRef();
5023         return ret;
5024       }
5025       
5026       virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5027       {
5028         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5029         if(ret)
5030           ret->incrRef();
5031         return ret;
5032       }
5033
5034       MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5035       {
5036         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5037         if(ret)
5038           ret->incrRef();
5039         return ret;
5040       }
5041
5042       MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5043       {
5044         const MEDCouplingIMesh *ret(self->getImageMesh());
5045         if(ret)
5046           ret->incrRef();
5047         return const_cast<MEDCouplingIMesh *>(ret);
5048       }
5049
5050       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5051       {
5052         if(patchId==self->getNumberOfPatches())
5053           {
5054             std::ostringstream oss;
5055             oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5056             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5057             return 0;
5058           }
5059         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5060         if(ret)
5061           ret->incrRef();
5062         return ret;
5063       }
5064
5065       void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5066       {
5067         std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5068         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5069         self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5070       }
5071
5072       void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5073       {
5074         std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
5075         convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5076         self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5077       }
5078
5079       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5080       {
5081         self->removePatch(patchId);
5082       }
5083
5084       int __len__() const throw(INTERP_KERNEL::Exception)
5085       {
5086         return self->getNumberOfPatches();
5087       }
5088     }
5089   };
5090
5091   class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5092   {
5093   };
5094
5095   class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5096   {
5097   public:
5098     %extend
5099     {
5100       static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5101       {
5102         static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5103         static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5104         const int *nodeStrctPtr(0);
5105         const double *originPtr(0),*dxyzPtr(0);
5106         int sw,sz,val0;
5107         std::vector<int> bb0;
5108         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5109         //
5110         double val,val2;
5111         std::vector<double> bb,bb2;
5112         int sz1,sz2;
5113         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5114         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5115         //
5116         return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5117       }
5118
5119       void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5120       {
5121         std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5122         convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5123         std::vector< std::vector<int> > inp2;
5124         convertPyToVectorOfVectorOfInt(factors,inp2);
5125         self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5126       }
5127
5128       MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5129       {
5130         return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New(meshName,spaceDim,nodeStrct,origin,dxyz);
5131       }
5132     }
5133   };
5134
5135   class MEDCouplingDataForGodFather : public RefCountObject
5136   {
5137   public:
5138     virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5139     virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5140     virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5141     virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5142     virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5143     virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5144     virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5145     virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5146     virtual void alloc() throw(INTERP_KERNEL::Exception);
5147     virtual void dealloc() throw(INTERP_KERNEL::Exception);
5148     %extend
5149     {
5150       MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5151       {
5152         MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5153         if(ret)
5154           ret->incrRef();
5155         return ret;
5156       }
5157     }
5158   };
5159   
5160   class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5161   {
5162   public:
5163     int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5164     MEDCouplingAMRAttribute *deepCpy() const throw(INTERP_KERNEL::Exception);
5165     MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5166     MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5167     MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5168     MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5169     bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5170     %extend
5171     {
5172       static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5173       {
5174         std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5175         std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5176         MEDCouplingAMRAttribute *ret(0);
5177         try
5178           {
5179             convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5180             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5181           }
5182         catch(INTERP_KERNEL::Exception&)
5183           {
5184             convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5185             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5186           }
5187         return ret;
5188       }
5189
5190       MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5191       {
5192         return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5193       }
5194
5195       DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5196       {
5197         const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5198         DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5199         if(ret2)
5200           ret2->incrRef();
5201         return ret2;
5202       }
5203
5204       void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5205       {
5206         std::vector< std::vector<std::string> > compNamesCpp;
5207         convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5208         self->spillInfoOnComponents(compNamesCpp);
5209       }
5210
5211       void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5212       {
5213         std::vector<int> inp0;
5214         if(!fillIntVector(nfs,inp0))
5215           throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5216         std::size_t sz(inp0.size());
5217         std::vector<NatureOfField> inp00(sz);
5218         for(std::size_t i=0;i<sz;i++)
5219           inp00[i]=(NatureOfField)inp0[i];
5220         self->spillNatures(inp00);
5221       }
5222       
5223       PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5224       {
5225         std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5226         int sz((int)ret.size());
5227         PyObject *retPy(PyList_New(sz));
5228         for(int i=0;i<sz;i++)
5229           PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5230         return retPy;
5231       }
5232     }
5233   };
5234
5235   class DenseMatrix : public RefCountObject, public TimeLabel
5236   {
5237   public:
5238     static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5239     static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5240     DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
5241     DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5242     //
5243     int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5244     int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5245     int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5246     void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5247     void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5248     void transpose() throw(INTERP_KERNEL::Exception);
5249     //
5250     bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5251     DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5252     static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5253     %extend
5254     {
5255       DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5256       {
5257         return DenseMatrix::New(nbRows,nbCols);
5258       }
5259
5260       DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5261       {
5262         return DenseMatrix::New(array,nbRows,nbCols);
5263       }
5264
5265       PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5266       {
5267         std::string ret1;
5268         bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5269         PyObject *ret=PyTuple_New(2);
5270         PyObject *ret0Py=ret0?Py_True:Py_False;
5271         Py_XINCREF(ret0Py);
5272         PyTuple_SetItem(ret,0,ret0Py);
5273         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5274         return ret;
5275       }
5276
5277       DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5278       {
5279         DataArrayDouble *ret(self->getData());
5280         if(ret)
5281           ret->incrRef();
5282         return ret;
5283       }
5284
5285       DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5286       {
5287         return ParaMEDMEM::DenseMatrix::Add(self,other);
5288       }
5289
5290       DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5291       {
5292         return ParaMEDMEM::DenseMatrix::Substract(self,other);
5293       }
5294
5295       DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5296       {
5297         return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5298       }
5299
5300       DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5301       {
5302         return ParaMEDMEM::DenseMatrix::Multiply(self,other);
5303       }
5304
5305       PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5306       {
5307         self->addEqual(other);
5308         Py_XINCREF(trueSelf);
5309         return trueSelf;
5310       }
5311
5312       PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5313       {
5314         self->substractEqual(other);
5315         Py_XINCREF(trueSelf);
5316         return trueSelf;
5317       }
5318 #ifdef WITH_NUMPY
5319       PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
5320       {
5321         PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
5322         return obj;
5323       }
5324 #endif
5325     }
5326   };
5327 }
5328
5329 %pythoncode %{
5330 import os
5331 __filename=os.environ.get('PYTHONSTARTUP')
5332 if __filename and os.path.isfile(__filename):
5333   execfile(__filename)
5334   pass
5335 %}