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