Salome HOME
Improve swig generation process on Windows platform.
[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 *explodeMeshIntoMicroEdges() const throw(INTERP_KERNEL::Exception)
2669       {
2670         MCAuto<DataArrayInt> d0=DataArrayInt::New();
2671         MCAuto<DataArrayInt> d1=DataArrayInt::New();
2672         MCAuto<DataArrayInt> d2=DataArrayInt::New();
2673         MCAuto<DataArrayInt> d3=DataArrayInt::New();
2674         MEDCouplingUMesh *m=self->explodeMeshIntoMicroEdges(d0,d1,d2,d3);
2675         PyObject *ret=PyTuple_New(5);
2676         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2677         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2678         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2679         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2680         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2681         return ret;
2682       }
2683
2684       PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
2685       {
2686         MCAuto<DataArrayInt> d0=DataArrayInt::New();
2687         MCAuto<DataArrayInt> d1=DataArrayInt::New();
2688         MCAuto<DataArrayInt> d2=DataArrayInt::New();
2689         MCAuto<DataArrayInt> d3=DataArrayInt::New();
2690         MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
2691         PyObject *ret=PyTuple_New(5);
2692         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2693         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2694         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2695         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2696         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2697         return ret;
2698       }
2699
2700       PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
2701       {
2702         MCAuto<DataArrayInt> d0=DataArrayInt::New();
2703         MCAuto<DataArrayInt> d1=DataArrayInt::New();
2704         MCAuto<DataArrayInt> d2=DataArrayInt::New();
2705         MCAuto<DataArrayInt> d3=DataArrayInt::New();
2706         MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
2707         PyObject *ret=PyTuple_New(5);
2708         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2709         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2710         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2711         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2712         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2713         return ret;
2714       }
2715       
2716       PyObject *computeNeighborsOfCells() const throw(INTERP_KERNEL::Exception)
2717       {
2718         DataArrayInt *neighbors=0,*neighborsIdx=0;
2719         self->computeNeighborsOfCells(neighbors,neighborsIdx);
2720         PyObject *ret=PyTuple_New(2);
2721         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2722         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2723         return ret;
2724       }
2725
2726       PyObject *computeNeighborsOfNodes() const throw(INTERP_KERNEL::Exception)
2727       {
2728         DataArrayInt *neighbors=0,*neighborsIdx=0;
2729         self->computeNeighborsOfNodes(neighbors,neighborsIdx);
2730         PyObject *ret=PyTuple_New(2);
2731         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2732         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2733         return ret;
2734       }
2735       
2736       PyObject *computeCellNeighborhoodFromNodesOne(const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI) const throw(INTERP_KERNEL::Exception)
2737       {
2738         MCAuto<DataArrayInt> cellNeigh,cellNeighIndex;
2739         self->computeCellNeighborhoodFromNodesOne(nodeNeigh,nodeNeighI,cellNeigh,cellNeighIndex);
2740         PyObject *ret=PyTuple_New(2);
2741         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeigh.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2742         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNeighIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2743         return ret;
2744       }
2745       
2746       static PyObject *ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI) throw(INTERP_KERNEL::Exception)
2747       {
2748         DataArrayInt *neighbors=0,*neighborsIdx=0;
2749         MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
2750         PyObject *ret=PyTuple_New(2);
2751         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2752         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2753         return ret;
2754       }
2755
2756       PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
2757       {
2758         MCAuto<DataArrayInt> d0=DataArrayInt::New();
2759         MCAuto<DataArrayInt> d1=DataArrayInt::New();
2760         DataArrayInt *d2,*d3,*d4,*dd5;
2761         MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
2762         PyObject *ret=PyTuple_New(7);
2763         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2764         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2765         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2766         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2767         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2768         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2769         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2770         return ret;
2771       }
2772
2773       DataArrayDouble *getPartBarycenterAndOwner(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2774       {
2775         if(!da)
2776           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2777         da->checkAllocated();
2778         return self->getPartBarycenterAndOwner(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2779       }
2780
2781       DataArrayDouble *getPartMeasureField(bool isAbs, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2782       {
2783         if(!da)
2784           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2785         da->checkAllocated();
2786         return self->getPartMeasureField(isAbs,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2787       }
2788
2789       MEDCouplingFieldDouble *buildPartOrthogonalField(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2790       {
2791         if(!da)
2792           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2793         da->checkAllocated();
2794         return self->buildPartOrthogonalField(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2795       }
2796
2797       PyObject *getTypesOfPart(DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2798       {
2799         if(!da)
2800           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2801         da->checkAllocated();
2802         std::set<INTERP_KERNEL::NormalizedCellType> result=self->getTypesOfPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2803         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
2804         PyObject *res = PyList_New(result.size());
2805         for (int i=0;iL!=result.end(); i++, iL++)
2806           PyList_SetItem(res,i,PyInt_FromLong(*iL));
2807         return res;
2808       }
2809
2810       DataArrayInt *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da) const throw(INTERP_KERNEL::Exception)
2811       {
2812         if(!da)
2813           throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
2814         da->checkAllocated();
2815         DataArrayInt *ret=self->keepCellIdsByType(type,da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
2816         ret->setName(da->getName().c_str());
2817         return ret;
2818       }
2819
2820       static PyObject *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps) throw(INTERP_KERNEL::Exception)
2821       {
2822         DataArrayInt *cellNb1=0,*cellNb2=0;
2823         MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
2824         PyObject *ret=PyTuple_New(3);
2825         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2826         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2827         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2828         return ret;
2829       }
2830
2831       static PyObject *Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps) throw(INTERP_KERNEL::Exception)
2832       {
2833         MEDCouplingUMesh *splitMesh2D(0),*splitMesh1D(0);
2834         DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
2835         MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
2836         PyObject *ret(PyTuple_New(4));
2837         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2838         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2839         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2840         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2841         return ret;
2842       }
2843
2844       PyObject *buildSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2845       {
2846         int spaceDim=self->getSpaceDimension();
2847         if(spaceDim!=3)
2848           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::buildSlice3D : works only for spaceDim 3 !");
2849         double val,val2;
2850         DataArrayDouble *a,*a2;
2851         DataArrayDoubleTuple *aa,*aa2;
2852         std::vector<double> bb,bb2;
2853         int sw;
2854         const char msg[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 1st paramater for origin.";
2855         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3D : 2nd paramater for vector.";
2856         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2857         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2858         //
2859         DataArrayInt *cellIds=0;
2860         MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
2861         PyObject *ret=PyTuple_New(2);
2862         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
2863         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
2864         return ret;
2865       }
2866
2867       PyObject *buildSlice3DSurf(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::buildSlice3DSurf : 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::buildSlice3DSurf : 1st paramater for origin.";
2878         const char msg2[]="Python wrap of MEDCouplingUMesh::buildSlice3DSurf : 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->buildSlice3DSurf(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       MEDCouplingUMesh *clipSingle3DCellByPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2891       {
2892         double val,val2;
2893         DataArrayDouble *a,*a2;
2894         DataArrayDoubleTuple *aa,*aa2;
2895         std::vector<double> bb,bb2;
2896         int sw;
2897         const char msg[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 1st paramater for origin.";
2898         const char msg2[]="Python wrap of MEDCouplingUMesh::clipSingle3DCellByPlane : 2nd paramater for vector.";
2899         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,3,true);
2900         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,3,true);
2901         MCAuto<MEDCouplingUMesh> ret(self->clipSingle3DCellByPlane(orig,vect,eps));
2902         return ret.retn();
2903       }
2904
2905       DataArrayInt *getCellIdsCrossingPlane(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
2906       {
2907         int spaceDim=self->getSpaceDimension();
2908         if(spaceDim!=3)
2909           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : works only for spaceDim 3 !");
2910         double val,val2;
2911         DataArrayDouble *a,*a2;
2912         DataArrayDoubleTuple *aa,*aa2;
2913         std::vector<double> bb,bb2;
2914         int sw;
2915         const char msg[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 1st paramater for origin.";
2916         const char msg2[]="Python wrap of MEDCouplingUMesh::getCellIdsCrossingPlane : 2nd paramater for vector.";
2917         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
2918         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
2919         return self->getCellIdsCrossingPlane(orig,vect,eps);
2920       }
2921
2922       void convertToPolyTypes(PyObject *li) throw(INTERP_KERNEL::Exception)
2923       {
2924         int sw;
2925         int pos1;
2926         std::vector<int> pos2;
2927         DataArrayInt *pos3=0;
2928         DataArrayIntTuple *pos4=0;
2929         convertObjToPossibleCpp1(li,sw,pos1,pos2,pos3,pos4);
2930         switch(sw)
2931           {
2932           case 1:
2933             {
2934               self->convertToPolyTypes(&pos1,&pos1+1);
2935               return;
2936             }
2937           case 2:
2938             {
2939               if(pos2.empty())
2940                 return;
2941               self->convertToPolyTypes(&pos2[0],&pos2[0]+pos2.size());
2942               return ;
2943             }
2944           case 3:
2945             {
2946               self->convertToPolyTypes(pos3->begin(),pos3->end());
2947               return ;
2948             }
2949           default:
2950             throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertToPolyTypes : unexpected input array type recognized !");
2951           }
2952       }      
2953     }
2954     void convertAllToPoly();
2955     void convertExtrudedPolyhedra() throw(INTERP_KERNEL::Exception);
2956     bool unPolyze() throw(INTERP_KERNEL::Exception);
2957     void simplifyPolyhedra(double eps) throw(INTERP_KERNEL::Exception);
2958     MEDCouplingUMesh *buildSpreadZonesWithPoly() const throw(INTERP_KERNEL::Exception);
2959     MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
2960   };
2961
2962   //== MEDCouplingUMesh End
2963
2964   //== MEDCouplingMappedExtrudedMesh
2965
2966   class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
2967   {
2968   public:
2969     static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
2970     static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception);
2971     MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
2972     int get2DCellIdForExtrusion() const;
2973     %extend {
2974       MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
2975       {
2976         return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
2977       }
2978
2979       MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D) throw(INTERP_KERNEL::Exception)
2980       {
2981         return MEDCouplingMappedExtrudedMesh::New(mesh3D);
2982       }
2983
2984       MEDCouplingMappedExtrudedMesh()
2985       {
2986         return MEDCouplingMappedExtrudedMesh::New();
2987       }
2988
2989       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
2990       {
2991         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
2992       }
2993       
2994       std::string __str__() const throw(INTERP_KERNEL::Exception)
2995       {
2996         return self->simpleRepr();
2997       }
2998
2999       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3000       {
3001         std::ostringstream oss;
3002         self->reprQuickOverview(oss);
3003         return oss.str();
3004       }
3005       
3006       PyObject *getMesh2D() const throw(INTERP_KERNEL::Exception)
3007       {
3008         MEDCouplingUMesh *ret=self->getMesh2D();
3009         if(ret)
3010           ret->incrRef();
3011         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3012       }
3013       PyObject *getMesh1D() const throw(INTERP_KERNEL::Exception)
3014       {
3015         MEDCouplingUMesh *ret=self->getMesh1D();
3016         if(ret)
3017           ret->incrRef();
3018         return convertMesh(ret, SWIG_POINTER_OWN | 0 );
3019       }
3020       PyObject *getMesh3DIds() const throw(INTERP_KERNEL::Exception)
3021       {
3022         DataArrayInt *ret=self->getMesh3DIds();
3023         if(ret)
3024           ret->incrRef();
3025         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3026       } 
3027     }
3028   };
3029
3030   //== MEDCouplingMappedExtrudedMesh End
3031
3032   class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
3033   {
3034   public:
3035     static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3036     static MEDCoupling1GTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3037     INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
3038     int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
3039     virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
3040     virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
3041     %extend
3042     {
3043       virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
3044       {
3045         int szArr,sw,iTypppArr;
3046         std::vector<int> stdvecTyyppArr;
3047         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3048         self->insertNextCell(tmp,tmp+szArr);
3049       }
3050
3051       virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3052       {
3053         DataArrayInt *ret=self->getNodalConnectivity();
3054         if(ret) ret->incrRef();
3055         return ret;
3056       }
3057       
3058       static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3059       {
3060         std::vector< const MEDCoupling1GTUMesh *> parts;
3061         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
3062         return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
3063       }
3064     }
3065   };
3066
3067   //== MEDCoupling1SGTUMesh
3068
3069   class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3070   {
3071   public:
3072     static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3073     static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3074     void setNodalConnectivity(DataArrayInt *nodalConn) throw(INTERP_KERNEL::Exception);
3075     int getNumberOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
3076     static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(const MEDCoupling1SGTUMesh *mesh1, const MEDCoupling1SGTUMesh *mesh2) throw(INTERP_KERNEL::Exception);
3077     MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3078     MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception);
3079     MEDCoupling1SGTUMesh *explodeEachHexa8To6Quad4() const throw(INTERP_KERNEL::Exception);
3080     DataArrayInt *sortHexa8EachOther() throw(INTERP_KERNEL::Exception);
3081     %extend
3082     {
3083       MEDCoupling1SGTUMesh()
3084       {
3085         return MEDCoupling1SGTUMesh::New();
3086       }
3087
3088       MEDCoupling1SGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3089       {
3090         return MEDCoupling1SGTUMesh::New(name,type);
3091       }
3092
3093       MEDCoupling1SGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3094       {
3095         return MEDCoupling1SGTUMesh::New(m);
3096       }
3097
3098       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3099       {
3100         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1SGTUMesh");
3101       }
3102
3103       std::string __str__() const throw(INTERP_KERNEL::Exception)
3104       {
3105         return self->simpleRepr();
3106       }
3107       
3108       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3109       {
3110         std::ostringstream oss;
3111         self->reprQuickOverview(oss);
3112         return oss.str();
3113       }
3114
3115       PyObject *structurizeMe(double eps=1e-12) const throw(INTERP_KERNEL::Exception)
3116       {
3117         DataArrayInt *cellPerm(0),*nodePerm(0);
3118         MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
3119         PyObject *ret(PyTuple_New(3));
3120         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
3121         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3122         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3123         return ret;
3124       }
3125
3126       static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3127       {
3128         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3129         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3130         return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
3131       }
3132       
3133       static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3134       {
3135         std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
3136         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
3137         return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
3138       }
3139     }
3140   };
3141   
3142   //== MEDCoupling1SGTUMesh End
3143
3144   //== MEDCoupling1DGTUMesh
3145
3146   class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
3147   {
3148   public:
3149     static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
3150     static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
3151     void setNodalConnectivity(DataArrayInt *nodalConn, DataArrayInt *nodalConnIndex) throw(INTERP_KERNEL::Exception);
3152     MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
3153     bool isPacked() const throw(INTERP_KERNEL::Exception);
3154     %extend
3155     {
3156       MEDCoupling1DGTUMesh()
3157       {
3158         return MEDCoupling1DGTUMesh::New();
3159       }
3160       MEDCoupling1DGTUMesh(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception)
3161       {
3162         return MEDCoupling1DGTUMesh::New(name,type);
3163       }
3164
3165       MEDCoupling1DGTUMesh(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception)
3166       {
3167         return MEDCoupling1DGTUMesh::New(m);
3168       }
3169
3170       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3171       {
3172         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCoupling1DGTUMesh");
3173       }
3174
3175       std::string __str__() const throw(INTERP_KERNEL::Exception)
3176       {
3177         return self->simpleRepr();
3178       }
3179       
3180       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3181       {
3182         std::ostringstream oss;
3183         self->reprQuickOverview(oss);
3184         return oss.str();
3185       }
3186
3187       DataArrayInt *getNodalConnectivityIndex() const throw(INTERP_KERNEL::Exception)
3188       {
3189         DataArrayInt *ret=self->getNodalConnectivityIndex();
3190         if(ret) ret->incrRef();
3191         return ret;
3192       }
3193
3194       PyObject *retrievePackedNodalConnectivity() const throw(INTERP_KERNEL::Exception)
3195       {
3196         DataArrayInt *ret1=0,*ret2=0;
3197         bool ret0=self->retrievePackedNodalConnectivity(ret1,ret2);
3198         PyObject *ret0Py=ret0?Py_True:Py_False;
3199         Py_XINCREF(ret0Py);
3200         PyObject *ret=PyTuple_New(3);
3201         PyTuple_SetItem(ret,0,ret0Py);
3202         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3203         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
3204         return ret;
3205       }
3206       
3207       PyObject *copyWithNodalConnectivityPacked() const throw(INTERP_KERNEL::Exception)
3208       {
3209         bool ret1;
3210         MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
3211         PyObject *ret=PyTuple_New(2);
3212         PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
3213         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
3214         PyTuple_SetItem(ret,1,ret1Py);
3215         return ret;
3216       }
3217
3218       static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
3219       {
3220         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3221         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3222         return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
3223       }
3224       
3225       static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
3226       {
3227         std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
3228         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
3229         return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
3230       }
3231       
3232       static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
3233       {
3234         std::vector<const MEDCoupling::DataArrayInt *> tmp;
3235         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
3236         return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
3237       }
3238     }
3239   };
3240
3241   //== MEDCoupling1DGTUMeshEnd
3242
3243   class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
3244   {
3245   public:
3246     int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3247     int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
3248     int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3249     int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
3250     double computeSquareness() const throw(INTERP_KERNEL::Exception);
3251     virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
3252     std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
3253     MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
3254     std::vector<int> getLocationFromCellId(int cellId) const throw(INTERP_KERNEL::Exception);
3255     std::vector<int> getLocationFromNodeId(int cellId) const throw(INTERP_KERNEL::Exception);
3256     static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
3257     MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
3258     static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
3259     static DataArrayInt *ComputeCornersGhost(const std::vector<int>& st, int ghostLev) throw(INTERP_KERNEL::Exception);
3260     static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
3261     %extend
3262     {
3263       virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
3264       {
3265         int tmpp1=-1,tmpp2=-1;
3266         std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
3267         std::vector< std::pair<int,int> > inp;
3268         if(tmpp2==2)
3269           {
3270             inp.resize(tmpp1);
3271             for(int i=0;i<tmpp1;i++)
3272               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3273           }
3274         else if(tmpp2==1)
3275           {
3276             if(tmpp1%2!=0)
3277               throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
3278             inp.resize(tmpp1/2);
3279             for(int i=0;i<tmpp1/2;i++)
3280               { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
3281           }
3282         else
3283           throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
3284         return self->buildStructuredSubPart(inp);
3285       }
3286
3287       static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
3288       {
3289         std::vector< std::pair<int,int> > inp;
3290         convertPyToVectorPairInt(part,inp);
3291         //
3292         int szArr,sw,iTypppArr;
3293         std::vector<int> stdvecTyyppArr;
3294         const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
3295         std::vector<int> tmp5(tmp4,tmp4+szArr);
3296         //
3297         return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
3298       }
3299
3300       static void MultiplyPartOf(const std::vector<int>& st, PyObject *part, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3301       {
3302         std::vector< std::pair<int,int> > inp;
3303         convertPyToVectorPairInt(part,inp);
3304         MEDCouplingStructuredMesh::MultiplyPartOf(st,inp,factor,da);
3305       }
3306
3307       static void MultiplyPartOfByGhost(const std::vector<int>& st, PyObject *part, int ghostSize, double factor, DataArrayDouble *da) throw(INTERP_KERNEL::Exception)
3308       {
3309         std::vector< std::pair<int,int> > inp;
3310         convertPyToVectorPairInt(part,inp);
3311         MEDCouplingStructuredMesh::MultiplyPartOfByGhost(st,inp,ghostSize,factor,da);
3312       }
3313
3314       static PyObject *PutInGhostFormat(int ghostSize, const std::vector<int>& st, PyObject *part) throw(INTERP_KERNEL::Exception)
3315       {
3316         std::vector< std::pair<int,int> > inp;
3317         convertPyToVectorPairInt(part,inp);
3318         std::vector<int> stWithGhost;
3319         std::vector< std::pair<int,int> > partWithGhost;
3320         MEDCouplingStructuredMesh::PutInGhostFormat(ghostSize,st,inp,stWithGhost,partWithGhost);
3321         PyObject *ret(PyTuple_New(2));
3322         PyTuple_SetItem(ret,0,convertIntArrToPyList2(stWithGhost));
3323         PyTuple_SetItem(ret,1,convertFromVectorPairInt(partWithGhost));
3324         return ret;
3325       }
3326
3327       static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector<int>& st, const DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3328       {
3329         std::vector< std::pair<int,int> > inp;
3330         convertPyToVectorPairInt(partCompactFormat,inp);
3331         return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp);
3332       }
3333
3334       static void AssignPartOfFieldOfDoubleUsing(const std::vector<int>& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
3335       {
3336         std::vector< std::pair<int,int> > inp;
3337         convertPyToVectorPairInt(partCompactFormat,inp);
3338         MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other);
3339       }
3340
3341       static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
3342       {
3343         std::vector< std::pair<int,int> > inp;
3344         convertPyToVectorPairInt(part,inp);
3345         return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
3346       }
3347
3348       static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
3349       {
3350         int szArr,sw,iTypppArr;
3351         std::vector<int> stdvecTyyppArr;
3352         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3353         return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
3354       }
3355
3356       static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
3357       {
3358         int szArr,sw,iTypppArr;
3359         std::vector<int> stdvecTyyppArr;
3360         const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
3361         return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
3362       }
3363
3364       static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
3365       {
3366         std::vector< std::pair<int,int> > inp;
3367         convertPyToVectorPairInt(partCompactFormat,inp);
3368         return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
3369       }
3370
3371       static PyObject *GetCompactFrmtFromDimensions(const std::vector<int>& dims) throw(INTERP_KERNEL::Exception)
3372       {
3373         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dims));
3374         PyObject *retPy=PyList_New(ret.size());
3375         for(std::size_t i=0;i<ret.size();i++)
3376           {
3377             PyObject *tmp=PyTuple_New(2);
3378             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3379             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3380             PyList_SetItem(retPy,i,tmp);
3381           }
3382         return retPy;
3383       }
3384
3385       static PyObject *IntersectRanges(PyObject *r1, PyObject *r2) throw(INTERP_KERNEL::Exception)
3386       {
3387         std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3388         convertPyToVectorPairInt(r1,r1Cpp);
3389         convertPyToVectorPairInt(r2,r2Cpp);
3390         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::IntersectRanges(r1Cpp,r2Cpp));
3391         PyObject *retPy=PyList_New(ret.size());
3392         for(std::size_t i=0;i<ret.size();i++)
3393           {
3394             PyObject *tmp=PyTuple_New(2);
3395             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3396             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3397             PyList_SetItem(retPy,i,tmp);
3398           }
3399         return retPy;
3400       }
3401
3402       static bool AreRangesIntersect(PyObject *r1, PyObject *r2)
3403       {
3404         std::vector< std::pair<int,int> > r1Cpp,r2Cpp;
3405         convertPyToVectorPairInt(r1,r1Cpp);
3406         convertPyToVectorPairInt(r2,r2Cpp);
3407         return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp);
3408       }
3409
3410       static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
3411       {
3412         int szArr,sw,iTypppArr;
3413         std::vector<int> stdvecTyyppArr;
3414         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
3415         int szArr2,sw2,iTypppArr2;
3416         std::vector<int> stdvecTyyppArr2;
3417         const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
3418         std::vector<int> tmp3(tmp2,tmp2+szArr2);
3419         std::vector< std::pair<int,int> > partCompactFormat;
3420         bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
3421         PyObject *ret=PyTuple_New(2);
3422         PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
3423         PyTuple_SetItem(ret,0,ret0Py);
3424         PyObject *ret1Py=PyList_New(partCompactFormat.size());
3425         for(std::size_t i=0;i<partCompactFormat.size();i++)
3426           {
3427             PyObject *tmp4=PyTuple_New(2);
3428             PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
3429             PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
3430             PyList_SetItem(ret1Py,i,tmp4);
3431           }
3432         PyTuple_SetItem(ret,1,ret1Py);
3433         return ret;
3434       }
3435
3436       static PyObject *ChangeReferenceFromGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigInAbs, bool check=true) throw(INTERP_KERNEL::Exception)
3437       {
3438         std::vector< std::pair<int,int> > param0,param1,ret;
3439         convertPyToVectorPairInt(bigInAbs,param0);
3440         convertPyToVectorPairInt(partOfBigInAbs,param1);
3441         MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(param0,param1,ret,check);
3442         PyObject *retPy(PyList_New(ret.size()));
3443         for(std::size_t i=0;i<ret.size();i++)
3444           {
3445             PyObject *tmp(PyTuple_New(2));
3446             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3447             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3448             PyList_SetItem(retPy,i,tmp);
3449           }
3450         return retPy;
3451       }
3452
3453       static PyObject *TranslateCompactFrmt(PyObject *part, const std::vector<int>& translation) throw(INTERP_KERNEL::Exception)
3454       {
3455         std::vector< std::pair<int,int> > param0;
3456         convertPyToVectorPairInt(part,param0);
3457         std::vector< std::pair<int,int> > ret(MEDCouplingStructuredMesh::TranslateCompactFrmt(param0,translation));
3458         PyObject *retPy(PyList_New(ret.size()));
3459         for(std::size_t i=0;i<ret.size();i++)
3460           {
3461             PyObject *tmp(PyTuple_New(2));
3462             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3463             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3464             PyList_SetItem(retPy,i,tmp);
3465           }
3466         return retPy;
3467       }
3468
3469       static std::vector<int> FindTranslationFrom(PyObject *startingFrom, PyObject *goingTo) throw(INTERP_KERNEL::Exception)
3470       {
3471         std::vector< std::pair<int,int> > param0,param1;
3472         convertPyToVectorPairInt(startingFrom,param0);
3473         convertPyToVectorPairInt(goingTo,param1);
3474         return  MEDCouplingStructuredMesh::FindTranslationFrom(param0,param1);
3475       }
3476
3477       static PyObject *ChangeReferenceToGlobalOfCompactFrmt(PyObject *bigInAbs, PyObject *partOfBigRelativeToBig, bool check=true) throw(INTERP_KERNEL::Exception)
3478       {
3479         std::vector< std::pair<int,int> > param0,param1,ret;
3480         convertPyToVectorPairInt(bigInAbs,param0);
3481         convertPyToVectorPairInt(partOfBigRelativeToBig,param1);
3482         MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt(param0,param1,ret,check);
3483         PyObject *retPy(PyList_New(ret.size()));
3484         for(std::size_t i=0;i<ret.size();i++)
3485           {
3486             PyObject *tmp(PyTuple_New(2));
3487             PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
3488             PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
3489             PyList_SetItem(retPy,i,tmp);
3490           }
3491         return retPy;
3492       }
3493     }
3494   };
3495
3496   class MEDCouplingCurveLinearMesh;
3497
3498   //== MEDCouplingCMesh
3499   
3500   class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
3501   {
3502   public:
3503     static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
3504     static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3505     void setCoords(const DataArrayDouble *coordsX,
3506                    const DataArrayDouble *coordsY=0,
3507                    const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
3508     void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
3509     MEDCouplingCurveLinearMesh *buildCurveLinear() const throw(INTERP_KERNEL::Exception);
3510     %extend {
3511       MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
3512       {
3513         return MEDCouplingCMesh::New();
3514       }
3515       MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3516       {
3517         return MEDCouplingCMesh::New(meshName);
3518       }
3519       // serialization
3520       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3521       {
3522         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCMesh");
3523       }
3524       std::string __str__() const throw(INTERP_KERNEL::Exception)
3525       {
3526         return self->simpleRepr();
3527       }
3528       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3529       {
3530         std::ostringstream oss;
3531         self->reprQuickOverview(oss);
3532         return oss.str();
3533       }
3534       DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
3535       {
3536         DataArrayDouble *ret=self->getCoordsAt(i);
3537         if(ret)
3538           ret->incrRef();
3539         return ret;
3540       }
3541     }
3542   };
3543
3544   //== MEDCouplingCMesh End
3545
3546   //== MEDCouplingCurveLinearMesh
3547
3548   class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
3549   {
3550   public:
3551     static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
3552     static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
3553     void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
3554     %extend {
3555       MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
3556       {
3557         return MEDCouplingCurveLinearMesh::New();
3558       }
3559       MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
3560       {
3561         return MEDCouplingCurveLinearMesh::New(meshName);
3562       }
3563       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3564       {
3565         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingCurveLinearMesh");
3566       }
3567       std::string __str__() const throw(INTERP_KERNEL::Exception) 
3568       {
3569         return self->simpleRepr();
3570       }
3571       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3572       {
3573         std::ostringstream oss;
3574         self->reprQuickOverview(oss);
3575         return oss.str();
3576       }
3577       DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception)
3578       {
3579         DataArrayDouble *ret=self->getCoords();
3580         if(ret)
3581           ret->incrRef();
3582         return ret;
3583       }
3584       void setNodeGridStructure(PyObject *gridStruct) throw(INTERP_KERNEL::Exception)
3585       {
3586         int szArr,sw,iTypppArr;
3587         std::vector<int> stdvecTyyppArr;
3588         const int *tmp=convertObjToPossibleCpp1_Safe(gridStruct,sw,szArr,iTypppArr,stdvecTyyppArr);
3589         self->setNodeGridStructure(tmp,tmp+szArr);
3590       }
3591     }
3592   };
3593
3594   //== MEDCouplingCurveLinearMesh End
3595
3596   //== MEDCouplingIMesh
3597
3598   class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
3599   {
3600   public:
3601     static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
3602     //
3603     void setSpaceDimension(int spaceDim) throw(INTERP_KERNEL::Exception);
3604     std::vector<int> getNodeStruct() const throw(INTERP_KERNEL::Exception);
3605     std::vector<double> getOrigin() const throw(INTERP_KERNEL::Exception);
3606     std::vector<double> getDXYZ() const throw(INTERP_KERNEL::Exception);
3607     void setAxisUnit(const std::string& unitName) throw(INTERP_KERNEL::Exception);
3608     std::string getAxisUnit() const throw(INTERP_KERNEL::Exception);
3609     double getMeasureOfAnyCell() const throw(INTERP_KERNEL::Exception);
3610     MEDCouplingCMesh *convertToCartesian() const throw(INTERP_KERNEL::Exception);
3611     void refineWithFactor(const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
3612     MEDCouplingIMesh *asSingleCell() const throw(INTERP_KERNEL::Exception);
3613     MEDCouplingIMesh *buildWithGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
3614     %extend
3615     {
3616       MEDCouplingIMesh()
3617       {
3618         return MEDCouplingIMesh::New();
3619       }
3620       static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3621       {
3622         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
3623         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
3624         const int *nodeStrctPtr(0);
3625         const double *originPtr(0),*dxyzPtr(0);
3626         int sw,sz,val0;
3627         std::vector<int> bb0;
3628         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
3629         //
3630         double val,val2;
3631         std::vector<double> bb,bb2;
3632         int sz1,sz2;
3633         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
3634         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
3635         //
3636         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
3637       }
3638
3639       MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3640       {
3641         return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
3642       }
3643
3644       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
3645       {
3646         return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingIMesh");
3647       }
3648
3649       void setNodeStruct(PyObject *nodeStrct) throw(INTERP_KERNEL::Exception)
3650       {
3651         int sw,sz,val0;
3652         std::vector<int> bb0;
3653         const int *nodeStrctPtr(convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0));
3654         self->setNodeStruct(nodeStrctPtr,nodeStrctPtr+sz);
3655       }
3656
3657       void setOrigin(PyObject *origin) throw(INTERP_KERNEL::Exception)
3658       {
3659         static const char msg[]="MEDCouplingIMesh::setOrigin : invalid input 'origin' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3660         double val;
3661         DataArrayDouble *a;
3662         DataArrayDoubleTuple *aa;
3663         std::vector<double> bb;
3664         int sw,nbTuples;
3665         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg,false,nbTuples));
3666         self->setOrigin(originPtr,originPtr+nbTuples);
3667       }
3668       
3669       void setDXYZ(PyObject *dxyz) throw(INTERP_KERNEL::Exception)
3670       {
3671         static const char msg[]="MEDCouplingIMesh::setDXYZ : invalid input 'dxyz' parameter ! integer, float, list/tuple of float, DataArrayDouble or DataArrayDoubleTuple supported !";
3672         double val;
3673         DataArrayDouble *a;
3674         DataArrayDoubleTuple *aa;
3675         std::vector<double> bb;
3676         int sw,nbTuples;
3677         const double *originPtr(convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val,bb,msg,false,nbTuples));
3678         self->setDXYZ(originPtr,originPtr+nbTuples);
3679       }
3680
3681       static void CondenseFineToCoarse(const std::vector<int>& coarseSt, const DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, DataArrayDouble *coarseDA) throw(INTERP_KERNEL::Exception)
3682       {
3683         std::vector< std::pair<int,int> > inp;
3684         convertPyToVectorPairInt(fineLocInCoarse,inp);
3685         MEDCouplingIMesh::CondenseFineToCoarse(coarseSt,fineDA,inp,facts,coarseDA);
3686       }
3687
3688       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)
3689       {
3690         std::vector< std::pair<int,int> > inp;
3691         convertPyToVectorPairInt(fineLocInCoarse,inp);
3692         MEDCouplingIMesh::CondenseFineToCoarseGhost(coarseSt,fineDA,inp,facts,coarseDA,ghostSize);
3693       }
3694
3695       static void SpreadCoarseToFine(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts) throw(INTERP_KERNEL::Exception)
3696       {
3697         std::vector< std::pair<int,int> > inp;
3698         convertPyToVectorPairInt(fineLocInCoarse,inp);
3699         MEDCouplingIMesh::SpreadCoarseToFine(coarseDA,coarseSt,fineDA,inp,facts);
3700       }
3701
3702       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)
3703       {
3704         std::vector< std::pair<int,int> > inp;
3705         convertPyToVectorPairInt(fineLocInCoarse,inp);
3706         MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3707       }
3708
3709       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)
3710       {
3711         std::vector< std::pair<int,int> > inp;
3712         convertPyToVectorPairInt(fineLocInCoarse,inp);
3713         MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
3714       }
3715
3716       std::string __str__() const throw(INTERP_KERNEL::Exception)
3717       {
3718         return self->simpleRepr();
3719       }
3720       std::string __repr__() const throw(INTERP_KERNEL::Exception)
3721       {
3722         std::ostringstream oss;
3723         self->reprQuickOverview(oss);
3724         return oss.str();
3725       }
3726     }
3727   };
3728
3729   //== MEDCouplingIMesh End
3730
3731 }
3732
3733 namespace MEDCoupling
3734 {
3735   class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
3736   {
3737   public:
3738     virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
3739     virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
3740     virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3741     virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
3742     virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
3743     void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
3744     void setName(const char *name) throw(INTERP_KERNEL::Exception);
3745     std::string getDescription() const throw(INTERP_KERNEL::Exception);
3746     void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
3747     std::string getName() const throw(INTERP_KERNEL::Exception);
3748     TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
3749     NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
3750     virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
3751     DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
3752     MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
3753     int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
3754     int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
3755     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
3756                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
3757     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
3758     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
3759     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
3760     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
3761     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
3762     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
3763     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
3764     %extend {
3765       PyObject *getMesh() const throw(INTERP_KERNEL::Exception)
3766       {
3767         MEDCouplingMesh *ret1=const_cast<MEDCouplingMesh *>(self->getMesh());
3768         if(ret1)
3769           ret1->incrRef();
3770         return convertMesh(ret1,SWIG_POINTER_OWN | 0 );
3771       }
3772
3773       PyObject *getDiscretization() throw(INTERP_KERNEL::Exception)
3774       {
3775         MEDCouplingFieldDiscretization *ret=self->getDiscretization();
3776         if(ret)
3777           ret->incrRef();
3778         return convertFieldDiscretization(ret,SWIG_POINTER_OWN | 0 );
3779       }
3780
3781       PyObject *getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
3782       {
3783         std::set<int> ret=self->getGaussLocalizationIdsOfOneType(type);
3784         return convertIntArrToPyList3(ret);
3785       }
3786
3787       PyObject *isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception)
3788       {
3789         std::string ret1;
3790         bool ret0=self->isEqualIfNotWhy(other,meshPrec,valsPrec,ret1);
3791         PyObject *ret=PyTuple_New(2);
3792         PyObject *ret0Py=ret0?Py_True:Py_False;
3793         Py_XINCREF(ret0Py);
3794         PyTuple_SetItem(ret,0,ret0Py);
3795         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
3796         return ret;
3797       }
3798
3799       PyObject *buildSubMeshData(PyObject *li) const throw(INTERP_KERNEL::Exception)
3800       {
3801         DataArrayInt *ret1=0;
3802         MEDCouplingMesh *ret0=0;
3803         void *da=0;
3804         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3805         if (!SWIG_IsOK(res1))
3806           {
3807             int size;
3808             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3809             ret0=self->buildSubMeshData(tmp,tmp+size,ret1);
3810           }
3811         else
3812           {
3813             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3814             if(!da2)
3815               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3816             da2->checkAllocated();
3817             ret0=self->buildSubMeshData(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),ret1);
3818           }
3819         PyObject *res = PyList_New(2);
3820         PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3821         PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3822         return res;
3823       }
3824
3825       PyObject *buildSubMeshDataRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception)
3826       {
3827         DataArrayInt *ret1=0;
3828         int bb,ee,ss;
3829         MEDCouplingMesh *ret0=self->buildSubMeshDataRange(begin,end,step,bb,ee,ss,ret1);
3830         PyObject *res=PyTuple_New(2);
3831         PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
3832         if(ret1)
3833           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
3834         else
3835           {
3836             PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
3837             PyTuple_SetItem(res,1,res1);
3838           }
3839         return res;
3840       }
3841
3842       DataArrayInt *computeTupleIdsToSelectFromCellIds(PyObject *cellIds) const
3843       {
3844         int sw,sz(-1);
3845         int v0; std::vector<int> v1;
3846         const int *cellIdsBg(convertObjToPossibleCpp1_Safe(cellIds,sw,sz,v0,v1));
3847         return self->computeTupleIdsToSelectFromCellIds(cellIdsBg,cellIdsBg+sz);
3848       }
3849
3850       void setGaussLocalizationOnCells(PyObject *li, const std::vector<double>& refCoo,
3851                                        const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
3852       {
3853         void *da=0;
3854         int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 |  0 );
3855         if (!SWIG_IsOK(res1))
3856           {
3857             int size;
3858             INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(li,&size);
3859             self->setGaussLocalizationOnCells(tmp,((int *)tmp)+size,refCoo,gsCoo,wg);
3860           }
3861         else
3862           {
3863             DataArrayInt *da2=reinterpret_cast< DataArrayInt * >(da);
3864             if(!da2)
3865               throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !");
3866             da2->checkAllocated();
3867             self->setGaussLocalizationOnCells(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),refCoo,gsCoo,wg);
3868           }
3869       }
3870
3871       PyObject *getCellIdsHavingGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception)
3872       {
3873         std::vector<int> tmp;
3874         self->getCellIdsHavingGaussLocalization(locId,tmp);
3875         DataArrayInt *ret=DataArrayInt::New();
3876         ret->alloc((int)tmp.size(),1);
3877         std::copy(tmp.begin(),tmp.end(),ret->getPointer());
3878         return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
3879       }
3880       
3881       int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
3882       {
3883         std::vector<int> inp0;
3884         convertPyToNewIntArr4(code,1,3,inp0);
3885         std::vector<const DataArrayInt *> inp1;
3886         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
3887         return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
3888       }
3889     }
3890   };
3891   
3892   class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
3893   {
3894   public:
3895     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
3896     static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception);
3897     static MEDCouplingFieldTemplate *New(TypeOfField type);
3898     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3899     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3900     %extend
3901        {
3902          MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception)
3903          {
3904            return MEDCouplingFieldTemplate::New(f);
3905          }
3906
3907          MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f) throw(INTERP_KERNEL::Exception)
3908          {
3909            return MEDCouplingFieldTemplate::New(f);
3910          }
3911          
3912          MEDCouplingFieldTemplate(TypeOfField type) throw(INTERP_KERNEL::Exception)
3913          {
3914            return MEDCouplingFieldTemplate::New(type);
3915          }
3916          
3917          std::string __str__() const throw(INTERP_KERNEL::Exception)
3918          {
3919            return self->simpleRepr();
3920          }
3921          
3922          std::string __repr__() const throw(INTERP_KERNEL::Exception)
3923          {
3924            std::ostringstream oss;
3925            self->reprQuickOverview(oss);
3926            return oss.str();
3927          }
3928        }
3929   };
3930   
3931   class MEDCouplingFieldInt;
3932   
3933   class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
3934   {
3935   public:
3936     static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
3937     static MEDCouplingFieldDouble *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
3938     void setTimeUnit(const std::string& unit);
3939     std::string getTimeUnit() const;
3940     void synchronizeTimeWithSupport() throw(INTERP_KERNEL::Exception);
3941     void copyTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3942     void copyAllTinyAttrFrom(const MEDCouplingFieldDouble *other) throw(INTERP_KERNEL::Exception);
3943     std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
3944     std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
3945     std::string  writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
3946     MEDCouplingFieldInt *convertToIntField() const throw(INTERP_KERNEL::Exception);
3947     MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
3948     MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
3949     MEDCouplingFieldDouble *deepCopy() const;
3950     MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
3951     MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
3952     MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
3953     TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
3954     double getIJ(int tupleId, int compoId) const throw(INTERP_KERNEL::Exception);
3955     double getIJK(int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
3956     void synchronizeTimeWithMesh() throw(INTERP_KERNEL::Exception);
3957     void setArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3958     void setEndArray(DataArrayDouble *array) throw(INTERP_KERNEL::Exception);
3959     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3960     void setStartTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3961     void setEndTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
3962     void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
3963     void applyLin(double a, double b) throw(INTERP_KERNEL::Exception);
3964     int getNumberOfComponents() const throw(INTERP_KERNEL::Exception);
3965     int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
3966     int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
3967     void setTimeTolerance(double val) throw(INTERP_KERNEL::Exception);
3968     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
3969     void setIteration(int it) throw(INTERP_KERNEL::Exception);
3970     void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
3971     void setOrder(int order) throw(INTERP_KERNEL::Exception);
3972     void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
3973     void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
3974     void setEndTimeValue(double val) throw(INTERP_KERNEL::Exception);
3975     void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3976     void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
3977     bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3978     bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3979     bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3980     bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
3981     bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
3982     MEDCouplingFieldDouble *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
3983     MEDCouplingFieldDouble *determinant() const throw(INTERP_KERNEL::Exception);
3984     MEDCouplingFieldDouble *eigenValues() const throw(INTERP_KERNEL::Exception);
3985     MEDCouplingFieldDouble *eigenVectors() const throw(INTERP_KERNEL::Exception);
3986     MEDCouplingFieldDouble *inverse() const throw(INTERP_KERNEL::Exception);
3987     MEDCouplingFieldDouble *trace() const throw(INTERP_KERNEL::Exception);
3988     MEDCouplingFieldDouble *deviator() const throw(INTERP_KERNEL::Exception);
3989     MEDCouplingFieldDouble *magnitude() const throw(INTERP_KERNEL::Exception);
3990     MEDCouplingFieldDouble *maxPerTuple() const throw(INTERP_KERNEL::Exception);
3991     void changeNbOfComponents(int newNbOfComp, double dftValue=0.) throw(INTERP_KERNEL::Exception);
3992     void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
3993     MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
3994     void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3995     void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3996     void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
3997     void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3998     void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
3999     void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
4000     void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
4001     void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
4002     void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
4003     void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
4004     double accumulate(int compId) const throw(INTERP_KERNEL::Exception);
4005     double getMaxValue() const throw(INTERP_KERNEL::Exception);
4006     double getMinValue() const throw(INTERP_KERNEL::Exception);
4007     double getAverageValue() const throw(INTERP_KERNEL::Exception);
4008     double norm2() const throw(INTERP_KERNEL::Exception);
4009     double normMax() const throw(INTERP_KERNEL::Exception);
4010     //do not put a default value to isWAbs because confusion in python with overloaded getWeightedAverageValue method
4011     double getWeightedAverageValue(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4012     double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
4013     double normL1(int compId) const throw(INTERP_KERNEL::Exception);
4014     double normL2(int compId) const throw(INTERP_KERNEL::Exception);
4015     DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
4016     MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
4017     static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4018     static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4019     static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4020     MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4021     static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4022     MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4023     static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4024     MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4025     static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4026     static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4027     static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4028     static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4029     static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
4030     MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
4031     MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
4032     %extend {
4033       MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
4034       {
4035         return MEDCouplingFieldDouble::New(type,td);
4036       }
4037
4038       MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
4039       {
4040         return MEDCouplingFieldDouble::New(ft,td);
4041       }
4042
4043       std::string __str__() const throw(INTERP_KERNEL::Exception)
4044       {
4045         return self->simpleRepr();
4046       }
4047
4048       std::string __repr__() const throw(INTERP_KERNEL::Exception)
4049       {
4050         std::ostringstream oss;
4051         self->reprQuickOverview(oss);
4052         return oss.str();
4053       }
4054       
4055       MEDCouplingFieldDouble *voronoize(double eps) const throw(INTERP_KERNEL::Exception)
4056       {
4057         MCAuto<MEDCouplingFieldDouble> ret(self->voronoize(eps));
4058         return ret.retn();
4059       }
4060
4061       MEDCouplingFieldDouble *convertQuadraticCellsToLinear() const throw(INTERP_KERNEL::Exception)
4062       {
4063         MCAuto<MEDCouplingFieldDouble> ret(self->convertQuadraticCellsToLinear());
4064         return ret.retn();
4065       }
4066       
4067       MEDCouplingFieldDouble *computeVectorFieldCyl(PyObject *center, PyObject *vector) const
4068       {
4069         const char msg[]="Python wrap of MEDCouplingFieldDouble::computeVectorFieldCyl : ";
4070         double val,val2;
4071         DataArrayDouble *a,*a2;
4072         DataArrayDoubleTuple *aa,*aa2;
4073         std::vector<double> bb,bb2;
4074         int sw;
4075         const double *centerPtr=convertObjToPossibleCpp5_Safe(center,sw,val,a,aa,bb,msg,1,3,true);
4076         const double *vectorPtr=convertObjToPossibleCpp5_Safe(vector,sw,val2,a2,aa2,bb2,msg,1,3,true);
4077         return self->computeVectorFieldCyl(centerPtr,vectorPtr);
4078       }
4079
4080       DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception)
4081       {
4082         DataArrayDouble *ret=self->getArray();
4083         if(ret)
4084           ret->incrRef();
4085         return ret;
4086       }
4087
4088       PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
4089       {
4090         std::vector<DataArrayDouble *> arrs=self->getArrays();
4091         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
4092           if(*it)
4093             (*it)->incrRef();
4094         int sz=arrs.size();
4095         PyObject *ret=PyTuple_New(sz);
4096         for(int i=0;i<sz;i++)
4097           {
4098             if(arrs[i])
4099               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
4100             else
4101               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
4102           }
4103         return ret;
4104       }
4105
4106       void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
4107       {
4108         std::vector<const DataArrayDouble *> tmp;
4109         convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
4110         int sz=tmp.size();
4111         std::vector<DataArrayDouble *> arrs(sz);
4112         for(int i=0;i<sz;i++)
4113           arrs[i]=const_cast<DataArrayDouble *>(tmp[i]);
4114         self->setArrays(arrs);
4115       }
4116
4117       DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception)
4118       {
4119         DataArrayDouble *ret=self->getEndArray();
4120         if(ret)
4121           ret->incrRef();
4122         return ret;
4123       }
4124
4125       PyObject *getValueOn(PyObject *sl) const throw(INTERP_KERNEL::Exception)
4126       {
4127         double val;
4128         DataArrayDouble *a;
4129         DataArrayDoubleTuple *aa;
4130         std::vector<double> bb;
4131         int sw;
4132         const MEDCouplingMesh *mesh=self->getMesh();
4133         if(!mesh)
4134           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4135         int spaceDim=mesh->getSpaceDimension();
4136         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4137         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4138         //
4139         int sz=self->getNumberOfComponents();
4140         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4141         self->getValueOn(spaceLoc,res);
4142         return convertDblArrToPyList(res,sz);
4143       }
4144
4145        PyObject *getValueOnPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception)
4146        {
4147          int sz=self->getNumberOfComponents();
4148          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4149          self->getValueOnPos(i,j,k,res);
4150          return convertDblArrToPyList(res,sz);
4151        }
4152
4153       DataArrayDouble *getValueOnMulti(PyObject *locs) const throw(INTERP_KERNEL::Exception)
4154       {
4155         const MEDCouplingMesh *mesh(self->getMesh());
4156         if(!mesh)
4157           throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
4158         //
4159         int sw,nbPts;
4160         double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
4161         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
4162                                                          mesh->getSpaceDimension(),true,nbPts);
4163         return self->getValueOnMulti(inp,nbPts);
4164       }
4165
4166       PyObject *getValueOn(PyObject *sl, double time) const throw(INTERP_KERNEL::Exception)
4167       {
4168         double val;
4169         DataArrayDouble *a;
4170         DataArrayDoubleTuple *aa;
4171         std::vector<double> bb;
4172         int sw;
4173         const MEDCouplingMesh *mesh=self->getMesh();
4174         if(!mesh)
4175           throw INTERP_KERNEL::Exception("Python wrap of MEDCouplingFieldDouble::getValueOn : no underlying mesh !");
4176         int spaceDim=mesh->getSpaceDimension();
4177         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
4178         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
4179         //
4180         //
4181         int sz=self->getNumberOfComponents();
4182         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
4183         self->getValueOn(spaceLoc,time,res);
4184         return convertDblArrToPyList(res,sz);
4185       }
4186
4187       void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
4188       {
4189         if(self->getArray()!=0)
4190           MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
4191         else
4192           {
4193             MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
4194             MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
4195             self->setArray(arr);
4196           }
4197       }
4198       
4199       PyObject *getTime() throw(INTERP_KERNEL::Exception)
4200       {
4201         int tmp1,tmp2;
4202         double tmp0=self->getTime(tmp1,tmp2);
4203         PyObject *res = PyList_New(3);
4204         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4205         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4206         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4207         return res;
4208       }
4209
4210       PyObject *getStartTime() throw(INTERP_KERNEL::Exception)
4211       {
4212         int tmp1,tmp2;
4213         double tmp0=self->getStartTime(tmp1,tmp2);
4214         PyObject *res = PyList_New(3);
4215         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4216         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4217         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4218         return res;
4219       }
4220
4221       PyObject *getEndTime() throw(INTERP_KERNEL::Exception)
4222       {
4223         int tmp1,tmp2;
4224         double tmp0=self->getEndTime(tmp1,tmp2);
4225         PyObject *res = PyList_New(3);
4226         PyList_SetItem(res,0,SWIG_From_double(tmp0));
4227         PyList_SetItem(res,1,SWIG_From_int(tmp1));
4228         PyList_SetItem(res,2,SWIG_From_int(tmp2));
4229         return res;
4230       }
4231       PyObject *accumulate() const throw(INTERP_KERNEL::Exception)
4232       {
4233         int sz=self->getNumberOfComponents();
4234         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4235         self->accumulate(tmp);
4236         return convertDblArrToPyList(tmp,sz);
4237       }
4238       PyObject *integral(bool isWAbs) const throw(INTERP_KERNEL::Exception)
4239       {
4240         int sz=self->getNumberOfComponents();
4241         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4242         self->integral(isWAbs,tmp);
4243         return convertDblArrToPyList(tmp,sz);
4244       }
4245       PyObject *getWeightedAverageValue(bool isWAbs=true) const throw(INTERP_KERNEL::Exception)
4246       {
4247         int sz=self->getNumberOfComponents();
4248         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4249         self->getWeightedAverageValue(tmp,isWAbs);
4250         return convertDblArrToPyList(tmp,sz);
4251       }
4252       PyObject *normL1() const throw(INTERP_KERNEL::Exception)
4253       {
4254         int sz=self->getNumberOfComponents();
4255         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4256         self->normL1(tmp);
4257         return convertDblArrToPyList(tmp,sz);
4258       }
4259       PyObject *normL2() const throw(INTERP_KERNEL::Exception)
4260       {
4261         int sz=self->getNumberOfComponents();
4262         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
4263         self->normL2(tmp);
4264         return convertDblArrToPyList(tmp,sz);
4265       }
4266       void renumberCells(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4267       {
4268         int szArr,sw,iTypppArr;
4269         std::vector<int> stdvecTyyppArr;
4270         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4271         self->renumberCells(tmp,check);
4272       }
4273       
4274       void renumberCellsWithoutMesh(PyObject *li, bool check=true) throw(INTERP_KERNEL::Exception)
4275       {
4276         int szArr,sw,iTypppArr;
4277         std::vector<int> stdvecTyyppArr;
4278         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4279         self->renumberCellsWithoutMesh(tmp,check);
4280       }
4281       
4282       void renumberNodes(PyObject *li, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4283       {
4284         int szArr,sw,iTypppArr;
4285         std::vector<int> stdvecTyyppArr;
4286         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4287         self->renumberNodes(tmp,eps);
4288       }
4289
4290       void renumberNodesWithoutMesh(PyObject *li, int newNbOfNodes, double eps=1e-15) throw(INTERP_KERNEL::Exception)
4291       {
4292         int szArr,sw,iTypppArr;
4293         std::vector<int> stdvecTyyppArr;
4294         const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
4295         self->renumberNodesWithoutMesh(tmp,newNbOfNodes,eps);
4296       }
4297
4298       MEDCouplingFieldDouble *buildSubPart(PyObject *li) const throw(INTERP_KERNEL::Exception)
4299       {
4300         int sw;
4301         int singleVal;
4302         std::vector<int> multiVal;
4303         std::pair<int, std::pair<int,int> > slic;
4304         MEDCoupling::DataArrayInt *daIntTyypp=0;
4305         const MEDCouplingMesh *mesh=self->getMesh();
4306         if(!mesh)
4307           throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
4308         int nbc=mesh->getNumberOfCells();
4309         convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
4310         switch(sw)
4311           {
4312           case 1:
4313             {
4314               if(singleVal>=nbc)
4315                 {
4316                   std::ostringstream oss;
4317                   oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4318                   throw INTERP_KERNEL::Exception(oss.str().c_str());
4319                 }
4320               if(singleVal>=0)
4321                 return self->buildSubPart(&singleVal,&singleVal+1);
4322               else
4323                 {
4324                   if(nbc+singleVal>0)
4325                     {
4326                       int tmp=nbc+singleVal;
4327                       return self->buildSubPart(&tmp,&tmp+1);
4328                     }
4329                   else
4330                     {
4331                       std::ostringstream oss;
4332                       oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
4333                       throw INTERP_KERNEL::Exception(oss.str().c_str());
4334                     }
4335                 }
4336             }
4337           case 2:
4338             {
4339               return self->buildSubPart(&multiVal[0],&multiVal[0]+multiVal.size());
4340             }
4341           case 3:
4342             {
4343               return self->buildSubPartRange(slic.first,slic.second.first,slic.second.second);
4344             }
4345           case 4:
4346             {
4347               if(!daIntTyypp)
4348                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : null instance has been given in input !");
4349               daIntTyypp->checkAllocated();
4350               return self->buildSubPart(daIntTyypp->begin(),daIntTyypp->end());
4351             }
4352           default:
4353             throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
4354           }
4355       }
4356
4357       MEDCouplingFieldDouble *__getitem__(PyObject *li) const throw(INTERP_KERNEL::Exception)
4358       {
4359         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";
4360         if(PyTuple_Check(li))
4361           {
4362             Py_ssize_t sz=PyTuple_Size(li);
4363             if(sz!=2)
4364               throw INTERP_KERNEL::Exception(msg);
4365             PyObject *elt0=PyTuple_GetItem(li,0),*elt1=PyTuple_GetItem(li,1);
4366             int sw;
4367             int singleVal;
4368             std::vector<int> multiVal;
4369             std::pair<int, std::pair<int,int> > slic;
4370             MEDCoupling::DataArrayInt *daIntTyypp=0;
4371             if(!self->getArray())
4372               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
4373             try
4374               { convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
4375             catch(INTERP_KERNEL::Exception& e)
4376               { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
4377             MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
4378             DataArrayDouble *ret0Arr=ret0->getArray();
4379             if(!ret0Arr)
4380               throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
4381             switch(sw)
4382               {
4383               case 1:
4384                 {
4385                   std::vector<int> v2(1,singleVal);
4386                   MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4387                   ret0->setArray(aarr);
4388                   return ret0.retn();
4389                 }
4390               case 2:
4391                 {
4392                   MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
4393                   ret0->setArray(aarr);
4394                   return ret0.retn();
4395                 }
4396               case 3:
4397                 {
4398                   int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(slic.first,slic.second.first,slic.second.second,"MEDCouplingFieldDouble::__getitem__ : invalid range in 2nd parameter (components) !");
4399                   std::vector<int> v2(nbOfComp);
4400                   for(int i=0;i<nbOfComp;i++)
4401                     v2[i]=slic.first+i*slic.second.second;
4402                   MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
4403                   ret0->setArray(aarr);
4404                   return ret0.retn();
4405                 }
4406               default:
4407                 throw INTERP_KERNEL::Exception(msg);
4408               }
4409             
4410           }
4411         else
4412           return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
4413       }
4414
4415       PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
4416       {
4417         DataArrayInt *tmp;
4418         double r1=self->getMaxValue2(tmp);
4419         PyObject *ret=PyTuple_New(2);
4420         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4421         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4422         return ret;
4423       }
4424       
4425       PyObject *getMinValue2() const throw(INTERP_KERNEL::Exception)
4426       {
4427         DataArrayInt *tmp;
4428         double r1=self->getMinValue2(tmp);
4429         PyObject *ret=PyTuple_New(2);
4430         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
4431         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
4432         return ret;
4433       }
4434       
4435       MEDCouplingFieldDouble *keepSelectedComponents(PyObject *li) const throw(INTERP_KERNEL::Exception)
4436       {
4437         std::vector<int> tmp;
4438         convertPyToNewIntArr3(li,tmp);
4439         return self->keepSelectedComponents(tmp);
4440       }
4441
4442       void setSelectedComponents(const MEDCouplingFieldDouble *f, PyObject *li) throw(INTERP_KERNEL::Exception)
4443       {
4444         std::vector<int> tmp;
4445         convertPyToNewIntArr3(li,tmp);
4446         self->setSelectedComponents(f,tmp);
4447       }
4448
4449       MEDCouplingFieldDouble *extractSlice3D(PyObject *origin, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
4450       {
4451         double val,val2;
4452         DataArrayDouble *a,*a2;
4453         DataArrayDoubleTuple *aa,*aa2;
4454         std::vector<double> bb,bb2;
4455         int sw;
4456         int spaceDim=3;
4457         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st paramater for origin.";
4458         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd paramater for vector.";
4459         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
4460         const double *vect=convertObjToPossibleCpp5_Safe(vec,sw,val2,a2,aa2,bb2,msg2,1,spaceDim,true);
4461         //
4462         return self->extractSlice3D(orig,vect,eps);
4463       }
4464
4465       MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4466       {
4467         return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
4468       }
4469
4470       MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4471       {
4472         return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
4473       }
4474
4475       MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4476       {
4477         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.";
4478         const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
4479         void *argp;
4480         //
4481         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4482           {
4483             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4484             if(other)
4485               return (*self)-(*other);
4486             else
4487               throw INTERP_KERNEL::Exception(msg);
4488           }
4489         //
4490         double val;
4491         DataArrayDouble *a;
4492         DataArrayDoubleTuple *aa;
4493         std::vector<double> bb;
4494         int sw;
4495         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4496         switch(sw)
4497           {
4498           case 1:
4499             {
4500               if(!self->getArray())
4501                 throw INTERP_KERNEL::Exception(msg2);
4502               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4503               ret->applyLin(1.,-val);
4504               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4505               ret2->setArray(ret);
4506               return ret2.retn();
4507             }
4508           case 2:
4509             {
4510               if(!self->getArray())
4511                 throw INTERP_KERNEL::Exception(msg2);
4512               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
4513               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4514               ret2->setArray(ret);
4515               return ret2.retn();
4516             }
4517           case 3:
4518             {
4519               if(!self->getArray())
4520                 throw INTERP_KERNEL::Exception(msg2);
4521               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4522               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4523               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4524               ret2->setArray(ret);
4525               return ret2.retn();
4526             }
4527           case 4:
4528             {
4529               if(!self->getArray())
4530                 throw INTERP_KERNEL::Exception(msg2);
4531               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4532               MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
4533               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4534               ret2->setArray(ret);
4535               return ret2.retn();
4536             }
4537           default:
4538             { throw INTERP_KERNEL::Exception(msg); }
4539           }
4540       }
4541
4542       MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4543       {
4544         return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
4545       }
4546
4547       MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4548       {
4549         return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
4550       }
4551
4552       MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4553       {
4554         return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
4555       }
4556
4557       MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4558       {
4559         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.";
4560         const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
4561         void *argp;
4562         //
4563         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4564           {
4565             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4566             if(other)
4567               return (*self)/(*other);
4568             else
4569               throw INTERP_KERNEL::Exception(msg);
4570           }
4571         //
4572         double val;
4573         DataArrayDouble *a;
4574         DataArrayDoubleTuple *aa;
4575         std::vector<double> bb;
4576         int sw;
4577         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4578         switch(sw)
4579           {
4580           case 1:
4581             {
4582               if(val==0.)
4583                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
4584               if(!self->getArray())
4585                 throw INTERP_KERNEL::Exception(msg2);
4586               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4587               ret->applyLin(1./val,0);
4588               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4589               ret2->setArray(ret);
4590               return ret2.retn();
4591             }
4592           case 2:
4593             {
4594               if(!self->getArray())
4595                 throw INTERP_KERNEL::Exception(msg2);
4596               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
4597               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4598               ret2->setArray(ret);
4599               return ret2.retn();
4600             }
4601           case 3:
4602             {
4603               if(!self->getArray())
4604                 throw INTERP_KERNEL::Exception(msg2);
4605               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4606               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4607               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4608               ret2->setArray(ret);
4609               return ret2.retn();
4610             }
4611           case 4:
4612             {
4613               if(!self->getArray())
4614                 throw INTERP_KERNEL::Exception(msg2);
4615               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4616               MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
4617               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4618               ret2->setArray(ret);
4619               return ret2.retn();
4620             }
4621           default:
4622             { throw INTERP_KERNEL::Exception(msg); }
4623           }
4624       }
4625
4626       MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4627       {
4628         return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
4629       }
4630
4631       MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
4632       {
4633         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.";
4634         const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
4635         void *argp;
4636         //
4637         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4638           {
4639             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4640             if(other)
4641               return (*self)^(*other);
4642             else
4643               throw INTERP_KERNEL::Exception(msg);
4644           }
4645         //
4646         double val;
4647         DataArrayDouble *a;
4648         DataArrayDoubleTuple *aa;
4649         std::vector<double> bb;
4650         int sw;
4651         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4652         switch(sw)
4653           {
4654           case 1:
4655             {
4656               if(!self->getArray())
4657                 throw INTERP_KERNEL::Exception(msg2);
4658               MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
4659               ret->applyPow(val);
4660               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4661               ret2->setArray(ret);
4662               return ret2.retn();
4663             }
4664           case 2:
4665             {
4666               if(!self->getArray())
4667                 throw INTERP_KERNEL::Exception(msg2);
4668               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
4669               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4670               ret2->setArray(ret);
4671               return ret2.retn();
4672             }
4673           case 3:
4674             {
4675               if(!self->getArray())
4676                 throw INTERP_KERNEL::Exception(msg2);
4677               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4678               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4679               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4680               ret2->setArray(ret);
4681               return ret2.retn();
4682             }
4683           case 4:
4684             {
4685               if(!self->getArray())
4686                 throw INTERP_KERNEL::Exception(msg2);
4687               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4688               MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
4689               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4690               ret2->setArray(ret);
4691               return ret2.retn();
4692             }
4693           default:
4694             { throw INTERP_KERNEL::Exception(msg); }
4695           }
4696       }
4697
4698       MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
4699       {
4700         return self->negate();
4701       }
4702
4703       PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4704       {
4705         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.";
4706         const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
4707         void *argp;
4708         //
4709         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4710           {
4711             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4712             if(other)
4713               {
4714                 *self+=*other;
4715                 Py_XINCREF(trueSelf);
4716                 return trueSelf;
4717               }
4718             else
4719               throw INTERP_KERNEL::Exception(msg);
4720           }
4721         //
4722         double val;
4723         DataArrayDouble *a;
4724         DataArrayDoubleTuple *aa;
4725         std::vector<double> bb;
4726         int sw;
4727         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4728         switch(sw)
4729           {
4730           case 1:
4731             {
4732               if(!self->getArray())
4733                 throw INTERP_KERNEL::Exception(msg2);
4734               self->getArray()->applyLin(1.,val);
4735               Py_XINCREF(trueSelf);
4736               return trueSelf;
4737             }
4738           case 2:
4739             {
4740               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4741               ret2->setArray(a);
4742               *self+=*ret2;
4743               Py_XINCREF(trueSelf);
4744               return trueSelf;
4745             }
4746           case 3:
4747             {
4748               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4749               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4750               ret2->setArray(aaa);
4751               *self+=*ret2;
4752               Py_XINCREF(trueSelf);
4753               return trueSelf;
4754             }
4755           case 4:
4756             {
4757               if(!self->getArray())
4758                 throw INTERP_KERNEL::Exception(msg2);
4759               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4760               self->getArray()->addEqual(aaa);
4761               Py_XINCREF(trueSelf);
4762               return trueSelf;
4763             }
4764           default:
4765             { throw INTERP_KERNEL::Exception(msg); }
4766           }
4767       }
4768
4769       PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4770       {
4771         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.";
4772         const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
4773         void *argp;
4774         //
4775         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4776           {
4777             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4778             if(other)
4779               {
4780                 *self-=*other;
4781                 Py_XINCREF(trueSelf);
4782                 return trueSelf;
4783               }
4784             else
4785               throw INTERP_KERNEL::Exception(msg);
4786           }
4787         //
4788         double val;
4789         DataArrayDouble *a;
4790         DataArrayDoubleTuple *aa;
4791         std::vector<double> bb;
4792         int sw;
4793         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4794         switch(sw)
4795           {
4796           case 1:
4797             {
4798               if(!self->getArray())
4799                 throw INTERP_KERNEL::Exception(msg2);
4800               self->getArray()->applyLin(1.,-val);
4801               Py_XINCREF(trueSelf);
4802               return trueSelf;
4803             }
4804           case 2:
4805             {
4806               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4807               ret2->setArray(a);
4808               *self-=*ret2;
4809               Py_XINCREF(trueSelf);
4810               return trueSelf;
4811             }
4812           case 3:
4813             {
4814               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4815               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4816               ret2->setArray(aaa);
4817               *self-=*ret2;
4818               Py_XINCREF(trueSelf);
4819               return trueSelf;
4820             }
4821           case 4:
4822             {
4823               if(!self->getArray())
4824                 throw INTERP_KERNEL::Exception(msg2);
4825               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4826               self->getArray()->substractEqual(aaa);
4827               Py_XINCREF(trueSelf);
4828               return trueSelf;
4829             }
4830           default:
4831             { throw INTERP_KERNEL::Exception(msg); }
4832           }
4833       }
4834
4835       PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4836       {
4837         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.";
4838         const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
4839         void *argp;
4840         //
4841         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4842           {
4843             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4844             if(other)
4845               {
4846                 *self*=*other;
4847                 Py_XINCREF(trueSelf);
4848                 return trueSelf;
4849               }
4850             else
4851               throw INTERP_KERNEL::Exception(msg);
4852           }
4853         //
4854         double val;
4855         DataArrayDouble *a;
4856         DataArrayDoubleTuple *aa;
4857         std::vector<double> bb;
4858         int sw;
4859         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4860         switch(sw)
4861           {
4862           case 1:
4863             {
4864               if(!self->getArray())
4865                 throw INTERP_KERNEL::Exception(msg2);
4866               self->getArray()->applyLin(val,0);
4867               Py_XINCREF(trueSelf);
4868               return trueSelf;
4869             }
4870           case 2:
4871             {
4872               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4873               ret2->setArray(a);
4874               *self*=*ret2;
4875               Py_XINCREF(trueSelf);
4876               return trueSelf;
4877             }
4878           case 3:
4879             {
4880               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4881               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4882               ret2->setArray(aaa);
4883               *self*=*ret2;
4884               Py_XINCREF(trueSelf);
4885               return trueSelf;
4886             }
4887           case 4:
4888             {
4889               if(!self->getArray())
4890                 throw INTERP_KERNEL::Exception(msg2);
4891               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4892               self->getArray()->multiplyEqual(aaa);
4893               Py_XINCREF(trueSelf);
4894               return trueSelf;
4895             }
4896           default:
4897             { throw INTERP_KERNEL::Exception(msg); }
4898           }
4899       }
4900
4901       PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4902       {
4903         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.";
4904         const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
4905         void *argp;
4906         //
4907         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4908           {
4909             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4910             if(other)
4911               {
4912                 *self/=*other;
4913                 Py_XINCREF(trueSelf);
4914                 return trueSelf;
4915               }
4916             else
4917               throw INTERP_KERNEL::Exception(msg);
4918           }
4919         //
4920         double val;
4921         DataArrayDouble *a;
4922         DataArrayDoubleTuple *aa;
4923         std::vector<double> bb;
4924         int sw;
4925         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4926         switch(sw)
4927           {
4928           case 1:
4929             {
4930               if(val==0.)
4931                 throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__idiv__ : trying to divide by zero !");
4932               if(!self->getArray())
4933                 throw INTERP_KERNEL::Exception(msg2);
4934               self->getArray()->applyLin(1./val,0);
4935               Py_XINCREF(trueSelf);
4936               return trueSelf;
4937             }
4938           case 2:
4939             {
4940               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4941               ret2->setArray(a);
4942               *self/=*ret2;
4943               Py_XINCREF(trueSelf);
4944               return trueSelf;
4945             }
4946           case 3:
4947             {
4948               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
4949               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
4950               ret2->setArray(aaa);
4951               *self/=*ret2;
4952               Py_XINCREF(trueSelf);
4953               return trueSelf;
4954             }
4955           case 4:
4956             {
4957               if(!self->getArray())
4958                 throw INTERP_KERNEL::Exception(msg2);
4959               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
4960               self->getArray()->divideEqual(aaa);
4961               Py_XINCREF(trueSelf);
4962               return trueSelf;
4963             }
4964           default:
4965             { throw INTERP_KERNEL::Exception(msg); }
4966           }
4967       }
4968
4969       PyObject *___ipow___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
4970       {
4971         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.";
4972         const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
4973         void *argp;
4974         //
4975         if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
4976           {
4977             MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
4978             if(other)
4979               {
4980                 *self^=*other;
4981                 Py_XINCREF(trueSelf);
4982                 return trueSelf;
4983               }
4984             else
4985               throw INTERP_KERNEL::Exception(msg);
4986           }
4987         //
4988         double val;
4989         DataArrayDouble *a;
4990         DataArrayDoubleTuple *aa;
4991         std::vector<double> bb;
4992         int sw;
4993         convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
4994         switch(sw)
4995           {
4996           case 1:
4997             {
4998               if(!self->getArray())
4999                 throw INTERP_KERNEL::Exception(msg2);
5000               self->getArray()->applyPow(val);
5001               Py_XINCREF(trueSelf);
5002               return trueSelf;
5003             }
5004           case 2:
5005             {
5006               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5007               ret2->setArray(a);
5008               *self^=*ret2;
5009               Py_XINCREF(trueSelf);
5010               return trueSelf;
5011             }
5012           case 3:
5013             {
5014               MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
5015               MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
5016               ret2->setArray(aaa);
5017               *self^=*ret2;
5018               Py_XINCREF(trueSelf);
5019               return trueSelf;
5020             }
5021           case 4:
5022             {
5023               if(!self->getArray())
5024                 throw INTERP_KERNEL::Exception(msg2);
5025               MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
5026               self->getArray()->powEqual(aaa);
5027               Py_XINCREF(trueSelf);
5028               return trueSelf;
5029             }
5030           default:
5031             { throw INTERP_KERNEL::Exception(msg); }
5032           }
5033       }
5034
5035       static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5036       {
5037         std::vector<const MEDCouplingFieldDouble *> tmp;
5038         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5039         return MEDCouplingFieldDouble::MergeFields(tmp);
5040       }
5041
5042       static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
5043       {
5044         std::vector<const MEDCouplingFieldDouble *> tmp;
5045         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5046         return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
5047       }
5048
5049       PyObject *getTinySerializationInformation() const throw(INTERP_KERNEL::Exception)
5050       {
5051         std::vector<double> a0;
5052         std::vector<int> a1;
5053         std::vector<std::string> a2;
5054         self->getTinySerializationDbleInformation(a0);
5055         self->getTinySerializationIntInformation(a1);
5056         self->getTinySerializationStrInformation(a2);
5057         //
5058         PyObject *ret(PyTuple_New(3));
5059         PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
5060         PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
5061         int sz(a2.size());
5062         PyObject *ret2(PyList_New(sz));
5063         {
5064           for(int i=0;i<sz;i++)
5065             PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
5066         }
5067         PyTuple_SetItem(ret,2,ret2);
5068         return ret;
5069       }
5070       
5071       PyObject *serialize() const throw(INTERP_KERNEL::Exception)
5072       {
5073         DataArrayInt *ret0(0);
5074         std::vector<DataArrayDouble *> ret1;
5075         self->serialize(ret0,ret1);
5076         if(ret0)
5077           ret0->incrRef();
5078         std::size_t sz(ret1.size());
5079         PyObject *ret(PyTuple_New(2));
5080         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
5081         PyObject *ret1Py(PyList_New(sz));
5082         for(std::size_t i=0;i<sz;i++)
5083           {
5084             if(ret1[i])
5085               ret1[i]->incrRef();
5086             PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5087           }
5088         PyTuple_SetItem(ret,1,ret1Py);
5089         return ret;
5090       }
5091
5092       static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
5093       {
5094         static const char MSG[]="MEDCouplingFieldDouble.__new__ : the args in input is expected to be a tuple !";
5095         if(!PyTuple_Check(args))
5096           throw INTERP_KERNEL::Exception(MSG);
5097         PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
5098         PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
5099         PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
5100         //
5101         PyObject *tmp0(PyTuple_New(1));
5102         PyTuple_SetItem(tmp0,0,cls); Py_XINCREF(cls);
5103         PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
5104         Py_DECREF(tmp0);
5105         Py_DECREF(selfMeth);
5106         if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)) && PyDict_Size(PyTuple_GetItem(args,1))==1 )
5107           {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
5108             PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
5109             ////
5110             PyObject *a(PyInt_FromLong(0));
5111             PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
5112             Py_DECREF(a);
5113             if(!uniqueElt)
5114               throw INTERP_KERNEL::Exception(MSG);
5115             if(!PyTuple_Check(uniqueElt) || PyTuple_Size(uniqueElt)!=2)
5116               throw INTERP_KERNEL::Exception(MSG);
5117             PyObject *tmp2(PyObject_CallObject(initMeth,uniqueElt));
5118             Py_XDECREF(tmp2);
5119             ////
5120             Py_DECREF(initMeth);
5121           }
5122         return instance;
5123       }
5124
5125       PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
5126       {// put an empty dict in input to say to __new__ to call __init__...
5127         self->checkConsistencyLight();
5128         PyObject *ret(PyTuple_New(1));
5129         PyObject *ret0(PyDict_New());
5130         {
5131           PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
5132           PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
5133           PyDict_SetItem(ret0,a,d);
5134           Py_DECREF(a); Py_DECREF(d);
5135         }
5136         PyTuple_SetItem(ret,0,ret0);
5137         return ret;
5138       }
5139
5140       PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
5141       {
5142         self->checkConsistencyLight();
5143         PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
5144         PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
5145         const MEDCouplingMesh *mesh(self->getMesh());
5146         if(mesh)
5147           mesh->incrRef();
5148         PyObject *ret(PyTuple_New(3));
5149         PyTuple_SetItem(ret,0,ret0);
5150         PyTuple_SetItem(ret,1,ret1);
5151         PyTuple_SetItem(ret,2,convertMesh(const_cast<MEDCouplingMesh *>(mesh),SWIG_POINTER_OWN | 0 ));
5152         return ret;
5153       }
5154       
5155       void __setstate__(PyObject *inp) throw(INTERP_KERNEL::Exception)
5156       {
5157         static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
5158         if(!PyTuple_Check(inp))
5159           throw INTERP_KERNEL::Exception(MSG);
5160         int sz(PyTuple_Size(inp));
5161         if(sz!=3)
5162           throw INTERP_KERNEL::Exception(MSG);
5163         // mesh
5164         PyObject *elt2(PyTuple_GetItem(inp,2));
5165         void *argp=0;
5166         int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
5167         if(!SWIG_IsOK(status))
5168           throw INTERP_KERNEL::Exception(MSG);
5169         self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
5170         //
5171         PyObject *elt0(PyTuple_GetItem(inp,0));
5172         PyObject *elt1(PyTuple_GetItem(inp,1));
5173         std::vector<double> a0;
5174         std::vector<int> a1;
5175         std::vector<std::string> a2;
5176         DataArrayInt *b0(0);
5177         std::vector<DataArrayDouble *>b1;
5178         {
5179           if(!PyTuple_Check(elt0) && PyTuple_Size(elt0)!=3)
5180             throw INTERP_KERNEL::Exception(MSG);
5181           PyObject *a0py(PyTuple_GetItem(elt0,0)),*a1py(PyTuple_GetItem(elt0,1)),*a2py(PyTuple_GetItem(elt0,2));
5182           int tmp(-1);
5183           fillArrayWithPyListDbl3(a0py,tmp,a0);
5184           convertPyToNewIntArr3(a1py,a1);
5185           fillStringVector(a2py,a2);
5186         }
5187         {
5188           if(!PyTuple_Check(elt1) && PyTuple_Size(elt1)!=2)
5189             throw INTERP_KERNEL::Exception(MSG);
5190           PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
5191           void *argp(0);
5192           int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
5193           if(!SWIG_IsOK(status))
5194             throw INTERP_KERNEL::Exception(MSG);
5195           b0=reinterpret_cast<DataArrayInt *>(argp);
5196           convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
5197         }
5198         self->checkForUnserialization(a1,b0,b1);
5199         // useless here to call resizeForUnserialization because arrays are well resized.
5200         self->finishUnserialization(a1,a0,a2);
5201       }
5202     }
5203   };
5204
5205   class MEDCouplingMultiFields : public RefCountObject, public TimeLabel
5206   {
5207   public:
5208     int getNumberOfFields() const;
5209     MEDCouplingMultiFields *deepCopy() const;
5210     virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
5211     virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
5212     virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5213     virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
5214     virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
5215     %extend
5216        {
5217          std::string __str__() const throw(INTERP_KERNEL::Exception)
5218          {
5219            return self->simpleRepr();
5220          }
5221          static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5222          {
5223            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5224            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5225            int sz=tmp.size();
5226            std::vector<MEDCouplingFieldDouble *> fs(sz);
5227            for(int i=0;i<sz;i++)
5228              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5229            return MEDCouplingMultiFields::New(fs);
5230          }
5231          MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
5232          {
5233            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5234            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5235            int sz=tmp.size();
5236            std::vector<MEDCouplingFieldDouble *> fs(sz);
5237            for(int i=0;i<sz;i++)
5238              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5239            return MEDCouplingMultiFields::New(fs);
5240          }
5241          PyObject *getFields() const
5242          {
5243            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
5244            int sz=fields.size();
5245            PyObject *res = PyList_New(sz);
5246            for(int i=0;i<sz;i++)
5247              {
5248                if(fields[i])
5249                  {
5250                    fields[i]->incrRef();
5251                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
5252                  }
5253                else
5254                  {
5255                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
5256                  }
5257              }
5258            return res;
5259          }
5260          PyObject *getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception)
5261          {
5262            const MEDCouplingFieldDouble *ret=self->getFieldAtPos(id);
5263            if(ret)
5264              {
5265                ret->incrRef();
5266                return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
5267              }
5268            else
5269              return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
5270          }
5271          PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
5272          {
5273            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
5274            int sz=ms.size();
5275            PyObject *res = PyList_New(sz);
5276            for(int i=0;i<sz;i++)
5277              {
5278                if(ms[i])
5279                  {
5280                    ms[i]->incrRef();
5281                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5282                  }
5283                else
5284                  {
5285                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5286                  }
5287              }
5288            return res;
5289          }
5290          PyObject *getDifferentMeshes() const throw(INTERP_KERNEL::Exception)
5291          {
5292            std::vector<int> refs;
5293            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
5294            int sz=ms.size();
5295            PyObject *res = PyList_New(sz);
5296            for(int i=0;i<sz;i++)
5297              {
5298                if(ms[i])
5299                  {
5300                    ms[i]->incrRef();
5301                    PyList_SetItem(res,i,convertMesh(ms[i], SWIG_POINTER_OWN | 0 ));
5302                  }
5303                else
5304                  {
5305                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
5306                  }
5307              }
5308            //
5309            PyObject *ret=PyTuple_New(2);
5310            PyTuple_SetItem(ret,0,res);
5311            PyTuple_SetItem(ret,1,convertIntArrToPyList2(refs));
5312            return ret;
5313          }
5314          PyObject *getArrays() const throw(INTERP_KERNEL::Exception)
5315          {
5316            std::vector<DataArrayDouble *> ms=self->getArrays();
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,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5325                  }
5326                else
5327                  {
5328                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5329                  }
5330              }
5331            return res;
5332          }
5333          PyObject *getDifferentArrays() const throw(INTERP_KERNEL::Exception)
5334          {
5335            std::vector< std::vector<int> > refs;
5336            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
5337            int sz=ms.size();
5338            PyObject *res = PyList_New(sz);
5339            PyObject *res2 = PyList_New(sz);
5340            for(int i=0;i<sz;i++)
5341              {
5342                if(ms[i])
5343                  {
5344                    ms[i]->incrRef();
5345                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5346                  }
5347                else
5348                  {
5349                    PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
5350                  }
5351                PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
5352              }
5353            //
5354            PyObject *ret=PyTuple_New(2);
5355            PyTuple_SetItem(ret,0,res);
5356            PyTuple_SetItem(ret,1,res2);
5357            return ret;
5358          }
5359        }
5360   };
5361
5362   class MEDCouplingFieldInt : public MEDCouplingField
5363   {
5364   public:
5365     static MEDCouplingFieldInt *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
5366     static MEDCouplingFieldInt *New(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME);
5367     void setTimeUnit(const std::string& unit) throw(INTERP_KERNEL::Exception);
5368     std::string getTimeUnit() const throw(INTERP_KERNEL::Exception);
5369     void setTime(double val, int iteration, int order) throw(INTERP_KERNEL::Exception);
5370     void setArray(DataArrayInt *array) throw(INTERP_KERNEL::Exception);
5371     MEDCouplingFieldInt *deepCopy() const throw(INTERP_KERNEL::Exception);
5372     MEDCouplingFieldInt *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5373     MEDCouplingFieldInt *cloneWithMesh(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
5374     MEDCouplingFieldDouble *convertToDblField() const throw(INTERP_KERNEL::Exception);
5375     %extend {
5376       MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
5377       {
5378         return MEDCouplingFieldInt::New(type,td);
5379       }
5380
5381       MEDCouplingFieldInt(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td=ONE_TIME)
5382       {
5383         return MEDCouplingFieldInt::New(ft,td);
5384       }
5385
5386       std::string __str__() const throw(INTERP_KERNEL::Exception)
5387       {
5388         return self->simpleRepr();
5389       }
5390
5391       std::string __repr__() const throw(INTERP_KERNEL::Exception)
5392       {
5393         std::ostringstream oss;
5394         self->reprQuickOverview(oss);
5395         return oss.str();
5396       }
5397
5398       DataArrayInt *getArray() throw(INTERP_KERNEL::Exception)
5399         {
5400           DataArrayInt *ret=self->getArray();
5401           if(ret)
5402             ret->incrRef();
5403           return ret;
5404         }
5405       
5406       PyObject *getTime() throw(INTERP_KERNEL::Exception)
5407         {
5408         int tmp1,tmp2;
5409         double tmp0=self->getTime(tmp1,tmp2);
5410         PyObject *res = PyList_New(3);
5411         PyList_SetItem(res,0,SWIG_From_double(tmp0));
5412         PyList_SetItem(res,1,SWIG_From_int(tmp1));
5413         PyList_SetItem(res,2,SWIG_From_int(tmp2));
5414         return res;
5415         }
5416     }
5417   };
5418   
5419   class MEDCouplingDefinitionTime
5420   {
5421   public:
5422     MEDCouplingDefinitionTime();
5423     void assign(const MEDCouplingDefinitionTime& other);
5424     bool isEqual(const MEDCouplingDefinitionTime& other) const;
5425     double getTimeResolution() const;
5426     std::vector<double> getHotSpotsTime() const;
5427     %extend
5428       {
5429         std::string __str__() const throw(INTERP_KERNEL::Exception)
5430           {
5431             std::ostringstream oss;
5432             self->appendRepr(oss);
5433             return oss.str();
5434           }
5435
5436         PyObject *getIdsOnTimeRight(double tm) const throw(INTERP_KERNEL::Exception)
5437         {
5438           int meshId,arrId,arrIdInField,fieldId;
5439           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
5440           PyObject *res=PyList_New(4);
5441           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5442           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5443           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5444           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5445           return res;
5446         }
5447
5448         PyObject *getIdsOnTimeLeft(double tm) const throw(INTERP_KERNEL::Exception)
5449         {
5450           int meshId,arrId,arrIdInField,fieldId;
5451           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
5452           PyObject *res=PyList_New(4);
5453           PyList_SetItem(res,0,PyInt_FromLong(meshId));
5454           PyList_SetItem(res,1,PyInt_FromLong(arrId));
5455           PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
5456           PyList_SetItem(res,3,PyInt_FromLong(fieldId));
5457           return res;
5458         }
5459       }
5460   };
5461
5462   class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
5463   {
5464   public:
5465     double getTimeTolerance() const throw(INTERP_KERNEL::Exception);
5466     MEDCouplingDefinitionTime getDefinitionTimeZone() const;
5467     
5468     %extend
5469       {
5470         MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
5471           {
5472             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5473             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5474             int sz=tmp.size();
5475             std::vector<MEDCouplingFieldDouble *> fs(sz);
5476             for(int i=0;i<sz;i++)
5477               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5478             return MEDCouplingFieldOverTime::New(fs);
5479           }
5480         std::string __str__() const throw(INTERP_KERNEL::Exception)
5481           {
5482             return self->simpleRepr();
5483           }
5484         static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
5485         {
5486           std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
5487           convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
5488            int sz=tmp.size();
5489            std::vector<MEDCouplingFieldDouble *> fs(sz);
5490            for(int i=0;i<sz;i++)
5491              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
5492            return MEDCouplingFieldOverTime::New(fs);
5493          }
5494       }
5495   };
5496
5497   class MEDCouplingCartesianAMRMesh;
5498   
5499   class MEDCouplingCartesianAMRPatchGen : public RefCountObject
5500   {
5501   public:
5502     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5503     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5504     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5505     %extend
5506     {
5507       MEDCouplingCartesianAMRMeshGen *getMesh() const throw(INTERP_KERNEL::Exception)
5508       {
5509         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5510         if(ret)
5511           ret->incrRef();
5512         return ret;
5513       }
5514     }
5515   };
5516
5517   class MEDCouplingCartesianAMRPatch : public MEDCouplingCartesianAMRPatchGen
5518   {
5519   public:
5520     int getNumberOfOverlapedCellsForFather() const throw(INTERP_KERNEL::Exception);
5521     bool isInMyNeighborhood(const MEDCouplingCartesianAMRPatch *other, int ghostLev) const throw(INTERP_KERNEL::Exception);
5522     std::vector<int> computeCellGridSt() const throw(INTERP_KERNEL::Exception);
5523     %extend
5524     {
5525       PyObject *getBLTRRange() const throw(INTERP_KERNEL::Exception)
5526       {
5527         const std::vector< std::pair<int,int> >& ret(self->getBLTRRange());
5528         return convertFromVectorPairInt(ret);
5529       }
5530
5531       PyObject *getBLTRRangeRelativeToGF() const throw(INTERP_KERNEL::Exception)
5532       {
5533         std::vector< std::pair<int,int> > ret(self->getBLTRRangeRelativeToGF());
5534         return convertFromVectorPairInt(ret);
5535       }
5536
5537       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5538       {
5539         std::vector< std::pair<int,int> > inp;
5540         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5541         self->addPatch(inp,factors);
5542       }
5543
5544       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5545       {
5546         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5547         if(!mesh)
5548           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatchGen.__getitem__ : no underlying mesh !");
5549         if(patchId==mesh->getNumberOfPatches())
5550           {
5551             std::ostringstream oss;
5552             oss << "Requesting for patchId " << patchId << " having only " << mesh->getNumberOfPatches() << " patches !";
5553             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5554             return 0;
5555           }
5556         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(mesh->getPatch(patchId)));
5557         if(ret)
5558           ret->incrRef();
5559         return ret;
5560       }
5561
5562       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5563       {
5564         MEDCouplingCartesianAMRMeshGen *mesh(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getMesh()));
5565         if(!mesh)
5566           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__delitem__ : no underlying mesh !");
5567         mesh->removePatch(patchId);
5568       }
5569
5570       int __len__() const throw(INTERP_KERNEL::Exception)
5571       {
5572         const MEDCouplingCartesianAMRMeshGen *mesh(self->getMesh());
5573         if(!mesh)
5574           throw INTERP_KERNEL::Exception("wrap MEDCouplingCartesianAMRPatch.__len__ : no underlying mesh !");
5575         return mesh->getNumberOfPatches();
5576       }
5577     }
5578   };
5579
5580   class MEDCouplingCartesianAMRPatchGF : public MEDCouplingCartesianAMRPatchGen
5581   {
5582   };
5583   
5584   class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
5585   {
5586   public:
5587     int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception);
5588     int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5589     std::vector<int> getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception);
5590     int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
5591     const std::vector<int>& getFactors() const throw(INTERP_KERNEL::Exception);
5592     void setFactors(const std::vector<int>& newFactors) throw(INTERP_KERNEL::Exception);
5593     int getMaxNumberOfLevelsRelativeToThis() const throw(INTERP_KERNEL::Exception);
5594     int getNumberOfCellsAtCurrentLevel() const throw(INTERP_KERNEL::Exception);
5595     int getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const throw(INTERP_KERNEL::Exception);
5596     int getNumberOfCellsRecursiveWithOverlap() const throw(INTERP_KERNEL::Exception);
5597     int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
5598     bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
5599    virtual void detachFromFather() throw(INTERP_KERNEL::Exception);
5600     //
5601     int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
5602     int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
5603     MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
5604     DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
5605     std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5606     MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
5607     MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
5608     void removeAllPatches() throw(INTERP_KERNEL::Exception);
5609     void removePatch(int patchId) throw(INTERP_KERNEL::Exception);
5610     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayByte *criterion, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception);
5611     void createPatchesFromCriterion(const INTERP_KERNEL::BoxSplittingOptions& bso, const DataArrayDouble *criterion, const std::vector<int>& factors, double eps) throw(INTERP_KERNEL::Exception);
5612     DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
5613     void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5614     void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5615     void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
5616     void fillCellFieldOnPatchOnlyOnGhostZoneWith(int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const;
5617     void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5618     void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const throw(INTERP_KERNEL::Exception);
5619     DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
5620     std::string buildPythonDumpOfThis() const throw(INTERP_KERNEL::Exception);
5621     %extend
5622     {
5623       void addPatch(PyObject *bottomLeftTopRight, const std::vector<int>& factors) throw(INTERP_KERNEL::Exception)
5624       {
5625         std::vector< std::pair<int,int> > inp;
5626         convertPyToVectorPairInt(bottomLeftTopRight,inp);
5627         self->addPatch(inp,factors);
5628       }
5629
5630       PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
5631       {
5632         std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
5633         int sz(ps.size());
5634         PyObject *ret = PyList_New(sz);
5635         for(int i=0;i<sz;i++)
5636           {
5637             MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
5638             if(elt)
5639               elt->incrRef();
5640             PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
5641           }
5642         return ret;
5643       }
5644
5645       // agy : don't know why typemap fails here ??? let it in the extend section
5646       PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
5647       {
5648         return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
5649       }
5650
5651       MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5652       {
5653         const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos));
5654         MEDCouplingCartesianAMRPatch *ret2(const_cast<MEDCouplingCartesianAMRPatch *>(ret));
5655         if(ret2)
5656           ret2->incrRef();
5657         return ret2;
5658       }
5659
5660       MEDCouplingCartesianAMRMeshGen *getMeshAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
5661       {
5662         const MEDCouplingCartesianAMRMeshGen *ret(self->getMeshAtPosition(pos));
5663         MEDCouplingCartesianAMRMeshGen *ret2(const_cast<MEDCouplingCartesianAMRMeshGen *>(ret));
5664         if(ret2)
5665           ret2->incrRef();
5666         return ret2;
5667       }
5668
5669       virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception)
5670       {
5671         std::vector<int> out1;
5672         std::vector< std::pair<int,int> > out0(self->positionRelativeToGodFather(out1));
5673         PyObject *ret(PyTuple_New(2));
5674         PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0));
5675         PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1));
5676         return ret;
5677       }
5678
5679       virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
5680       {
5681         std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
5682         int sz(ps.size());
5683         PyObject *ret = PyList_New(sz);
5684         for(int i=0;i<sz;i++)
5685           PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
5686         return ret;
5687       }
5688
5689       MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
5690       {
5691         std::vector<const DataArrayDouble *> inp;
5692         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
5693         return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
5694       }
5695
5696       virtual MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
5697       {
5698         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
5699         if(ret)
5700           ret->incrRef();
5701         return ret;
5702       }
5703       
5704       virtual MEDCouplingCartesianAMRMeshGen *getGodFather() const throw(INTERP_KERNEL::Exception)
5705       {
5706         MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getGodFather()));
5707         if(ret)
5708           ret->incrRef();
5709         return ret;
5710       }
5711
5712       MEDCouplingCartesianAMRPatch *getPatch(int patchId) const throw(INTERP_KERNEL::Exception)
5713       {
5714         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5715         if(ret)
5716           ret->incrRef();
5717         return ret;
5718       }
5719
5720       MEDCouplingIMesh *getImageMesh() const throw(INTERP_KERNEL::Exception)
5721       {
5722         const MEDCouplingIMesh *ret(self->getImageMesh());
5723         if(ret)
5724           ret->incrRef();
5725         return const_cast<MEDCouplingIMesh *>(ret);
5726       }
5727
5728       MEDCouplingCartesianAMRPatch *__getitem__(int patchId) const throw(INTERP_KERNEL::Exception)
5729       {
5730         if(patchId==self->getNumberOfPatches())
5731           {
5732             std::ostringstream oss;
5733             oss << "Requesting for patchId " << patchId << " having only " << self->getNumberOfPatches() << " patches !";
5734             PyErr_SetString(PyExc_StopIteration,oss.str().c_str());
5735             return 0;
5736           }
5737         MEDCouplingCartesianAMRPatch *ret(const_cast<MEDCouplingCartesianAMRPatch *>(self->getPatch(patchId)));
5738         if(ret)
5739           ret->incrRef();
5740         return ret;
5741       }
5742
5743       void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
5744       {
5745         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5746         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5747         self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
5748       }
5749
5750       void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
5751       {
5752         std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
5753         convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
5754         self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
5755       }
5756
5757       void __delitem__(int patchId) throw(INTERP_KERNEL::Exception)
5758       {
5759         self->removePatch(patchId);
5760       }
5761
5762       int __len__() const throw(INTERP_KERNEL::Exception)
5763       {
5764         return self->getNumberOfPatches();
5765       }
5766     }
5767   };
5768
5769   class MEDCouplingCartesianAMRMeshSub : public MEDCouplingCartesianAMRMeshGen
5770   {
5771   };
5772
5773   class MEDCouplingCartesianAMRMesh : public MEDCouplingCartesianAMRMeshGen
5774   {
5775   public:
5776     static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception);
5777     %extend
5778     {
5779       static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5780       {
5781         static const char msg0[]="MEDCouplingCartesianAMRMesh::New : error on 'origin' parameter !";
5782         static const char msg1[]="MEDCouplingCartesianAMRMesh::New : error on 'dxyz' parameter !";
5783         const int *nodeStrctPtr(0);
5784         const double *originPtr(0),*dxyzPtr(0);
5785         int sw,sz,val0;
5786         std::vector<int> bb0;
5787         nodeStrctPtr=convertObjToPossibleCpp1_Safe(nodeStrct,sw,sz,val0,bb0);
5788         //
5789         double val,val2;
5790         std::vector<double> bb,bb2;
5791         int sz1,sz2;
5792         originPtr=convertObjToPossibleCpp5_SingleCompo(origin,sw,val,bb,msg0,false,sz1);
5793         dxyzPtr=convertObjToPossibleCpp5_SingleCompo(dxyz,sw,val2,bb2,msg1,false,sz2);
5794         //
5795         return MEDCouplingCartesianAMRMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
5796       }
5797
5798       void createPatchesFromCriterionML(PyObject *bso, const DataArrayDouble *criterion, PyObject *factors, double eps) throw(INTERP_KERNEL::Exception)
5799       {
5800         std::vector<const INTERP_KERNEL::BoxSplittingOptions *> inp0;
5801         convertFromPyObjVectorOfObj<const INTERP_KERNEL::BoxSplittingOptions *>(bso,SWIGTYPE_p_INTERP_KERNEL__BoxSplittingOptions,"BoxSplittingOptions",inp0);
5802         std::vector< std::vector<int> > inp2;
5803         convertPyToVectorOfVectorOfInt(factors,inp2);
5804         self->createPatchesFromCriterionML(inp0,criterion,inp2,eps);
5805       }
5806
5807       MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
5808       {
5809         return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
5810       }
5811
5812       MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
5813       {
5814         return MEDCouplingCartesianAMRMesh::New(mesh);
5815       }
5816     }
5817   };
5818
5819   class MEDCouplingDataForGodFather : public RefCountObject
5820   {
5821   public:
5822     virtual void synchronizeFineToCoarse() throw(INTERP_KERNEL::Exception);
5823     virtual void synchronizeFineToCoarseBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5824     virtual void synchronizeCoarseToFine() throw(INTERP_KERNEL::Exception);
5825     virtual void synchronizeCoarseToFineBetween(int fromLev, int toLev) throw(INTERP_KERNEL::Exception);
5826     virtual void synchronizeAllGhostZones() throw(INTERP_KERNEL::Exception);
5827     virtual void synchronizeAllGhostZonesOfDirectChidrenOf(const MEDCouplingCartesianAMRMeshGen *mesh) throw(INTERP_KERNEL::Exception);
5828     virtual void synchronizeAllGhostZonesAtASpecifiedLevel(int level) throw(INTERP_KERNEL::Exception);
5829     virtual void synchronizeAllGhostZonesAtASpecifiedLevelUsingOnlyFather(int level) throw(INTERP_KERNEL::Exception);
5830     virtual void alloc() throw(INTERP_KERNEL::Exception);
5831     virtual void dealloc() throw(INTERP_KERNEL::Exception);
5832     %extend
5833     {
5834       MEDCouplingCartesianAMRMesh *getMyGodFather() throw(INTERP_KERNEL::Exception)
5835       {
5836         MEDCouplingCartesianAMRMesh *ret(self->getMyGodFather());
5837         if(ret)
5838           ret->incrRef();
5839         return ret;
5840       }
5841     }
5842   };
5843   
5844   class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
5845   {
5846   public:
5847     int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
5848     MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
5849     MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
5850     MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5851     MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5852     MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
5853     bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
5854     MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception);
5855     std::string writeVTHB(const std::string& fileName) const throw(INTERP_KERNEL::Exception);
5856     %extend
5857     {
5858       static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5859       {
5860         std::vector< std::pair<std::string,int> > fieldNamesCpp0;
5861         std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
5862         MEDCouplingAMRAttribute *ret(0);
5863         try
5864           {
5865             convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
5866             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0,ghostLev);
5867           }
5868         catch(INTERP_KERNEL::Exception&)
5869           {
5870             convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
5871             ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1,ghostLev);
5872           }
5873         return ret;
5874       }
5875
5876       MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
5877       {
5878         return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
5879       }
5880
5881       DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
5882       {
5883         const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
5884         DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
5885         if(ret2)
5886           ret2->incrRef();
5887         return ret2;
5888       }
5889
5890       void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
5891       {
5892         std::vector< std::vector<std::string> > compNamesCpp;
5893         convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
5894         self->spillInfoOnComponents(compNamesCpp);
5895       }
5896
5897       void spillNatures(PyObject *nfs) throw(INTERP_KERNEL::Exception)
5898       {
5899         std::vector<int> inp0;
5900         if(!fillIntVector(nfs,inp0))
5901           throw INTERP_KERNEL::Exception("wrap of MEDCouplingAMRAttribute::spillNatures : vector of NatureOfField enum expected !");
5902         std::size_t sz(inp0.size());
5903         std::vector<NatureOfField> inp00(sz);
5904         for(std::size_t i=0;i<sz;i++)
5905           inp00[i]=(NatureOfField)inp0[i];
5906         self->spillNatures(inp00);
5907       }
5908       
5909       PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
5910       {
5911         std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
5912         int sz((int)ret.size());
5913         PyObject *retPy(PyList_New(sz));
5914         for(int i=0;i<sz;i++)
5915           PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
5916         return retPy;
5917       }
5918     }
5919   };
5920
5921   class DenseMatrix : public RefCountObject, public TimeLabel
5922   {
5923   public:
5924     static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5925     static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5926     DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
5927     DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
5928     //
5929     int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
5930     int getNumberOfCols() const throw(INTERP_KERNEL::Exception);
5931     int getNbOfElems() const throw(INTERP_KERNEL::Exception);
5932     void reBuild(DataArrayDouble *array, int nbRows=-1, int nbCols=-1) throw(INTERP_KERNEL::Exception);
5933     void reShape(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
5934     void transpose() throw(INTERP_KERNEL::Exception);
5935     //
5936     bool isEqual(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception);
5937     DataArrayDouble *matVecMult(const DataArrayDouble *vec) const throw(INTERP_KERNEL::Exception);
5938     static DataArrayDouble *MatVecMult(const DenseMatrix *mat, const DataArrayDouble *vec) throw(INTERP_KERNEL::Exception);
5939     %extend
5940     {
5941       DenseMatrix(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5942       {
5943         return DenseMatrix::New(nbRows,nbCols);
5944       }
5945
5946       DenseMatrix(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception)
5947       {
5948         return DenseMatrix::New(array,nbRows,nbCols);
5949       }
5950
5951       PyObject *isEqualIfNotWhy(const DenseMatrix& other, double eps) const throw(INTERP_KERNEL::Exception)
5952       {
5953         std::string ret1;
5954         bool ret0=self->isEqualIfNotWhy(other,eps,ret1);
5955         PyObject *ret=PyTuple_New(2);
5956         PyObject *ret0Py=ret0?Py_True:Py_False;
5957         Py_XINCREF(ret0Py);
5958         PyTuple_SetItem(ret,0,ret0Py);
5959         PyTuple_SetItem(ret,1,PyString_FromString(ret1.c_str()));
5960         return ret;
5961       }
5962
5963       DataArrayDouble *getData() throw(INTERP_KERNEL::Exception)
5964       {
5965         DataArrayDouble *ret(self->getData());
5966         if(ret)
5967           ret->incrRef();
5968         return ret;
5969       }
5970
5971       DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5972       {
5973         return MEDCoupling::DenseMatrix::Add(self,other);
5974       }
5975
5976       DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5977       {
5978         return MEDCoupling::DenseMatrix::Substract(self,other);
5979       }
5980
5981       DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5982       {
5983         return MEDCoupling::DenseMatrix::Multiply(self,other);
5984       }
5985
5986       DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
5987       {
5988         return MEDCoupling::DenseMatrix::Multiply(self,other);
5989       }
5990
5991       PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5992       {
5993         self->addEqual(other);
5994         Py_XINCREF(trueSelf);
5995         return trueSelf;
5996       }
5997
5998       PyObject *___isub___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
5999       {
6000         self->substractEqual(other);
6001         Py_XINCREF(trueSelf);
6002         return trueSelf;
6003       }
6004 #ifdef WITH_NUMPY
6005       PyObject *toNumPyMatrix() throw(INTERP_KERNEL::Exception) // not const. It is not a bug !
6006       {
6007         PyObject *obj(ToNumPyArrayUnderground<DataArrayDouble,double>(self->getData(),NPY_DOUBLE,"DataArrayDouble",self->getNumberOfRows(),self->getNumberOfCols()));
6008         return obj;
6009       }
6010 #endif
6011     }
6012   };
6013 }
6014
6015 %pythoncode %{
6016 import os
6017 __filename=os.environ.get('PYTHONSTARTUP')
6018 if __filename and os.path.isfile(__filename):
6019   execfile(__filename)
6020   pass
6021 %}