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