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