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