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