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