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