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