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