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