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