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