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