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