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