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