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