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