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