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