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