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