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