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