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