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