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