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