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