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