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