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