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